On 26.06.2025 16:01, Teddy Astie wrote: > Introduce vpid_sync_vcpu_context to do a single-context invalidation > on the vpid attached to the vcpu as a alternative to per-gva and all-context > invlidations. > > Signed-off-by: Teddy Astie <teddy.as...@vates.tech>
Looks okay to me, but I'm not convinced we want to put it in possibly long before a first user appears. > --- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h > +++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h > @@ -452,6 +452,19 @@ static inline void ept_sync_all(void) > > void ept_sync_domain(struct p2m_domain *p2m); > > +static inline void vpid_sync_vcpu_context(struct vcpu *v) Andrew - is this again a case where you would object to me asking for the pointer to be pointer-to-const? Jan > +{ > + unsigned long type; > + > + /* Use the most precise invalidation type available. */ > + if ( likely(cpu_has_vmx_vpid_invvpid_single_context) ) > + type = INVVPID_SINGLE_CONTEXT; > + else > + type = INVVPID_ALL_CONTEXT; > + > + __invvpid(type, v->arch.hvm.n1asid.asid, 0); > +} > + > static inline void vpid_sync_vcpu_gva(struct vcpu *v, unsigned long gva) > { > unsigned long type;