History

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

Pull kvm updates from Paolo Bonzini: "ARM64: - Enable the per-vcpu dirty-ring tracking mechanism, together with an option to keep the good old dirty log around for pages that are dirtied by something other than a vcpu. - Switch to the relaxed parallel fault handling, using RCU to delay page table reclaim and giving better performance under load. - Relax the MTE ABI, allowing a VMM to use the MAP_SHARED mapping option, which multi-process VMMs such as crosvm rely on (see merge commit 382b5b87a97d: "Fix a number of issues with MTE, such as races on the tags being initialised vs the PG_mte_tagged flag as well as the lack of support for VM_SHARED when KVM is involved. Patches from Catalin Marinas and Peter Collingbourne"). - Merge the pKVM shadow vcpu state tracking that allows the hypervisor to have its own view of a vcpu, keeping that state private. - Add support for the PMUv3p5 architecture revision, bringing support for 64bit counters on systems that support it, and fix the no-quite-compliant CHAIN-ed counter support for the machines that actually exist out there. - Fix a handful of minor issues around 52bit VA/PA support (64kB pages only) as a prefix of the oncoming support for 4kB and 16kB pages. - Pick a small set of documentation and spelling fixes, because no good merge window would be complete without those. s390: - Second batch of the lazy destroy patches - First batch of KVM changes for kernel virtual != physical address support - Removal of a unused function x86: - Allow compiling out SMM support - Cleanup and documentation of SMM state save area format - Preserve interrupt shadow in SMM state save area - Respond to generic signals during slow page faults - Fixes and optimizations for the non-executable huge page errata fix. - Reprogram all performance counters on PMU filter change - Cleanups to Hyper-V emulation and tests - Process Hyper-V TLB flushes from a nested guest (i.e. from a L2 guest running on top of a L1 Hyper-V hypervisor) - Advertise several new Intel features - x86 Xen-for-KVM: - Allow the Xen runstate information to cross a page boundary - Allow XEN_RUNSTATE_UPDATE flag behaviour to be configured - Add support for 32-bit guests in SCHEDOP_poll - Notable x86 fixes and cleanups: - One-off fixes for various emulation flows (SGX, VMXON, NRIPS=0). - Reinstate IBPB on emulated VM-Exit that was incorrectly dropped a few years back when eliminating unnecessary barriers when switching between vmcs01 and vmcs02. - Clean up vmread_error_trampoline() to make it more obvious that params must be passed on the stack, even for x86-64. - Let userspace set all supported bits in MSR_IA32_FEAT_CTL irrespective of the current guest CPUID. - Fudge around a race with TSC refinement that results in KVM incorrectly thinking a guest needs TSC scaling when running on a CPU with a constant TSC, but no hardware-enumerated TSC frequency. - Advertise (on AMD) that the SMM_CTL MSR is not supported - Remove unnecessary exports Generic: - Support for responding to signals during page faults; introduces new FOLL_INTERRUPTIBLE flag that was reviewed by mm folks Selftests: - Fix an inverted check in the access tracking perf test, and restore support for asserting that there aren't too many idle pages when running on bare metal. - Fix build errors that occur in certain setups (unsure exactly what is unique about the problematic setup) due to glibc overriding static_assert() to a variant that requires a custom message. - Introduce actual atomics for clear/set_bit() in selftests - Add support for pinning vCPUs in dirty_log_perf_test. - Rename the so called "perf_util" framework to "memstress". - Add a lightweight psuedo RNG for guest use, and use it to randomize the access pattern and write vs. read percentage in the memstress tests. - Add a common ucall implementation; code dedup and pre-work for running SEV (and beyond) guests in selftests. - Provide a common constructor and arch hook, which will eventually be used by x86 to automatically select the right hypercall (AMD vs. Intel). - A bunch of added/enabled/fixed selftests for ARM64, covering memslots, breakpoints, stage-2 faults and access tracking. - x86-specific selftest changes: - Clean up x86's page table management. - Clean up and enhance the "smaller maxphyaddr" test, and add a related test to cover generic emulation failure. - Clean up the nEPT support checks. - Add X86_PROPERTY_* framework to retrieve multi-bit CPUID values. - Fix an ordering issue in the AMX test introduced by recent conversions to use kvm_cpu_has(), and harden the code to guard against similar bugs in the future. Anything that tiggers caching of KVM's supported CPUID, kvm_cpu_has() in this case, effectively hides opt-in XSAVE features if the caching occurs before the test opts in via prctl(). Documentation: - Remove deleted ioctls from documentation - Clean up the docs for the x86 MSR filter. - Various fixes" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (361 commits) KVM: x86: Add proper ReST tables for userspace MSR exits/flags KVM: selftests: Allocate ucall pool from MEM_REGION_DATA KVM: arm64: selftests: Align VA space allocator with TTBR0 KVM: arm64: Fix benign bug with incorrect use of VA_BITS KVM: arm64: PMU: Fix period computation for 64bit counters with 32bit overflow KVM: x86: Advertise that the SMM_CTL MSR is not supported KVM: x86: remove unnecessary exports KVM: selftests: Fix spelling mistake "probabalistic" -> "probabilistic" tools: KVM: selftests: Convert clear/set_bit() to actual atomics tools: Drop "atomic_" prefix from atomic test_and_set_bit() tools: Drop conflicting non-atomic test_and_{clear,set}_bit() helpers KVM: selftests: Use non-atomic clear/set bit helpers in KVM tests perf tools: Use dedicated non-atomic clear/set bit helpers tools: Take @bit as an "unsigned long" in {clear,set}_bit() helpers KVM: arm64: selftests: Enable single-step without a "full" ucall() KVM: x86: fix APICv/x2AVIC disabled when vm reboot by itself KVM: Remove stale comment about KVM_REQ_UNHALT KVM: Add missing arch for KVM_CREATE_DEVICE and KVM_{SET,GET}_DEVICE_ATTR KVM: Reference to kvm_userspace_memory_region in doc and comments KVM: Delete all references to removed KVM_SET_MEMORY_ALIAS ioctl ...

Linus Torvalds committed 3 years ago

Commit 8fa590b2 parents 057b40f 549a715257 files · +12068 −4988Browse files

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

Unified · Split

include/uapi/linux/kvm.h+14−17
@@ -86,14 +86,6 @@ struct kvm_debug_guest { · 85 unmodified lines
86/* *** End of deprecated interfaces *** */86/* *** End of deprecated interfaces *** */
87 87
88 88
89/* for KVM_CREATE_MEMORY_REGION */
90struct kvm_memory_region {
91 __u32 slot;
92 __u32 flags;
93 __u64 guest_phys_addr;
94 __u64 memory_size; /* bytes */
95};
96
97/* for KVM_SET_USER_MEMORY_REGION */89/* for KVM_SET_USER_MEMORY_REGION */
98struct kvm_userspace_memory_region {90struct kvm_userspace_memory_region {
99 __u32 slot;91 __u32 slot;
@@ -104,9 +96,9 @@ struct kvm_userspace_memory_region { · 4 unmodified lines
104};96};
105 97
106/*98/*
107 * The bit 0 ~ bit 15 of kvm_memory_region::flags are visible for userspace,99 * The bit 0 ~ bit 15 of kvm_userspace_memory_region::flags are visible for
108 * other bits are reserved for kvm internal use which are defined in100 * userspace, other bits are reserved for kvm internal use which are defined
109 * include/linux/kvm_host.h.101 * in include/linux/kvm_host.h.
110 */102 */
111#define KVM_MEM_LOG_DIRTY_PAGES (1UL << 0)103#define KVM_MEM_LOG_DIRTY_PAGES (1UL << 0)
112#define KVM_MEM_READONLY (1UL << 1)104#define KVM_MEM_READONLY (1UL << 1)
@@ -485,6 +477,9 @@ struct kvm_run { · 372 unmodified lines
485#define KVM_MSR_EXIT_REASON_INVAL (1 << 0)477#define KVM_MSR_EXIT_REASON_INVAL (1 << 0)
486#define KVM_MSR_EXIT_REASON_UNKNOWN (1 << 1)478#define KVM_MSR_EXIT_REASON_UNKNOWN (1 << 1)
487#define KVM_MSR_EXIT_REASON_FILTER (1 << 2)479#define KVM_MSR_EXIT_REASON_FILTER (1 << 2)
480#define KVM_MSR_EXIT_REASON_VALID_MASK (KVM_MSR_EXIT_REASON_INVAL | \
481 KVM_MSR_EXIT_REASON_UNKNOWN | \
482 KVM_MSR_EXIT_REASON_FILTER)
488 __u32 reason; /* kernel -> user */483 __u32 reason; /* kernel -> user */
489 __u32 index; /* kernel -> user */484 __u32 index; /* kernel -> user */
490 __u64 data; /* kernel <-> user */485 __u64 data; /* kernel <-> user */
@@ -1178,6 +1173,8 @@ struct kvm_ppc_resize_hpt { · 687 unmodified lines
1178#define KVM_CAP_S390_ZPCI_OP 2211173#define KVM_CAP_S390_ZPCI_OP 221
1179#define KVM_CAP_S390_CPU_TOPOLOGY 2221174#define KVM_CAP_S390_CPU_TOPOLOGY 222
1180#define KVM_CAP_DIRTY_LOG_RING_ACQ_REL 2231175#define KVM_CAP_DIRTY_LOG_RING_ACQ_REL 223
1176#define KVM_CAP_S390_PROTECTED_ASYNC_DISABLE 224
1177#define KVM_CAP_DIRTY_LOG_RING_WITH_BITMAP 225
1181 1178
1182#ifdef KVM_CAP_IRQ_ROUTING1179#ifdef KVM_CAP_IRQ_ROUTING
1183 1180
@@ -1267,6 +1264,7 @@ struct kvm_x86_mce { · 83 unmodified lines
1267#define KVM_XEN_HVM_CONFIG_RUNSTATE (1 << 3)1264#define KVM_XEN_HVM_CONFIG_RUNSTATE (1 << 3)
1268#define KVM_XEN_HVM_CONFIG_EVTCHN_2LEVEL (1 << 4)1265#define KVM_XEN_HVM_CONFIG_EVTCHN_2LEVEL (1 << 4)
1269#define KVM_XEN_HVM_CONFIG_EVTCHN_SEND (1 << 5)1266#define KVM_XEN_HVM_CONFIG_EVTCHN_SEND (1 << 5)
1267#define KVM_XEN_HVM_CONFIG_RUNSTATE_UPDATE_FLAG (1 << 6)
1270 1268
1271struct kvm_xen_hvm_config {1269struct kvm_xen_hvm_config {
1272 __u32 flags;1270 __u32 flags;
@@ -1437,18 +1435,12 @@ struct kvm_vfio_spapr_tce { · 164 unmodified lines
1437 __s32 tablefd;1435 __s32 tablefd;
1438};1436};
1439 1437
1440/*
1441 * ioctls for VM fds
1442 */
1443#define KVM_SET_MEMORY_REGION _IOW(KVMIO, 0x40, struct kvm_memory_region)
1444/*1438/*
1445 * KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns1439 * KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns
1446 * a vcpu fd.1440 * a vcpu fd.
1447 */1441 */
1448#define KVM_CREATE_VCPU _IO(KVMIO, 0x41)1442#define KVM_CREATE_VCPU _IO(KVMIO, 0x41)
1449#define KVM_GET_DIRTY_LOG _IOW(KVMIO, 0x42, struct kvm_dirty_log)1443#define KVM_GET_DIRTY_LOG _IOW(KVMIO, 0x42, struct kvm_dirty_log)
1450/* KVM_SET_MEMORY_ALIAS is obsolete: */
1451#define KVM_SET_MEMORY_ALIAS _IOW(KVMIO, 0x43, struct kvm_memory_alias)
1452#define KVM_SET_NR_MMU_PAGES _IO(KVMIO, 0x44)1444#define KVM_SET_NR_MMU_PAGES _IO(KVMIO, 0x44)
1453#define KVM_GET_NR_MMU_PAGES _IO(KVMIO, 0x45)1445#define KVM_GET_NR_MMU_PAGES _IO(KVMIO, 0x45)
1454#define KVM_SET_USER_MEMORY_REGION _IOW(KVMIO, 0x46, \1446#define KVM_SET_USER_MEMORY_REGION _IOW(KVMIO, 0x46, \
@@ -1740,6 +1732,8 @@ enum pv_cmd_id { · 285 unmodified lines
1740 KVM_PV_UNSHARE_ALL,1732 KVM_PV_UNSHARE_ALL,
1741 KVM_PV_INFO,1733 KVM_PV_INFO,
1742 KVM_PV_DUMP,1734 KVM_PV_DUMP,
1735 KVM_PV_ASYNC_CLEANUP_PREPARE,
1736 KVM_PV_ASYNC_CLEANUP_PERFORM,
1743};1737};
1744 1738
1745struct kvm_pv_cmd {1739struct kvm_pv_cmd {
@@ -1770,6 +1764,7 @@ struct kvm_xen_hvm_attr { · 24 unmodified lines
1770 union {1764 union {
1771 __u8 long_mode;1765 __u8 long_mode;
1772 __u8 vector;1766 __u8 vector;
1767 __u8 runstate_update_flag;
1773 struct {1768 struct {
1774 __u64 gfn;1769 __u64 gfn;
1775 } shared_info;1770 } shared_info;
@@ -1810,6 +1805,8 @@ struct kvm_xen_hvm_attr { · 34 unmodified lines
1810/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_EVTCHN_SEND */1805/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_EVTCHN_SEND */
1811#define KVM_XEN_ATTR_TYPE_EVTCHN 0x31806#define KVM_XEN_ATTR_TYPE_EVTCHN 0x3
1812#define KVM_XEN_ATTR_TYPE_XEN_VERSION 0x41807#define KVM_XEN_ATTR_TYPE_XEN_VERSION 0x4
1808/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_RUNSTATE_UPDATE_FLAG */
1809#define KVM_XEN_ATTR_TYPE_RUNSTATE_UPDATE_FLAG 0x5
1813 1810
1814/* Per-vCPU Xen attributes */1811/* Per-vCPU Xen attributes */
1815#define KVM_XEN_VCPU_GET_ATTR _IOWR(KVMIO, 0xca, struct kvm_xen_vcpu_attr)1812#define KVM_XEN_VCPU_GET_ATTR _IOWR(KVMIO, 0xca, struct kvm_xen_vcpu_attr)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t