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: <7950cbd5-d254-4e67-81fa-ab2194f9dbc4@intel.com>
Date: Thu, 17 Apr 2025 08:15:21 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Juergen Gross <jgross@...e.com>, linux-kernel@...r.kernel.org,
 x86@...nel.org
Cc: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
 Borislav Petkov <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>,
 "H. Peter Anvin" <hpa@...or.com>, Andy Lutomirski <luto@...nel.org>,
 Peter Zijlstra <peterz@...radead.org>, Petr Vaněk
 <arkamar@...as.cz>, stable@...r.kernel.org
Subject: Re: [PATCH] x86/mm: fix _pgd_alloc() for Xen PV mode

On 4/17/25 07:48, Juergen Gross wrote:
> -#define PGD_ALLOCATION_ORDER 1
> +#define PGD_ALLOCATION_ORDER pgd_allocation_order
> +extern unsigned int pgd_allocation_order;
>  #else
>  #define PGD_ALLOCATION_ORDER 0
>  #endif

Instead of hiding a variable behind a macro-looking name and a bunch of
#ifdefs, can we please fix this properly?

static inline pgd_allocation_order(void)
{
	if (cpu_feature_enabled(X86_FEATURE_PTI))
		return 1;
	return 0;
}

and then s/PGD_ALLOCATION_ORDER/pgd_allocation_order()/.

Wouldn't that be a billion times better?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ