diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-13 12:55:09 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-13 12:55:09 -0500 |
| commit | b9085bcbf5f43adf60533f9b635b2e7faeed0fe9 (patch) | |
| tree | e397abf5682a45c096e75b3d0fa99c8e228425fc /include/linux | |
| parent | c7d7b98671552abade78834c522b7308bda73c0d (diff) | |
| parent | 6557bada461afeaa920a189fae2cff7c8fdce39f (diff) | |
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Pull KVM update from Paolo Bonzini:
"Fairly small update, but there are some interesting new features.
Common:
Optional support for adding a small amount of polling on each HLT
instruction executed in the guest (or equivalent for other
architectures). This can improve latency up to 50% on some
scenarios (e.g. O_DSYNC writes or TCP_RR netperf tests). This
also has to be enabled manually for now, but the plan is to
auto-tune this in the future.
ARM/ARM64:
The highlights are support for GICv3 emulation and dirty page
tracking
s390:
Several optimizations and bugfixes. Also a first: a feature
exposed by KVM (UUID and long guest name in /proc/sysinfo) before
it is available in IBM's hypervisor! :)
MIPS:
Bugfixes.
x86:
Support for PML (page modification logging, a new feature in
Broadwell Xeons that speeds up dirty page tracking), nested
virtualization improvements (nested APICv---a nice optimization),
usual round of emulation fixes.
There is also a new option to reduce latency of the TSC deadline
timer in the guest; this needs to be tuned manually.
Some commits are common between this pull and Catalin's; I see you
have already included his tree.
Powerpc:
Nothing yet.
The KVM/PPC changes will come in through the PPC maintainers,
because I haven't received them yet and I might end up being
offline for some part of next week"
* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (130 commits)
KVM: ia64: drop kvm.h from installed user headers
KVM: x86: fix build with !CONFIG_SMP
KVM: x86: emulate: correct page fault error code for NoWrite instructions
KVM: Disable compat ioctl for s390
KVM: s390: add cpu model support
KVM: s390: use facilities and cpu_id per KVM
KVM: s390/CPACF: Choose crypto control block format
s390/kernel: Update /proc/sysinfo file with Extended Name and UUID
KVM: s390: reenable LPP facility
KVM: s390: floating irqs: fix user triggerable endless loop
kvm: add halt_poll_ns module parameter
kvm: remove KVM_MMIO_SIZE
KVM: MIPS: Don't leak FPU/DSP to guest
KVM: MIPS: Disable HTW while in guest
KVM: nVMX: Enable nested posted interrupt processing
KVM: nVMX: Enable nested virtual interrupt delivery
KVM: nVMX: Enable nested apic register virtualization
KVM: nVMX: Make nested control MSRs per-cpu
KVM: nVMX: Enable nested virtualize x2apic mode
KVM: nVMX: Prepare for using hardware MSR bitmap
...
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/irqchip/arm-gic-v3.h | 44 | ||||
| -rw-r--r-- | include/linux/kvm_host.h | 17 |
2 files changed, 56 insertions, 5 deletions
diff --git a/include/linux/irqchip/arm-gic-v3.h b/include/linux/irqchip/arm-gic-v3.h index 1e8b0cf30792..800544bc7bfd 100644 --- a/include/linux/irqchip/arm-gic-v3.h +++ b/include/linux/irqchip/arm-gic-v3.h | |||
| @@ -33,6 +33,7 @@ | |||
| 33 | #define GICD_SETSPI_SR 0x0050 | 33 | #define GICD_SETSPI_SR 0x0050 |
| 34 | #define GICD_CLRSPI_SR 0x0058 | 34 | #define GICD_CLRSPI_SR 0x0058 |
| 35 | #define GICD_SEIR 0x0068 | 35 | #define GICD_SEIR 0x0068 |
| 36 | #define GICD_IGROUPR 0x0080 | ||
| 36 | #define GICD_ISENABLER 0x0100 | 37 | #define GICD_ISENABLER 0x0100 |
| 37 | #define GICD_ICENABLER 0x0180 | 38 | #define GICD_ICENABLER 0x0180 |
| 38 | #define GICD_ISPENDR 0x0200 | 39 | #define GICD_ISPENDR 0x0200 |
| @@ -41,14 +42,37 @@ | |||
| 41 | #define GICD_ICACTIVER 0x0380 | 42 | #define GICD_ICACTIVER 0x0380 |
| 42 | #define GICD_IPRIORITYR 0x0400 | 43 | #define GICD_IPRIORITYR 0x0400 |
| 43 | #define GICD_ICFGR 0x0C00 | 44 | #define GICD_ICFGR 0x0C00 |
| 45 | #define GICD_IGRPMODR 0x0D00 | ||
| 46 | #define GICD_NSACR 0x0E00 | ||
| 44 | #define GICD_IROUTER 0x6000 | 47 | #define GICD_IROUTER 0x6000 |
| 48 | #define GICD_IDREGS 0xFFD0 | ||
| 45 | #define GICD_PIDR2 0xFFE8 | 49 | #define GICD_PIDR2 0xFFE8 |
| 46 | 50 | ||
| 51 | /* | ||
| 52 | * Those registers are actually from GICv2, but the spec demands that they | ||
| 53 | * are implemented as RES0 if ARE is 1 (which we do in KVM's emulated GICv3). | ||
| 54 | */ | ||
| 55 | #define GICD_ITARGETSR 0x0800 | ||
| 56 | #define GICD_SGIR 0x0F00 | ||
| 57 | #define GICD_CPENDSGIR 0x0F10 | ||
| 58 | #define GICD_SPENDSGIR 0x0F20 | ||
| 59 | |||
| 47 | #define GICD_CTLR_RWP (1U << 31) | 60 | #define GICD_CTLR_RWP (1U << 31) |
| 61 | #define GICD_CTLR_DS (1U << 6) | ||
| 48 | #define GICD_CTLR_ARE_NS (1U << 4) | 62 | #define GICD_CTLR_ARE_NS (1U << 4) |
| 49 | #define GICD_CTLR_ENABLE_G1A (1U << 1) | 63 | #define GICD_CTLR_ENABLE_G1A (1U << 1) |
| 50 | #define GICD_CTLR_ENABLE_G1 (1U << 0) | 64 | #define GICD_CTLR_ENABLE_G1 (1U << 0) |
| 51 | 65 | ||
| 66 | /* | ||
| 67 | * In systems with a single security state (what we emulate in KVM) | ||
| 68 | * the meaning of the interrupt group enable bits is slightly different | ||
| 69 | */ | ||
| 70 | #define GICD_CTLR_ENABLE_SS_G1 (1U << 1) | ||
| 71 | #define GICD_CTLR_ENABLE_SS_G0 (1U << 0) | ||
| 72 | |||
| 73 | #define GICD_TYPER_LPIS (1U << 17) | ||
| 74 | #define GICD_TYPER_MBIS (1U << 16) | ||
| 75 | |||
| 52 | #define GICD_TYPER_ID_BITS(typer) ((((typer) >> 19) & 0x1f) + 1) | 76 | #define GICD_TYPER_ID_BITS(typer) ((((typer) >> 19) & 0x1f) + 1) |
| 53 | #define GICD_TYPER_IRQS(typer) ((((typer) & 0x1f) + 1) * 32) | 77 | #define GICD_TYPER_IRQS(typer) ((((typer) & 0x1f) + 1) * 32) |
| 54 | #define GICD_TYPER_LPIS (1U << 17) | 78 | #define GICD_TYPER_LPIS (1U << 17) |
| @@ -60,6 +84,8 @@ | |||
| 60 | #define GIC_PIDR2_ARCH_GICv3 0x30 | 84 | #define GIC_PIDR2_ARCH_GICv3 0x30 |
| 61 | #define GIC_PIDR2_ARCH_GICv4 0x40 | 85 | #define GIC_PIDR2_ARCH_GICv4 0x40 |
| 62 | 86 | ||
| 87 | #define GIC_V3_DIST_SIZE 0x10000 | ||
| 88 | |||
| 63 | /* | 89 | /* |
| 64 | * Re-Distributor registers, offsets from RD_base | 90 | * Re-Distributor registers, offsets from RD_base |
| 65 | */ | 91 | */ |
| @@ -78,6 +104,7 @@ | |||
| 78 | #define GICR_SYNCR 0x00C0 | 104 | #define GICR_SYNCR 0x00C0 |
| 79 | #define GICR_MOVLPIR 0x0100 | 105 | #define GICR_MOVLPIR 0x0100 |
| 80 | #define GICR_MOVALLR 0x0110 | 106 | #define GICR_MOVALLR 0x0110 |
| 107 | #define GICR_IDREGS GICD_IDREGS | ||
| 81 | #define GICR_PIDR2 GICD_PIDR2 | 108 | #define GICR_PIDR2 GICD_PIDR2 |
| 82 | 109 | ||
| 83 | #define GICR_CTLR_ENABLE_LPIS (1UL << 0) | 110 | #define GICR_CTLR_ENABLE_LPIS (1UL << 0) |
| @@ -104,6 +131,7 @@ | |||
| 104 | /* | 131 | /* |
| 105 | * Re-Distributor registers, offsets from SGI_base | 132 | * Re-Distributor registers, offsets from SGI_base |
| 106 | */ | 133 | */ |
| 134 | #define GICR_IGROUPR0 GICD_IGROUPR | ||
| 107 | #define GICR_ISENABLER0 GICD_ISENABLER | 135 | #define GICR_ISENABLER0 GICD_ISENABLER |
| 108 | #define GICR_ICENABLER0 GICD_ICENABLER | 136 | #define GICR_ICENABLER0 GICD_ICENABLER |
| 109 | #define GICR_ISPENDR0 GICD_ISPENDR | 137 | #define GICR_ISPENDR0 GICD_ISPENDR |
| @@ -112,11 +140,15 @@ | |||
| 112 | #define GICR_ICACTIVER0 GICD_ICACTIVER | 140 | #define GICR_ICACTIVER0 GICD_ICACTIVER |
| 113 | #define GICR_IPRIORITYR0 GICD_IPRIORITYR | 141 | #define GICR_IPRIORITYR0 GICD_IPRIORITYR |
| 114 | #define GICR_ICFGR0 GICD_ICFGR | 142 | #define GICR_ICFGR0 GICD_ICFGR |
| 143 | #define GICR_IGRPMODR0 GICD_IGRPMODR | ||
| 144 | #define GICR_NSACR GICD_NSACR | ||
| 115 | 145 | ||
| 116 | #define GICR_TYPER_PLPIS (1U << 0) | 146 | #define GICR_TYPER_PLPIS (1U << 0) |
| 117 | #define GICR_TYPER_VLPIS (1U << 1) | 147 | #define GICR_TYPER_VLPIS (1U << 1) |
| 118 | #define GICR_TYPER_LAST (1U << 4) | 148 | #define GICR_TYPER_LAST (1U << 4) |
| 119 | 149 | ||
| 150 | #define GIC_V3_REDIST_SIZE 0x20000 | ||
| 151 | |||
| 120 | #define LPI_PROP_GROUP1 (1 << 1) | 152 | #define LPI_PROP_GROUP1 (1 << 1) |
| 121 | #define LPI_PROP_ENABLED (1 << 0) | 153 | #define LPI_PROP_ENABLED (1 << 0) |
| 122 | 154 | ||
| @@ -248,6 +280,18 @@ | |||
| 248 | #define ICC_SRE_EL2_SRE (1 << 0) | 280 | #define ICC_SRE_EL2_SRE (1 << 0) |
| 249 | #define ICC_SRE_EL2_ENABLE (1 << 3) | 281 | #define ICC_SRE_EL2_ENABLE (1 << 3) |
| 250 | 282 | ||
| 283 | #define ICC_SGI1R_TARGET_LIST_SHIFT 0 | ||
| 284 | #define ICC_SGI1R_TARGET_LIST_MASK (0xffff << ICC_SGI1R_TARGET_LIST_SHIFT) | ||
| 285 | #define ICC_SGI1R_AFFINITY_1_SHIFT 16 | ||
| 286 | #define ICC_SGI1R_AFFINITY_1_MASK (0xff << ICC_SGI1R_AFFINITY_1_SHIFT) | ||
| 287 | #define ICC_SGI1R_SGI_ID_SHIFT 24 | ||
| 288 | #define ICC_SGI1R_SGI_ID_MASK (0xff << ICC_SGI1R_SGI_ID_SHIFT) | ||
| 289 | #define ICC_SGI1R_AFFINITY_2_SHIFT 32 | ||
| 290 | #define ICC_SGI1R_AFFINITY_2_MASK (0xffULL << ICC_SGI1R_AFFINITY_1_SHIFT) | ||
| 291 | #define ICC_SGI1R_IRQ_ROUTING_MODE_BIT 40 | ||
| 292 | #define ICC_SGI1R_AFFINITY_3_SHIFT 48 | ||
| 293 | #define ICC_SGI1R_AFFINITY_3_MASK (0xffULL << ICC_SGI1R_AFFINITY_1_SHIFT) | ||
| 294 | |||
| 251 | /* | 295 | /* |
| 252 | * System register definitions | 296 | * System register definitions |
| 253 | */ | 297 | */ |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index d189ee098aa2..d12b2104d19b 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
| @@ -33,10 +33,6 @@ | |||
| 33 | 33 | ||
| 34 | #include <asm/kvm_host.h> | 34 | #include <asm/kvm_host.h> |
| 35 | 35 | ||
| 36 | #ifndef KVM_MMIO_SIZE | ||
| 37 | #define KVM_MMIO_SIZE 8 | ||
| 38 | #endif | ||
| 39 | |||
| 40 | /* | 36 | /* |
| 41 | * The bit 16 ~ bit 31 of kvm_memory_region::flags are internally used | 37 | * The bit 16 ~ bit 31 of kvm_memory_region::flags are internally used |
| 42 | * in kvm, other bits are visible for userspace which are defined in | 38 | * in kvm, other bits are visible for userspace which are defined in |
| @@ -600,6 +596,15 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext); | |||
| 600 | 596 | ||
| 601 | int kvm_get_dirty_log(struct kvm *kvm, | 597 | int kvm_get_dirty_log(struct kvm *kvm, |
| 602 | struct kvm_dirty_log *log, int *is_dirty); | 598 | struct kvm_dirty_log *log, int *is_dirty); |
| 599 | |||
| 600 | int kvm_get_dirty_log_protect(struct kvm *kvm, | ||
| 601 | struct kvm_dirty_log *log, bool *is_dirty); | ||
| 602 | |||
| 603 | void kvm_arch_mmu_enable_log_dirty_pt_masked(struct kvm *kvm, | ||
| 604 | struct kvm_memory_slot *slot, | ||
| 605 | gfn_t gfn_offset, | ||
| 606 | unsigned long mask); | ||
| 607 | |||
| 603 | int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, | 608 | int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, |
| 604 | struct kvm_dirty_log *log); | 609 | struct kvm_dirty_log *log); |
| 605 | 610 | ||
| @@ -641,7 +646,7 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu); | |||
| 641 | void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu); | 646 | void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu); |
| 642 | struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id); | 647 | struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id); |
| 643 | int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu); | 648 | int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu); |
| 644 | int kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu); | 649 | void kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu); |
| 645 | void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu); | 650 | void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu); |
| 646 | 651 | ||
| 647 | int kvm_arch_hardware_enable(void); | 652 | int kvm_arch_hardware_enable(void); |
| @@ -1031,6 +1036,8 @@ void kvm_unregister_device_ops(u32 type); | |||
| 1031 | 1036 | ||
| 1032 | extern struct kvm_device_ops kvm_mpic_ops; | 1037 | extern struct kvm_device_ops kvm_mpic_ops; |
| 1033 | extern struct kvm_device_ops kvm_xics_ops; | 1038 | extern struct kvm_device_ops kvm_xics_ops; |
| 1039 | extern struct kvm_device_ops kvm_arm_vgic_v2_ops; | ||
| 1040 | extern struct kvm_device_ops kvm_arm_vgic_v3_ops; | ||
| 1034 | 1041 | ||
| 1035 | #ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT | 1042 | #ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT |
| 1036 | 1043 | ||
