Generic:

* Rework almost all of KVM's exports to expose symbols only to KVM's x86
  vendor modules (kvm-{amd,intel}.ko and PPC's kvm-{pr,hv}.ko.

x86:

* Rework almost all of KVM x86's exports to expose symbols only to KVM's
  vendor modules, i.e. to kvm-{amd,intel}.ko.

* Add support for virtualizing Control-flow Enforcement Technology (CET) on
  Intel (Shadow Stacks and Indirect Branch Tracking) and AMD (Shadow Stacks).
  It's worth noting that while SHSTK and IBT can be enabled separately in CPUID,
  it is not really possible to virtualize them separately.  Therefore, Intel
  processors will really allow both SHSTK and IBT under the hood if either is
  made visible in the guest's CPUID.  The alternative would be to intercept
  XSAVES/XRSTORS, which is not feasible for performance reasons.

* Fix a variety of fuzzing WARNs all caused by checking L1 intercepts when
  completing userspace I/O.  KVM has already committed to allowing L2 to
  to perform I/O at that point.

* Emulate PERF_CNTR_GLOBAL_STATUS_SET for PerfMonV2 guests, as the MSR is
  supposed to exist for v2 PMUs.

* Allow Centaur CPU leaves (base 0xC000_0000) for Zhaoxin CPUs.

* Add support for the immediate forms of RDMSR and WRMSRNS, sans full
  emulator support (KVM should never need to emulate the MSRs outside of
  forced emulation and other contrived testing scenarios).

* Clean up the MSR APIs in preparation for CET and FRED virtualization, as
  well as mediated vPMU support.

* Clean up a pile of PMU code in anticipation of adding support for mediated
  vPMUs.

* Reject in-kernel IOAPIC/PIT for TDX VMs, as KVM can't obtain EOI vmexits
  needed to faithfully emulate an I/O APIC for such guests.

* Many cleanups and minor fixes.

* Recover possible NX huge pages within the TDP MMU under read lock to
  reduce guest jitter when restoring NX huge pages.

* Return -EAGAIN during prefault if userspace concurrently deletes/moves the
  relevant memslot, to fix an issue where prefaulting could deadlock with the
  memslot update.

x86 (AMD):

* Enable AVIC by default for Zen4+ if x2AVIC (and other prereqs) is supported.

* Require a minimum GHCB version of 2 when starting SEV-SNP guests via
  KVM_SEV_INIT2 so that invalid GHCB versions result in immediate errors
  instead of latent guest failures.

* Add support for SEV-SNP's CipherText Hiding, an opt-in feature that prevents
  unauthorized CPU accesses from reading the ciphertext of SNP guest private
  memory, e.g. to attempt an offline attack.  This feature splits the shared
  SEV-ES/SEV-SNP ASID space into separate ranges for SEV-ES and SEV-SNP guests,
  therefore a new module parameter is needed to control the number of ASIDs
  that can be used for VMs with CipherText Hiding vs. how many can be used to
  run SEV-ES guests.

* Add support for Secure TSC for SEV-SNP guests, which prevents the untrusted
  host from tampering with the guest's TSC frequency, while still allowing the
  the VMM to configure the guest's TSC frequency prior to launch.

* Validate the XCR0 provided by the guest (via the GHCB) to avoid bugs
  resulting from bogus XCR0 values.

* Save an SEV guest's policy if and only if LAUNCH_START fully succeeds to
  avoid leaving behind stale state (thankfully not consumed in KVM).

* Explicitly reject non-positive effective lengths during SNP's LAUNCH_UPDATE
  instead of subtly relying on guest_memfd to deal with them.

* Reload the pre-VMRUN TSC_AUX on #VMEXIT for SEV-ES guests, not the host's
  desired TSC_AUX, to fix a bug where KVM was keeping a different vCPU's
  TSC_AUX in the host MSR until return to userspace.

KVM (Intel):

* Preparation for FRED support.

* Don't retry in TDX's anti-zero-step mitigation if the target memslot is
  invalid, i.e. is being deleted or moved, to fix a deadlock scenario similar
  to the aforementioned prefaulting case.

* Misc bugfixes and minor cleanups.
KVM: x86: Export KVM-internal symbols for sub-modules only

Rework almost all of KVM x86's exports to expose symbols only to KVM's
vendor modules, i.e. to kvm-{amd,intel}.ko.  Keep the generic exports that
are guarded by CONFIG_KVM_EXTERNAL_WRITE_TRACKING=y, as they're explicitly
designed/intended for external usage.

Link: https://lore.kernel.org/r/20250919003303.1355064-6-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 files changed