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:   Tue, 11 Jan 2022 12:01:56 -0800
From:   Dave Hansen <dave.hansen@...el.com>
To:     "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
        Borislav Petkov <bp@...en8.de>,
        Andy Lutomirski <luto@...nel.org>,
        Sean Christopherson <seanjc@...gle.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Joerg Roedel <jroedel@...e.de>,
        Ard Biesheuvel <ardb@...nel.org>
Cc:     Andi Kleen <ak@...ux.intel.com>,
        Kuppuswamy Sathyanarayanan 
        <sathyanarayanan.kuppuswamy@...ux.intel.com>,
        David Rientjes <rientjes@...gle.com>,
        Vlastimil Babka <vbabka@...e.cz>,
        Tom Lendacky <thomas.lendacky@....com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Peter Zijlstra <peterz@...radead.org>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Ingo Molnar <mingo@...hat.com>,
        Varad Gautam <varad.gautam@...e.com>,
        Dario Faggioli <dfaggioli@...e.com>, x86@...nel.org,
        linux-mm@...ck.org, linux-coco@...ts.linux.dev,
        linux-efi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCHv2 6/7] x86/mm: Provide helpers for unaccepted memory

On 1/11/22 03:33, Kirill A. Shutemov wrote:
> Core-mm requires few helpers to support unaccepted memory:
> 
>   - accept_memory() checks the range of addresses against the bitmap and
>     accept memory if needed;
> 
>   - maybe_set_page_offline() checks the bitmap and marks a page with
>     PageOffline() if memory acceptance required on the first
>     allocation of the page.
> 
>   - accept_and_clear_page_offline() accepts memory for the page and clears
>     PageOffline().
> 
...
> +void accept_memory(phys_addr_t start, phys_addr_t end)
> +{
> +	unsigned long flags;
> +	if (!boot_params.unaccepted_memory)
> +		return;
> +
> +	spin_lock_irqsave(&unaccepted_memory_lock, flags);
> +	__accept_memory(start, end);
> +	spin_unlock_irqrestore(&unaccepted_memory_lock, flags);
> +}

Not a big deal, but please cc me on all the patches in the series.  This 
is called from the core mm patches which I wasn't cc'd on.

This also isn't obvious, but this introduces a new, global lock into the 
fast path of the page allocator and holds it for extended periods of 
time.  It won't be taken any more once all memory is accepted, but you 
can sure bet that it will be noticeable until that happens.

*PLEASE* document this.  It needs changelog and probably code comments.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ