From: Richard Henderson <richard.henderson@linaro.org>
To: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
qemu-devel@nongnu.org
Subject: Re: [PATCH] x86: Implement Linear Address Masking support
Date: Wed, 6 Apr 2022 22:34:41 -0500 [thread overview]
Message-ID: <79fa875e-0f67-5e21-c22f-9df700716575@linaro.org> (raw)
In-Reply-To: <20220407010107.34734-1-kirill.shutemov@linux.intel.com>
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~
next prev parent reply other threads:[~2022-04-07 3:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-07 1:01 [PATCH] x86: Implement Linear Address Masking support Kirill A. Shutemov
2022-04-07 3:34 ` Richard Henderson [this message]
2022-04-07 13:18 ` Kirill A. Shutemov
2022-04-07 14:28 ` Richard Henderson
2022-04-07 15:27 ` Kirill A. Shutemov
2022-04-07 16:38 ` Paolo Bonzini
2022-04-07 17:44 ` Kirill A. Shutemov
2022-04-08 14:39 ` Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=79fa875e-0f67-5e21-c22f-9df700716575@linaro.org \
--to=richard.henderson@linaro.org \
--cc=kirill.shutemov@linux.intel.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).