* Re: git pull: x86 header unification
[not found] <498CCFB5.3000706@goop.org>
@ 2009-02-09 10:22 ` Ingo Molnar
2009-02-09 10:33 ` [PATCH] x86: early_printk.c - fix pgtable.h unification fallout Ingo Molnar
0 siblings, 1 reply; 5+ messages in thread
From: Ingo Molnar @ 2009-02-09 10:22 UTC (permalink / raw)
To: Jeremy Fitzhardinge; +Cc: the arch/x86 maintainers, linux-kernel
(Cc:-ed lkml)
* Jeremy Fitzhardinge <jeremy@goop.org> wrote:
> The following changes since commit 45c82b5a770be66845687a7d027c8b52946d59af:
> Linus Torvalds (1):
> Merge branch 'header-fixes-for-linus' of git://git.kernel.org/.../tip/linux-2.6-tip
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git jsgf/x86/unify
>
> Thanks,
> J
>
> Jeremy Fitzhardinge (36):
> x86: unify pte_none
> x86: unify pte_same
> x86: unify pte_present
> x86: unify pud_present
> x86: unify pgd_present
> x86: unify pmd_present
> x86: unify pmd_none
> x86: unify pgd_page_vaddr
> x86: unify pud_page_vaddr
> x86: include pgtable_SIZE.h earlier
> x86: unify pud_page
> x86: unify pgd_page
> x86: unify pud_index
> x86: unify pud_offset
> x86: unify pmd_page_vaddr
> x86: unify pmd_page
> x86: unify pmd_index
> x86: unify pmd_offset
> x86: remove redundant pfn_pmd definition
> x86: unify pmd_pfn
> x86: unify pmd_pfn
> x86: unify pte_index
> x86: unify pte_offset_kernel
> x86: unify pud_large
> x86: unify pgd_bad
> x86: unify pgd_bad
> x86: unify pmd_bad
> x86: unify pages_to_mb
> x86: unify pud_none
> x86: unify pgd_none
> x86: unify io_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 in arch/x86/kernel/early_printk.c
>
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] x86: early_printk.c - fix pgtable.h unification fallout
2009-02-09 10:22 ` git pull: x86 header unification Ingo Molnar
@ 2009-02-09 10:33 ` Ingo Molnar
2009-02-09 10:44 ` [PATCH] x86, pgtable.h: macro-ify *_page() methods Ingo Molnar
0 siblings, 1 reply; 5+ messages in thread
From: Ingo Molnar @ 2009-02-09 10:33 UTC (permalink / raw)
To: Jeremy Fitzhardinge; +Cc: the arch/x86 maintainers, linux-kernel
* Ingo Molnar <mingo@elte.hu> wrote:
> Pulled into tip/x86/headers, thanks Jeremy!
>
> I'll keep watching out for any build fallout.
One small fixlet is below.
Ingo
---------->
>From 726c0d95b6bd06cb83efd36a76ccf03fa9a770f0 Mon Sep 17 00:00:00 2001
From: Ingo Molnar <mingo@elte.hu>
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.)
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/kernel/early_printk.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c
index 6a36dd2..639ad98 100644
--- a/arch/x86/kernel/early_printk.c
+++ b/arch/x86/kernel/early_printk.c
@@ -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 */
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] x86, pgtable.h: macro-ify *_page() methods
2009-02-09 10:33 ` [PATCH] x86: early_printk.c - fix pgtable.h unification fallout Ingo Molnar
@ 2009-02-09 10:44 ` Ingo Molnar
2009-02-09 11:00 ` [PATCH] x86, pgtable.h: fix 2-level 32-bit build Ingo Molnar
0 siblings, 1 reply; 5+ messages in thread
From: Ingo Molnar @ 2009-02-09 10:44 UTC (permalink / raw)
To: Jeremy Fitzhardinge, Andrew Morton; +Cc: the arch/x86 maintainers, linux-kernel
Another header-spaghetti fallout is below.
The mmzone.h dependency looks quite ugly.
Ingo
--------------->
>From e5f7f202f31fd05e9de7e1ba5a7b30de7855f5aa Mon Sep 17 00:00:00 2001
From: Ingo Molnar <mingo@elte.hu>
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.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/pgtable.h | 27 +++++++++++++++------------
1 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index a80a956..76696e9 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -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)
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] x86, pgtable.h: fix 2-level 32-bit build
2009-02-09 10:44 ` [PATCH] x86, pgtable.h: macro-ify *_page() methods Ingo Molnar
@ 2009-02-09 11:00 ` Ingo Molnar
2009-02-09 17:25 ` Jeremy Fitzhardinge
0 siblings, 1 reply; 5+ messages in thread
From: Ingo Molnar @ 2009-02-09 11:00 UTC (permalink / raw)
To: Jeremy Fitzhardinge, Andrew Morton; +Cc: the arch/x86 maintainers, linux-kernel
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
----------->
>From c47c1b1f3a9d6973108020df1dcab7604f7774dd Mon Sep 17 00:00:00 2001
From: Ingo Molnar <mingo@elte.hu>
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
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/page.h | 9 +++++----
arch/x86/include/asm/pgtable.h | 9 +++++++++
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/arch/x86/include/asm/page.h b/arch/x86/include/asm/page.h
index 0b16b64..823cc93 100644
--- a/arch/x86/include/asm/page.h
+++ b/arch/x86/include/asm/page.h
@@ -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 };
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 76696e9..1782053 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -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)
{
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] x86, pgtable.h: fix 2-level 32-bit build
2009-02-09 11:00 ` [PATCH] x86, pgtable.h: fix 2-level 32-bit build Ingo Molnar
@ 2009-02-09 17:25 ` Jeremy Fitzhardinge
0 siblings, 0 replies; 5+ messages in thread
From: Jeremy Fitzhardinge @ 2009-02-09 17:25 UTC (permalink / raw)
To: Ingo Molnar; +Cc: Andrew Morton, the arch/x86 maintainers, linux-kernel
Ingo Molnar wrote:
> 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.
>
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-02-09 17:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <498CCFB5.3000706@goop.org>
2009-02-09 10:22 ` git pull: x86 header unification Ingo Molnar
2009-02-09 10:33 ` [PATCH] x86: early_printk.c - fix pgtable.h unification fallout Ingo Molnar
2009-02-09 10:44 ` [PATCH] x86, pgtable.h: macro-ify *_page() methods Ingo Molnar
2009-02-09 11:00 ` [PATCH] x86, pgtable.h: fix 2-level 32-bit build Ingo Molnar
2009-02-09 17:25 ` Jeremy Fitzhardinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox