lkml.org 
[lkml]   [2023]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v10 7/9] KVM: VMX: Implement and wire get_untagged_addr() for LAM
From
On Wed, Jul 19, 2023, Binbin Wu wrote:
> + return (sign_extend64(gva, lam_bit) & ~BIT_ULL(63)) | (gva & BIT_ULL(63));

Almost forgot. Please add a comment explaning how LAM untags the address,
specifically the whole bit 63 preservation. The logic is actually straightforward,
but the above looks way more complex than it actually is. This?

/*
* Untag the address by sign-extending the LAM bit, but NOT to bit 63.
* Bit 63 is retained from the raw virtual address so that untagging
* doesn't change a user access to a supervisor access, and vice versa.
*/

\
 
 \ /
  Last update: 2023-08-17 00:03    [W:0.111 / U:0.972 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site