diff --git a/hermit/arch/x86/include/asm/processor.h b/hermit/arch/x86/include/asm/processor.h index fbe6650c5..8d73be3ee 100644 --- a/hermit/arch/x86/include/asm/processor.h +++ b/hermit/arch/x86/include/asm/processor.h @@ -584,7 +584,7 @@ int ipi_tlb_flush(void); * * Just reads cr3 and writes the same value back into it. */ -static inline void tlb_flush(void) +static inline void tlb_flush(uint8_t with_ipi) { size_t val = read_cr3(); @@ -592,19 +592,21 @@ static inline void tlb_flush(void) write_cr3(val); #if MAX_CORES > 1 - ipi_tlb_flush(); + if (with_ipi) + ipi_tlb_flush(); #endif } /** @brief Flush a specific page entry in TLB * @param addr The (virtual) address of the page to flush */ -static inline void tlb_flush_one_page(size_t addr) +static inline void tlb_flush_one_page(size_t addr, uint8_t with_ipi) { asm volatile("invlpg (%0)" : : "r"(addr) : "memory"); #if MAX_CORES > 1 - ipi_tlb_flush(); + if (with_ipi) + ipi_tlb_flush(); #endif } diff --git a/hermit/arch/x86/mm/page.c b/hermit/arch/x86/mm/page.c index b119ab029..98bf098a5 100644 --- a/hermit/arch/x86/mm/page.c +++ b/hermit/arch/x86/mm/page.c @@ -109,6 +109,7 @@ int page_map(size_t viraddr, size_t phyaddr, size_t npages, size_t bits) int lvl, ret = -ENOMEM; long vpn = viraddr >> PAGE_BITS; long first[PAGE_LEVELS], last[PAGE_LEVELS]; + int8_t send_ipi = 0; /* Calculate index boundaries for page map traversal */ for (lvl=0; lvl>PAGE_BITS; for (vpn=start; vpn