diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2020-05-13 13:36:32 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-06-01 04:26:05 -0400 |
commit | cc440cdad5b7a4c1de12dace725209eb3e0cf663 (patch) | |
tree | 9e87ebc3ac64411bad0c87ec1e5b8b2a07d0e8e5 /arch/x86/kvm/cpuid.h | |
parent | 8ec107c89b19bc37a7ec364f3e1c92ae4d961b78 (diff) | |
download | lwn-cc440cdad5b7a4c1de12dace725209eb3e0cf663.tar.gz lwn-cc440cdad5b7a4c1de12dace725209eb3e0cf663.zip |
KVM: nSVM: implement KVM_GET_NESTED_STATE and KVM_SET_NESTED_STATE
Similar to VMX, the state that is captured through the currently available
IOCTLs is a mix of L1 and L2 state, dependent on whether the L2 guest was
running at the moment when the process was interrupted to save its state.
In particular, the SVM-specific state for nested virtualization includes
the L1 saved state (including the interrupt flag), the cached L2 controls,
and the GIF.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/cpuid.h')
-rw-r--r-- | arch/x86/kvm/cpuid.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/kvm/cpuid.h b/arch/x86/kvm/cpuid.h index 63a70f6a3df3..05434cd9342f 100644 --- a/arch/x86/kvm/cpuid.h +++ b/arch/x86/kvm/cpuid.h @@ -303,4 +303,9 @@ static __always_inline void kvm_cpu_cap_check_and_set(unsigned int x86_feature) kvm_cpu_cap_set(x86_feature); } +static inline bool page_address_valid(struct kvm_vcpu *vcpu, gpa_t gpa) +{ + return PAGE_ALIGNED(gpa) && !(gpa >> cpuid_maxphyaddr(vcpu)); +} + #endif |