diff options
| author | Sean Christopherson <[email protected]> | 2023-08-15 20:36:51 +0000 |
|---|---|---|
| committer | Sean Christopherson <[email protected]> | 2023-08-17 18:43:31 +0000 |
| commit | b89456aee78d22b20c6c83c4d75af7985ae5be8d (patch) | |
| tree | e16bfa3993e1d825507dbdc6340df496cd97eba2 /arch/x86/kvm/svm/nested.c | |
| parent | KVM: nSVM: Use KVM-governed feature framework to track "Pause Filter enabled" (diff) | |
| download | kernel-b89456aee78d22b20c6c83c4d75af7985ae5be8d.tar.gz kernel-b89456aee78d22b20c6c83c4d75af7985ae5be8d.zip | |
KVM: nSVM: Use KVM-governed feature framework to track "vGIF enabled"
Track "virtual GIF exposed to L1" via a governed feature flag instead of
using a dedicated bit/flag in vcpu_svm.
Note, checking KVM's capabilities instead of the "vgif" param means that
the code isn't strictly equivalent, as vgif_enabled could have been set
if nested=false where as that the governed feature cannot. But that's a
glorified nop as the feature/flag is consumed only by paths that are
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sean Christopherson <[email protected]>
Diffstat (limited to 'arch/x86/kvm/svm/nested.c')
| -rw-r--r-- | arch/x86/kvm/svm/nested.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c index ac03b2bc5b2c..dd496c9e5f91 100644 --- a/arch/x86/kvm/svm/nested.c +++ b/arch/x86/kvm/svm/nested.c @@ -660,7 +660,8 @@ static void nested_vmcb02_prepare_control(struct vcpu_svm *svm, * exit_int_info, exit_int_info_err, next_rip, insn_len, insn_bytes. */ - if (svm->vgif_enabled && (svm->nested.ctl.int_ctl & V_GIF_ENABLE_MASK)) + if (guest_can_use(vcpu, X86_FEATURE_VGIF) && + (svm->nested.ctl.int_ctl & V_GIF_ENABLE_MASK)) int_ctl_vmcb12_bits |= (V_GIF_MASK | V_GIF_ENABLE_MASK); else int_ctl_vmcb01_bits |= (V_GIF_MASK | V_GIF_ENABLE_MASK); |
