projects/linux·commit 66dcff86

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

66dcff86 · Linus Torvalds <[email protected]> · 2014-12-18 16:05:28 -08:00

Pull KVM update from Paolo Bonzini:
 "3.19 changes for KVM:

   - spring cleaning: removed support for IA64, and for hardware-
     assisted virtualization on the PPC970

   - ARM, PPC, s390 all had only small fixes

  For x86:
   - small performance improvements (though only on weird guests)
   - usual round of hardware-compliancy fixes from Nadav
   - APICv fixes
   - XSAVES support for hosts and guests.  XSAVES hosts were broken
     because the (non-KVM) XSAVES patches inadvertently changed the KVM
     userspace ABI whenever XSAVES was enabled; hence, this part is
     going to stable.  Guest support is just a matter of exposing the
     feature and CPUID leaves support"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (179 commits)
  KVM: move APIC types to arch/x86/
  KVM: PPC: Book3S: Enable in-kernel XICS emulation by default
  KVM: PPC: Book3S HV: Improve H_CONFER implementation
  KVM: PPC: Book3S HV: Fix endianness of instruction obtained from HEIR register
  KVM: PPC: Book3S HV: Remove code for PPC970 processors
  KVM: PPC: Book3S HV: Tracepoints for KVM HV guest interactions
  KVM: PPC: Book3S HV: Simplify locking around stolen time calculations
  arch: powerpc: kvm: book3s_paired_singles.c: Remove unused function
  arch: powerpc: kvm: book3s_pr.c: Remove unused function
  arch: powerpc: kvm: book3s.c: Remove some unused functions
  arch: powerpc: kvm: book3s_32_mmu.c: Remove unused function
  KVM: PPC: Book3S HV: Check wait conditions before sleeping in kvmppc_vcore_blocked
  KVM: PPC: Book3S HV: ptes are big endian
  KVM: PPC: Book3S HV: Fix inaccuracies in ICP emulation for H_IPI
  KVM: PPC: Book3S HV: Fix KSM memory corruption
  KVM: PPC: Book3S HV: Fix an issue where guest is paused on receiving HMI
  KVM: PPC: Book3S HV: Fix computation of tlbie operand
  KVM: PPC: Book3S HV: Add missing HPTE unlock
  KVM: PPC: BookE: Improve irq inject tracepoint
  arm/arm64: KVM: Require in-kernel vgic for the arch timers
  ...
Commit
66dcff86ba40eebb5133cccf450878f2bba102ef
Parents
91ed9e8a · 2c4aa55a

Merge commit. Changes below are compared with the first parent: 91ed9e8a.

Changes

114 files changed · +3551 −16095

FileStatusAddDelContent
Documentation/ia64/kvm.txtdeleted+0−83View before deletion
Documentation/virtual/kvm/api.txtmodified+71−31View file
Documentation/virtual/kvm/devices/vm.txtmodified+5−5View file
Documentation/virtual/kvm/msr.txtmodified+1−1View file
MAINTAINERSmodified+0−9View file
arch/arm/include/asm/kvm_emulate.hmodified+5−0View file
arch/arm/include/asm/kvm_host.hmodified+0−2View file
arch/arm/include/asm/kvm_mmu.hmodified+4−2View file
arch/arm/kvm/arm.cmodified+73−5View file
arch/arm/kvm/guest.cmodified+0−26View file
arch/arm/kvm/mmio.cmodified+9−6View file
arch/arm/kvm/mmu.cmodified+86−6View file
arch/arm/kvm/psci.cmodified+18−0View file
arch/arm64/include/asm/kvm_emulate.hmodified+5−0View file
arch/arm64/include/asm/kvm_host.hmodified+1−2View file
arch/arm64/include/asm/kvm_mmu.hmodified+4−2View file
arch/arm64/kvm/guest.cmodified+0−26View file
arch/ia64/Kconfigmodified+0−3View file
arch/ia64/Makefilemodified+0−1View file
arch/ia64/include/asm/kvm_host.hdeleted+0−609View before deletion
arch/ia64/include/asm/pvclock-abi.hdeleted+0−48View before deletion
arch/ia64/include/uapi/asm/kvm.hdeleted+0−268View before deletion
arch/ia64/kvm/Kconfigdeleted+0−66View before deletion
arch/ia64/kvm/Makefiledeleted+0−67View before deletion
arch/ia64/kvm/asm-offsets.cdeleted+0−241View before deletion
arch/ia64/kvm/irq.hdeleted+0−33View before deletion
arch/ia64/kvm/kvm-ia64.cdeleted+0−1942View before deletion
arch/ia64/kvm/kvm_fw.cdeleted+0−674View before deletion
arch/ia64/kvm/kvm_lib.cdeleted+0−21View before deletion
arch/ia64/kvm/kvm_minstate.hdeleted+0−266View before deletion
arch/ia64/kvm/lapic.hdeleted+0−30View before deletion
arch/ia64/kvm/memcpy.Sdeleted+0−1View before deletion
arch/ia64/kvm/memset.Sdeleted+0−1View before deletion
arch/ia64/kvm/misc.hdeleted+0−94View before deletion
arch/ia64/kvm/mmio.cdeleted+0−336View before deletion
arch/ia64/kvm/optvfault.Sdeleted+0−1090View before deletion
arch/ia64/kvm/process.cdeleted+0−1024View before deletion
arch/ia64/kvm/trampoline.Sdeleted+0−1038View before deletion
arch/ia64/kvm/vcpu.cdeleted+0−2209View before deletion
arch/ia64/kvm/vcpu.hdeleted+0−752View before deletion
arch/ia64/kvm/vmm.cdeleted+0−99View before deletion
arch/ia64/kvm/vmm_ivt.Sdeleted+0−1392View before deletion
arch/ia64/kvm/vti.hdeleted+0−290View before deletion
arch/ia64/kvm/vtlb.cdeleted+0−640View before deletion
arch/powerpc/include/asm/kvm_book3s.hmodified+0−2View file
arch/powerpc/include/asm/kvm_book3s_64.hmodified+1−2View file
arch/powerpc/include/asm/kvm_host.hmodified+4−14View file
arch/powerpc/include/asm/kvm_ppc.hmodified+0−2View file
arch/powerpc/kernel/asm-offsets.cmodified+1−1View file
arch/powerpc/kvm/Kconfigmodified+1−0View file
arch/powerpc/kvm/book3s.cmodified+0−8View file
arch/powerpc/kvm/book3s_32_mmu.cmodified+0−5View file
arch/powerpc/kvm/book3s_64_mmu_hv.cmodified+34−190View file
arch/powerpc/kvm/book3s_hv.cmodified+144−294View file
arch/powerpc/kvm/book3s_hv_builtin.cmodified+34−102View file
arch/powerpc/kvm/book3s_hv_interrupts.Smodified+1−38View file
arch/powerpc/kvm/book3s_hv_ras.cmodified+1−4View file
arch/powerpc/kvm/book3s_hv_rm_mmu.cmodified+32−118View file
arch/powerpc/kvm/book3s_hv_rm_xics.cmodified+28−8View file
arch/powerpc/kvm/book3s_hv_rmhandlers.Smodified+8−243View file
arch/powerpc/kvm/book3s_paired_singles.cmodified+0−8View file
arch/powerpc/kvm/book3s_pr.cmodified+0−5View file
arch/powerpc/kvm/book3s_xics.cmodified+23−7View file
arch/powerpc/kvm/book3s_xics.hmodified+1−0View file
arch/powerpc/kvm/e500.cmodified+0−8View file
arch/powerpc/kvm/powerpc.cmodified+2−8View file
arch/powerpc/kvm/trace_book3s.hadded+32−0View file
arch/powerpc/kvm/trace_booke.hmodified+45−2View file
arch/powerpc/kvm/trace_hv.hadded+477−0View file
arch/powerpc/kvm/trace_pr.hmodified+1−24View file
arch/s390/include/asm/kvm_host.hmodified+96−3View file
arch/s390/include/asm/pgalloc.hmodified+1−0View file
arch/s390/include/asm/sigp.hmodified+1−0View file
arch/s390/kvm/gaccess.cmodified+23−17View file
arch/s390/kvm/intercept.cmodified+16−4View file
arch/s390/kvm/interrupt.cmodified+697−347View file
arch/s390/kvm/kvm-s390.cmodified+17−5View file
arch/s390/kvm/kvm-s390.hmodified+8−3View file
arch/s390/kvm/priv.cmodified+45−50View file
arch/s390/kvm/sigp.cmodified+148−157View file
arch/s390/mm/pgtable.cmodified+40−1View file
arch/x86/include/asm/kvm_host.hmodified+34−3View file
arch/x86/include/asm/vmx.hmodified+3−0View file
arch/x86/include/asm/xsave.hmodified+1−0View file
arch/x86/include/uapi/asm/vmx.hmodified+5−1View file
arch/x86/kernel/kvm.cmodified+8−1View file
arch/x86/kernel/kvmclock.cmodified+8−12View file
arch/x86/kernel/xsave.cmodified+1−0View file
arch/x86/kvm/Makefilemodified+3−4View file
virt/kvm/assigned-dev.c → arch/x86/kvm/assigned-dev.crenamed+28−2View file
arch/x86/kvm/assigned-dev.hadded+32−0View file
arch/x86/kvm/cpuid.cmodified+43−14View file
arch/x86/kvm/emulate.cmodified+218−190View file
virt/kvm/ioapic.c → arch/x86/kvm/ioapic.crenamed+0−12View file
virt/kvm/ioapic.h → arch/x86/kvm/ioapic.hrenamed+18−3View file
virt/kvm/iommu.c → arch/x86/kvm/iommu.crenamed+3−8View file
virt/kvm/irq_comm.c → arch/x86/kvm/irq_comm.crenamed+4−41View file
arch/x86/kvm/lapic.cmodified+134−76View file
arch/x86/kvm/lapic.hmodified+7−7View file
arch/x86/kvm/mmu.cmodified+3−4View file
arch/x86/kvm/svm.cmodified+17−7View file
arch/x86/kvm/trace.hmodified+37−0View file
arch/x86/kvm/vmx.cmodified+354−254View file
arch/x86/kvm/x86.cmodified+159−67View file
arch/x86/kvm/x86.hmodified+2−1View file
include/kvm/arm_arch_timer.hmodified+4−6View file
include/kvm/arm_vgic.hmodified+9−3View file
include/linux/kvm_host.hmodified+32−74View file
include/linux/kvm_types.hmodified+0−27View file
include/uapi/linux/kvm.hmodified+0−11View file
virt/kvm/arm/arch_timer.cmodified+22−8View file
virt/kvm/arm/vgic.cmodified+60−56View file
virt/kvm/eventfd.cmodified+0−7View file
virt/kvm/kvm_main.cmodified+58−75View file

Only the first 600 diff lines are shown. Download the complete patch.

Documentation/ia64/kvm.txt

View before deletion
diff --git a/Documentation/ia64/kvm.txt b/Documentation/ia64/kvm.txt
deleted file mode 100644
index ffb5c80..0000000
--- a/Documentation/ia64/kvm.txt
+++ /dev/null
@@ -1,83 +0,0 @@
-Currently, kvm module is in EXPERIMENTAL stage on IA64. This means that
-interfaces are not stable enough to use. So, please don't run critical
-applications in virtual machine.
-We will try our best to improve it in future versions!
-
- Guide: How to boot up guests on kvm/ia64
-
-This guide is to describe how to enable kvm support for IA-64 systems.
-
-1. Get the kvm source from git.kernel.org.
- Userspace source:
- git clone git://git.kernel.org/pub/scm/virt/kvm/kvm-userspace.git
- Kernel Source:
- git clone git://git.kernel.org/pub/scm/linux/kernel/git/xiantao/kvm-ia64.git
-
-2. Compile the source code.
- 2.1 Compile userspace code:
- (1)cd ./kvm-userspace
- (2)./configure
- (3)cd kernel
- (4)make sync LINUX= $kernel_dir (kernel_dir is the directory of kernel source.)
- (5)cd ..
- (6)make qemu
- (7)cd qemu; make install
-
- 2.2 Compile kernel source code:
- (1) cd ./$kernel_dir
- (2) Make menuconfig
- (3) Enter into virtualization option, and choose kvm.
- (4) make
- (5) Once (4) done, make modules_install
- (6) Make initrd, and use new kernel to reboot up host machine.
- (7) Once (6) done, cd $kernel_dir/arch/ia64/kvm
- (8) insmod kvm.ko; insmod kvm-intel.ko
-
-Note: For step 2, please make sure that host page size == TARGET_PAGE_SIZE of qemu, otherwise, may fail.
-
-3. Get Guest Firmware named as Flash.fd, and put it under right place:
- (1) If you have the guest firmware (binary) released by Intel Corp for Xen, use it directly.
-
- (2) If you have no firmware at hand, Please download its source from
- hg clone http://xenbits.xensource.com/ext/efi-vfirmware.hg
- you can get the firmware's binary in the directory of efi-vfirmware.hg/binaries.
-
- (3) Rename the firmware you owned to Flash.fd, and copy it to /usr/local/share/qemu
-
-4. Boot up Linux or Windows guests:
- 4.1 Create or install a image for guest boot. If you have xen experience, it should be easy.
-
- 4.2 Boot up guests use the following command.
- /usr/local/bin/qemu-system-ia64 -smp xx -m 512 -hda $your_image
- (xx is the number of virtual processors for the guest, now the maximum value is 4)
-
-5. Known possible issue on some platforms with old Firmware.
-
-In the event of strange host crash issues, try to solve it through either of the following ways:
-
-(1): Upgrade your Firmware to the latest one.
-
-(2): Applying the below patch to kernel source.
-diff --git a/arch/ia64/kernel/pal.S b/arch/ia64/kernel/pal.S
-index 0b53344..f02b0f7 100644
---- a/arch/ia64/kernel/pal.S
-+++ b/arch/ia64/kernel/pal.S
-@@ -84,7 +84,8 @@ GLOBAL_ENTRY(ia64_pal_call_static)
- mov ar.pfs = loc1
- mov rp = loc0
- ;;
-- srlz.d // serialize restoration of psr.l
-+ srlz.i // serialize restoration of psr.l
-+ ;;
- br.ret.sptk.many b0
- END(ia64_pal_call_static)
-
-6. Bug report:
- If you found any issues when use kvm/ia64, Please post the bug info to kvm-ia64-devel mailing list.
- https://lists.sourceforge.net/lists/listinfo/kvm-ia64-devel/
-
-Thanks for your interest! Let's work together, and make kvm/ia64 stronger and stronger!
-
-
- Xiantao Zhang <[email protected]>
- 2008.3.10

Documentation/virtual/kvm/api.txt

View file
diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt
index 7610eaa..0007fef 100644
--- a/Documentation/virtual/kvm/api.txt
+++ b/Documentation/virtual/kvm/api.txt
@@ -68,9 +68,12 @@ description:
Capability: which KVM extension provides this ioctl. Can be 'basic',
which means that is will be provided by any kernel that supports
- API version 12 (see section 4.1), or a KVM_CAP_xyz constant, which
+ API version 12 (see section 4.1), a KVM_CAP_xyz constant, which
means availability needs to be checked with KVM_CHECK_EXTENSION
- (see section 4.4).
+ (see section 4.4), or 'none' which means that while not all kernels
+ support this ioctl, there's no capability bit to check its
+ availability: for kernels that don't support the ioctl,
+ the ioctl returns -ENOTTY.
Architectures: which instruction set architectures provide this ioctl.
x86 includes both i386 and x86_64.
@@ -604,7 +607,7 @@ struct kvm_fpu {
4.24 KVM_CREATE_IRQCHIP
Capability: KVM_CAP_IRQCHIP, KVM_CAP_S390_IRQCHIP (s390)
-Architectures: x86, ia64, ARM, arm64, s390
+Architectures: x86, ARM, arm64, s390
Type: vm ioctl
Parameters: none
Returns: 0 on success, -1 on error
@@ -612,7 +615,7 @@ Returns: 0 on success, -1 on error
Creates an interrupt controller model in the kernel. On x86, creates a virtual
ioapic, a virtual PIC (two PICs, nested), and sets up future vcpus to have a
local APIC. IRQ routing for GSIs 0-15 is set to both PIC and IOAPIC; GSI 16-23
-only go to the IOAPIC. On ia64, a IOSAPIC is created. On ARM/arm64, a GIC is
+only go to the IOAPIC. On ARM/arm64, a GIC is
created. On s390, a dummy irq routing table is created.
Note that on s390 the KVM_CAP_S390_IRQCHIP vm capability needs to be enabled
@@ -622,7 +625,7 @@ before KVM_CREATE_IRQCHIP can be used.
4.25 KVM_IRQ_LINE
Capability: KVM_CAP_IRQCHIP
-Architectures: x86, ia64, arm, arm64
+Architectures: x86, arm, arm64
Type: vm ioctl
Parameters: struct kvm_irq_level
Returns: 0 on success, -1 on error
@@ -676,7 +679,7 @@ struct kvm_irq_level {
4.26 KVM_GET_IRQCHIP
Capability: KVM_CAP_IRQCHIP
-Architectures: x86, ia64
+Architectures: x86
Type: vm ioctl
Parameters: struct kvm_irqchip (in/out)
Returns: 0 on success, -1 on error
@@ -698,7 +701,7 @@ struct kvm_irqchip {
4.27 KVM_SET_IRQCHIP
Capability: KVM_CAP_IRQCHIP
-Architectures: x86, ia64
+Architectures: x86
Type: vm ioctl
Parameters: struct kvm_irqchip (in)
Returns: 0 on success, -1 on error
@@ -991,7 +994,7 @@ for vm-wide capabilities.
4.38 KVM_GET_MP_STATE
Capability: KVM_CAP_MP_STATE
-Architectures: x86, ia64, s390
+Architectures: x86, s390
Type: vcpu ioctl
Parameters: struct kvm_mp_state (out)
Returns: 0 on success; -1 on error
@@ -1005,16 +1008,15 @@ uniprocessor guests).
Possible values are:
- - KVM_MP_STATE_RUNNABLE: the vcpu is currently running [x86, ia64]
+ - KVM_MP_STATE_RUNNABLE: the vcpu is currently running [x86]
- KVM_MP_STATE_UNINITIALIZED: the vcpu is an application processor (AP)
- which has not yet received an INIT signal [x86,
- ia64]
+ which has not yet received an INIT signal [x86]
- KVM_MP_STATE_INIT_RECEIVED: the vcpu has received an INIT signal, and is
- now ready for a SIPI [x86, ia64]
+ now ready for a SIPI [x86]
- KVM_MP_STATE_HALTED: the vcpu has executed a HLT instruction and
- is waiting for an interrupt [x86, ia64]
+ is waiting for an interrupt [x86]
- KVM_MP_STATE_SIPI_RECEIVED: the vcpu has just received a SIPI (vector
- accessible via KVM_GET_VCPU_EVENTS) [x86, ia64]
+ accessible via KVM_GET_VCPU_EVENTS) [x86]
- KVM_MP_STATE_STOPPED: the vcpu is stopped [s390]
- KVM_MP_STATE_CHECK_STOP: the vcpu is in a special error state [s390]
- KVM_MP_STATE_OPERATING: the vcpu is operating (running or halted)
@@ -1022,7 +1024,7 @@ Possible values are:
- KVM_MP_STATE_LOAD: the vcpu is in a special load/startup state
[s390]
-On x86 and ia64, this ioctl is only useful after KVM_CREATE_IRQCHIP. Without an
+On x86, this ioctl is only useful after KVM_CREATE_IRQCHIP. Without an
in-kernel irqchip, the multiprocessing state must be maintained by userspace on
these architectures.
@@ -1030,7 +1032,7 @@ these architectures.
4.39 KVM_SET_MP_STATE
Capability: KVM_CAP_MP_STATE
-Architectures: x86, ia64, s390
+Architectures: x86, s390
Type: vcpu ioctl
Parameters: struct kvm_mp_state (in)
Returns: 0 on success; -1 on error
@@ -1038,7 +1040,7 @@ Returns: 0 on success; -1 on error
Sets the vcpu's current "multiprocessing state"; see KVM_GET_MP_STATE for
arguments.
-On x86 and ia64, this ioctl is only useful after KVM_CREATE_IRQCHIP. Without an
+On x86, this ioctl is only useful after KVM_CREATE_IRQCHIP. Without an
in-kernel irqchip, the multiprocessing state must be maintained by userspace on
these architectures.
@@ -1065,7 +1067,7 @@ documentation when it pops into existence).
4.41 KVM_SET_BOOT_CPU_ID
Capability: KVM_CAP_SET_BOOT_CPU_ID
-Architectures: x86, ia64
+Architectures: x86
Type: vm ioctl
Parameters: unsigned long vcpu_id
Returns: 0 on success, -1 on error
@@ -1257,8 +1259,8 @@ The flags bitmap is defined as:
4.48 KVM_ASSIGN_PCI_DEVICE
-Capability: KVM_CAP_DEVICE_ASSIGNMENT
-Architectures: x86 ia64
+Capability: none
+Architectures: x86
Type: vm ioctl
Parameters: struct kvm_assigned_pci_dev (in)
Returns: 0 on success, -1 on error
@@ -1298,25 +1300,36 @@ Only PCI header type 0 devices with PCI BAR resources are supported by
device assignment. The user requesting this ioctl must have read/write
access to the PCI sysfs resource files associated with the device.
+Errors:
+ ENOTTY: kernel does not support this ioctl
+
+ Other error conditions may be defined by individual device types or
+ have their standard meanings.
+
4.49 KVM_DEASSIGN_PCI_DEVICE
-Capability: KVM_CAP_DEVICE_DEASSIGNMENT
-Architectures: x86 ia64
+Capability: none
+Architectures: x86
Type: vm ioctl
Parameters: struct kvm_assigned_pci_dev (in)
Returns: 0 on success, -1 on error
Ends PCI device assignment, releasing all associated resources.
-See KVM_CAP_DEVICE_ASSIGNMENT for the data structure. Only assigned_dev_id is
+See KVM_ASSIGN_PCI_DEVICE for the data structure. Only assigned_dev_id is
used in kvm_assigned_pci_dev to identify the device.
+Errors:
+ ENOTTY: kernel does not support this ioctl
+
+ Other error conditions may be defined by individual device types or
+ have their standard meanings.
4.50 KVM_ASSIGN_DEV_IRQ
Capability: KVM_CAP_ASSIGN_DEV_IRQ
-Architectures: x86 ia64
+Architectures: x86
Type: vm ioctl
Parameters: struct kvm_assigned_irq (in)
Returns: 0 on success, -1 on error
@@ -1346,11 +1359,17 @@ The following flags are defined:
It is not valid to specify multiple types per host or guest IRQ. However, the
IRQ type of host and guest can differ or can even be null.
+Errors:
+ ENOTTY: kernel does not support this ioctl
+
+ Other error conditions may be defined by individual device types or
+ have their standard meanings.
+
4.51 KVM_DEASSIGN_DEV_IRQ
Capability: KVM_CAP_ASSIGN_DEV_IRQ
-Architectures: x86 ia64
+Architectures: x86
Type: vm ioctl
Parameters: struct kvm_assigned_irq (in)
Returns: 0 on success, -1 on error
@@ -1365,7 +1384,7 @@ KVM_ASSIGN_DEV_IRQ. Partial deassignment of host or guest IRQ is allowed.
4.52 KVM_SET_GSI_ROUTING
Capability: KVM_CAP_IRQ_ROUTING
-Architectures: x86 ia64 s390
+Architectures: x86 s390
Type: vm ioctl
Parameters: struct kvm_irq_routing (in)
Returns: 0 on success, -1 on error
@@ -1423,8 +1442,8 @@ struct kvm_irq_routing_s390_adapter {
4.53 KVM_ASSIGN_SET_MSIX_NR
-Capability: KVM_CAP_DEVICE_MSIX
-Architectures: x86 ia64
+Capability: none
+Architectures: x86
Type: vm ioctl
Parameters: struct kvm_assigned_msix_nr (in)
Returns: 0 on success, -1 on error
@@ -1445,8 +1464,8 @@ struct kvm_assigned_msix_nr {
4.54 KVM_ASSIGN_SET_MSIX_ENTRY
-Capability: KVM_CAP_DEVICE_MSIX
-Architectures: x86 ia64
+Capability: none
+Architectures: x86
Type: vm ioctl
Parameters: struct kvm_assigned_msix_entry (in)
Returns: 0 on success, -1 on error
@@ -1461,6 +1480,12 @@ struct kvm_assigned_msix_entry {
__u16 padding[3];
};
+Errors:
+ ENOTTY: kernel does not support this ioctl
+
+ Other error conditions may be defined by individual device types or
+ have their standard meanings.
+
4.55 KVM_SET_TSC_KHZ
@@ -2453,9 +2478,15 @@ return ENOEXEC for that vcpu.
Note that because some registers reflect machine topology, all vcpus
should be created before this ioctl is invoked.
+Userspace can call this function multiple times for a given vcpu, including
+after the vcpu has been run. This will reset the vcpu to its initial
+state. All calls to this function after the initial call must use the same
+target and same set of feature flags, otherwise EINVAL will be returned.
+
Possible features:
- KVM_ARM_VCPU_POWER_OFF: Starts the CPU in a power-off state.
- Depends on KVM_CAP_ARM_PSCI.
+ Depends on KVM_CAP_ARM_PSCI. If not set, the CPU will be powered on
+ and execute guest code when KVM_RUN is called.
- KVM_ARM_VCPU_EL1_32BIT: Starts the CPU in a 32bit mode.
Depends on KVM_CAP_ARM_EL1_32BIT (arm64 only).
- KVM_ARM_VCPU_PSCI_0_2: Emulate PSCI v0.2 for the CPU.
@@ -2951,6 +2982,15 @@ HVC instruction based PSCI call from the vcpu. The 'type' field describes
the system-level event type. The 'flags' field describes architecture
specific flags for the system-level event.
+Valid values for 'type' are:
+ KVM_SYSTEM_EVENT_SHUTDOWN -- the guest has requested a shutdown of the
+ VM. Userspace is not obliged to honour this, and if it does honour
+ this does not need to destroy the VM synchronously (ie it may call
+ KVM_RUN again before shutdown finally occurs).
+ KVM_SYSTEM_EVENT_RESET -- the guest has requested a reset of the VM.
+ As with SHUTDOWN, userspace can choose to ignore the request, or
+ to schedule the reset to occur in the future and may call KVM_RUN again.
+
/* Fix the size of the union. */
char padding[256];
};

Documentation/virtual/kvm/devices/vm.txt

View file
diff --git a/Documentation/virtual/kvm/devices/vm.txt b/Documentation/virtual/kvm/devices/vm.txt
index 0d16f96..d426fc8 100644
--- a/Documentation/virtual/kvm/devices/vm.txt
+++ b/Documentation/virtual/kvm/devices/vm.txt
@@ -12,14 +12,14 @@ specific.
1. GROUP: KVM_S390_VM_MEM_CTRL
Architectures: s390
-1.1. ATTRIBUTE: KVM_S390_VM_MEM_CTRL
+1.1. ATTRIBUTE: KVM_S390_VM_MEM_ENABLE_CMMA
Parameters: none
-Returns: -EBUSY if already a vcpus is defined, otherwise 0
+Returns: -EBUSY if a vcpu is already defined, otherwise 0
-Enables CMMA for the virtual machine
+Enables Collaborative Memory Management Assist (CMMA) for the virtual machine.
-1.2. ATTRIBUTE: KVM_S390_VM_CLR_CMMA
-Parameteres: none
+1.2. ATTRIBUTE: KVM_S390_VM_MEM_CLR_CMMA
+Parameters: none
Returns: 0
Clear the CMMA status for all guest pages, so any pages the guest marked

Documentation/virtual/kvm/msr.txt

View file
diff --git a/Documentation/virtual/kvm/msr.txt b/Documentation/virtual/kvm/msr.txt
index 6d470ae..2a71c8f 100644
--- a/Documentation/virtual/kvm/msr.txt
+++ b/Documentation/virtual/kvm/msr.txt
@@ -168,7 +168,7 @@ MSR_KVM_ASYNC_PF_EN: 0x4b564d02
64 byte memory area which must be in guest RAM and must be
zeroed. Bits 5-2 are reserved and should be zero. Bit 0 is 1
when asynchronous page faults are enabled on the vcpu 0 when
- disabled. Bit 2 is 1 if asynchronous page faults can be injected
+ disabled. Bit 1 is 1 if asynchronous page faults can be injected
when vcpu is in cpl == 0.
First 4 byte of 64 byte memory location will be written to by

MAINTAINERS

View file
diff --git a/MAINTAINERS b/MAINTAINERS
index 4507a7e..7605833 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5495,15 +5495,6 @@ S: Supported
F: arch/powerpc/include/asm/kvm*
F: arch/powerpc/kvm/
-KERNEL VIRTUAL MACHINE For Itanium (KVM/IA64)
-M: Xiantao Zhang <[email protected]>
-W: http://kvm.qumranet.com
-S: Supported
-F: Documentation/ia64/kvm.txt
-F: arch/ia64/include/asm/kvm*
-F: arch/ia64/kvm/
-
KERNEL VIRTUAL MACHINE for s390 (KVM/s390)
M: Christian Borntraeger <[email protected]>
M: Cornelia Huck <[email protected]>

arch/arm/include/asm/kvm_emulate.h

View file
diff --git a/arch/arm/include/asm/kvm_emulate.h b/arch/arm/include/asm/kvm_emulate.h
index b9db269..66ce176 100644
--- a/arch/arm/include/asm/kvm_emulate.h
+++ b/arch/arm/include/asm/kvm_emulate.h
@@ -33,6 +33,11 @@ void kvm_inject_undefined(struct kvm_vcpu *vcpu);
void kvm_inject_dabt(struct kvm_vcpu *vcpu, unsigned long addr);
void kvm_inject_pabt(struct kvm_vcpu *vcpu, unsigned long addr);
+static inline void vcpu_reset_hcr(struct kvm_vcpu *vcpu)
+{
+ vcpu->arch.hcr = HCR_GUEST_MASK;
+}
+
static inline bool vcpu_mode_is_32bit(struct kvm_vcpu *vcpu)
{
return 1;

arch/arm/include/asm/kvm_host.h

View file
diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h
index 53036e2..254e065 100644
--- a/arch/arm/include/asm/kvm_host.h
+++ b/arch/arm/include/asm/kvm_host.h
@@ -150,8 +150,6 @@ struct kvm_vcpu_stat {
u32 halt_wakeup;
};
-int kvm_vcpu_set_target(struct kvm_vcpu *vcpu,
- const struct kvm_vcpu_init *init);
int kvm_vcpu_preferred_target(struct kvm_vcpu_init *init);
unsigned long kvm_arm_num_regs(struct kvm_vcpu *vcpu);
int kvm_arm_copy_reg_indices(struct kvm_vcpu *vcpu, u64 __user *indices);

arch/arm/include/asm/kvm_mmu.h

View file
diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h
index acb0d57..63e0ecc 100644
--- a/arch/arm/include/asm/kvm_mmu.h
+++ b/arch/arm/include/asm/kvm_mmu.h
@@ -52,6 +52,7 @@ int create_hyp_io_mappings(void *from, void *to, phys_addr_t);
void free_boot_hyp_pgd(void);
void free_hyp_pgds(void);
+void stage2_unmap_vm(struct kvm *kvm);
int kvm_alloc_stage2_pgd(struct kvm *kvm);
void kvm_free_stage2_pgd(struct kvm *kvm);
int kvm_phys_addr_ioremap(struct kvm *kvm, phys_addr_t guest_ipa,
@@ -161,9 +162,10 @@ static inline bool vcpu_has_cache_enabled(struct kvm_vcpu *vcpu)
}
static inline void coherent_cache_guest_page(struct kvm_vcpu *vcpu, hva_t hva,
- unsigned long size)
+ unsigned long size,
+ bool ipa_uncached)
{
- if (!vcpu_has_cache_enabled(vcpu))
+ if (!vcpu_has_cache_enabled(vcpu) || ipa_uncached)
kvm_flush_dcache_to_poc((void *)hva, size);
/*

arch/arm/kvm/arm.c

View file
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index 9e193c8..2d6d910 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -213,6 +213,11 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id)
int err;
struct kvm_vcpu *vcpu;
+ if (irqchip_in_kernel(kvm) && vgic_initialized(kvm)) {
+ err = -EBUSY;
+ goto out;
+ }
+
vcpu = kmem_cache_zalloc(kvm_vcpu_cache, GFP_KERNEL);
if (!vcpu) {
err = -ENOMEM;
@@ -263,6 +268,7 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
{
/* Force users to call KVM_ARM_VCPU_INIT */
vcpu->arch.target = -1;
+ bitmap_zero(vcpu->arch.features, KVM_VCPU_MAX_FEATURES);
/* Set up the timer */
kvm_timer_vcpu_init(vcpu);
@@ -419,6 +425,7 @@ static void update_vttbr(struct kvm *kvm)
static int kvm_vcpu_first_run_init(struct kvm_vcpu *vcpu)
{
+ struct kvm *kvm = vcpu->kvm;
int ret;
if (likely(vcpu->arch.has_run_once))
@@ -427,15 +434,23 @@ static int kvm_vcpu_first_run_init(struct kvm_vcpu *vcpu)
vcpu->arch.has_run_once = true;
/*
- * Initialize the VGIC before running a vcpu the first time on
- * this VM.
+ * Map the VGIC hardware resources before running a vcpu the first
+ * time on this VM.
*/
- if (unlikely(!vgic_initialized(vcpu->kvm))) {
- ret = kvm_vgic_init(vcpu->kvm);
+ if (unlikely(!vgic_ready(kvm))) {
+ ret = kvm_vgic_map_resources(kvm);
if (ret)
return ret;
}
+ /*
+ * Enable the arch timers only if we have an in-kernel VGIC
+ * and it has been properly initialized, since we cannot handle
+ * interrupts from the virtual timer with a userspace gic.
+ */
+ if (irqchip_in_kernel(kvm) && vgic_initialized(kvm))
+ kvm_timer_enable(kvm);
+
return 0;
}
@@ -649,6 +664,48 @@ int kvm_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_level,
return -EINVAL;
}
+static int kvm_vcpu_set_target(struct kvm_vcpu *vcpu,
+ const struct kvm_vcpu_init *init)
+{
+ unsigned int i;
+ int phys_target = kvm_target_cpu();
+
+ if (init->target != phys_target)
+ return -EINVAL;
+
+ /*
+ * Secondary and subsequent calls to KVM_ARM_VCPU_INIT must
+ * use the same target.
+ */
+ if (vcpu->arch.target != -1 && vcpu->arch.target != init->target)
+ return -EINVAL;
+
+ /* -ENOENT for unknown features, -EINVAL for invalid combinations. */
+ for (i = 0; i < sizeof(init->features) * 8; i++) {
+ bool set = (init->features[i / 32] & (1 << (i % 32)));
+
+ if (set && i >= KVM_VCPU_MAX_FEATURES)
+ return -ENOENT;
+
+ /*
+ * Secondary and subsequent calls to KVM_ARM_VCPU_INIT must
+ * use the same feature set.
+ */
+ if (vcpu->arch.target != -1 && i < KVM_VCPU_MAX_FEATURES &&
+ test_bit(i, vcpu->arch.features) != set)
+ return -EINVAL;
+
+ if (set)
+ set_bit(i, vcpu->arch.features);
+ }
+
+ vcpu->arch.target = phys_target;
+
+ /* Now we know what it is, we can reset it. */
+ return kvm_reset_vcpu(vcpu);
+}
+
+
static int kvm_arch_vcpu_ioctl_vcpu_init(struct kvm_vcpu *vcpu,
struct kvm_vcpu_init *init)
{
@@ -659,10 +716,21 @@ static int kvm_arch_vcpu_ioctl_vcpu_init(struct kvm_vcpu *vcpu,
return ret;
/*
+ * Ensure a rebooted VM will fault in RAM pages and detect if the
+ * guest MMU is turned off and flush the caches as needed.
+ */
+ if (vcpu->arch.has_run_once)
+ stage2_unmap_vm(vcpu->kvm);
+
+ vcpu_reset_hcr(vcpu);
+

This diff is incomplete. Download the complete patch.

arch/arm/kvm/guest.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/kvm/mmio.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/kvm/mmu.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/kvm/psci.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/kvm_emulate.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/kvm_host.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/kvm_mmu.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kvm/guest.c

View file

This diff is incomplete. Download the complete patch.

arch/ia64/Kconfig

View file

This diff is incomplete. Download the complete patch.

arch/ia64/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/ia64/include/asm/kvm_host.h

View before deletion

This diff is incomplete. Download the complete patch.

arch/ia64/include/asm/pvclock-abi.h

View before deletion

This diff is incomplete. Download the complete patch.

arch/ia64/include/uapi/asm/kvm.h

View before deletion

This diff is incomplete. Download the complete patch.

arch/ia64/kvm/Kconfig

View before deletion

This diff is incomplete. Download the complete patch.

arch/ia64/kvm/Makefile

View before deletion

This diff is incomplete. Download the complete patch.

arch/ia64/kvm/asm-offsets.c

View before deletion

This diff is incomplete. Download the complete patch.

arch/ia64/kvm/irq.h

View before deletion

This diff is incomplete. Download the complete patch.

arch/ia64/kvm/kvm-ia64.c

View before deletion

This diff is incomplete. Download the complete patch.

arch/ia64/kvm/kvm_fw.c

View before deletion

This diff is incomplete. Download the complete patch.

arch/ia64/kvm/kvm_lib.c

View before deletion

This diff is incomplete. Download the complete patch.

arch/ia64/kvm/kvm_minstate.h

View before deletion

This diff is incomplete. Download the complete patch.

arch/ia64/kvm/lapic.h

View before deletion

This diff is incomplete. Download the complete patch.

arch/ia64/kvm/memcpy.S

View before deletion

This diff is incomplete. Download the complete patch.

arch/ia64/kvm/memset.S

View before deletion

This diff is incomplete. Download the complete patch.

arch/ia64/kvm/misc.h

View before deletion

This diff is incomplete. Download the complete patch.

arch/ia64/kvm/mmio.c

View before deletion

This diff is incomplete. Download the complete patch.

arch/ia64/kvm/optvfault.S

View before deletion

This diff is incomplete. Download the complete patch.

arch/ia64/kvm/process.c

View before deletion

This diff is incomplete. Download the complete patch.

arch/ia64/kvm/trampoline.S

View before deletion

This diff is incomplete. Download the complete patch.

arch/ia64/kvm/vcpu.c

View before deletion

This diff is incomplete. Download the complete patch.

arch/ia64/kvm/vcpu.h

View before deletion

This diff is incomplete. Download the complete patch.

arch/ia64/kvm/vmm.c

View before deletion

This diff is incomplete. Download the complete patch.

arch/ia64/kvm/vmm_ivt.S

View before deletion

This diff is incomplete. Download the complete patch.

arch/ia64/kvm/vti.h

View before deletion

This diff is incomplete. Download the complete patch.

arch/ia64/kvm/vtlb.c

View before deletion

This diff is incomplete. Download the complete patch.

arch/powerpc/include/asm/kvm_book3s.h

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/include/asm/kvm_book3s_64.h

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/include/asm/kvm_host.h

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/include/asm/kvm_ppc.h

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/kernel/asm-offsets.c

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/kvm/Kconfig

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/kvm/book3s.c

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/kvm/book3s_32_mmu.c

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/kvm/book3s_64_mmu_hv.c

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/kvm/book3s_hv.c

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/kvm/book3s_hv_builtin.c

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/kvm/book3s_hv_interrupts.S

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/kvm/book3s_hv_ras.c

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/kvm/book3s_hv_rm_mmu.c

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/kvm/book3s_hv_rm_xics.c

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/kvm/book3s_hv_rmhandlers.S

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/kvm/book3s_paired_singles.c

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/kvm/book3s_pr.c

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/kvm/book3s_xics.c

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/kvm/book3s_xics.h

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/kvm/e500.c

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/kvm/powerpc.c

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/kvm/trace_book3s.h

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/kvm/trace_booke.h

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/kvm/trace_hv.h

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/kvm/trace_pr.h

View file

This diff is incomplete. Download the complete patch.

arch/s390/include/asm/kvm_host.h

View file

This diff is incomplete. Download the complete patch.

arch/s390/include/asm/pgalloc.h

View file

This diff is incomplete. Download the complete patch.

arch/s390/include/asm/sigp.h

View file

This diff is incomplete. Download the complete patch.

arch/s390/kvm/gaccess.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/kvm/intercept.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/kvm/interrupt.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/kvm/kvm-s390.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/kvm/kvm-s390.h

View file

This diff is incomplete. Download the complete patch.

arch/s390/kvm/priv.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/kvm/sigp.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/mm/pgtable.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/include/asm/kvm_host.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/include/asm/vmx.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/include/asm/xsave.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/include/uapi/asm/vmx.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/kvm.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/kvmclock.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/xsave.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kvm/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/x86/kvm/assigned-dev.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kvm/assigned-dev.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/kvm/cpuid.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kvm/emulate.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kvm/ioapic.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kvm/ioapic.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/kvm/iommu.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kvm/irq_comm.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kvm/lapic.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kvm/lapic.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/kvm/mmu.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kvm/svm.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kvm/trace.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/kvm/vmx.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kvm/x86.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kvm/x86.h

View file

This diff is incomplete. Download the complete patch.

include/kvm/arm_arch_timer.h

View file

This diff is incomplete. Download the complete patch.

include/kvm/arm_vgic.h

View file

This diff is incomplete. Download the complete patch.

include/linux/kvm_host.h

View file

This diff is incomplete. Download the complete patch.

include/linux/kvm_types.h

View file

This diff is incomplete. Download the complete patch.

include/uapi/linux/kvm.h

View file

This diff is incomplete. Download the complete patch.

virt/kvm/arm/arch_timer.c

View file

This diff is incomplete. Download the complete patch.

virt/kvm/arm/vgic.c

View file

This diff is incomplete. Download the complete patch.

virt/kvm/eventfd.c

View file

This diff is incomplete. Download the complete patch.

virt/kvm/kvm_main.c

View file

This diff is incomplete. Download the complete patch.