summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2015-10-14 16:35:15 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2015-10-14 16:40:46 +0200
commitbff98d3b01e0420bfd027d8f320cdc9869f6cc2b (patch)
tree580e6695c23c0dc7c49f6835430be049d252a679 /arch/x86/kvm
parent58f800d5ace99c49e6418cb5757d868f2746acb4 (diff)
parentb10d92a54dac25a6152f1aa1ffc95c12908035ce (diff)
downloadlinux-stable-bff98d3b01e0420bfd027d8f320cdc9869f6cc2b.tar.gz
linux-stable-bff98d3b01e0420bfd027d8f320cdc9869f6cc2b.tar.bz2
linux-stable-bff98d3b01e0420bfd027d8f320cdc9869f6cc2b.zip
Merge branch 'kvm-master' into HEAD
Merge more important SMM fixes.
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r--arch/x86/kvm/emulate.c10
-rw-r--r--arch/x86/kvm/x86.c2
2 files changed, 8 insertions, 4 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index b372a7557c16..9da95b9daf8d 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -2418,7 +2418,7 @@ static int rsm_load_state_64(struct x86_emulate_ctxt *ctxt, u64 smbase)
u64 val, cr0, cr4;
u32 base3;
u16 selector;
- int i;
+ int i, r;
for (i = 0; i < 16; i++)
*reg_write(ctxt, i) = GET_SMSTATE(u64, smbase, 0x7ff8 - i * 8);
@@ -2460,13 +2460,17 @@ static int rsm_load_state_64(struct x86_emulate_ctxt *ctxt, u64 smbase)
dt.address = GET_SMSTATE(u64, smbase, 0x7e68);
ctxt->ops->set_gdt(ctxt, &dt);
+ r = rsm_enter_protected_mode(ctxt, cr0, cr4);
+ if (r != X86EMUL_CONTINUE)
+ return r;
+
for (i = 0; i < 6; i++) {
- int r = rsm_load_seg_64(ctxt, smbase, i);
+ r = rsm_load_seg_64(ctxt, smbase, i);
if (r != X86EMUL_CONTINUE)
return r;
}
- return rsm_enter_protected_mode(ctxt, cr0, cr4);
+ return X86EMUL_CONTINUE;
}
static int em_rsm(struct x86_emulate_ctxt *ctxt)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index ba1a968b829a..e28954d2698a 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -7564,7 +7564,7 @@ void kvm_arch_sync_events(struct kvm *kvm)
int __x86_set_memory_region(struct kvm *kvm, int id, gpa_t gpa, u32 size)
{
int i, r;
- u64 hva;
+ unsigned long hva;
struct kvm_memslots *slots = kvm_memslots(kvm);
struct kvm_memory_slot *slot, old;