[GIT PULL] KVM: x86: Misc changes for 6.10
From: Sean Christopherson
Date: Fri May 10 2024 - 19:51:45 EST
The max mappable GPA changes are the most notable, though unless we really
botched the KVM implementation, they should be old news for you.
The other mildly interesting change is a fix for KVM's handling of userspace
writes to immutable feature MSRs. The seemingly good idea of simply ignoring
the writes, e.g. to avoid a problematic/useless PMU refresh, neglected to
consider the fact that access to the MSR might be disallowed. E.g. the VMX
MSRs are off limits if nested support is disabled.
The following changes since commit fec50db7033ea478773b159e0e2efb135270e3b7:
Linux 6.9-rc3 (2024-04-07 13:22:46 -0700)
are available in the Git repository at:
https://github.com/kvm-x86/linux.git tags/kvm-x86-misc-6.10
for you to fetch changes up to 51937f2aae186e335175dde78279aaf0cb5e72ae:
KVM: x86: Remove VT-d mention in posted interrupt tracepoint (2024-05-02 07:54:14 -0700)
----------------------------------------------------------------
KVM x86 misc changes for 6.10:
- Advertise the max mappable GPA in the "guest MAXPHYADDR" CPUID field, which
is unused by hardware, so that KVM can communicate its inability to map GPAs
that set bits 51:48 due to lack of 5-level paging. Guest firmware is
expected to use the information to safely remap BARs in the uppermost GPA
space, i.e to avoid placing a BAR at a legal, but unmappable, GPA.
- Use vfree() instead of kvfree() for allocations that always use vcalloc()
or __vcalloc().
- Don't completely ignore same-value writes to immutable feature MSRs, as
doing so results in KVM failing to reject accesses to MSR that aren't
supposed to exist given the vCPU model and/or KVM configuration.
- Don't mark APICv as being inhibited due to ABSENT if APICv is disabled
KVM-wide to avoid confusing debuggers (KVM will never bother clearing the
ABSENT inhibit, even if userspace enables in-kernel local APIC).
----------------------------------------------------------------
Alejandro Jimenez (2):
KVM: x86: Only set APICV_INHIBIT_REASON_ABSENT if APICv is enabled
KVM: x86: Remove VT-d mention in posted interrupt tracepoint
Gerd Hoffmann (2):
KVM: x86: Don't advertise guest.MAXPHYADDR as host.MAXPHYADDR in CPUID
KVM: x86: Advertise max mappable GPA in CPUID.0x80000008.GuestPhysBits
Li RongQing (1):
KVM: Use vfree for memory allocated by vcalloc()/__vcalloc()
Sean Christopherson (1):
KVM: x86: Allow, don't ignore, same-value writes to immutable MSRs
arch/x86/kvm/cpuid.c | 41 +++++++++++++++++++++++++++++++----------
arch/x86/kvm/mmu.h | 2 ++
arch/x86/kvm/mmu/mmu.c | 5 +++++
arch/x86/kvm/mmu/page_track.c | 2 +-
arch/x86/kvm/trace.h | 4 ++--
arch/x86/kvm/x86.c | 28 +++++++++++-----------------
virt/kvm/kvm_main.c | 2 +-
7 files changed, 53 insertions(+), 31 deletions(-)