qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Richard Henderson
Subject: Re: [PATCH] x86: Implement Linear Address Masking support
Date: Wed, 6 Apr 2022 22:34:41 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0

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 metadata in bits 62:57 of
user pointers.

CR3.LAM_U48[bit 61] allows to encode 15 bits of metadata in bits 62:48
of user pointers.

CR4.LAM_SUP[bit 28] allows to encode metadata of supervisor pointers.
If 5-level paging is in use, 6 bits of metadata can be encoded in 62:57.
For 4-level paging, 15 bits of metadata can be encoded in bits 62:48.

QEMU strips address from the metadata bits and gets it to canonical
shape before handling memory access. It has to be done very early before
TLB lookup.

The new hook is incorrect, in that it doesn't apply to addresses along the tlb 
fast path.

But it isn't really needed. You can do all of the work in the existing tlb_fill hook. AArch64 has a similar feature, and that works fine.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]