> + */ > + vmcb_set_flush_rap(svm->vmcb01.ptr); Eh, follow the TLB flush helpers and just go with vmcb_flush_rap(). > + } > + > vmexit = nested_svm_exit_special(svm); > > if (vmexit == NESTED_EXIT_CONTINUE) > diff --git a/arch/x86/kvm/svm/svm.h b/arch/x86/kvm/svm/svm.h > index 43fa6a16eb19..8a7877f46dc5 100644 > --- a/arch/x86/kvm/svm/svm.h > +++ b/arch/x86/kvm/svm/svm.h > @@ -500,6 +500,21 @@ static inline bool svm_is_intercept(struct vcpu_svm *svm, int bit) > return vmcb_is_intercept(&svm->vmcb->control, bit); > } > > +static inline void vmcb_set_flush_rap(struct vmcb *vmcb) > +{ > + __set_bit(ERAP_CONTROL_FLUSH_RAP, (unsigned long *)&vmcb->control.erap_ctl); Eww. Don't use the bitops helpers, casting a u8 to an unsigned long, and then having to use the non-atomic helpers makes this way, way more complicated then it actually is. vmcb->control.erap_ctl |= ERAP_CONTROL_FLUSH_RAP_ON_VMRUN; > +} > + > +static inline void vmcb_set_larger_rap(struct vmcb *vmcb) > +{ > + __set_bit(ERAP_CONTROL_ALLOW_LARGER_RAP, (unsigned long *)&vmcb->control.erap_ctl); > +} > + > +static inline bool vmcb_is_larger_rap(struct vmcb *vmcb) > +{ > + return test_bit(ERAP_CONTROL_ALLOW_LARGER_RAP, (unsigned long *)&vmcb->control.erap_ctl); > +} > + > static inline bool nested_vgif_enabled(struct vcpu_svm *svm) > { > return guest_can_use(&svm->vcpu, X86_FEATURE_VGIF) && > -- > 2.47.0 >