Skip to content

Commit 96971e9

Browse files
committed
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Pull kvm fixes from Paolo Bonzini: "This is a pretty large update. I think it is roughly as big as what I usually had for the _whole_ rc period. There are a few bad bugs where the guest can OOPS or crash the host. We have also started looking at attack models for nested virtualization; bugs that usually result in the guest ring 0 crashing itself become more worrisome if you have nested virtualization, because the nested guest might bring down the non-nested guest as well. For current uses of nested virtualization these do not really have a security impact, but you never know and bugs are bugs nevertheless. A lot of these bugs are in 3.17 too, resulting in a large number of stable@ Ccs. I checked that all the patches apply there with no conflicts" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: kvm: vfio: fix unregister kvm_device_ops of vfio KVM: x86: Wrong assertion on paging_tmpl.h kvm: fix excessive pages un-pinning in kvm_iommu_map error path. KVM: x86: PREFETCH and HINT_NOP should have SrcMem flag KVM: x86: Emulator does not decode clflush well KVM: emulate: avoid accessing NULL ctxt->memopp KVM: x86: Decoding guest instructions which cross page boundary may fail kvm: x86: don't kill guest on unknown exit reason kvm: vmx: handle invvpid vm exit gracefully KVM: x86: Handle errors when RIP is set during far jumps KVM: x86: Emulator fixes for eip canonical checks on near branches KVM: x86: Fix wrong masking on relative jump/call KVM: x86: Improve thread safety in pit KVM: x86: Prevent host from panicking on shared MSR writes. KVM: x86: Check non-canonical addresses upon WRMSR
2 parents 20ca57c + 571ee1b commit 96971e9

13 files changed

Lines changed: 282 additions & 85 deletions

File tree

‎arch/x86/include/asm/kvm_host.h‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,20 @@ static inline void kvm_inject_gp(struct kvm_vcpu *vcpu, u32 error_code)
989989
kvm_queue_exception_e(vcpu, GP_VECTOR, error_code);
990990
}
991991

992+
static inline u64 get_canonical(u64 la)
993+
{
994+
return ((int64_t)la << 16) >> 16;
995+
}
996+
997+
static inline bool is_noncanonical_address(u64 la)
998+
{
999+
#ifdef CONFIG_X86_64
1000+
return get_canonical(la) != la;
1001+
#else
1002+
return false;
1003+
#endif
1004+
}
1005+
9921006
#define TSS_IOPB_BASE_OFFSET 0x66
9931007
#define TSS_BASE_SIZE 0x68
9941008
#define TSS_IOPB_SIZE (65536 / 8)
@@ -1050,7 +1064,7 @@ void kvm_arch_mmu_notifier_invalidate_page(struct kvm *kvm,
10501064
unsigned long address);
10511065

10521066
void kvm_define_shared_msr(unsigned index, u32 msr);
1053-
void kvm_set_shared_msr(unsigned index, u64 val, u64 mask);
1067+
int kvm_set_shared_msr(unsigned index, u64 val, u64 mask);
10541068

10551069
bool kvm_is_linear_rip(struct kvm_vcpu *vcpu, unsigned long linear_rip);
10561070

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
#define EXIT_REASON_EPT_MISCONFIG 49
6868
#define EXIT_REASON_INVEPT 50
6969
#define EXIT_REASON_PREEMPTION_TIMER 52
70+
#define EXIT_REASON_INVVPID 53
7071
#define EXIT_REASON_WBINVD 54
7172
#define EXIT_REASON_XSETBV 55
7273
#define EXIT_REASON_APIC_WRITE 56
@@ -114,6 +115,7 @@
114115
{ EXIT_REASON_EOI_INDUCED, "EOI_INDUCED" }, \
115116
{ EXIT_REASON_INVALID_STATE, "INVALID_STATE" }, \
116117
{ EXIT_REASON_INVD, "INVD" }, \
118+
{ EXIT_REASON_INVVPID, "INVVPID" }, \
117119
{ EXIT_REASON_INVPCID, "INVPCID" }
118120

119121
#endif /* _UAPIVMX_H */

0 commit comments

Comments
 (0)