This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit b90a12a5c16a1c6b7a57d58b83f1f06519a6c2d3
Author: Marco Casaroli <[email protected]>
AuthorDate: Sat Oct 31 23:52:36 2026 +0100

    arch/x86_64: Invalidate the TLB entries of the pages in up_invalid_tlb().
    
    The operand of invlpg is the address to invalidate.  With the "m"
    constraint the operand was the memory of the loop variable, so
    invlpg invalidated the entry of a stack address and not the entry of
    the page: after mmu_ln_setentry() changed a mapping, the old mapping
    could stay in the TLB.  Give the page address in a register.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 arch/x86_64/include/intel64/io.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/x86_64/include/intel64/io.h b/arch/x86_64/include/intel64/io.h
index be8b5836ca7..9672b4cf498 100644
--- a/arch/x86_64/include/intel64/io.h
+++ b/arch/x86_64/include/intel64/io.h
@@ -179,7 +179,9 @@ static inline void up_invalid_tlb(uintptr_t start, 
uintptr_t end)
 
   for (i = start; i < end; i += PAGE_SIZE)
     {
-      __asm__ volatile ("invlpg %0;":: "m"(i):"memory");
+      /* The operand of invlpg is the address to invalidate */
+
+      __asm__ volatile ("invlpg (%0)" :: "r"(i) : "memory");
     }
 }
 

Reply via email to