Re: [PATCH 03/22] KVM: x86/mmu: adjust MMIO generation bit allocation and allowed mask

From: Paolo Bonzini

Date: Tue Mar 24 2026 - 05:21:45 EST


On 3/24/26 04:48, Huang, Kai wrote:

/*
- * Due to limited space in PTEs, the MMIO generation is a 19 bit subset of
+ * Due to limited space in PTEs, the MMIO generation is an 18 bit subset of
* the memslots generation and is derived as follows:

Is "a -> an" unintentional change?

No, "a nineteen-bit" -> "an eighteen-bit". :)

Besides the changes to MMIO_GEN, the FROZEN_SPTE seems to have bit 10 set:

#define FROZEN_SPTE (SHADOW_NONPRESENT_VALUE | 0x5a0ULL)

When MBEC is enabled, IIUC such SPTE will be treated as present by hardware
if CPU supports execution-only SPTE.

Also, when MBEC is enabled, per SDM if CPU doesn't support execution-only,
an SPTE with bit 0 clear but with bit 10 set will trigger EPT
miscofiguration, rather than EPT violation.

So seems we should exclude bit 10 from FROZEN_SPTE.

True, good catch (so 0x5a0 should become 0x1a0).

Paolo