History

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

Pull kvm updates from Paolo Bonzini: "ARM: - Generalized infrastructure for 'writable' ID registers, effectively allowing userspace to opt-out of certain vCPU features for its guest - Optimization for vSGI injection, opportunistically compressing MPIDR to vCPU mapping into a table - Improvements to KVM's PMU emulation, allowing userspace to select the number of PMCs available to a VM - Guest support for memory operation instructions (FEAT_MOPS) - Cleanups to handling feature flags in KVM_ARM_VCPU_INIT, squashing bugs and getting rid of useless code - Changes to the way the SMCCC filter is constructed, avoiding wasted memory allocations when not in use - Load the stage-2 MMU context at vcpu_load() for VHE systems, reducing the overhead of errata mitigations - Miscellaneous kernel and selftest fixes LoongArch: - New architecture for kvm. The hardware uses the same model as x86, s390 and RISC-V, where guest/host mode is orthogonal to supervisor/user mode. The virtualization extensions are very similar to MIPS, therefore the code also has some similarities but it's been cleaned up to avoid some of the historical bogosities that are found in arch/mips. The kernel emulates MMU, timer and CSR accesses, while interrupt controllers are only emulated in userspace, at least for now. RISC-V: - Support for the Smstateen and Zicond extensions - Support for virtualizing senvcfg - Support for virtualized SBI debug console (DBCN) S390: - Nested page table management can be monitored through tracepoints and statistics x86: - Fix incorrect handling of VMX posted interrupt descriptor in KVM_SET_LAPIC, which could result in a dropped timer IRQ - Avoid WARN on systems with Intel IPI virtualization - Add CONFIG_KVM_MAX_NR_VCPUS, to allow supporting up to 4096 vCPUs without forcing more common use cases to eat the extra memory overhead. - Add virtualization support for AMD SRSO mitigation (IBPB_BRTYPE and SBPB, aka Selective Branch Predictor Barrier). - Fix a bug where restoring a vCPU snapshot that was taken within 1 second of creating the original vCPU would cause KVM to try to synchronize the vCPU's TSC and thus clobber the correct TSC being set by userspace. - Compute guest wall clock using a single TSC read to avoid generating an inaccurate time, e.g. if the vCPU is preempted between multiple TSC reads. - "Virtualize" HWCR.TscFreqSel to make Linux guests happy, which complain about a "Firmware Bug" if the bit isn't set for select F/M/S combos. Likewise "virtualize" (ignore) MSR_AMD64_TW_CFG to appease Windows Server 2022. - Don't apply side effects to Hyper-V's synthetic timer on writes from userspace to fix an issue where the auto-enable behavior can trigger spurious interrupts, i.e. do auto-enabling only for guest writes. - Remove an unnecessary kick of all vCPUs when synchronizing the dirty log without PML enabled. - Advertise "support" for non-serializing FS/GS base MSR writes as appropriate. - Harden the fast page fault path to guard against encountering an invalid root when walking SPTEs. - Omit "struct kvm_vcpu_xen" entirely when CONFIG_KVM_XEN=n. - Use the fast path directly from the timer callback when delivering Xen timer events, instead of waiting for the next iteration of the run loop. This was not done so far because previously proposed code had races, but now care is taken to stop the hrtimer at critical points such as restarting the timer or saving the timer information for userspace. - Follow the lead of upstream Xen and ignore the VCPU_SSHOTTMR_future flag. - Optimize injection of PMU interrupts that are simultaneous with NMIs. - Usual handful of fixes for typos and other warts. x86 - MTRR/PAT fixes and optimizations: - Clean up code that deals with honoring guest MTRRs when the VM has non-coherent DMA and host MTRRs are ignored, i.e. EPT is enabled. - Zap EPT entries when non-coherent DMA assignment stops/start to prevent using stale entries with the wrong memtype. - Don't ignore guest PAT for CR0.CD=1 && KVM_X86_QUIRK_CD_NW_CLEARED=y This was done as a workaround for virtual machine BIOSes that did not bother to clear CR0.CD (because ancient KVM/QEMU did not bother to set it, in turn), and there's zero reason to extend the quirk to also ignore guest PAT. x86 - SEV fixes: - Report KVM_EXIT_SHUTDOWN instead of EINVAL if KVM intercepts SHUTDOWN while running an SEV-ES guest. - Clean up the recognition of emulation failures on SEV guests, when KVM would like to "skip" the instruction but it had already been partially emulated. This makes it possible to drop a hack that second guessed the (insufficient) information provided by the emulator, and just do the right thing. Documentation: - Various updates and fixes, mostly for x86 - MTRR and PAT fixes and optimizations" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (164 commits) KVM: selftests: Avoid using forced target for generating arm64 headers tools headers arm64: Fix references to top srcdir in Makefile KVM: arm64: Add tracepoint for MMIO accesses where ISV==0 KVM: arm64: selftest: Perform ISB before reading PAR_EL1 KVM: arm64: selftest: Add the missing .guest_prepare() KVM: arm64: Always invalidate TLB for stage-2 permission faults KVM: x86: Service NMI requests after PMI requests in VM-Enter path KVM: arm64: Handle AArch32 SPSR_{irq,abt,und,fiq} as RAZ/WI KVM: arm64: Do not let a L1 hypervisor access the *32_EL2 sysregs KVM: arm64: Refine _EL2 system register list that require trap reinjection arm64: Add missing _EL2 encodings arm64: Add missing _EL12 encodings KVM: selftests: aarch64: vPMU test for validating user accesses KVM: selftests: aarch64: vPMU register test for unimplemented counters KVM: selftests: aarch64: vPMU register test for implemented counters KVM: selftests: aarch64: Introduce vpmu_counter_access test tools: Import arm_pmuv3.h KVM: arm64: PMU: Allow userspace to limit PMCR_EL0.N for the guest KVM: arm64: Sanitize PM{C,I}NTEN{SET,CLR}, PMOVS{SET,CLR} before first run KVM: arm64: Add {get,set}_user for PM{C,I}NTEN{SET,CLR}, PMOVS{SET,CLR} ...

Linus Torvalds committed 3 years ago

Commit 6803bd72 parents 5be9911 45b890f127 files · +8885 −1503Browse files

Showing the changes to include/uapi/linux (1 of 127 files). Show all

Unified · Split

include/uapi/linux/kvm.h+11−0
@@ -264,6 +264,7 @@ struct kvm_xen_exit { · 263 unmodified lines
264#define KVM_EXIT_RISCV_SBI 35264#define KVM_EXIT_RISCV_SBI 35
265#define KVM_EXIT_RISCV_CSR 36265#define KVM_EXIT_RISCV_CSR 36
266#define KVM_EXIT_NOTIFY 37266#define KVM_EXIT_NOTIFY 37
267#define KVM_EXIT_LOONGARCH_IOCSR 38
267 268
268/* For KVM_EXIT_INTERNAL_ERROR */269/* For KVM_EXIT_INTERNAL_ERROR */
269/* Emulate instruction failed. */270/* Emulate instruction failed. */
@@ -336,6 +337,13 @@ struct kvm_run { · 66 unmodified lines
336 __u32 len;337 __u32 len;
337 __u8 is_write;338 __u8 is_write;
338 } mmio;339 } mmio;
340 /* KVM_EXIT_LOONGARCH_IOCSR */
341 struct {
342 __u64 phys_addr;
343 __u8 data[8];
344 __u32 len;
345 __u8 is_write;
346 } iocsr_io;
339 /* KVM_EXIT_HYPERCALL */347 /* KVM_EXIT_HYPERCALL */
340 struct {348 struct {
341 __u64 nr;349 __u64 nr;
@@ -1192,6 +1200,7 @@ struct kvm_ppc_resize_hpt { · 850 unmodified lines
1192#define KVM_CAP_COUNTER_OFFSET 2271200#define KVM_CAP_COUNTER_OFFSET 227
1193#define KVM_CAP_ARM_EAGER_SPLIT_CHUNK_SIZE 2281201#define KVM_CAP_ARM_EAGER_SPLIT_CHUNK_SIZE 228
1194#define KVM_CAP_ARM_SUPPORTED_BLOCK_SIZES 2291202#define KVM_CAP_ARM_SUPPORTED_BLOCK_SIZES 229
1203#define KVM_CAP_ARM_SUPPORTED_REG_MASK_RANGES 230
1195 1204
1196#ifdef KVM_CAP_IRQ_ROUTING1205#ifdef KVM_CAP_IRQ_ROUTING
1197 1206
@@ -1362,6 +1371,7 @@ struct kvm_dirty_tlb { · 164 unmodified lines
1362#define KVM_REG_ARM64 0x6000000000000000ULL1371#define KVM_REG_ARM64 0x6000000000000000ULL
1363#define KVM_REG_MIPS 0x7000000000000000ULL1372#define KVM_REG_MIPS 0x7000000000000000ULL
1364#define KVM_REG_RISCV 0x8000000000000000ULL1373#define KVM_REG_RISCV 0x8000000000000000ULL
1374#define KVM_REG_LOONGARCH 0x9000000000000000ULL
1365 1375
1366#define KVM_REG_SIZE_SHIFT 521376#define KVM_REG_SIZE_SHIFT 52
1367#define KVM_REG_SIZE_MASK 0x00f0000000000000ULL1377#define KVM_REG_SIZE_MASK 0x00f0000000000000ULL
@@ -1562,6 +1572,7 @@ struct kvm_s390_ucas_mapping { · 194 unmodified lines
1562#define KVM_ARM_MTE_COPY_TAGS _IOR(KVMIO, 0xb4, struct kvm_arm_copy_mte_tags)1572#define KVM_ARM_MTE_COPY_TAGS _IOR(KVMIO, 0xb4, struct kvm_arm_copy_mte_tags)
1563/* Available with KVM_CAP_COUNTER_OFFSET */1573/* Available with KVM_CAP_COUNTER_OFFSET */
1564#define KVM_ARM_SET_COUNTER_OFFSET _IOW(KVMIO, 0xb5, struct kvm_arm_counter_offset)1574#define KVM_ARM_SET_COUNTER_OFFSET _IOW(KVMIO, 0xb5, struct kvm_arm_counter_offset)
1575#define KVM_ARM_GET_REG_WRITABLE_MASKS _IOR(KVMIO, 0xb6, struct reg_mask_range)
1565 1576
1566/* ioctl for vm fd */1577/* ioctl for vm fd */
1567#define KVM_CREATE_DEVICE _IOWR(KVMIO, 0xe0, struct kvm_create_device)1578#define KVM_CREATE_DEVICE _IOWR(KVMIO, 0xe0, struct kvm_create_device)