Commit c760e86f authored by Maxim Levitsky's avatar Maxim Levitsky Committed by Sean Christopherson
Browse files

KVM: x86: Move HF_GIF_MASK into "struct vcpu_svm" as "guest_gif"



Move HF_GIF_MASK out of the common "hflags" and into vcpu_svm.guest_gif.
GIF is an SVM-only concept and has should never be consulted outside of
SVM-specific code.

No functional change is intended.

Suggested-by: default avatarSean Christopherson <seanjc@google.com>
Signed-off-by: default avatarMaxim Levitsky <mlevitsk@redhat.com>
Tested-by: default avatarSantosh Shukla <Santosh.Shukla@amd.com>
Link: https://lore.kernel.org/r/20221129193717.513824-5-mlevitsk@redhat.com


[sean: split to separate patch]
Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
parent 8957cbcf
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -2074,7 +2074,6 @@ enum {
	TASK_SWITCH_GATE = 3,
};

#define HF_GIF_MASK		(1 << 0)
#define HF_NMI_MASK		(1 << 3)
#define HF_IRET_MASK		(1 << 4)
#define HF_GUEST_MASK		(1 << 5) /* VCPU is in guest-mode */
+6 −3
Original line number Diff line number Diff line
@@ -273,6 +273,9 @@ struct vcpu_svm {
	bool guest_state_loaded;

	bool x2avic_msrs_intercepted;

	/* Guest GIF value, used when vGIF is not enabled */
	bool guest_gif;
};

struct svm_cpu_data {
@@ -490,7 +493,7 @@ static inline void enable_gif(struct vcpu_svm *svm)
	if (vmcb)
		vmcb->control.int_ctl |= V_GIF_MASK;
	else
		svm->vcpu.arch.hflags |= HF_GIF_MASK;
		svm->guest_gif = true;
}

static inline void disable_gif(struct vcpu_svm *svm)
@@ -500,7 +503,7 @@ static inline void disable_gif(struct vcpu_svm *svm)
	if (vmcb)
		vmcb->control.int_ctl &= ~V_GIF_MASK;
	else
		svm->vcpu.arch.hflags &= ~HF_GIF_MASK;
		svm->guest_gif = false;
}

static inline bool gif_set(struct vcpu_svm *svm)
@@ -510,7 +513,7 @@ static inline bool gif_set(struct vcpu_svm *svm)
	if (vmcb)
		return !!(vmcb->control.int_ctl & V_GIF_MASK);
	else
		return !!(svm->vcpu.arch.hflags & HF_GIF_MASK);
		return svm->guest_gif;
}

static inline bool nested_npt_enabled(struct vcpu_svm *svm)