lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGdbjmKOwRbWa9w3M6NH-gTnTOt-ZaM0UA700TMhFzrX8z5MVw@mail.gmail.com>
Date: Thu, 1 Feb 2024 08:38:23 -0800
From: Kevin Loughlin <kevinloughlin@...gle.com>
To: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
Cc: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>, 
	Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org, 
	Nick Desaulniers <ndesaulniers@...gle.com>, Justin Stitt <justinstitt@...gle.com>, 
	Tom Lendacky <thomas.lendacky@....com>, Pankaj Gupta <pankaj.gupta@....com>, 
	Hou Wenlong <houwenlong.hwl@...group.com>, Ard Biesheuvel <ardb@...nel.org>, 
	Dionna Glaze <dionnaglaze@...gle.com>, Brijesh Singh <brijesh.singh@....com>, 
	Michael Roth <michael.roth@....com>, linux-kernel@...r.kernel.org, llvm@...ts.linux.dev, 
	linux-coco@...ts.linux.dev, Ashish Kalra <ashish.kalra@....com>, 
	Andi Kleen <ak@...ux.intel.com>, Adam Dunlap <acdunlap@...gle.com>, 
	Peter Gonda <pgonda@...gle.com>, Jacob Xu <jacobhxu@...gle.com>, 
	Sidharth Telang <sidtelang@...gle.com>
Subject: Re: [PATCH v3 2/2] x86/head64: Replace pointer fixups with RIP_RELATIVE_ADDR()

On Wed, Jan 31, 2024 at 12:24 AM Kirill A. Shutemov
<kirill.shutemov@...ux.intel.com> wrote:
>
> On Tue, Jan 30, 2024 at 10:08:45PM +0000, Kevin Loughlin wrote:
> > @@ -594,15 +579,15 @@ static void set_bringup_idt_handler(gate_desc *idt, int n, void *handler)
> >  /* This runs while still in the direct mapping */
> >  static void __head startup_64_load_idt(unsigned long physbase)
> >  {
> > -     struct desc_ptr *desc = fixup_pointer(&bringup_idt_descr, physbase);
> > -     gate_desc *idt = fixup_pointer(bringup_idt_table, physbase);
> > +     struct desc_ptr *desc = RIP_RELATIVE_ADDR(bringup_idt_descr);
> > +     gate_desc *idt = RIP_RELATIVE_ADDR(bringup_idt_table);
> >
> >
> >       if (IS_ENABLED(CONFIG_AMD_MEM_ENCRYPT)) {
> >               void *handler;
> >
> >               /* VMM Communication Exception */
> > -             handler = fixup_pointer(vc_no_ghcb, physbase);
> > +             handler = RIP_RELATIVE_ADDR(vc_no_ghcb);
> >               set_bringup_idt_handler(idt, X86_TRAP_VC, handler);
> >       }
> >
>
> Looks like you removed all physbase users in the function. No need to pass
> it to it.

Thanks, will fix.

>
> > @@ -629,7 +614,7 @@ void early_setup_idt(void)
> >  void __head startup_64_setup_env(unsigned long physbase)
> >  {
> >       /* Load GDT */
> > -     startup_gdt_descr.address = (unsigned long)fixup_pointer(startup_gdt, physbase);
> > +     startup_gdt_descr.address = (unsigned long)RIP_RELATIVE_ADDR(startup_gdt);
> >       native_load_gdt(&startup_gdt_descr);
> >
> >       /* New GDT is live - reload data segment registers */
>
> With startup_64_load_idt() fixed, no users for physbase in this function
> either.

Ditto.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ