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:   Wed, 4 Mar 2020 20:22:36 +0100
From:   Ard Biesheuvel <ardb@...nel.org>
To:     Arvind Sankar <nivedita@...m.mit.edu>
Cc:     Dave Hansen <dave.hansen@...ux.intel.com>,
        Andy Lutomirski <luto@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        "H. Peter Anvin" <hpa@...or.com>,
        "the arch/x86 maintainers" <x86@...nel.org>,
        linux-efi <linux-efi@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/4] x86/mm/pat: Handle no-GBPAGES case correctly in populate_pud

On Wed, 4 Mar 2020 at 20:10, Arvind Sankar <nivedita@...m.mit.edu> wrote:
>
> On Wed, Mar 04, 2020 at 08:04:04PM +0100, Ard Biesheuvel wrote:
> > On Wed, 4 Mar 2020 at 19:50, Arvind Sankar <nivedita@...m.mit.edu> wrote:
> > >
> > > On Wed, Mar 04, 2020 at 07:44:50PM +0100, Ard Biesheuvel wrote:
> > > >
> > > > I've tried a couple of different ways, but I can't seem to get my
> > > > memory map organized in the way that will trigger the error.
> > >
> > > What does yours look like? efi_merge_regions doesn't merge everything
> > > that will eventually be mapped the same way, so if there are some
> > > non-conventional memory regions scattered over the address space, it
> > > might be breaking up the mappings to the point where this doesn't
> > > trigger.
> >
> > I have a region
> >
> > [    0.000000] efi: mem07: [Conventional Memory|   |  |  |  |  |  |  |
> >  |   |WB|WT|WC|UC] range=[0x0000000001400000-0x00000000b9855fff]
> > (2948MB)
> >
> > which gets covered correctly
> >
> > [    0.401766] 0x0000000000a00000-0x0000000040000000        1014M
> > RW         PSE         NX pmd
> > [    0.403436] 0x0000000040000000-0x0000000080000000           1G
> > RW         PSE         NX pud
> > [    0.404645] 0x0000000080000000-0x00000000b9800000         920M
> > RW         PSE         NX pmd
> > [    0.405844] 0x00000000b9800000-0x00000000b9a00000           2M
> > RW                     NX pte
> > [    0.407436] 0x00000000b9a00000-0x00000000baa00000          16M
> > ro         PSE         x  pmd
> > [    0.408591] 0x00000000baa00000-0x00000000bbe00000          20M
> > RW         PSE         NX pmd
> > [    0.409751] 0x00000000bbe00000-0x00000000bc000000           2M
> > RW                     NX pte
> > [    0.410821] 0x00000000bc000000-0x00000000be600000          38M
> > RW         PSE         NX pmd
> >
> > However, the fact that you can provide a case where it does fail
> > should be sufficient justification for taking this patch. I was just
> > trying to give more than a regression-tested-by
>
> No, this case is exactly one that should break. But I think you're
> running on a processor model that _does_ support GB pages, as shown by
> the "pud" mapping there for the 1G-2G range.
>
> At least for my version of qemu, -cpu Haswell does not enable the
> pdpe1gb feature. Which cpu did you specify?
>

The wrong one, obviously :-)

With Haswell, I get [before]

[    0.368541] 0x0000000000900000-0x0000000000a00000           1M
RW                     NX pte
[    0.369118] 0x0000000000a00000-0x0000000080000000        2038M
RW         PSE         NX pmd
[    0.369592] 0x0000000080000000-0x00000000b9800000         920M
                         pmd
[    0.370177] 0x00000000b9800000-0x00000000b9856000         344K
                         pte
[    0.370649] 0x00000000b9856000-0x00000000b9a00000        1704K
RW                     NX pte
[    0.371066] 0x00000000b9a00000-0x00000000baa00000          16M
ro         PSE         x  pmd

and after

[    0.349577] 0x0000000000a00000-0x0000000080000000        2038M
RW         PSE         NX pmd
[    0.350049] 0x0000000080000000-0x00000000b9800000         920M
                         pmd
[    0.350514] 0x00000000b9800000-0x00000000b9856000         344K
                         pte
[    0.351013] 0x00000000b9856000-0x00000000b9a00000        1704K
RW                     NX pte

so i'm still doing something wrong, I think?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ