On Wed, 2022-12-21 at 08:35 +0800, Yang, Weijiang wrote: > > +static inline u64 get_canonical(u64 la, u8 vaddr_bits) > > +{ > > + return ((int64_t)la << (64 - vaddr_bits)) >> (64 - vaddr_bits); > > +} > > + > > > There's already a helper for the calculation: __canonical_address(), > and > it's used in KVM > > before set MSR_IA32_SYSENTER_ESP/MSR_IA32_SYSENTER_EIP. > Nice, thanks Weijiang.