[GIT PULL] KVM updates for v4.9-rc1

From: Radim KrÄmÃÅ
Date: Thu Oct 06 2016 - 07:17:31 EST


Linus,

this merge needs one manual conflict resolution that is foretold in
3d9cd95f90b2 ("ARM: gic-v3: Work around definition of gic_write_bpr1").
The commit says that the conflict is "obvious to resolve", but
linux-next got it wrong, so I have pasted the correct resolution at the
bottom -- inline assembly and surrounding #if should be removed, because
the #if would always select the write_sysreg() branch.

The following changes since commit fa8410b355251fd30341662a40ac6b22d3e38468:

Linux 4.8-rc3 (2016-08-21 16:14:10 -0700)

are available in the git repository at:

git://git.kernel.org/pub/scm/virt/kvm/kvm.git tags/kvm-4.9-1

for you to fetch changes up to d9ab710b85310e4ba9295f2b494eda54cf1a355a:

Merge tag 'kvm_mips_4.9_1' of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/kvm-mips into next (2016-09-29 16:26:52 +0200)

----------------------------------------------------------------
KVM updates for v4.9-rc1

Common code:
Move `make kvmconfig` stubs from x86; use 64 bits for debugfs stats.

ARM:
Important fixes for not using an in-kernel irqchip; handle SError
exceptions and present them to guests if appropriate; proxying of GICV
access at EL2 if guest mappings are unsafe; GICv3 on AArch32 on ARMv8;
preparations for GICv3 save/restore, including ABI docs; cleanups and
a bit of optimizations.

MIPS:
A couple of fixes in preparation for supporting MIPS EVA host kernels;
MIPS SMP host & TLB invalidation fixes.

PPC:
Fix the bug which caused guests to falsely report lockups; other minor
fixes; a small optimization.

s390:
Lazy enablement of runtime instrumentation; up to 255 CPUs for nested
guests; rework of machine check deliver; cleanups and fixes.

x86:
IOMMU part of AMD's AVIC for vmexit-less interrupt delivery; Hyper-V
TSC page; per-vcpu tsc_offset in debugfs; accelerated INS/OUTS in
nVMX; cleanups and fixes.

----------------------------------------------------------------
Balbir Singh (1):
KVM: PPC: Book3S: Remove duplicate setting of the B field in tlbie

Bandan Das (1):
mmu: don't pass *kvm to spte_write_protect and spte_*_dirty

Bhaktipriya Shridhar (1):
KVM: Remove deprecated create_singlethread_workqueue

Christian Borntraeger (1):
Merge remote-tracking branch 'kvms390/s390forkvm' into kvms390next

Christoffer Dall (6):
KVM: arm/arm64: Add VGICv3 save/restore API documentation
KVM: arm/arm64: Factor out vgic_attr_regs_access functionality
KVM: arm/arm64: Rename vgic_attr_regs_access to vgic_attr_regs_access_v2
KVM: arm/arm64: Get rid of exported aliases to static functions
KVM: arm64: Require in-kernel irqchip for PMU support
KVM: arm/arm64: vgic: Don't flush/sync without a working vgic

Colin Ian King (1):
kvm: svm: fix unsigned compare less than zero comparison

Dan Carpenter (1):
KVM: PPC: BookE: Fix a sanity check

David Hildenbrand (6):
KVM: s390: factor out actual delivery of machine checks
KVM: s390: split store status and machine check handling
KVM: s390: fix delivery of vector regs during machine checks
KVM: s390: write external damage code on machine checks
KVM: s390: guestdbg: separate defines for per code
KVM: s390: allow 255 VCPUs when sca entries aren't used

Fan Zhang (1):
KVM: s390: lazy enable RI

Heiko Carstens (1):
KVM: s390: generate facility mask from readable list

James Hogan (6):
KVM: MIPS: Override HVA error values for EVA
KVM: MIPS: Emulate MMIO via TLB miss for EVA
KVM: MIPS: Drop other CPU ASIDs on guest MMU changes
KVM: MIPS: Split kernel/user ASID regeneration
KVM: MIPS: Invalidate TLB by regenerating ASIDs
KVM: MIPS: Drop dubious EntryHi optimisation

Jan Dakinevich (2):
KVM: nVMX: pass valid guest linear-address to the L1
KVM: nVMX: expose INS/OUTS information support

Janosch Frank (1):
KVM: s390: gaccess: simplify translation exception handling

Liang Li (1):
vmx: refine validity check for guest linear address

Luiz Capitulino (6):
kvm: x86: add tsc_offset field to struct kvm_vcpu_arch
kvm: x86: drop read_tsc_offset()
kvm: kvm_destroy_vm_debugfs(): check debugfs_stat_data pointer
kvm: add stubs for arch specific debugfs support
kvm: create per-vcpu dirs in debugfs
kvm: x86: export TSC information to user-space

Luwei Kang (1):
KVM: x86: Expose more Intel AVX512 feature to guest

Marc Zyngier (28):
KVM: arm: vgic: Drop build compatibility hack for older kernel versions
arm64: KVM: Move kvm_vcpu_get_condition out of emulate.c
arm64: KVM: Move the AArch32 conditional execution to common code
arm: KVM: Use common AArch32 conditional execution code
arm64: KVM: Make kvm_skip_instr32 available to HYP
arm64: KVM: vgic-v2: Add the GICV emulation infrastructure
arm64: KVM: vgic-v2: Add GICV access from HYP
arm64: KVM: vgic-v2: Enable GICV access from HYP if access from guest is unsafe
arm64: KVM: Rename HCR_VA to HCR_VSE
arm64: KVM: Preserve pending vSError in world switch
arm64: KVM: Add Virtual Abort injection helper
arm64: KVM: Add exception code to report EL1 asynchronous aborts
arm64: KVM: Add EL1 async abort handler
arm64: KVM: Route asynchronous aborts
arm64: KVM: Allow an exit code to be tagged with an SError
arm64: KVM: Inject a Virtual SError if it was pending
arm64: KVM: Handle async aborts delivered while at EL2
arm: KVM: Preserve pending Virtual Abort in world switch
arm: KVM: Add Virtual Abort injection helper
arm: KVM: Add HYP async abort handler
arm: KVM: Allow an exit code to be tagged with a Virtual Abort
arm: KVM: Handle async aborts delivered while at HYP
arm: KVM: Inject a Virtual Abort if it was pending
arm: KVM: Drop unreachable HYP abort handlers
arm/arm64: KVM: Inject virtual abort when guest exits on external abort
arm/arm64: KVM: Remove external abort test from MMIO handling
arm64: KVM: Inject a vSerror if detecting a bad GICV access at EL2
ARM: gic-v3: Work around definition of gic_write_bpr1

Mark Rutland (2):
arm/kvm: excise redundant cache maintenance
arm64/kvm: remove unused stub functions

Markus Elfring (8):
KVM: s390: Improve determination of sizes in kvm_s390_import_bp_data()
KVM: s390: Use memdup_user() rather than duplicating code
KVM: PPC: e500: Use kmalloc_array() in kvm_vcpu_ioctl_config_tlb()
KVM: PPC: e500: Less function calls in kvm_vcpu_ioctl_config_tlb() after error detection
KVM: PPC: e500: Delete an unnecessary initialisation in kvm_vcpu_ioctl_config_tlb()
KVM: PPC: e500: Replace kzalloc() calls by kcalloc() in two functions
KVM: PPC: e500: Use kmalloc_array() in kvmppc_e500_tlb_init()
KVM: PPC: e500: Rename jump labels in kvmppc_e500_tlb_init()

Paolo Bonzini (12):
Merge branch 'x86/amd-avic' of git://git.kernel.org/.../joro/iommu into HEAD
KVM: x86: ratelimit and decrease severity for guest-triggered printk
KVM: x86: remove stale comments
KVM: VMX: not use vmcs_config in setup_vmcs_config
KVM: ARM: cleanup kvm_timer_hyp_init
Merge tag 'kvm-s390-next-4.9-1' of git://git.kernel.org/.../kvms390/linux into HEAD
powerpc: move hmi.c to arch/powerpc/kvm/
Merge branch 'kvm-ppc-next' of git://git.kernel.org/.../paulus/powerpc into HEAD
KVM: x86: always fill in vcpu->arch.hv_clock
KVM: x86: initialize kvmclock_offset
KVM: x86: introduce get_kvmclock_ns
KVM: x86: Hyper-V tsc page setup

Paul Mackerras (8):
KVM: PPC: Book3S: Don't crash if irqfd used with no in-kernel XICS emulation
KVM: PPC: Implement kvm_arch_intc_initialized() for PPC
KVM: PPC: Always select KVM_VFIO, plus Makefile cleanup
powerpc/mm: Speed up computation of base and actual page size for a HPTE
Merge branch 'kvm-ppc-infrastructure' into kvm-ppc-next
KVM: PPC: Book3S HV: Set server for passed-through interrupts
KVM: PPC: Book3S: Treat VTB as a per-subcore register, not per-thread
KVM: PPC: Book3S HV: Take out virtual core piggybacking code

Radim KrÄmÃÅ (3):
Merge tag 'kvm-arm-for-v4.9' of git://git.kernel.org/.../kvmarm/kvmarm into next
Merge branch 'kvm-ppc-next' of git://git.kernel.org/.../paulus/powerpc into next
Merge tag 'kvm_mips_4.9_1' of git://git.kernel.org/.../jhogan/kvm-mips into next

Rob Herring (2):
config: move x86 kvm_guest.config to a common location
kvmconfig: add virtio-gpu to config fragment

Shanker Donthineni (1):
arm64: KVM: Optimize __guest_enter/exit() to save a few instructions

Suraj Jitindar Singh (5):
KVM: PPC: Book3S HV: Move struct kvmppc_vcore from kvm_host.h to kvm_book3s.h
KVM: PPC: Book3S HV: Change vcore element runnable_threads from linked-list to array
KVM: PPC: Book3S HV: Implement halt polling
KVM: Add provisioning for ulong vm stats and u64 vcpu stats
KVM: PPC: Implement existing and add new halt polling vcpu stats

Suravee Suthikulpanit (12):
iommu/amd: Detect and enable guest vAPIC support
iommu/amd: Move and introduce new IRTE-related unions and structures
iommu/amd: Introduce interrupt remapping ops structure
iommu/amd: Add support for multiple IRTE formats
iommu/amd: Detect and initialize guest vAPIC log
iommu/amd: Adding GALOG interrupt handler
iommu/amd: Introduce amd_iommu_update_ga()
iommu/amd: Implements irq_set_vcpu_affinity() hook to setup vapic mode for pass-through devices
iommu/amd: Enable vAPIC interrupt remapping mode by default
svm: Introduces AVIC per-VM ID
svm: Introduce AMD IOMMU avic_ga_log_notifier
svm: Implements update_pi_irte hook to setup posted interrupt

Suresh Warrier (12):
powerpc: Add simple cache inhibited MMIO accessors
powerpc/powernv: Provide facilities for EOI, usable from real mode
KVM: PPC: Book3S HV: Convert kvmppc_read_intr to a C function
KVM: PPC: select IRQ_BYPASS_MANAGER
KVM: PPC: Book3S HV: Introduce kvmppc_passthru_irqmap
KVM: PPC: Book3S HV: Enable IRQ bypass
KVM: PPC: Book3S HV: Handle passthrough interrupts in guest
KVM: PPC: Book3S HV: Complete passthrough interrupt in host
KVM: PPC: Book3S HV: Dump irqmap in debugfs
KVM: PPC: Book3S HV: Tunable to disable KVM IRQ bypass
KVM: PPC: Book3S HV: Update irq stats for IRQs handled in real mode
KVM: PPC: Book3S HV: Counters for passthrough IRQ stats

Thomas Huth (2):
KVM: PPC: Book3S PR: Support 64kB page size on POWER8E and POWER8NVL
KVM: PPC: Book3s PR: Allow access to unprivileged MMCR2 register

Vladimir Murzin (12):
arm64: KVM: VHE: reset PSTATE.PAN on entry to EL2
arm64: KVM: Use static keys for selecting the GIC backend
arm64: KVM: Move GIC accessors to arch_gicv3.h
arm64: KVM: Move vgic-v3 save/restore to virt/kvm/arm/hyp
KVM: arm64: vgic-its: Introduce config option to guard ITS specific code
KVM: arm: vgic: Fix compiler warnings when built for 32-bit
KVM: arm: vgic: Support 64-bit data manipulation on 32-bit host systems
ARM: Introduce MPIDR_LEVEL_SHIFT macro
ARM: Move system register accessors to asm/cp15.h
ARM: gic-v3: Introduce 32-to-64-bit mappings for GICv3 cpu registers
ARM: KVM: Support vgic-v3
arm64: KVM: Remove duplicating init code for setting VMID

Wanpeng Li (5):
KVM: lapic: don't recalculate apic map table twice when enabling LAPIC
KVM: nVMX: make emulated nested preemption timer pinned
KVM: nVMX: Fix reload apic access page warning
KVM: VMX: Enable MSR-BASED TPR shadow even if APICv is inactive
KVM: nVMX: Fix the NMI IDT-vectoring handling

Documentation/arm64/silicon-errata.txt | 1 +
Documentation/kernel-parameters.txt | 9 +
Documentation/virtual/kvm/devices/arm-vgic-its.txt | 38 ++
Documentation/virtual/kvm/devices/arm-vgic-v3.txt | 206 ++++++++
Documentation/virtual/kvm/devices/arm-vgic.txt | 52 +-
Documentation/virtual/kvm/devices/vcpu.txt | 4 +-
arch/arm/include/asm/arch_gicv3.h | 100 +++-
arch/arm/include/asm/cp15.h | 15 +
arch/arm/include/asm/cputype.h | 1 +
arch/arm/include/asm/kvm_asm.h | 7 +
arch/arm/include/asm/kvm_emulate.h | 35 +-
arch/arm/include/asm/kvm_host.h | 17 +-
arch/arm/include/asm/kvm_hyp.h | 18 +-
arch/arm/include/asm/kvm_mmu.h | 28 +-
arch/arm/include/uapi/asm/kvm.h | 7 +
arch/arm/kvm/Makefile | 3 +
arch/arm/kvm/arm.c | 22 +-
arch/arm/kvm/coproc.c | 35 ++
arch/arm/kvm/emulate.c | 111 +----
arch/arm/kvm/handle_exit.c | 49 +-
arch/arm/kvm/hyp/Makefile | 1 +
arch/arm/kvm/hyp/entry.S | 31 ++
arch/arm/kvm/hyp/hyp-entry.S | 16 +-
arch/arm/kvm/hyp/switch.c | 25 +-
arch/arm/kvm/hyp/tlb.c | 15 +-
arch/arm/kvm/mmio.c | 6 -
arch/arm/kvm/mmu.c | 9 +-
arch/arm64/include/asm/arch_gicv3.h | 13 +
arch/arm64/include/asm/kvm_arm.h | 4 +-
arch/arm64/include/asm/kvm_asm.h | 9 +-
arch/arm64/include/asm/kvm_emulate.h | 11 +
arch/arm64/include/asm/kvm_host.h | 12 +-
arch/arm64/include/asm/kvm_hyp.h | 1 +
arch/arm64/include/asm/kvm_mmu.h | 6 -
arch/arm64/kvm/Kconfig | 4 +-
arch/arm64/kvm/Makefile | 3 +-
arch/arm64/kvm/handle_exit.c | 23 +
arch/arm64/kvm/hyp/Makefile | 2 +-
arch/arm64/kvm/hyp/debug-sr.c | 4 +-
arch/arm64/kvm/hyp/entry.S | 126 +++--
arch/arm64/kvm/hyp/hyp-entry.S | 73 +--
arch/arm64/kvm/hyp/switch.c | 86 +++-
arch/arm64/kvm/hyp/tlb.c | 13 +-
arch/arm64/kvm/inject_fault.c | 12 +
arch/arm64/kvm/sys_regs.c | 10 +-
arch/mips/include/asm/kvm_host.h | 63 ++-
arch/mips/kvm/emulate.c | 78 ++-
arch/mips/kvm/mips.c | 40 ++
arch/mips/kvm/mmu.c | 20 +-
arch/mips/kvm/trap_emul.c | 18 +
arch/powerpc/include/asm/book3s/64/mmu-hash.h | 37 ++
arch/powerpc/include/asm/hmi.h | 2 +-
arch/powerpc/include/asm/io.h | 29 ++
arch/powerpc/include/asm/kvm_asm.h | 10 +
arch/powerpc/include/asm/kvm_book3s.h | 39 ++
arch/powerpc/include/asm/kvm_book3s_64.h | 90 +---
arch/powerpc/include/asm/kvm_host.h | 124 +++--
arch/powerpc/include/asm/kvm_ppc.h | 28 ++
arch/powerpc/include/asm/mmu.h | 1 +
arch/powerpc/include/asm/opal.h | 1 +
arch/powerpc/include/asm/paca.h | 12 +-
arch/powerpc/include/asm/pnv-pci.h | 3 +
arch/powerpc/include/asm/reg.h | 1 +
arch/powerpc/kernel/Makefile | 2 +-
arch/powerpc/kernel/asm-offsets.c | 2 +-
arch/powerpc/kvm/Kconfig | 3 +
arch/powerpc/kvm/Makefile | 20 +-
arch/powerpc/kvm/book3s.c | 13 +-
arch/powerpc/kvm/book3s_emulate.c | 4 +-
arch/powerpc/kvm/book3s_hv.c | 533 ++++++++++++++-------
arch/powerpc/kvm/book3s_hv_builtin.c | 156 ++++++
arch/powerpc/{kernel/hmi.c => kvm/book3s_hv_hmi.c} | 0
arch/powerpc/kvm/book3s_hv_rm_xics.c | 120 +++++
arch/powerpc/kvm/book3s_hv_rmhandlers.S | 197 ++++----
arch/powerpc/kvm/book3s_pr.c | 10 +-
arch/powerpc/kvm/book3s_xics.c | 57 ++-
arch/powerpc/kvm/book3s_xics.h | 2 +
arch/powerpc/kvm/booke.c | 2 +-
arch/powerpc/kvm/e500_mmu.c | 75 +--
arch/powerpc/kvm/powerpc.c | 61 +++
arch/powerpc/kvm/trace_hv.h | 22 +
arch/powerpc/mm/hash_native_64.c | 42 +-
arch/powerpc/mm/hash_utils_64.c | 55 +++
arch/powerpc/platforms/powernv/opal-wrappers.S | 1 +
arch/powerpc/platforms/powernv/pci-ioda.c | 26 +-
arch/s390/include/asm/facilities_src.h | 24 +
arch/s390/include/asm/kvm_host.h | 136 +++---
arch/s390/kernel/asm-offsets.c | 1 +
arch/s390/kvm/gaccess.c | 37 +-
arch/s390/kvm/guestdbg.c | 59 +--
arch/s390/kvm/intercept.c | 1 +
arch/s390/kvm/interrupt.c | 98 +++-
arch/s390/kvm/kvm-s390.c | 80 ++--
arch/s390/kvm/kvm-s390.h | 14 +-
arch/s390/kvm/priv.c | 21 +
arch/x86/entry/vdso/vclock_gettime.c | 2 +-
arch/x86/include/asm/kvm_host.h | 76 +--
arch/x86/include/asm/pvclock.h | 5 +-
arch/x86/kernel/pvclock.c | 2 +-
arch/x86/kvm/Makefile | 2 +-
arch/x86/kvm/cpuid.c | 3 +-
arch/x86/kvm/debugfs.c | 69 +++
arch/x86/kvm/hyperv.c | 157 +++++-
arch/x86/kvm/hyperv.h | 3 +
arch/x86/kvm/lapic.c | 5 +-
arch/x86/kvm/mmu.c | 12 +-
arch/x86/kvm/svm.c | 417 ++++++++++++++--
arch/x86/kvm/vmx.c | 341 +++++++------
arch/x86/kvm/x86.c | 171 ++++---
arch/x86/kvm/x86.h | 6 +-
drivers/iommu/amd_iommu.c | 484 ++++++++++++++++---
drivers/iommu/amd_iommu_init.c | 181 ++++++-
drivers/iommu/amd_iommu_proto.h | 1 +
drivers/iommu/amd_iommu_types.h | 149 ++++++
include/kvm/arm_vgic.h | 18 +-
include/linux/amd-iommu.h | 43 +-
include/linux/irqchip/arm-gic-v3.h | 1 +
include/linux/kvm_host.h | 4 +
{arch/x86 => kernel}/configs/kvm_guest.config | 1 +
arch/arm64/kvm/emulate.c => virt/kvm/arm/aarch32.c | 25 +-
virt/kvm/arm/arch_timer.c | 28 +-
virt/kvm/arm/hyp/vgic-v2-sr.c | 57 +++
{arch/arm64/kvm => virt/kvm/arm}/hyp/vgic-v3-sr.c | 17 +-
virt/kvm/arm/pmu.c | 8 +
virt/kvm/arm/vgic/vgic-init.c | 4 +
virt/kvm/arm/vgic/vgic-irqfd.c | 6 -
virt/kvm/arm/vgic/vgic-its.c | 156 ++++--
virt/kvm/arm/vgic/vgic-kvm-device.c | 133 +++--
virt/kvm/arm/vgic/vgic-mmio-v3.c | 34 +-
virt/kvm/arm/vgic/vgic-mmio.c | 2 -
virt/kvm/arm/vgic/vgic-mmio.h | 4 +-
virt/kvm/arm/vgic/vgic-v2.c | 71 +--
virt/kvm/arm/vgic/vgic-v3.c | 8 +
virt/kvm/arm/vgic/vgic.c | 20 +-
virt/kvm/arm/vgic/vgic.h | 52 +-
virt/kvm/eventfd.c | 22 +-
virt/kvm/kvm_main.c | 50 +-
137 files changed, 4813 insertions(+), 1780 deletions(-)
create mode 100644 Documentation/virtual/kvm/devices/arm-vgic-its.txt
create mode 100644 Documentation/virtual/kvm/devices/arm-vgic-v3.txt
rename arch/powerpc/{kernel/hmi.c => kvm/book3s_hv_hmi.c} (100%)
create mode 100644 arch/x86/kvm/debugfs.c
rename {arch/x86 => kernel}/configs/kvm_guest.config (96%)
rename arch/arm64/kvm/emulate.c => virt/kvm/arm/aarch32.c (90%)
rename {arch/arm64/kvm => virt/kvm/arm}/hyp/vgic-v3-sr.c (94%)

---
The promised conflict resolution.
(Merge commit will have two more hunks that are resolved automatically.)

diff --cc arch/arm/include/asm/arch_gicv3.h
index dfe4002812da,1fee657d3827..a8088290b778
--- a/arch/arm/include/asm/arch_gicv3.h
+++ b/arch/arm/include/asm/arch_gicv3.h
@@@ -160,7 -218,11 +219,7 @@@ static inline void gic_write_sre(u32 va

static inline void gic_write_bpr1(u32 val)
{
- asm volatile("mcr " __stringify(ICC_BPR1) : : "r" (val));
-#if defined(__write_sysreg) && defined(ICC_BPR1)
+ write_sysreg(val, ICC_BPR1);
-#else
- asm volatile("mcr " __stringify(ICC_BPR1) : : "r" (val));
-#endif
}

/*