diff options
author | Avi Kivity <avi@redhat.com> | 2011-04-20 08:24:32 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-05-22 08:39:12 -0400 |
commit | fd72c4192220d0086fb24356ac6ff9c3b1e067d9 (patch) | |
tree | b7f82b62e27a787fa26a16c22446e0a79c9c585e /arch | |
parent | c2ad2bb3ef870067ecfc9ccdcf465feb51f2b6a5 (diff) |
KVM: x86 emulator: Replace calls to is_pae() and is_paging with ->get_cr()
Avoid use of ctxt->vcpu.
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/emulate.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index be1532f4b8b8..6a5125328669 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -2644,9 +2644,9 @@ static int check_cr_write(struct x86_emulate_ctxt *ctxt) | |||
2644 | ctxt->ops->get_msr(ctxt, MSR_EFER, &efer); | 2644 | ctxt->ops->get_msr(ctxt, MSR_EFER, &efer); |
2645 | if (efer & EFER_LMA) | 2645 | if (efer & EFER_LMA) |
2646 | rsvd = CR3_L_MODE_RESERVED_BITS; | 2646 | rsvd = CR3_L_MODE_RESERVED_BITS; |
2647 | else if (is_pae(ctxt->vcpu)) | 2647 | else if (ctxt->ops->get_cr(ctxt, 4) & X86_CR4_PAE) |
2648 | rsvd = CR3_PAE_RESERVED_BITS; | 2648 | rsvd = CR3_PAE_RESERVED_BITS; |
2649 | else if (is_paging(ctxt->vcpu)) | 2649 | else if (ctxt->ops->get_cr(ctxt, 0) & X86_CR0_PG) |
2650 | rsvd = CR3_NONPAE_RESERVED_BITS; | 2650 | rsvd = CR3_NONPAE_RESERVED_BITS; |
2651 | 2651 | ||
2652 | if (new_val & rsvd) | 2652 | if (new_val & rsvd) |