Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for-linus-6.11' of git://git.kernel.org/pub/scm/virt/kvm/kvm

Pull kvm fix from Paolo Bonzini:
"Do not always honor guest PAT on CPUs that support self-snoop.

This triggers an issue in the bochsdrm driver, which used ioremap()
instead of ioremap_wc() to map the video RAM.

The revert lets video RAM use the WB memory type instead of the slower
UC memory type"

* tag 'for-linus-6.11' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
Revert "KVM: VMX: Always honor guest PAT on CPUs that support self-snoop"

+7 -11
+3 -5
arch/x86/kvm/mmu/mmu.c
··· 4674 4674 bool kvm_mmu_may_ignore_guest_pat(void) 4675 4675 { 4676 4676 /* 4677 - * When EPT is enabled (shadow_memtype_mask is non-zero), the CPU does 4678 - * not support self-snoop (or is affected by an erratum), and the VM 4677 + * When EPT is enabled (shadow_memtype_mask is non-zero), and the VM 4679 4678 * has non-coherent DMA (DMA doesn't snoop CPU caches), KVM's ABI is to 4680 4679 * honor the memtype from the guest's PAT so that guest accesses to 4681 4680 * memory that is DMA'd aren't cached against the guest's wishes. As a 4682 4681 * result, KVM _may_ ignore guest PAT, whereas without non-coherent DMA, 4683 - * KVM _always_ ignores or honors guest PAT, i.e. doesn't toggle SPTE 4684 - * bits in response to non-coherent device (un)registration. 4682 + * KVM _always_ ignores guest PAT (when EPT is enabled). 4685 4683 */ 4686 - return !static_cpu_has(X86_FEATURE_SELFSNOOP) && shadow_memtype_mask; 4684 + return shadow_memtype_mask; 4687 4685 } 4688 4686 4689 4687 int kvm_tdp_page_fault(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault)
+4 -6
arch/x86/kvm/vmx/vmx.c
··· 7659 7659 7660 7660 /* 7661 7661 * Force WB and ignore guest PAT if the VM does NOT have a non-coherent 7662 - * device attached and the CPU doesn't support self-snoop. Letting the 7663 - * guest control memory types on Intel CPUs without self-snoop may 7664 - * result in unexpected behavior, and so KVM's (historical) ABI is to 7665 - * trust the guest to behave only as a last resort. 7662 + * device attached. Letting the guest control memory types on Intel 7663 + * CPUs may result in unexpected behavior, and so KVM's ABI is to trust 7664 + * the guest to behave only as a last resort. 7666 7665 */ 7667 - if (!static_cpu_has(X86_FEATURE_SELFSNOOP) && 7668 - !kvm_arch_has_noncoherent_dma(vcpu->kvm)) 7666 + if (!kvm_arch_has_noncoherent_dma(vcpu->kvm)) 7669 7667 return (MTRR_TYPE_WRBACK << VMX_EPT_MT_EPTE_SHIFT) | VMX_EPT_IPAT_BIT; 7670 7668 7671 7669 return (MTRR_TYPE_WRBACK << VMX_EPT_MT_EPTE_SHIFT);