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: <1515dae4-cb53-4645-8c72-d33b27ede7eb@quicinc.com>
Date: Thu, 9 Jan 2025 15:04:22 +0800
From: Zhenhua Huang <quic_zhenhuah@...cinc.com>
To: Anshuman Khandual <anshuman.khandual@....com>,
        Catalin Marinas
	<catalin.marinas@....com>
CC: <will@...nel.org>, <ardb@...nel.org>, <ryan.roberts@....com>,
        <mark.rutland@....com>, <joey.gouly@....com>,
        <dave.hansen@...ux.intel.com>, <akpm@...ux-foundation.org>,
        <chenfeiyang@...ngson.cn>, <chenhuacai@...nel.org>,
        <linux-mm@...ck.org>, <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>, <quic_tingweiz@...cinc.com>,
        <stable@...r.kernel.org>
Subject: Re: [PATCH v4] arm64: mm: Populate vmemmap/linear at the page level
 for hotplugged sections



On 2025/1/8 18:52, Anshuman Khandual wrote:
>> I found another bug, that even for early section, when vmemmap_populate is called, SECTION_IS_EARLY is not set. Therefore, early_section() always return false.
> Hmm, well that's unexpected.
> 
>> Since vmemmap_populate() occurs during section initialization, it may be hard to say it is a bug..
>> However, should we instead using SECTION_MARKED_PRESENT to check? I tested well in my setup.
>>
>> Hot plug flow:
>> 1. section_activate -> vmemmap_populate
>> 2. mark PRESENT
>>
>> In contrast, the early flow:
>> 1. memblocks_present -> mark PRESENT
>> 2. __populate_section_memmap -> vmemmap_populate
> But from a semantics perspective, should SECTION_MARKED_PRESENT be marked on a
> section before SECTION_IS_EARLY ? Is it really the expected behaviour here or
> that needs to be fixed first ?

The tricky part is vmemmap_populate initializes mem_map, that happens 
during mem_section initialization process. PRESENT or EARLY tag is in 
the same process as well. There doesn't appear to be a compelling reason 
to enforce a specific sequence..

> 
> Although SYSTEM_BOOTING state check might help but section flag seems to be the
> right thing to do here.

Good idea, I prefer to vote for this alternative rather than PRESENT 
tag. As I see we already took this stage to determine whether memmap 
pages are boot pages or not in common mm code:
https://elixir.bootlin.com/linux/v6.13-rc3/source/mm/sparse-vmemmap.c#L465

Would like to hear Catalin's perspective ?:)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ