On 2026/10/31 下午9:03, mdspan wrote:
On 10/21/26 14:20, Richard Henderson wrote:
In particular, arm requires the complete address, including tagging, to
be available for any raised exception.  So clipping the address at any
other place loses that information.  Dunno if that applies to LAM.

It doesn't for LAM. LAM masking applies before paging, so CR2 gets
the masked address (ISE 319433-048, section 6.5). The non-canonical
case riases #GP, which doesn't report an address.

One change would touch common code: tlb_flush_range_locked() compares
large_page_addr in all 64 bits, so INVLPG of the untagged address
misses a large page entered under a tagged alias. I'd compare under
the flush mask:

     if (((addr + len - 1) & d->large_page_mask & mask) ==
         (d->large_page_addr & mask)) {
There is similar issue on LoongArch, there is windows mapping before MMU TLB, such as 64bit virtual address 0x9000 XXXX XXXX XXXX -> 48 bit PA 0xXXXX XXXX XXXX. I try to add 48 bit page size when adding QEMU TLB with API tlb_set_page(), but qemu LoongArch fails to boot, so I give up :(

Regards
Bibo Mao

If that's fine, I'll post the system-mode series.

On Wed, Oct 21, 2026 at 6:20 AM Richard Henderson
<[email protected]> wrote:

On 10/21/26 12:57, mdspan wrote:
Ping.

Paolo, Richard: does masking in get_physical_address(), with TLB
entries kept per tag and INVLPG flushing all aliases through
tlb_flush_page_bits_by_mmuidx(), look acceptable to you? I have a
prototype of items 1 and 2 and can post it as an RFC series if that
would be easier to review.

Yes, this is what we do in target/arm for top-byte-ignore.

In particular, arm requires the complete address, including tagging, to
be available for any raised exception.  So clipping the address at any
other place loses that information.  Dunno if that applies to LAM.

r~


Reply via email to