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. */