diff options
author | Avi Kivity <avi@redhat.com> | 2009-12-07 05:16:48 -0500 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2010-03-01 10:35:39 -0500 |
commit | fc78f51938e1ea866daa2045851b2e5681371668 (patch) | |
tree | bf46fdc9daca6cab3b42d102ec12c133a62cb2ff /arch/x86/kvm/mmu.h | |
parent | cdc0e24456bf5678f63497569c3676c9019f82c1 (diff) |
KVM: Add accessor for reading cr4 (or some bits of cr4)
Some bits of cr4 can be owned by the guest on vmx, so when we read them,
we copy them to the vcpu structure. In preparation for making the set of
guest-owned bits dynamic, use helpers to access these bits so we don't need
to know where the bit resides.
No changes to svm since all bits are host-owned there.
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/mmu.h')
-rw-r--r-- | arch/x86/kvm/mmu.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/kvm/mmu.h b/arch/x86/kvm/mmu.h index 61a1b3884b49..4567d8042b22 100644 --- a/arch/x86/kvm/mmu.h +++ b/arch/x86/kvm/mmu.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define __KVM_X86_MMU_H | 2 | #define __KVM_X86_MMU_H |
3 | 3 | ||
4 | #include <linux/kvm_host.h> | 4 | #include <linux/kvm_host.h> |
5 | #include "kvm_cache_regs.h" | ||
5 | 6 | ||
6 | #define PT64_PT_BITS 9 | 7 | #define PT64_PT_BITS 9 |
7 | #define PT64_ENT_PER_PAGE (1 << PT64_PT_BITS) | 8 | #define PT64_ENT_PER_PAGE (1 << PT64_PT_BITS) |
@@ -64,12 +65,12 @@ static inline int is_long_mode(struct kvm_vcpu *vcpu) | |||
64 | 65 | ||
65 | static inline int is_pae(struct kvm_vcpu *vcpu) | 66 | static inline int is_pae(struct kvm_vcpu *vcpu) |
66 | { | 67 | { |
67 | return vcpu->arch.cr4 & X86_CR4_PAE; | 68 | return kvm_read_cr4_bits(vcpu, X86_CR4_PAE); |
68 | } | 69 | } |
69 | 70 | ||
70 | static inline int is_pse(struct kvm_vcpu *vcpu) | 71 | static inline int is_pse(struct kvm_vcpu *vcpu) |
71 | { | 72 | { |
72 | return vcpu->arch.cr4 & X86_CR4_PSE; | 73 | return kvm_read_cr4_bits(vcpu, X86_CR4_PSE); |
73 | } | 74 | } |
74 | 75 | ||
75 | static inline int is_paging(struct kvm_vcpu *vcpu) | 76 | static inline int is_paging(struct kvm_vcpu *vcpu) |