On Tue, Jun 20, 2023 at 10:42:57AM +0800, Chao Gao wrote:
On Fri, Jun 16, 2023 at 10:38:15AM +0800, Yan Zhao wrote:This patch is actually a preparation for later patch 10 to implement
For KVM_X86_QUIRK_CD_NW_CLEARED, remove the ignore PAT bit in EPT memoryGiven guest sets CR0.CD, what's the point of honoring (guest) PAT? e.g.,
types when cache is disabled and non-coherent DMA are present.
With the quirk KVM_X86_QUIRK_CD_NW_CLEARED, WB + IPAT are returned as the
EPT memory type when guest cache is disabled before this patch.
Removing the IPAT bit in this patch will allow effective memory type to
honor PAT values as well, which will make the effective memory type
which guests can benefit from this change?
fine-grained zap.
If when CR0.CD=1 the EPT type is WB + IPAT, and
when CR0.CD=0 + mtrr enabled, EPT type is WB or UC or ..., which are
without IPAT, then we have to always zap all EPT entries.
Given removing the IPAT bit when CR0.CD=1 only makes the quirk
KVM_X86_QUIRK_CD_NW_CLEARED more strict (meaning it could be WC/UC... if
the guest PAT overwrites it), it's still acceptable.