nestedsvm_gif_isset(struct vcpu *v)
{
struct nestedsvm *svm = &vcpu_nestedsvm(v);
+ struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
- return (!!svm->ns_gif);
+ /* get the vmcb gif value if using vgif */
+ if ( vmcb->_vintr.fields.vgif_enable )
+ return vmcb->_vintr.fields.vgif;
+ else
+ return svm->ns_gif;
}
void svm_vmexit_do_stgi(struct cpu_user_regs *regs, struct vcpu *v)
P(cpu_has_svm_cleanbits, "VMCB Clean Bits");
P(cpu_has_svm_decode, "DecodeAssists");
P(cpu_has_svm_vloadsave, "Virtual VMLOAD/VMSAVE");
+ P(cpu_has_svm_vgif, "Virtual GIF");
P(cpu_has_pause_filter, "Pause-Intercept Filter");
P(cpu_has_tsc_ratio, "TSC Rate MSR");
#undef P
vmcb->_exception_intercepts |= (1U << TRAP_page_fault);
}
+ /* if available, enable and configure virtual gif */
+ if ( cpu_has_svm_vgif )
+ {
+ vmcb->_vintr.fields.vgif = 1;
+ vmcb->_vintr.fields.vgif_enable = 1;
+ vmcb->_general2_intercepts &= ~GENERAL2_INTERCEPT_STGI;
+ vmcb->_general2_intercepts &= ~GENERAL2_INTERCEPT_CLGI;
+ }
+
if ( cpu_has_pause_filter )
{
vmcb->_pause_filter_count = SVM_PAUSEFILTER_INIT;