[GIT PULL] First batch of KVM changes for v4.14

From: Radim KrÄmÃÅ
Date: Fri Sep 08 2017 - 10:31:10 EST


Linus,

there is going to be a simple merge conflict between ea2800ddb20d
("kvm/x86: Avoid clearing the C-bit in rsvd_bits()") and d6321d493319
("KVM: x86: generalize guest_cpuid_has_ helpers"). It should be
resolved as in next and I've also pasted the resolution at the bottom.

Outside of kvm files, there there is an obligatory MAINTAINERS patch and
a VGIF feature flag addition. Topic branch merges in s390 and powerpc
are already in mainline -- would you prefer to see the expected result
after merge instead of what `git request-pull` produces?
i.e. 64 files changed, 1479 insertions(+), 768 deletions(-)
vs. 88 files changed, 2041 insertions(+), 916 deletions(-)

The following changes since commit 47c5310a8dbe7c2cb9f0083daa43ceed76c257fa:

KVM: PPC: Book3S: Fix race and leak in kvm_vm_ioctl_create_spapr_tce() (2017-08-25 11:08:57 +0200)

are available in the git repository at:

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

for you to fetch changes up to 5f54c8b2d4fad95d1f8ecbe023ebe6038e6d3760:

Merge branch 'kvm-ppc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc (2017-09-08 14:40:43 +0200)

Thanks.

----------------------------------------------------------------
First batch of KVM changes for 4.14

Common:
- improve heuristic for boosting preempted spinlocks by ignoring VCPUs
in user mode

ARM:
- fix for decoding external abort types from guests

- added support for migrating the active priority of interrupts when
running a GICv2 guest on a GICv3 host

- minor cleanup

PPC:
- expose storage keys to userspace

- merge powerpc/topic/ppc-kvm branch that contains
find_linux_pte_or_hugepte and POWER9 thread management cleanup

- merge kvm-ppc-fixes with a fix that missed 4.13 because of vacations

- fixes

s390:
- merge of topic branch tlb-flushing from the s390 tree to get the
no-dat base features

- merge of kvm/master to avoid conflicts with additional sthyi fixes

- wire up the no-dat enhancements in KVM

- multiple epoch facility (z14 feature)

- Configuration z/Architecture Mode

- more sthyi fixes

- gdb server range checking fix

- small code cleanups

x86:
- emulate Hyper-V TSC frequency MSRs

- add nested INVPCID

- emulate EPTP switching VMFUNC

- support Virtual GIF

- support 5 level page tables

- speedup nested VM exits by packing byte operations

- speedup MMIO by using hardware provided physical address

- a lot of fixes and cleanups, especially nested

----------------------------------------------------------------
Andreas Schwab (1):
KVM: PPC: Book3S HV: Fix invalid use of register expression

Andrew Jones (1):
KVM: MAINTAINERS improvements

Aneesh Kumar K.V (1):
powerpc/mm: Rename find_linux_pte_or_hugepte()

Arnd Bergmann (1):
kvm: avoid uninitialized-variable warnings

Arvind Yadav (1):
KVM: arm/arm64: vgic: constify seq_operations and file_operations

Bandan Das (3):
KVM: vmx: Enable VMFUNCs
KVM: nVMX: Enable VMFUNC for the L1 hypervisor
KVM: nVMX: Emulate EPTP switching for the L1 hypervisor

Brijesh Singh (2):
KVM: SVM: Limit PFERR_NESTED_GUEST_PAGE error_code check to L1 guest
KVM: x86: Avoid guest page table walk when gpa_available is set

Christian Borntraeger (2):
Merge branch 'tlb-flushing' of git://git.kernel.org/.../s390/linux into kernelorgnext
Merge tag 'kvm-s390-master-4.13-2' into kvms390/next

Christoffer Dall (2):
KVM: arm/arm64: Extract GICv3 max APRn index calculation
KVM: arm/arm64: Support uaccess of GICC_APRn

Claudio Imbrenda (1):
KVM: s390: expose no-DAT to guest and migration support

Collin L. Walling (1):
KVM: s390: Multiple Epoch Facility support

Dan Carpenter (2):
KVM: PPC: e500: Fix some NULL dereferences on error
KVM: PPC: e500mc: Fix a NULL dereference

David Hildenbrand (9):
KVM: nVMX: get rid of nested_get_page()
KVM: nVMX: get rid of nested_release_page*
KVM: nVMX: validate eptp pointer
KVM: VMX: cleanup EPTP definitions
KVM: VMX: always require WB memory type for EPT
KVM: s390: we are always in czam mode
KVM: s390: guestdbg: fix range check
KVM: s390: use WARN_ON_ONCE only for checking
KVM: s390: vsie: cleanup mcck reinjection

Denys Vlasenko (1):
KVM: SVM: delete avic_vm_id_bitmap (2 megabyte static array)

Heiko Carstens (1):
KVM: s390: sthyi: remove invalid guest write access

James Morse (1):
KVM: arm/arm64: Fix guest external abort matching

Janakarajan Natarajan (2):
KVM: SVM: Add Virtual GIF feature definition
KVM: SVM: Enable Virtual GIF feature

Jason J. Herne (1):
KVM: s390: Support Configuration z/Architecture Mode

Jim Mattson (4):
kvm: x86: Disallow illegal IA32_APIC_BASE MSR values
kvm: vmx: Raise #UD on unsupported RDRAND
kvm: vmx: Raise #UD on unsupported RDSEED
kvm: nVMX: Validate the virtual-APIC address on nested VM-entry

Ladi Prosek (1):
KVM: hyperv: support HV_X64_MSR_TSC_FREQUENCY and HV_X64_MSR_APIC_FREQUENCY

Longpeng(Mike) (4):
KVM: add spinlock optimization framework
KVM: X86: implement the logic for spinlock optimization
KVM: s390: implements the kvm_arch_vcpu_in_kernel()
KVM: arm: implements the kvm_arch_vcpu_in_kernel()

Marc Zyngier (1):
KVM: arm/arm64: vITS: Drop its_ite->lpi field

Martin Schwidefsky (4):
s390/mm: tag normal pages vs pages used in page tables
s390/mm: add no-dat TLB flush optimization
s390/mm: add guest ASCE TLB flush optimization
s390/mm,kvm: use nodat PGSTE tag to optimize TLB flushing

Nicholas Piggin (2):
KVM: PPC: Book3S HV: POWER9 does not require secondary thread management
KVM: PPC: Book3S HV: Fix H_REGISTER_VPA VPA size validation

Paolo Bonzini (7):
KVM: nVMX: INVPCID support
kvm: nVMX: Add support for fast unprotection of nested guest page tables
KVM: x86: simplify ept_misconfig
KVM: x86: fix use of L1 MMIO areas in nested guests
KVM: VMX: cache secondary exec controls
kvm: vmx: Raise #UD on unsupported XSAVES/XRSTORS
KVM: MMU: speedup update_permission_bitmask

Paul Mackerras (4):
KVM: PPC: Book3S HV: Protect updates to spapr_tce_tables list
KVM: PPC: Book3S HV: Fix case where HDEC is treated as 32-bit on POWER9
KVM: PPC: Book3S HV: Report storage key support to userspace
Merge remote-tracking branch 'remotes/powerpc/topic/ppc-kvm' into kvm-ppc-next

Radim KrÄmÃÅ (7):
KVM: x86: X86_FEATURE_NRIPS is not scattered anymore
KVM: x86: generalize guest_cpuid_has_ helpers
KVM: x86: use general helpers for some cpuid manipulation
Merge tag 'kvm-s390-next-4.14-2' of git://git.kernel.org/.../kvms390/linux
Merge tag 'kvm-arm-for-v4.14' of git://git.kernel.org/.../kvmarm/kvmarm
Merge branch 'kvm-ppc-next' of git://git.kernel.org/.../paulus/powerpc
Merge branch 'kvm-ppc-fixes' of git://git.kernel.org/.../paulus/powerpc

Ram Pai (1):
KVM: PPC: Book3S HV: Fix setting of storage key in H_ENTER

Wanpeng Li (6):
KVM: X86: Fix residual mmio emulation request to userspace
KVM: MMU: Fix softlockup due to mmu_lock is held too long
KVM: MMU: Bail out immediately if there is no available mmu page
KVM: VMX: use kvm_event_needs_reinjection
KVM: X86: Fix loss of exception which has not yet been injected
KVM: nVMX: Fix trying to cancel vmlauch/vmresume

Yu Zhang (5):
KVM: x86: Add return value to kvm_cpuid().
KVM: MMU: check guest CR3 reserved bits based on its physical address width.
KVM: MMU: Rename PT64_ROOT_LEVEL to PT64_ROOT_4LEVEL.
KVM: MMU: Add 5 level EPT & Shadow page table support.
KVM: MMU: Expose the LA57 feature to VM.

nixiaoming (1):
KVM: PPC: Book3S HV: Fix memory leak in kvm_vm_ioctl_get_htab_fd

Documentation/virtual/kvm/devices/arm-vgic.txt | 5 +
Documentation/virtual/kvm/devices/vm.txt | 14 +-
MAINTAINERS | 37 +-
arch/arm/include/asm/kvm_arm.h | 1 -
arch/arm/include/asm/kvm_emulate.h | 24 +-
arch/arm/kvm/handle_exit.c | 2 +-
arch/arm64/include/asm/kvm_emulate.h | 24 +-
arch/arm64/kvm/handle_exit.c | 2 +-
arch/arm64/kvm/vgic-sys-reg-v3.c | 23 +-
arch/mips/kvm/mips.c | 5 +
arch/powerpc/include/asm/book3s/64/mmu-hash.h | 1 +
arch/powerpc/include/asm/kvm_book3s_asm.h | 4 +
arch/powerpc/include/asm/pgtable.h | 10 +-
arch/powerpc/include/asm/pte-walk.h | 35 ++
arch/powerpc/kernel/eeh.c | 4 +-
arch/powerpc/kernel/idle_book3s.S | 35 +-
arch/powerpc/kernel/io-workarounds.c | 5 +-
arch/powerpc/kvm/book3s_64_mmu_hv.c | 6 +-
arch/powerpc/kvm/book3s_64_mmu_radix.c | 28 +-
arch/powerpc/kvm/book3s_64_vio.c | 21 +-
arch/powerpc/kvm/book3s_64_vio_hv.c | 12 +-
arch/powerpc/kvm/book3s_hv.c | 29 +-
arch/powerpc/kvm/book3s_hv_rm_mmu.c | 20 +-
arch/powerpc/kvm/book3s_hv_rmhandlers.S | 13 +-
arch/powerpc/kvm/e500.c | 8 +-
arch/powerpc/kvm/e500_mmu_host.c | 3 +-
arch/powerpc/kvm/e500mc.c | 4 +-
arch/powerpc/kvm/powerpc.c | 5 +
arch/powerpc/mm/hash_utils_64.c | 5 +-
arch/powerpc/mm/hugetlbpage.c | 24 +-
arch/powerpc/mm/tlb_hash64.c | 6 +-
arch/powerpc/perf/callchain.c | 3 +-
arch/s390/include/asm/kvm_host.h | 6 +-
arch/s390/include/asm/page-states.h | 3 +-
arch/s390/include/asm/page.h | 3 +
arch/s390/include/asm/pgtable.h | 88 +++-
arch/s390/include/asm/setup.h | 9 +-
arch/s390/include/asm/tlbflush.h | 7 +-
arch/s390/include/uapi/asm/kvm.h | 6 +
arch/s390/kernel/suspend.c | 24 +-
arch/s390/kernel/vdso.c | 2 +
arch/s390/kvm/diag.c | 2 +-
arch/s390/kvm/guestdbg.c | 2 +-
arch/s390/kvm/interrupt.c | 6 +-
arch/s390/kvm/kvm-s390.c | 118 ++++-
arch/s390/kvm/kvm-s390.h | 2 +
arch/s390/kvm/priv.c | 6 +-
arch/s390/kvm/sigp.c | 36 +-
arch/s390/kvm/sthyi.c | 8 -
arch/s390/kvm/vsie.c | 16 +-
arch/s390/mm/init.c | 2 +
arch/s390/mm/page-states.c | 192 +++++++-
arch/s390/mm/pageattr.c | 2 +-
arch/s390/mm/pgalloc.c | 2 +
arch/s390/mm/pgtable.c | 160 +++++--
arch/s390/tools/gen_facilities.c | 1 +
arch/x86/include/asm/cpufeatures.h | 1 +
arch/x86/include/asm/kvm_emulate.h | 4 +-
arch/x86/include/asm/kvm_host.h | 40 +-
arch/x86/include/asm/svm.h | 6 +
arch/x86/include/asm/vmx.h | 22 +-
arch/x86/kvm/cpuid.c | 34 +-
arch/x86/kvm/cpuid.h | 186 +++-----
arch/x86/kvm/emulate.c | 42 +-
arch/x86/kvm/hyperv.c | 8 +-
arch/x86/kvm/kvm_cache_regs.h | 2 +-
arch/x86/kvm/lapic.c | 2 -
arch/x86/kvm/lapic.h | 3 +
arch/x86/kvm/mmu.c | 267 +++++++----
arch/x86/kvm/mmu.h | 23 +-
arch/x86/kvm/mmu_audit.c | 4 +-
arch/x86/kvm/mtrr.c | 2 +-
arch/x86/kvm/paging_tmpl.h | 6 +-
arch/x86/kvm/svm.c | 139 +++---
arch/x86/kvm/trace.h | 11 +-
arch/x86/kvm/vmx.c | 620 ++++++++++++++++++-------
arch/x86/kvm/x86.c | 213 +++++----
arch/x86/kvm/x86.h | 54 ++-
drivers/s390/char/sclp_early.c | 6 +-
include/linux/kvm_host.h | 9 +-
include/uapi/linux/kvm.h | 3 +-
virt/kvm/arm/arm.c | 5 +
virt/kvm/arm/mmu.c | 40 +-
virt/kvm/arm/vgic/vgic-debug.c | 4 +-
virt/kvm/arm/vgic/vgic-its.c | 10 +-
virt/kvm/arm/vgic/vgic-mmio-v2.c | 47 +-
virt/kvm/arm/vgic/vgic.h | 16 +
virt/kvm/kvm_main.c | 7 +-
88 files changed, 2041 insertions(+), 916 deletions(-)
create mode 100644 arch/powerpc/include/asm/pte-walk.h


---8<---
diff --cc arch/x86/kvm/mmu.c
index 04d750813c9d,2a8a6e3e2a31..eca30c1eb1d9
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@@ -4116,21 -4157,11 +4162,21 @@@ reset_shadow_zero_bits_mask(struct kvm_
* Passing "true" to the last argument is okay; it adds a check
* on bit 8 of the SPTEs which KVM doesn't use anyway.
*/
- __reset_rsvds_bits_mask(vcpu, &context->shadow_zero_check,
+ shadow_zero_check = &context->shadow_zero_check;
+ __reset_rsvds_bits_mask(vcpu, shadow_zero_check,
boot_cpu_data.x86_phys_bits,
context->shadow_root_level, uses_nx,
- guest_cpuid_has_gbpages(vcpu), is_pse(vcpu),
- true);
+ guest_cpuid_has(vcpu, X86_FEATURE_GBPAGES),
+ is_pse(vcpu), true);
+
+ if (!shadow_me_mask)
+ return;
+
+ for (i = context->shadow_root_level; --i >= 0;) {
+ shadow_zero_check->rsvd_bits_mask[0][i] &= ~shadow_me_mask;
+ shadow_zero_check->rsvd_bits_mask[1][i] &= ~shadow_me_mask;
+ }
+
}
EXPORT_SYMBOL_GPL(reset_shadow_zero_bits_mask);