Skip to content

Commit 4ebb105

Browse files
committed
KVM: SEV: introduce to_kvm_sev_info
Suggested-by: Sean Christopherson <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]> Message-ID: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 2a955c4 commit 4ebb105

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

arch/x86/kvm/svm/sev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static int sev_flush_asids(unsigned int min_asid, unsigned int max_asid)
9696

9797
static inline bool is_mirroring_enc_context(struct kvm *kvm)
9898
{
99-
return !!to_kvm_svm(kvm)->sev_info.enc_context_owner;
99+
return !!to_kvm_sev_info(kvm)->enc_context_owner;
100100
}
101101

102102
static bool sev_vcpu_has_debug_swap(struct vcpu_svm *svm)
@@ -653,7 +653,7 @@ static int __sev_launch_update_vmsa(struct kvm *kvm, struct kvm_vcpu *vcpu,
653653
clflush_cache_range(svm->sev_es.vmsa, PAGE_SIZE);
654654

655655
vmsa.reserved = 0;
656-
vmsa.handle = to_kvm_svm(kvm)->sev_info.handle;
656+
vmsa.handle = to_kvm_sev_info(kvm)->handle;
657657
vmsa.address = __sme_pa(svm->sev_es.vmsa);
658658
vmsa.len = PAGE_SIZE;
659659
ret = sev_issue_cmd(kvm, SEV_CMD_LAUNCH_UPDATE_VMSA, &vmsa, error);

arch/x86/kvm/svm/svm.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,11 @@ static __always_inline struct kvm_svm *to_kvm_svm(struct kvm *kvm)
319319
return container_of(kvm, struct kvm_svm, kvm);
320320
}
321321

322+
static __always_inline struct kvm_sev_info *to_kvm_sev_info(struct kvm *kvm)
323+
{
324+
return &to_kvm_svm(kvm)->sev_info;
325+
}
326+
322327
static __always_inline bool sev_guest(struct kvm *kvm)
323328
{
324329
#ifdef CONFIG_KVM_AMD_SEV

0 commit comments

Comments
 (0)