Re: [PATCHv2 2/3] x86/tdx: Fix race between set_memory_encrypted() and load_unaligned_zeropad()

From: Dave Hansen
Date: Fri Jun 02 2023 - 13:42:38 EST


On 6/2/23 09:11, Michael Kelley (LINUX) wrote:
> Tom -- Does the above sequence *depend* on the hypervisor doing anything
> to make it work? I'm not clear on why KVM would automatically change the
> page over to private. If there's a dependency on the hypervisor doing
> something, then it seems like we'll need to standardize that "something"
> across hypervisors, lest we end up with per-hypervisor code in Linux to handle
> this scenario. And running SEV-SNP with multiple VMPLs probably makes it
> even more complicated.
>
> Kirill -- Same question about TDX. Does making load_unaligned_zeropad()
> work in a TDX VM depend on the hypervisor doing anything? Or is the
> behavior seen by the guest dependent only on architected behavior of
> the TDX processor?

No, there's no active help from the hypervisor here.

Also, fwiw, the "architected behavior" here is really just the TDX
module policy and _arguably_ the hardware Secure-EPT controlled by the
TDX module.