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: <3a14471baa1fe0803a27922fe9bd929a0062f780.camel@intel.com>
Date: Fri, 18 Apr 2025 18:18:32 +0000
From: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
To: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>
CC: "luto@...nel.org" <luto@...nel.org>, "jgross@...e.com" <jgross@...e.com>,
	"x86@...nel.org" <x86@...nel.org>, "joro@...tes.org" <joro@...tes.org>,
	"peterz@...radead.org" <peterz@...radead.org>, "bp@...en8.de" <bp@...en8.de>,
	"tglx@...utronix.de" <tglx@...utronix.de>, "kirill.shutemov@...ux.intel.com"
	<kirill.shutemov@...ux.intel.com>
Subject: Re: [PATCH 1/2] x86/mm: Kill a 32-bit #ifdef for shared PMD handling

On Fri, 2025-04-18 at 08:56 -0700, Dave Hansen wrote:
> +
> +	if (IS_ENABLED(CONFIG_X86_64))
> +		return;

Nit to throw away if you don't like it, but the below code the conditional is
about special 32 bit requirements, not, not being 64 bit. So I'd have done:

	if (!IS_ENABLED(CONFIG_X86_32))
		return;

Probably anyone reading this is going to know CONFIG_X86_64 and CONFIG_X86_32
are exclusive, and there are only two options. But to me the check is a tiny bit
harder to read this way. In either case:

Reviewed-by: Rick Edgecombe <rick.p.edgecombe@...el.com>

> +
> +	/*
> +	 * 32-bit mm_structs don't share kernel PMD pages.
> +	 * Propagate the change to each relevant PMD entry:
> +	 */
> +	list_for_each_entry(page, &pgd_list, lru) {
> +		pgd_t *pgd;
> +		p4d_t *p4d;
> +		pud_t *pud;
> +		pmd_t *pmd;
> +
> +		pgd = (pgd_t *)page_address(page) + pgd_index(address);
> +		p4d = p4d_offset(pgd, address);
> +		pud = pud_offset(p4d, address);
> +		pmd = pmd_offset(pud, address);
> +		set_pte_atomic((pte_t *)pmd, pte);
>  	}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ