Re: [PATCH] KVM: x86/mmu: Only zap valid non-mirror roots in kvm_zap_gfn_range()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 23, 2024, Yan Zhao wrote:
> On Sun, Dec 22, 2024 at 08:28:56PM +0100, Paolo Bonzini wrote:
> > On Fri, Nov 15, 2024 at 9:50 AM Yan Zhao <yan.y.zhao@xxxxxxxxx> wrote:
> > > Sean also suggested making the self-snoop feature a hard dependency for
> > > enabling TDX [2].
> > >
> > > That is because
> > > - TDX shared EPT is able to reuse the memory type specified in VMX's code
> > >   as long as guest MTRRs are not referenced.
> > > - KVM does not call kvm_zap_gfn_range() when attaching/detaching
> > >   non-coherent DMA devices when the CPU have feature self-snoop. [3]
> > >
> > > However, [3] cannot be guaranteed after commit 9d70f3fec144 ("Revert "KVM:
> > > VMX: Always honor guest PAT on CPUs that support self-snoop"), which was
> > > due to a regression with the bochsdrm driver.
> > 
> > I think we should treat honoring of guest PAT like zap-memslot-only,
> > and make it a quirk that TDX disables.  Making it a quirk adds a bit of
> > complexity, but it documents why the code exists and it makes it easy for
> > TDX to disable it.

Belated +1.  Adding a quirk for honoring guest PAT was on my todo list.  A quirk
also allows setups that don't provide a Bochs device to honor guest PAT, which
IIRC is needed for virtio-gpu with a non-snooping graphics device.

> Thanks! Will do in this way after the new year.

Nice!  One oddity to keep in mind when documenting the quirk is that KVM always
honors guest PAT when running on AMD.  :-/





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux