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]
Date:   Fri, 16 Feb 2018 18:00:13 +0300
From:   "Kirill A. Shutemov" <kirill@...temov.name>
To:     Matthew Wilcox <willy@...radead.org>
Cc:     "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
        Ingo Molnar <mingo@...hat.com>, x86@...nel.org,
        Thomas Gleixner <tglx@...utronix.de>,
        "H. Peter Anvin" <hpa@...or.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Andy Lutomirski <luto@...capital.net>,
        Borislav Petkov <bp@...e.de>, Andi Kleen <ak@...ux.intel.com>,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] x86/xen: Allow XEN_PV and XEN_PVH to be enabled with
 X86_5LEVEL

On Fri, Feb 16, 2018 at 06:11:10AM -0800, Matthew Wilcox wrote:
> On Fri, Feb 16, 2018 at 02:49:46PM +0300, Kirill A. Shutemov wrote:
> > @@ -38,12 +38,12 @@
> >   *
> >   */
> >  
> > +#define l4_index(x)	(((x) >> 39) & 511)
> >  #define pud_index(x)	(((x) >> PUD_SHIFT) & (PTRS_PER_PUD-1))
> 
> Shouldn't that be
> +#define p4d_index(x)	(((x) >> P4D_SHIFT) & (PTRS_PER_P4D-1))

With CONFIG_X86_5LEVEL=y, PTRS_PER_P4D is a varaible, so it won't compile.
With CONFIG_X86_5LEVEL=n, PTRS_PER_P4D is 1, so it's broken.

And I didn't want to mixin p4d here: it's actually top-level page table
in 4-level paging mode.

I guess we can do something like:

#define l4_index(x)	(((x) >> P4D_SIFT) & (PTRS_PER_PGD-1))

But to me it's more confusing than couple numbers.

-- 
 Kirill A. Shutemov

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ