On 7/27/25 17:22, Bibo Mao wrote:
yeap, sextract64 is simpler and effective. How about loongarch_vppn_to_vaddr compared with __vaddr about function name?+static inline target_ulong __vaddr(target_ulong addr) +{ + target_ulong high; + + high = -(addr >> (TARGET_VIRT_ADDR_SPACE_BITS - 1)); + return addr + (high << TARGET_VIRT_ADDR_SPACE_BITS); +}Don't use __ symbols. Also, this function is sextract64(addr, 0, TARGET_VIRT_ADDR_SPACE_BITS - 1)
There was one use of __vaddr in this patch. Do you need a separate helper function at all? Just use sextract64 directly within invalidate_tlb_entry.
r~
