Re: [PATCH] x86: Implement Linear Address Masking support

2022-04-08 Thread Richard Henderson
On 4/7/22 08:27, Kirill A. Shutemov wrote: The fast path does not clear the bits, so you enter the slow path before you get to clearing the bits. You've lost most of the advantage of the tlb already. Sorry for my ignorance, but what do you mean by fast path here? My understanding is that it

Re: [PATCH] x86: Implement Linear Address Masking support

2022-04-07 Thread Kirill A. Shutemov
On Thu, Apr 07, 2022 at 06:38:40PM +0200, Paolo Bonzini wrote: > On 4/7/22 17:27, Kirill A. Shutemov wrote: > > On Thu, Apr 07, 2022 at 07:28:54AM -0700, Richard Henderson wrote: > > > On 4/7/22 06:18, Kirill A. Shutemov wrote: > > > > > The new hook is incorrect, in that it doesn't apply to

Re: [PATCH] x86: Implement Linear Address Masking support

2022-04-07 Thread Paolo Bonzini
On 4/7/22 17:27, Kirill A. Shutemov wrote: On Thu, Apr 07, 2022 at 07:28:54AM -0700, Richard Henderson wrote: On 4/7/22 06:18, Kirill A. Shutemov wrote: The new hook is incorrect, in that it doesn't apply to addresses along the tlb fast path. I'm not sure what you mean by that. tlb_hit()

Re: [PATCH] x86: Implement Linear Address Masking support

2022-04-07 Thread Kirill A. Shutemov
On Thu, Apr 07, 2022 at 07:28:54AM -0700, Richard Henderson wrote: > On 4/7/22 06:18, Kirill A. Shutemov wrote: > > > The new hook is incorrect, in that it doesn't apply to addresses along > > > the tlb fast path. > > > > I'm not sure what you mean by that. tlb_hit() mechanics works. We strip > >

Re: [PATCH] x86: Implement Linear Address Masking support

2022-04-07 Thread Richard Henderson
On 4/7/22 06:18, Kirill A. Shutemov wrote: The new hook is incorrect, in that it doesn't apply to addresses along the tlb fast path. I'm not sure what you mean by that. tlb_hit() mechanics works. We strip the tag bits before tlb lookup. Could you elaborate? The fast path does not clear the

Re: [PATCH] x86: Implement Linear Address Masking support

2022-04-07 Thread Kirill A. Shutemov
On Wed, Apr 06, 2022 at 10:34:41PM -0500, Richard Henderson wrote: > On 4/6/22 20:01, Kirill A. Shutemov wrote: > > Linear Address Masking feature makes CPU ignore some bits of the virtual > > address. These bits can be used to encode metadata. > > > > The feature is enumerated with

Re: [PATCH] x86: Implement Linear Address Masking support

2022-04-06 Thread Richard Henderson
On 4/6/22 20:01, Kirill A. Shutemov wrote: Linear Address Masking feature makes CPU ignore some bits of the virtual address. These bits can be used to encode metadata. The feature is enumerated with CPUID.(EAX=07H, ECX=01H):EAX.LAM[bit 26]. CR3.LAM_U57[bit 62] allows to encode 6 bits of

[PATCH] x86: Implement Linear Address Masking support

2022-04-06 Thread Kirill A. Shutemov
Linear Address Masking feature makes CPU ignore some bits of the virtual address. These bits can be used to encode metadata. The feature is enumerated with CPUID.(EAX=07H, ECX=01H):EAX.LAM[bit 26]. CR3.LAM_U57[bit 62] allows to encode 6 bits of metadata in bits 62:57 of user pointers.