git pull: x86 header unification
(Cc:-ed lkml)
Quoted 49 lines · Jeremy Fitzhardinge
The following changes since commit
45c82b5a770be66845687a7d027c8b52946d59af:
Linus Torvalds (1):Merge branch 'header-fixes-for-linus' of git://git.kernel.org/.../tip/linux-2.6-tipare available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.gitjsgf/x86/unifyThanks,
JJeremy Fitzhardinge (36):
x86: unifypte_none
x86: unifypte_same
x86: unifypte_present
x86: unifypud_present
x86: unifypgd_present
x86: unifypmd_present
x86: unifypmd_none
x86: unifypgd_page_vaddr
x86: unifypud_page_vaddr
x86: includepgtable_SIZE.hearlier
x86: unifypud_page
x86: unifypgd_page
x86: unifypud_index
x86: unifypud_offset
x86: unifypmd_page_vaddr
x86: unifypmd_page
x86: unifypmd_index
x86: unifypmd_offset
x86: remove redundantpfn_pmddefinition
x86: unifypmd_pfn
x86: unifypmd_pfn
x86: unifypte_index
x86: unifypte_offset_kernel
x86: unifypud_large
x86: unifypgd_bad
x86: unifypgd_bad
x86: unifypmd_bad
x86: unifypages_to_mb
x86: unifypud_none
x86: unifypgd_none
x86: unifyio_remap_pfn_range
x86: add and use pgd/pud/pmd_flags
x86: make pgd/pud/pmd/pte_none consistent
x86:asm/io.h: unify virt_to_phys/phys_to_virt
x86:asm/io.h: unify ioremap prototypes
x86: Fix compile error inarch/x86/kernel/early_printk.c
Quoted 11 lines
arch/x86/include/asm/io.h | 90 +++++++++++++++++ arch/x86/include/asm/io_32.h | 86 ---------------- arch/x86/include/asm/io_64.h | 59 ----------- arch/x86/include/asm/page.h | 15 +++ arch/x86/include/asm/pgtable-2level.h | 2 - arch/x86/include/asm/pgtable-3level.h | 35 ------- arch/x86/include/asm/pgtable.h | 176 ++++++++++++++++++++++++++++++++- arch/x86/include/asm/pgtable_32.h | 46 --------- arch/x86/include/asm/pgtable_64.h | 64 ------------ arch/x86/kernel/early_printk.c | 1 - 10 files changed, 280 insertions(+), 294 deletions(-)
Pulled into tip/x86/headers, thanks Jeremy!
I'll keep watching out for any build fallout.
Ingo
PATCH 1/1 x86: early_printk.c - fix pgtable.h unification fallout
Quoted 3 lines · Ingo Molnar
Pulled into tip/x86/headers, thanks Jeremy!
I'll keep watching out for any build fallout.
One small fixlet is below.
Ingo
---------->
Quoted 1 line
From
726c0d95b6bd06cb83efd36a76ccf03fa9a770f0Mon Sep 17 00:00:00 2001
From: Ingo Molnar <[email protected]>
Date: Mon, 9 Feb 2009 11:32:17 +0100
Subject: [PATCH] x86: early_printk.c - fix pgtable.h unification fallout
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
arch/x86/kernel/early_printk.c: In function ‘early_dbgp_init’:
arch/x86/kernel/early_printk.c:827: error: ‘PAGE_KERNEL_NOCACHE’ undeclared (first use in this function) arch/x86/kernel/early_printk.c:827: error: (Each undeclared identifier is reported only once arch/x86/kernel/early_printk.c:827: error: for each function it appears in.)
--- arch/x86/kernel/early_printk.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/x86/kernel/early_printk.c +1 -0
@@ -14,6 +14,7 @@#include <xen/hvc-console.h> #include <asm/pci-direct.h> #include <asm/fixmap.h> +#include <asm/pgtable.h> #include <linux/usb/ehci_def.h> /* Simple VGA output */
PATCH 1/1 x86, pgtable.h: macro-ify *_page() methods
Another header-spaghetti fallout is below.
The mmzone.h dependency looks quite ugly.
Ingo
--------------->
Quoted 1 line
From
e5f7f202f31fd05e9de7e1ba5a7b30de7855f5aaMon Sep 17 00:00:00 2001
From: Ingo Molnar <[email protected]>
Date: Mon, 9 Feb 2009 11:42:57 +0100
Subject: [PATCH] x86, pgtable.h: macro-ify *_page() methods
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
The p?d_page() methods still rely on highlevel types and methods:
In file included from arch/x86/kernel/early_printk.c:18:/home/mingo/tip/arch/x86/include/asm/pgtable.h: In function ‘pmd_page’:/home/mingo/tip/arch/x86/include/asm/pgtable.h:516: error: implicit declaration of function â__pfn_to_sectionâ /home/mingo/tip/arch/x86/include/asm/pgtable.h:516: error: initialization makes pointer from integer without a cast /home/mingo/tip/arch/x86/include/asm/pgtable.h:516: error: implicit declaration of function ‘__section_mem_map_addr’ /home/mingo/tip/arch/x86/include/asm/pgtable.h:516: error: return makes pointer from integer without a cast
So convert them to macros and document the type dependency.
--- arch/x86/include/asm/pgtable.h | 27 +++++++++++++++------------ 1 files changed, 15 insertions(+), 12 deletions(-)
arch/x86/include/asm/pgtable.h +15 -12
@@ -473,10 +473,11 @@ static inline unsigned long pmd_page_vaddr(pmd_t pmd)return (unsigned long )__va (pmd_val (pmd) &PTE_PFN_MASK ); } -static inline struct page *pmd_page (pmd_t pmd) -{ -return pfn_to_page (pmd_val (pmd) >>PAGE_SHIFT ); -} +/* +* Currently stuck as a macro due to indirect forward reference to +* linux/mmzone.h's __section_mem_map_addr() definition: +*/ +#define pmd_page (pmd) pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)/* * the pmd page can be thought of an array like this: pmd_t[PTRS_PER_PMD]
@@ -543,10 +544,11 @@ static inline unsigned long pud_page_vaddr(pud_t pud)return (unsigned long )__va ((unsigned long )pud_val (pud) &PTE_PFN_MASK ); } -static inline struct page *pud_page (pud_t pud) -{ -return pfn_to_page (pud_val (pud) >>PAGE_SHIFT ); -} +/* +* Currently stuck as a macro due to indirect forward reference to +* linux/mmzone.h's __section_mem_map_addr() definition: +*/ +#define pud_page (pud) pfn_to_page(pud_val(pud) >> PAGE_SHIFT)/* Find an entry in the second-level page table.. */ static inline pmd_t *pmd_offset (pud_t *pud,unsigned long address)
@@ -582,10 +584,11 @@ static inline unsigned long pgd_page_vaddr(pgd_t pgd)return (unsigned long )__va ((unsigned long )pgd_val (pgd) &PTE_PFN_MASK ); } -static inline struct page *pgd_page (pgd_t pgd) -{ -return pfn_to_page (pgd_val (pgd) >>PAGE_SHIFT ); -} +/* +* Currently stuck as a macro due to indirect forward reference to +* linux/mmzone.h's __section_mem_map_addr() definition: +*/ +#define pgd_page (pgd) pfn_to_page(pgd_val(pgd) >> PAGE_SHIFT)/* to find an entry in a page-table-directory. */ static inline unsigned pud_index (unsigned long address)
PATCH 1/1 x86, pgtable.h: fix 2-level 32-bit build
Please double check the fix below.
Regarding the page.h include - maybe we should introduce asm/page_types.h just for the bare essentials? OTOH ... x86 asm/page.h already seems bare essentials.
Regarding types, each include file should be self-sufficient.
Ingo
----------->
Quoted 1 line
From
c47c1b1f3a9d6973108020df1dcab7604f7774ddMon Sep 17 00:00:00 2001
From: Ingo Molnar <[email protected]>
Date: Mon, 9 Feb 2009 11:57:45 +0100
Subject: [PATCH] x86, pgtable.h: fix 2-level 32-bit build
- pmd_flags() needs to be available on 2-levels too
- provide pud_large() wrapper as well
- include page.h - it provides basic types relied on by pgtable.h
--- arch/x86/include/asm/page.h | 9 +++++---- arch/x86/include/asm/pgtable.h | 9 +++++++++ 2 files changed, 14 insertions(+), 4 deletions(-)
arch/x86/include/asm/page.h +5 -4
@@ -139,10 +139,6 @@ static inline pmdval_t native_pmd_val(pmd_t pmd) return pmd.pmd; } -static inline pmdval_t pmd_flags (pmd_t pmd) -{ -return native_pmd_val (pmd) &PTE_FLAGS_MASK ; -}#else /* PAGETABLE_LEVELS == 2 */ #include <asm-generic/pgtable-nopmd.h>
@@ -152,6 +148,11 @@ static inline pmdval_t native_pmd_val(pmd_t pmd) }#endif /* PAGETABLE_LEVELS >= 3 */ +static inline pmdval_t pmd_flags (pmd_t pmd) +{ +return native_pmd_val (pmd) &PTE_FLAGS_MASK ; +} +static inline pte_t native_make_pte (pteval_t val) {return (pte_t ) { .pte = val };
arch/x86/include/asm/pgtable.h +9 -0
@@ -1,6 +1,8 @@#ifndef _ASM_X86_PGTABLE_H#define _ASM_X86_PGTABLE_H +#include <asm/page.h> +#define FIRST_USER_ADDRESS 0#define _PAGE_BIT_PRESENT 0/* is present */
@@ -528,6 +530,13 @@ static inline unsigned long pages_to_mb(unsigned long npg)#define io_remap_pfn_range (vma, vaddr, pfn, size, prot) \ remap_pfn_range(vma, vaddr, pfn, size, prot) +#if PAGETABLE_LEVELS ==2 +static inline int pud_large (pud_t pud) +{ +return 0 ; +} +#endif +#if PAGETABLE_LEVELS >2 static inline int pud_none (pud_t pud) {
Re: [PATCH] x86, pgtable.h: fix 2-level 32-bit build
Quoted 6 lines · Ingo Molnar
Please double check the fix below.
Regarding the
page.hinclude - maybe we should introduceasm/page_types.hjust for the bare essentials? OTOH ... x86asm/page.halready seems bare essentials.Regarding types, each include file should be self-sufficient.
I did some more work on this last night, resulting in the series below. It introduces a series of *-defs.h headers which define constants and very simple inlines without any complex external dependencies (they depend on either other asm/*-defs.h headers, or basic common headers like linux/types.h).
The following changes since commit fd95fb02f7ac3c96f2a8db4a8f0a04fdc4db5731:
Jeremy Fitzhardinge (1):
Include linux/mmzone to avoid cyclic dependency
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git x86/untangle
Jeremy Fitzhardinge (9):
Revert "Include linux/mmzone to avoid cyclic dependency" Split pgtable.h into pgtable-defs.h and pgtable.h
Split pgtable_32.h into pgtable_32.h and pgtable_32-defs.h Split pgtable_64.h into pgtable_64-defs.h and pgtable_64.h Include pgtable_32|64-defs.h in pgtable-defs.h
create -defs.h counterparts for page*.h
x86: move 2 and 3 level asm-generic defs into page-defs
x86: move defs around to allow paravirt.h to just include page-defs.h define pud_flags and pud_large properly to allow non-PAE builds
arch/x86/include/asm/page-defs.h | 155 ++++++++++++++++++++++ arch/x86/include/asm/page.h | 145 +-------------------- arch/x86/include/asm/page_32-defs.h | 92 +++++++++++++ arch/x86/include/asm/page_32.h | 89 +------------ arch/x86/include/asm/page_64-defs.h | 105 +++++++++++++++ arch/x86/include/asm/page_64.h | 101 +-------------- arch/x86/include/asm/paravirt.h | 2 +- arch/x86/include/asm/pgtable-defs.h | 226 ++++++++++++++++++++++++++++++++ arch/x86/include/asm/pgtable.h | 223 +------------------------------ arch/x86/include/asm/pgtable_32-defs.h | 46 +++++++ arch/x86/include/asm/pgtable_32.h | 42 +------ arch/x86/include/asm/pgtable_64-defs.h | 46 +++++++ arch/x86/include/asm/pgtable_64.h | 48 +------- drivers/char/hvc_xen.c | 1 - 14 files changed, 686 insertions(+), 635 deletions(-)
create mode 100644 arch/x86/include/asm/page-defs.h create mode 100644 arch/x86/include/asm/page_32-defs.h create mode 100644 arch/x86/include/asm/page_64-defs.h create mode 100644 arch/x86/include/asm/pgtable-defs.h create mode 100644 arch/x86/include/asm/pgtable_32-defs.h create mode 100644 arch/x86/include/asm/pgtable_64-defs.h
J