[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7fccb7f2-fc88-993e-e1b2-919448844112@citrix.com>
Date: Thu, 10 Mar 2022 19:46:59 +0000
From: Andrew Cooper <Andrew.Cooper3@...rix.com>
To: Bharata B Rao <bharata@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC: "linux-mm@...ck.org" <linux-mm@...ck.org>,
"x86@...nel.org" <x86@...nel.org>,
"kirill.shutemov@...ux.intel.com" <kirill.shutemov@...ux.intel.com>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"mingo@...hat.com" <mingo@...hat.com>,
"bp@...en8.de" <bp@...en8.de>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
"catalin.marinas@....com" <catalin.marinas@....com>,
"will@...nel.org" <will@...nel.org>,
"shuah@...nel.org" <shuah@...nel.org>,
"oleg@...hat.com" <oleg@...hat.com>,
"ananth.narayan@....com" <ananth.narayan@....com>,
"Andrew Cooper" <Andrew.Cooper3@...rix.com>
Subject: Re: [RFC PATCH v0 3/6] x86: Enable Upper Address Ignore(UAI) feature
On 10/03/2022 11:15, Bharata B Rao wrote:
> diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
> index f7a132eb794d..12615b1b4af5 100644
> --- a/arch/x86/kernel/setup.c
> +++ b/arch/x86/kernel/setup.c
> @@ -740,6 +740,12 @@ dump_kernel_offset(struct notifier_block *self, unsigned long v, void *p)
> return 0;
> }
>
> +static inline void __init uai_enable(void)
> +{
> + if (boot_cpu_has(X86_FEATURE_UAI))
> + msr_set_bit(MSR_EFER, _EFER_UAI);
> +}
> +
> /*
> * Determine if we were loaded by an EFI loader. If so, then we have also been
> * passed the efi memmap, systab, etc., so we should use these data structures
> @@ -1146,6 +1152,8 @@ void __init setup_arch(char **cmdline_p)
>
> x86_init.paging.pagetable_init();
>
> + uai_enable();
I would think incredibly carefully before enabling UAI by default.
Suffice it to say that Intel were talked down from 7 bits to 6, and
apparently AMD didn't get the same memo from the original requesters.
The problem is that UAI + LA57 means that all the poison pointers cease
functioning as a defence-in-depth mechanism, and become legal pointers
pointing at random positions in user or kernel space.
~Andrew
Powered by blists - more mailing lists