[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4bc56567-e2ce-40ec-19ab-349c8de8d969@intel.com>
Date: Fri, 6 May 2022 11:43:39 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Boris Petkov <bp@...en8.de>,
Dan Williams <dan.j.williams@...el.com>
Cc: Martin Fernandez <martin.fernandez@...ypsium.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-efi <linux-efi@...r.kernel.org>,
Linux MM <linux-mm@...ck.org>,
platform-driver-x86@...r.kernel.org, daniel.gutson@...ypsium.com,
Andrew Morton <akpm@...ux-foundation.org>,
Kees Cook <keescook@...omium.org>,
Darren Hart <dvhart@...radead.org>,
"Schofield, Alison" <alison.schofield@...el.com>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Mike Rapoport <rppt@...nel.org>,
Ard Biesheuvel <ardb@...nel.org>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
X86 ML <x86@...nel.org>, alex.bazhaniuk@...ypsium.com,
hughsient@...il.com, Andy Shevchenko <andy@...radead.org>,
Greg KH <gregkh@...uxfoundation.org>,
Ben Widawsky <ben.widawsky@...el.com>,
"Huang, Kai" <kai.huang@...el.com>
Subject: Re: [PATCH v8 0/8] x86: Show in sysfs if a memory node is able to do
encryption
On 5/6/22 11:25, Boris Petkov wrote:
> On May 6, 2022 6:14:00 PM UTC, Dave Hansen <dave.hansen@...el.com>
> wrote:
>> But, this interface will *work* both for the uniform and
>> non-uniform systems alike.
> And what would that additional information that some "node" -
> whatever "node" means nowadays - is not encrypted give you?
Tying it to the node ties it to the NUMA ABIs. For instance, it lets
you say: "allocate memory with encryption capabilities" with a
set_mempolicy() to nodes that are enumerated as encryption-capable.
Imagine that we have a non-uniform system: some memory supports TDX (or
SEV-SNP) and some doesn't. QEMU calls mmap() to allocate some guest
memory and then its ioctl()s to get its addresses stuffed into EPT/NPT.
The memory might be allocated from anywhere, CPU_CRYPTO-capable or not.
VM creation will fail because the (hardware-enforced) security checks
can't be satisfied on non-CPU_CRYPTO memory.
Userspace has no recourse to fix this. It's just stuck. In that case,
the *kernel* needs to be responsible for ensuring that the backing
physical memory supports TDX (or SEV).
This node attribute punts the problem back out to userspace. It gives
userspace the ability to steer allocations to compatible NUMA nodes. If
something goes wrong, they can use other NUMA ABIs to inspect the
situation, like /proc/$pid/numa_maps.
Powered by blists - more mailing lists