From 96afdad6f40454a7a5de4c7941c7d48356308cd9 Mon Sep 17 00:00:00 2001 From: Alexander Kuleshov Date: Tue, 12 Sep 2017 00:49:33 +0600 Subject: [PATCH] mm/fixmaps: read_cr3() was splited on __read_cr3() and read_cr3_pa() --- mm/linux-mm-2.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/linux-mm-2.md b/mm/linux-mm-2.md index 2aa335c..fd32c32 100644 --- a/mm/linux-mm-2.md +++ b/mm/linux-mm-2.md @@ -317,7 +317,7 @@ static unsigned long slot_virt[FIX_BTMAPS_SLOTS] __initdata; ```C static inline pmd_t * __init early_ioremap_pmd(unsigned long addr) { - pgd_t *base = __va(read_cr3()); + pgd_t *base = __va(read_cr3_pa()); pgd_t *pgd = &base[pgd_index(addr)]; pud_t *pud = pud_offset(pgd, addr); pmd_t *pmd = pmd_offset(pud, addr); @@ -477,7 +477,7 @@ static inline void __flush_tlb_one(unsigned long addr) The `__flush_tlb_one` function invalidates the given address in the [TLB](http://en.wikipedia.org/wiki/Translation_lookaside_buffer). As you just saw we updated the paging structure, but `TLB` is not informed of the changes, that's why we need to do it manually. There are two ways to do it. The first is to update the `cr3` control register and the `__flush_tlb` function does this: ```C -native_write_cr3(native_read_cr3()); +native_write_cr3(__native_read_cr3()); ``` The second method is to use the `invlpg` instruction to invalidate the `TLB` entry. Let's look at the `__flush_tlb_one` implementation. As you can see, first of all the function checks `cpu_has_invlpg` which is defined as: