From aeab719a2ff25085b9f920b3f2262da7c4f4ed79 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Sun, 7 Aug 2016 20:28:10 +0200 Subject: [PATCH] reactivate IPI for a TLB shootdown - required if an existing mapping (virtual addr -> physical addr) changed --- hermit/arch/x86/include/asm/processor.h | 10 +--------- hermit/arch/x86/kernel/apic.c | 23 +++++++++-------------- 2 files changed, 10 insertions(+), 23 deletions(-) diff --git a/hermit/arch/x86/include/asm/processor.h b/hermit/arch/x86/include/asm/processor.h index 7f5db2eb9..fbe6650c5 100644 --- a/hermit/arch/x86/include/asm/processor.h +++ b/hermit/arch/x86/include/asm/processor.h @@ -577,19 +577,15 @@ inline static void invalidate_cache(void) { asm volatile ("invd" ::: "memory"); } -#if 0 /// Send IPIs to the other core, which flush the TLB on the other cores. int ipi_tlb_flush(void); -#endif /** @brief Flush Translation Lookaside Buffer * * Just reads cr3 and writes the same value back into it. */ -static inline void flush_tlb(void) +static inline void tlb_flush(void) { -/* single-address space OS => no TLB flush required */ -#if 0 size_t val = read_cr3(); if (val) @@ -598,7 +594,6 @@ static inline void flush_tlb(void) #if MAX_CORES > 1 ipi_tlb_flush(); #endif -#endif } /** @brief Flush a specific page entry in TLB @@ -606,14 +601,11 @@ static inline void flush_tlb(void) */ static inline void tlb_flush_one_page(size_t addr) { -/* single-address space OS => no TLB flush required */ -#if 0 asm volatile("invlpg (%0)" : : "r"(addr) : "memory"); #if MAX_CORES > 1 ipi_tlb_flush(); #endif -#endif } /** @brief Invalidate cache diff --git a/hermit/arch/x86/kernel/apic.c b/hermit/arch/x86/kernel/apic.c index ff9df9268..ae20d0440 100644 --- a/hermit/arch/x86/kernel/apic.c +++ b/hermit/arch/x86/kernel/apic.c @@ -851,27 +851,23 @@ int smp_start(void) return smp_main(); } -#if 0 int ipi_tlb_flush(void) { uint32_t id = CORE_ID; - uint32_t j; - uint64_t i; - uint8_t flags; if (atomic_int32_read(&cpu_online) == 1) return 0; if (has_x2apic()) { - flags = irq_nested_disable(); - for(i=0; i 1 - //irq_install_handler(80+32, apic_tlb_handler); + irq_install_handler(80+32, apic_tlb_handler); #endif irq_install_handler(81+32, apic_shutdown); irq_install_handler(124, apic_lint0);