Re: [RFC v2 15/32] x86/tdx: Handle in-kernel MMIO

From: Dave Hansen
Date: Fri May 07 2021 - 17:52:26 EST


On 4/26/21 11:01 AM, Kuppuswamy Sathyanarayanan wrote:
> Handle #VE due to MMIO operations. MMIO triggers #VE with EPT_VIOLATION
> exit reason.

This needs a bit of a history lesson. "In traditional VMs, MMIO tends
to be implemented by giving a guest access to an mapping which will
cause a VMEXIT on access. That's not possible in a TDX guest..."

> For now we only handle subset of instruction that kernel uses for MMIO
> oerations. User-space access triggers SIGBUS.

I still don't think that TDX guests should be doing things that they
*KNOW* will cause #VE, including MMIO. I really want to hear a more
discrete story about why this is the *best* way to do this for Linux
instead of just a hack from the Windows binary driver ecosystem that
seemed expedient.