Re: [RFC v2-fix-v3 1/1] x86/tdx: Skip WBINVD instruction for TDX guest

From: Andi Kleen
Date: Tue Jun 08 2021 - 18:34:55 EST

On 6/8/2021 3:17 PM, Dave Hansen wrote:
On 6/8/21 2:35 PM, Kuppuswamy Sathyanarayanan wrote:
Persistent memory is also currently not supported. Another code
path that uses WBINVD is the MTRR driver, but EPT/virtualization
always disables MTRRs so those are not needed. This all implies
WBINVD is not needed with current TDX.
It's one thing to declare something unsupported. It's quite another to
declare it unsupported and then back it up with code to ensure that any
attempted use is thwarted.

This patch certainly shows us half of the solution. But, to be
complete, we also need to see the other half: where is the patch

We had multiple patches to handle it earlier (by ignoring it which is the right way and deployed successfully everywhere in KVM), but you guys all didn't like them.

So they got removed.

You can't have your cake and eat it. Either you have the ignore or warn on patches or you have panic.

In this iteration now you have panic (through the exception handler) except we explicitely ignore it for the cases we know that can happen (which is reboot)

documentation for why it is not *possible* to encounter persistent
memory in a TDX guest?

I thought we already went over this ad nauseam.

The current TDX VMMs don't support anything else than plain DRAM.

If there is support for anything else in the future we'll need to add a new GHCI call that implements WBINVD through the host, but right now we don't need it.