Commit fd72c419 authored by Avi Kivity's avatar Avi Kivity

KVM: x86 emulator: Replace calls to is_pae() and is_paging with ->get_cr()

Avoid use of ctxt->vcpu.
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent c2ad2bb3
...@@ -2644,9 +2644,9 @@ static int check_cr_write(struct x86_emulate_ctxt *ctxt) ...@@ -2644,9 +2644,9 @@ static int check_cr_write(struct x86_emulate_ctxt *ctxt)
ctxt->ops->get_msr(ctxt, MSR_EFER, &efer); ctxt->ops->get_msr(ctxt, MSR_EFER, &efer);
if (efer & EFER_LMA) if (efer & EFER_LMA)
rsvd = CR3_L_MODE_RESERVED_BITS; rsvd = CR3_L_MODE_RESERVED_BITS;
else if (is_pae(ctxt->vcpu)) else if (ctxt->ops->get_cr(ctxt, 4) & X86_CR4_PAE)
rsvd = CR3_PAE_RESERVED_BITS; rsvd = CR3_PAE_RESERVED_BITS;
else if (is_paging(ctxt->vcpu)) else if (ctxt->ops->get_cr(ctxt, 0) & X86_CR0_PG)
rsvd = CR3_NONPAE_RESERVED_BITS; rsvd = CR3_NONPAE_RESERVED_BITS;
if (new_val & rsvd) if (new_val & rsvd)
......
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