Commit 4d675181 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'x86-mm-2023-06-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 mm updates from Ingo Molnar:

 - Remove Xen-PV leftovers from init_32.c

 - Fix __swp_entry_to_pte() warning splat for Xen PV guests, triggered
   on CONFIG_DEBUG_VM_PGTABLE=y

* tag 'x86-mm-2023-06-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/mm: Remove Xen-PV leftovers from init_32.c
  x86/mm: Fix __swp_entry_to_pte() for Xen PV guests
parents a193cc75 78841cd1
...@@ -237,8 +237,8 @@ static inline void native_pgd_clear(pgd_t *pgd) ...@@ -237,8 +237,8 @@ static inline void native_pgd_clear(pgd_t *pgd)
#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val((pte)) }) #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val((pte)) })
#define __pmd_to_swp_entry(pmd) ((swp_entry_t) { pmd_val((pmd)) }) #define __pmd_to_swp_entry(pmd) ((swp_entry_t) { pmd_val((pmd)) })
#define __swp_entry_to_pte(x) ((pte_t) { .pte = (x).val }) #define __swp_entry_to_pte(x) (__pte((x).val))
#define __swp_entry_to_pmd(x) ((pmd_t) { .pmd = (x).val }) #define __swp_entry_to_pmd(x) (__pmd((x).val))
extern void cleanup_highmap(void); extern void cleanup_highmap(void);
......
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
#include <asm/olpc_ofw.h> #include <asm/olpc_ofw.h>
#include <asm/pgalloc.h> #include <asm/pgalloc.h>
#include <asm/sections.h> #include <asm/sections.h>
#include <asm/paravirt.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/set_memory.h> #include <asm/set_memory.h>
#include <asm/page_types.h> #include <asm/page_types.h>
...@@ -74,7 +73,6 @@ static pmd_t * __init one_md_table_init(pgd_t *pgd) ...@@ -74,7 +73,6 @@ static pmd_t * __init one_md_table_init(pgd_t *pgd)
#ifdef CONFIG_X86_PAE #ifdef CONFIG_X86_PAE
if (!(pgd_val(*pgd) & _PAGE_PRESENT)) { if (!(pgd_val(*pgd) & _PAGE_PRESENT)) {
pmd_table = (pmd_t *)alloc_low_page(); pmd_table = (pmd_t *)alloc_low_page();
paravirt_alloc_pmd(&init_mm, __pa(pmd_table) >> PAGE_SHIFT);
set_pgd(pgd, __pgd(__pa(pmd_table) | _PAGE_PRESENT)); set_pgd(pgd, __pgd(__pa(pmd_table) | _PAGE_PRESENT));
p4d = p4d_offset(pgd, 0); p4d = p4d_offset(pgd, 0);
pud = pud_offset(p4d, 0); pud = pud_offset(p4d, 0);
...@@ -99,7 +97,6 @@ static pte_t * __init one_page_table_init(pmd_t *pmd) ...@@ -99,7 +97,6 @@ static pte_t * __init one_page_table_init(pmd_t *pmd)
if (!(pmd_val(*pmd) & _PAGE_PRESENT)) { if (!(pmd_val(*pmd) & _PAGE_PRESENT)) {
pte_t *page_table = (pte_t *)alloc_low_page(); pte_t *page_table = (pte_t *)alloc_low_page();
paravirt_alloc_pte(&init_mm, __pa(page_table) >> PAGE_SHIFT);
set_pmd(pmd, __pmd(__pa(page_table) | _PAGE_TABLE)); set_pmd(pmd, __pmd(__pa(page_table) | _PAGE_TABLE));
BUG_ON(page_table != pte_offset_kernel(pmd, 0)); BUG_ON(page_table != pte_offset_kernel(pmd, 0));
} }
...@@ -181,12 +178,10 @@ static pte_t *__init page_table_kmap_check(pte_t *pte, pmd_t *pmd, ...@@ -181,12 +178,10 @@ static pte_t *__init page_table_kmap_check(pte_t *pte, pmd_t *pmd,
set_pte(newpte + i, pte[i]); set_pte(newpte + i, pte[i]);
*adr = (void *)(((unsigned long)(*adr)) + PAGE_SIZE); *adr = (void *)(((unsigned long)(*adr)) + PAGE_SIZE);
paravirt_alloc_pte(&init_mm, __pa(newpte) >> PAGE_SHIFT);
set_pmd(pmd, __pmd(__pa(newpte)|_PAGE_TABLE)); set_pmd(pmd, __pmd(__pa(newpte)|_PAGE_TABLE));
BUG_ON(newpte != pte_offset_kernel(pmd, 0)); BUG_ON(newpte != pte_offset_kernel(pmd, 0));
__flush_tlb_all(); __flush_tlb_all();
paravirt_release_pte(__pa(pte) >> PAGE_SHIFT);
pte = newpte; pte = newpte;
} }
BUG_ON(vaddr < fix_to_virt(FIX_KMAP_BEGIN - 1) BUG_ON(vaddr < fix_to_virt(FIX_KMAP_BEGIN - 1)
...@@ -482,7 +477,6 @@ void __init native_pagetable_init(void) ...@@ -482,7 +477,6 @@ void __init native_pagetable_init(void)
pfn, pmd, __pa(pmd), pte, __pa(pte)); pfn, pmd, __pa(pmd), pte, __pa(pte));
pte_clear(NULL, va, pte); pte_clear(NULL, va, pte);
} }
paravirt_alloc_pmd(&init_mm, __pa(base) >> PAGE_SHIFT);
paging_init(); paging_init();
} }
...@@ -491,15 +485,8 @@ void __init native_pagetable_init(void) ...@@ -491,15 +485,8 @@ void __init native_pagetable_init(void)
* point, we've been running on some set of pagetables constructed by * point, we've been running on some set of pagetables constructed by
* the boot process. * the boot process.
* *
* If we're booting on native hardware, this will be a pagetable * This will be a pagetable constructed in arch/x86/kernel/head_32.S.
* constructed in arch/x86/kernel/head_32.S. The root of the * The root of the pagetable will be swapper_pg_dir.
* pagetable will be swapper_pg_dir.
*
* If we're booting paravirtualized under a hypervisor, then there are
* more options: we may already be running PAE, and the pagetable may
* or may not be based in swapper_pg_dir. In any case,
* paravirt_pagetable_init() will set up swapper_pg_dir
* appropriately for the rest of the initialization to work.
* *
* In general, pagetable_init() assumes that the pagetable may already * In general, pagetable_init() assumes that the pagetable may already
* be partially populated, and so it avoids stomping on any existing * be partially populated, and so it avoids stomping on any existing
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment