Commit 10e18e62 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'kvm-updates/3.0' of git://git.kernel.org/pub/scm/virt/kvm/kvm

* 'kvm-updates/3.0' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  KVM: Fix register corruption in pvclock_scale_delta
  KVM: MMU: fix opposite condition in mapping_level_dirty_bitmap
  KVM: VMX: do not overwrite uptodate vcpu->arch.cr3 on KVM_SET_SREGS
  KVM: MMU: Fix build warnings in walk_addr_generic()
parents 8816ead9 de2d1a52
...@@ -22,6 +22,8 @@ static inline u64 pvclock_scale_delta(u64 delta, u32 mul_frac, int shift) ...@@ -22,6 +22,8 @@ static inline u64 pvclock_scale_delta(u64 delta, u32 mul_frac, int shift)
u64 product; u64 product;
#ifdef __i386__ #ifdef __i386__
u32 tmp1, tmp2; u32 tmp1, tmp2;
#else
ulong tmp;
#endif #endif
if (shift < 0) if (shift < 0)
...@@ -42,8 +44,11 @@ static inline u64 pvclock_scale_delta(u64 delta, u32 mul_frac, int shift) ...@@ -42,8 +44,11 @@ static inline u64 pvclock_scale_delta(u64 delta, u32 mul_frac, int shift)
: "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) ); : "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) );
#elif defined(__x86_64__) #elif defined(__x86_64__)
__asm__ ( __asm__ (
"mul %%rdx ; shrd $32,%%rdx,%%rax" "mul %[mul_frac] ; shrd $32, %[hi], %[lo]"
: "=a" (product) : "0" (delta), "d" ((u64)mul_frac) ); : [lo]"=a"(product),
[hi]"=d"(tmp)
: "0"(delta),
[mul_frac]"rm"((u64)mul_frac));
#else #else
#error implement me! #error implement me!
#endif #endif
......
...@@ -565,7 +565,7 @@ gfn_to_memslot_dirty_bitmap(struct kvm_vcpu *vcpu, gfn_t gfn, ...@@ -565,7 +565,7 @@ gfn_to_memslot_dirty_bitmap(struct kvm_vcpu *vcpu, gfn_t gfn,
static bool mapping_level_dirty_bitmap(struct kvm_vcpu *vcpu, gfn_t large_gfn) static bool mapping_level_dirty_bitmap(struct kvm_vcpu *vcpu, gfn_t large_gfn)
{ {
return gfn_to_memslot_dirty_bitmap(vcpu, large_gfn, true); return !gfn_to_memslot_dirty_bitmap(vcpu, large_gfn, true);
} }
static int mapping_level(struct kvm_vcpu *vcpu, gfn_t large_gfn) static int mapping_level(struct kvm_vcpu *vcpu, gfn_t large_gfn)
......
...@@ -121,7 +121,7 @@ static int FNAME(walk_addr_generic)(struct guest_walker *walker, ...@@ -121,7 +121,7 @@ static int FNAME(walk_addr_generic)(struct guest_walker *walker,
gva_t addr, u32 access) gva_t addr, u32 access)
{ {
pt_element_t pte; pt_element_t pte;
pt_element_t __user *ptep_user; pt_element_t __user *uninitialized_var(ptep_user);
gfn_t table_gfn; gfn_t table_gfn;
unsigned index, pt_access, uninitialized_var(pte_access); unsigned index, pt_access, uninitialized_var(pte_access);
gpa_t pte_gpa; gpa_t pte_gpa;
......
...@@ -2047,7 +2047,8 @@ static void ept_update_paging_mode_cr0(unsigned long *hw_cr0, ...@@ -2047,7 +2047,8 @@ static void ept_update_paging_mode_cr0(unsigned long *hw_cr0,
unsigned long cr0, unsigned long cr0,
struct kvm_vcpu *vcpu) struct kvm_vcpu *vcpu)
{ {
vmx_decache_cr3(vcpu); if (!test_bit(VCPU_EXREG_CR3, (ulong *)&vcpu->arch.regs_avail))
vmx_decache_cr3(vcpu);
if (!(cr0 & X86_CR0_PG)) { if (!(cr0 & X86_CR0_PG)) {
/* From paging/starting to nonpaging */ /* From paging/starting to nonpaging */
vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, vmcs_write32(CPU_BASED_VM_EXEC_CONTROL,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment