Attilio Rao
2012-Aug-21 20:22 UTC
[PATCH v2 0/5] X86/XEN: Merge x86_init.paging.pagetable_setup_start and x86_init.paging.pagetable_setup_done setup functions and document its semantic
Currently the definition of x86_init.paging.pagetable_setup_start and x86_init.paging.pagetable_setup_done is twisted and not really well defined (in terms of prototypes desired). More specifically: pagetable_setup_start: * cleans up the boot time page table in the x86_32 case * it is a nop for the XEN case * it is a nop on x86_64 pagetable_setup_done: * it is a nop on x86_32 * sets up accessor functions for pagetable manipulation, for the XEN case * it is a nop on x86_64 Most of this logic can be skipped by creating a new setup function that can handle pagetable setup and pre/post operations on it. This means the above mentioned functions will be removed and only one will be used for the whole operation. The new function must be called only once, during boot-time setup and after the direct mapping for physical memory is available. Differences with v1: - The patch serie is re-arranged in a way that it helps reviews, following a plan by Thomas Gleixner - The PVOPS nomenclature is not used as it is not correct - The front-end message is adjusted with feedback by Thomas Gleixner, Stefano Stabellini and Konrad Rzeszutek Wilk Attilio Rao (5): X86/XEN: Remove the base argument from x86_init.paging.pagetable_setup_start X86/XEN: Rename pagetable_setup_start() setup functions into pagetable_init() X86/XEN: Allow setup function x86_init.paging.pagetable_init to setup kernel pagetables X86/XEN: Move content of xen_pagetable_setup_done() into xen_pagetable_init() and retire now unused x86_init.paging.pagetable_setup_done X86/XEN: Add few lines explaining simple semantic for x86_init.paging.pagetable_init setup function arch/x86/include/asm/pgtable_types.h | 6 ++---- arch/x86/include/asm/x86_init.h | 11 +++++++---- arch/x86/kernel/setup.c | 4 +--- arch/x86/kernel/x86_init.c | 4 +--- arch/x86/mm/init_32.c | 11 ++++------- arch/x86/xen/mmu.c | 18 +++++++----------- 6 files changed, 22 insertions(+), 32 deletions(-) -- 1.7.2.5
Attilio Rao
2012-Aug-21 20:22 UTC
[PATCH v2 1/5] X86/XEN: Remove the base argument from x86_init.paging.pagetable_setup_start
x86_init.paging.pagetable_setup_start for native will however use swapper_pg_dir in the single place where it is used and for native the argument is simply unused. Aditionally, the comments already point to swapper_pg_dir as the sole base touched. Finally, this will help with further merging of x86_init.paging.pagetable_setup_start with x86_init.paging.pagetable_setup_done. Signed-off-by: Attilio Rao <attilio.rao@citrix.com> --- arch/x86/include/asm/pgtable_types.h | 6 +++--- arch/x86/include/asm/x86_init.h | 2 +- arch/x86/kernel/setup.c | 2 +- arch/x86/kernel/x86_init.c | 3 ++- arch/x86/mm/init_32.c | 4 ++-- arch/x86/xen/mmu.c | 2 +- 6 files changed, 10 insertions(+), 9 deletions(-) diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h index 013286a..e02b875 100644 --- a/arch/x86/include/asm/pgtable_types.h +++ b/arch/x86/include/asm/pgtable_types.h @@ -303,11 +303,11 @@ void set_pte_vaddr(unsigned long vaddr, pte_t pte); extern void native_pagetable_reserve(u64 start, u64 end); #ifdef CONFIG_X86_32 -extern void native_pagetable_setup_start(pgd_t *base); +extern void native_pagetable_setup_start(void); extern void native_pagetable_setup_done(pgd_t *base); #else -#define native_pagetable_setup_start x86_init_pgd_noop -#define native_pagetable_setup_done x86_init_pgd_noop +#define native_pagetable_setup_start x86_init_pgd_start_noop +#define native_pagetable_setup_done x86_init_pgd_done_noop #endif struct seq_file; diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h index 38155f6..782ba0c 100644 --- a/arch/x86/include/asm/x86_init.h +++ b/arch/x86/include/asm/x86_init.h @@ -85,7 +85,7 @@ struct x86_init_mapping { * @pagetable_setup_done: platform specific post paging_init() call */ struct x86_init_paging { - void (*pagetable_setup_start)(pgd_t *base); + void (*pagetable_setup_start)(void); void (*pagetable_setup_done)(pgd_t *base); }; diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index f4b9b80..90cbbe0 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -961,7 +961,7 @@ void __init setup_arch(char **cmdline_p) kvmclock_init(); #endif - x86_init.paging.pagetable_setup_start(swapper_pg_dir); + x86_init.paging.pagetable_setup_start(); paging_init(); x86_init.paging.pagetable_setup_done(swapper_pg_dir); diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c index 9f3167e..3b88493 100644 --- a/arch/x86/kernel/x86_init.c +++ b/arch/x86/kernel/x86_init.c @@ -26,7 +26,8 @@ void __cpuinit x86_init_noop(void) { } void __init x86_init_uint_noop(unsigned int unused) { } -void __init x86_init_pgd_noop(pgd_t *unused) { } +void __init x86_init_pgd_start_noop(void) { } +void __init x86_init_pgd_done_noop(pgd_t *unused) { } int __init iommu_init_noop(void) { return 0; } void iommu_shutdown_noop(void) { } diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index 575d86f..c4aa1b2 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c @@ -445,10 +445,10 @@ static inline void permanent_kmaps_init(pgd_t *pgd_base) } #endif /* CONFIG_HIGHMEM */ -void __init native_pagetable_setup_start(pgd_t *base) +void __init native_pagetable_setup_start(void) { unsigned long pfn, va; - pgd_t *pgd; + pgd_t *pgd, *base = swapper_pg_dir; pud_t *pud; pmd_t *pmd; pte_t *pte; diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index b65a761..d89ea5c 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c @@ -1174,7 +1174,7 @@ static void xen_exit_mmap(struct mm_struct *mm) spin_unlock(&mm->page_table_lock); } -static void __init xen_pagetable_setup_start(pgd_t *base) +static void __init xen_pagetable_setup_start(void) { } -- 1.7.2.5
Attilio Rao
2012-Aug-21 20:22 UTC
[PATCH v2 2/5] X86/XEN: Rename pagetable_setup_start() setup functions into pagetable_init()
In preparation for unifying the pagetable_setup_start() and pagetable_setup_done() setup functions, rename appropriately all the infrastructure related to pagetable_setup_start(). Signed-off-by: Attilio Rao <attilio.rao@citrix.com> --- arch/x86/include/asm/pgtable_types.h | 4 ++-- arch/x86/include/asm/x86_init.h | 4 ++-- arch/x86/kernel/setup.c | 2 +- arch/x86/kernel/x86_init.c | 4 ++-- arch/x86/mm/init_32.c | 4 ++-- arch/x86/xen/mmu.c | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h index e02b875..0c01e07 100644 --- a/arch/x86/include/asm/pgtable_types.h +++ b/arch/x86/include/asm/pgtable_types.h @@ -303,10 +303,10 @@ void set_pte_vaddr(unsigned long vaddr, pte_t pte); extern void native_pagetable_reserve(u64 start, u64 end); #ifdef CONFIG_X86_32 -extern void native_pagetable_setup_start(void); +extern void native_pagetable_init(void); extern void native_pagetable_setup_done(pgd_t *base); #else -#define native_pagetable_setup_start x86_init_pgd_start_noop +#define native_pagetable_init x86_init_pgd_init_noop #define native_pagetable_setup_done x86_init_pgd_done_noop #endif diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h index 782ba0c..24084b2 100644 --- a/arch/x86/include/asm/x86_init.h +++ b/arch/x86/include/asm/x86_init.h @@ -81,11 +81,11 @@ struct x86_init_mapping { /** * struct x86_init_paging - platform specific paging functions - * @pagetable_setup_start: platform specific pre paging_init() call + * @pagetable_init: platform specific paging initialization call * @pagetable_setup_done: platform specific post paging_init() call */ struct x86_init_paging { - void (*pagetable_setup_start)(void); + void (*pagetable_init)(void); void (*pagetable_setup_done)(pgd_t *base); }; diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 90cbbe0..61b7d98 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -961,7 +961,7 @@ void __init setup_arch(char **cmdline_p) kvmclock_init(); #endif - x86_init.paging.pagetable_setup_start(); + x86_init.paging.pagetable_init(); paging_init(); x86_init.paging.pagetable_setup_done(swapper_pg_dir); diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c index 3b88493..0e1e950 100644 --- a/arch/x86/kernel/x86_init.c +++ b/arch/x86/kernel/x86_init.c @@ -26,7 +26,7 @@ void __cpuinit x86_init_noop(void) { } void __init x86_init_uint_noop(unsigned int unused) { } -void __init x86_init_pgd_start_noop(void) { } +void __init x86_init_pgd_init_noop(void) { } void __init x86_init_pgd_done_noop(pgd_t *unused) { } int __init iommu_init_noop(void) { return 0; } void iommu_shutdown_noop(void) { } @@ -69,7 +69,7 @@ struct x86_init_ops x86_init __initdata = { }, .paging = { - .pagetable_setup_start = native_pagetable_setup_start, + .pagetable_init = native_pagetable_init, .pagetable_setup_done = native_pagetable_setup_done, }, diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index c4aa1b2..0e38e0e 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c @@ -445,7 +445,7 @@ static inline void permanent_kmaps_init(pgd_t *pgd_base) } #endif /* CONFIG_HIGHMEM */ -void __init native_pagetable_setup_start(void) +void __init native_pagetable_init(void) { unsigned long pfn, va; pgd_t *pgd, *base = swapper_pg_dir; @@ -493,7 +493,7 @@ void __init native_pagetable_setup_done(pgd_t *base) * 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_setup_start() will set up swapper_pg_dir + * 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 diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index d89ea5c..ff1af97 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c @@ -1174,7 +1174,7 @@ static void xen_exit_mmap(struct mm_struct *mm) spin_unlock(&mm->page_table_lock); } -static void __init xen_pagetable_setup_start(void) +static void __init xen_pagetable_init(void) { } @@ -2068,7 +2068,7 @@ static const struct pv_mmu_ops xen_mmu_ops __initconst = { void __init xen_init_mmu_ops(void) { x86_init.mapping.pagetable_reserve = xen_mapping_pagetable_reserve; - x86_init.paging.pagetable_setup_start = xen_pagetable_setup_start; + x86_init.paging.pagetable_init = xen_pagetable_init; x86_init.paging.pagetable_setup_done = xen_pagetable_setup_done; pv_mmu_ops = xen_mmu_ops; -- 1.7.2.5
Attilio Rao
2012-Aug-21 20:22 UTC
[PATCH v2 3/5] X86/XEN: Allow setup function x86_init.paging.pagetable_init to setup kernel pagetables
Currently, x86_init.paging.pagetable_init relies on callers to setup the kernel pagetable. In order to unify the functionality of x86_init.paging.pagetable_setup_start and x86_init.paging.pagetable_setup_done allow the new setup function to perform the operation itself. Signed-off-by: Attilio Rao <attilio.rao@citrix.com> --- arch/x86/include/asm/pgtable_types.h | 2 +- arch/x86/kernel/setup.c | 1 - arch/x86/kernel/x86_init.c | 1 - arch/x86/mm/init_32.c | 1 + arch/x86/xen/mmu.c | 1 + 5 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h index 0c01e07..c93cb8e 100644 --- a/arch/x86/include/asm/pgtable_types.h +++ b/arch/x86/include/asm/pgtable_types.h @@ -306,7 +306,7 @@ extern void native_pagetable_reserve(u64 start, u64 end); extern void native_pagetable_init(void); extern void native_pagetable_setup_done(pgd_t *base); #else -#define native_pagetable_init x86_init_pgd_init_noop +#define native_pagetable_init paging_init #define native_pagetable_setup_done x86_init_pgd_done_noop #endif diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 61b7d98..315fd24 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -962,7 +962,6 @@ void __init setup_arch(char **cmdline_p) #endif x86_init.paging.pagetable_init(); - paging_init(); x86_init.paging.pagetable_setup_done(swapper_pg_dir); if (boot_cpu_data.cpuid_level >= 0) { diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c index 0e1e950..5f2478f 100644 --- a/arch/x86/kernel/x86_init.c +++ b/arch/x86/kernel/x86_init.c @@ -26,7 +26,6 @@ void __cpuinit x86_init_noop(void) { } void __init x86_init_uint_noop(unsigned int unused) { } -void __init x86_init_pgd_init_noop(void) { } void __init x86_init_pgd_done_noop(pgd_t *unused) { } int __init iommu_init_noop(void) { return 0; } void iommu_shutdown_noop(void) { } diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index 0e38e0e..e35b4b1 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c @@ -475,6 +475,7 @@ void __init native_pagetable_init(void) pte_clear(NULL, va, pte); } paravirt_alloc_pmd(&init_mm, __pa(base) >> PAGE_SHIFT); + paging_init(); } void __init native_pagetable_setup_done(pgd_t *base) diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index ff1af97..4f47b87 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c @@ -1176,6 +1176,7 @@ static void xen_exit_mmap(struct mm_struct *mm) static void __init xen_pagetable_init(void) { + paging_init(); } static __init void xen_mapping_pagetable_reserve(u64 start, u64 end) -- 1.7.2.5
Attilio Rao
2012-Aug-21 20:22 UTC
[PATCH v2 4/5] X86/XEN: Move content of xen_pagetable_setup_done() into xen_pagetable_init() and retire now unused x86_init.paging.pagetable_setup_done
At this stage x86_init.paging.pagetable_setup_done is only used in the XEN case. Move its content in the x86_init.paging.pagetable_init setup function and remove the now unused x86_init.paging.pagetable_setup_done remaining infrastructure. Signed-off-by: Attilio Rao <attilio.rao@citrix.com> --- arch/x86/include/asm/pgtable_types.h | 2 -- arch/x86/include/asm/x86_init.h | 2 -- arch/x86/kernel/setup.c | 1 - arch/x86/kernel/x86_init.c | 2 -- arch/x86/mm/init_32.c | 4 ---- arch/x86/xen/mmu.c | 13 ++++--------- 6 files changed, 4 insertions(+), 20 deletions(-) diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h index c93cb8e..db8fec6 100644 --- a/arch/x86/include/asm/pgtable_types.h +++ b/arch/x86/include/asm/pgtable_types.h @@ -304,10 +304,8 @@ void set_pte_vaddr(unsigned long vaddr, pte_t pte); extern void native_pagetable_reserve(u64 start, u64 end); #ifdef CONFIG_X86_32 extern void native_pagetable_init(void); -extern void native_pagetable_setup_done(pgd_t *base); #else #define native_pagetable_init paging_init -#define native_pagetable_setup_done x86_init_pgd_done_noop #endif struct seq_file; diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h index 24084b2..995ea5c 100644 --- a/arch/x86/include/asm/x86_init.h +++ b/arch/x86/include/asm/x86_init.h @@ -82,11 +82,9 @@ struct x86_init_mapping { /** * struct x86_init_paging - platform specific paging functions * @pagetable_init: platform specific paging initialization call - * @pagetable_setup_done: platform specific post paging_init() call */ struct x86_init_paging { void (*pagetable_init)(void); - void (*pagetable_setup_done)(pgd_t *base); }; /** diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 315fd24..4f16547 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -962,7 +962,6 @@ void __init setup_arch(char **cmdline_p) #endif x86_init.paging.pagetable_init(); - x86_init.paging.pagetable_setup_done(swapper_pg_dir); if (boot_cpu_data.cpuid_level >= 0) { /* A CPU has %cr4 if and only if it has CPUID */ diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c index 5f2478f..7a3d075 100644 --- a/arch/x86/kernel/x86_init.c +++ b/arch/x86/kernel/x86_init.c @@ -26,7 +26,6 @@ void __cpuinit x86_init_noop(void) { } void __init x86_init_uint_noop(unsigned int unused) { } -void __init x86_init_pgd_done_noop(pgd_t *unused) { } int __init iommu_init_noop(void) { return 0; } void iommu_shutdown_noop(void) { } @@ -69,7 +68,6 @@ struct x86_init_ops x86_init __initdata = { .paging = { .pagetable_init = native_pagetable_init, - .pagetable_setup_done = native_pagetable_setup_done, }, .timers = { diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index e35b4b1..4f04db1 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c @@ -478,10 +478,6 @@ void __init native_pagetable_init(void) paging_init(); } -void __init native_pagetable_setup_done(pgd_t *base) -{ -} - /* * Build a proper pagetable for the kernel mappings. Up until this * point, we''ve been running on some set of pagetables constructed by diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 4f47b87..4290d83 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c @@ -1174,9 +1174,13 @@ static void xen_exit_mmap(struct mm_struct *mm) spin_unlock(&mm->page_table_lock); } +static void xen_post_allocator_init(void); + static void __init xen_pagetable_init(void) { paging_init(); + xen_setup_shared_info(); + xen_post_allocator_init(); } static __init void xen_mapping_pagetable_reserve(u64 start, u64 end) @@ -1193,14 +1197,6 @@ static __init void xen_mapping_pagetable_reserve(u64 start, u64 end) } } -static void xen_post_allocator_init(void); - -static void __init xen_pagetable_setup_done(pgd_t *base) -{ - xen_setup_shared_info(); - xen_post_allocator_init(); -} - static void xen_write_cr2(unsigned long cr2) { this_cpu_read(xen_vcpu)->arch.cr2 = cr2; @@ -2070,7 +2066,6 @@ void __init xen_init_mmu_ops(void) { x86_init.mapping.pagetable_reserve = xen_mapping_pagetable_reserve; x86_init.paging.pagetable_init = xen_pagetable_init; - x86_init.paging.pagetable_setup_done = xen_pagetable_setup_done; pv_mmu_ops = xen_mmu_ops; memset(dummy_mapping, 0xff, PAGE_SIZE); -- 1.7.2.5
Attilio Rao
2012-Aug-21 20:22 UTC
[PATCH v2 5/5] X86/XEN: Add few lines explaining simple semantic for x86_init.paging.pagetable_init setup function
- Explain the purpose of the hook - Report execution constraints Signed-off-by: Attilio Rao <attilio.rao@citrix.com> --- arch/x86/include/asm/x86_init.h | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h index 995ea5c..7ea4186 100644 --- a/arch/x86/include/asm/x86_init.h +++ b/arch/x86/include/asm/x86_init.h @@ -82,6 +82,11 @@ struct x86_init_mapping { /** * struct x86_init_paging - platform specific paging functions * @pagetable_init: platform specific paging initialization call + * + * It does setup the kernel pagetables and prepares accessors functions to + * manipulate them. + * It must be called once, during the boot sequence and after the direct + * mapping for phys memory is setup. */ struct x86_init_paging { void (*pagetable_init)(void); -- 1.7.2.5
Thomas Gleixner
2012-Aug-21 21:22 UTC
Re: [PATCH v2 0/5] X86/XEN: Merge x86_init.paging.pagetable_setup_start and x86_init.paging.pagetable_setup_done setup functions and document its semantic
On Tue, 21 Aug 2012, Attilio Rao wrote:> Differences with v1: > - The patch serie is re-arranged in a way that it helps reviews, following > a plan by Thomas Gleixner > - The PVOPS nomenclature is not used as it is not correct > - The front-end message is adjusted with feedback by Thomas Gleixner, > Stefano Stabellini and Konrad Rzeszutek WilkThis is much simpler to read and review. Just have a look at the diffstats of the two series: 6 files changed, 9 insertions(+), 8 deletions(-) 6 files changed, 11 insertions(+), 9 deletions(-) 5 files changed, 50 insertions(+), 2 deletions(-) 6 files changed, 2 insertions(+), 65 deletions(-) 1 files changed, 5 insertions(+), 0 deletions(-) versus 6 files changed, 10 insertions(+), 9 deletions(-) 6 files changed, 11 insertions(+), 11 deletions(-) 5 files changed, 3 insertions(+), 3 deletions(-) 6 files changed, 4 insertions(+), 20 deletions(-) 1 files changed, 5 insertions(+), 0 deletions(-) The overall result is basically the same, but it''s way simpler to look at obvious and well done patches than checking whether a subtle copy and paste bug happened in 3/5 of the first version. Copy and paste is the #1 cause for subtle bugs. :) I''m waiting for the ack of Xen folks before taking it into tip. Thanks for following up! tglx
Stefano Stabellini
2012-Aug-22 10:30 UTC
Re: [PATCH v2 0/5] X86/XEN: Merge x86_init.paging.pagetable_setup_start and x86_init.paging.pagetable_setup_done setup functions and document its semantic
On Tue, 21 Aug 2012, Thomas Gleixner wrote:> On Tue, 21 Aug 2012, Attilio Rao wrote: > > Differences with v1: > > - The patch serie is re-arranged in a way that it helps reviews, following > > a plan by Thomas Gleixner > > - The PVOPS nomenclature is not used as it is not correct > > - The front-end message is adjusted with feedback by Thomas Gleixner, > > Stefano Stabellini and Konrad Rzeszutek Wilk > > This is much simpler to read and review. Just have a look at the > diffstats of the two series: > > 6 files changed, 9 insertions(+), 8 deletions(-) > 6 files changed, 11 insertions(+), 9 deletions(-) > 5 files changed, 50 insertions(+), 2 deletions(-) > 6 files changed, 2 insertions(+), 65 deletions(-) > 1 files changed, 5 insertions(+), 0 deletions(-) > > versus > > 6 files changed, 10 insertions(+), 9 deletions(-) > 6 files changed, 11 insertions(+), 11 deletions(-) > 5 files changed, 3 insertions(+), 3 deletions(-) > 6 files changed, 4 insertions(+), 20 deletions(-) > 1 files changed, 5 insertions(+), 0 deletions(-) > > The overall result is basically the same, but it''s way simpler to look > at obvious and well done patches than checking whether a subtle copy > and paste bug happened in 3/5 of the first version. Copy and paste is > the #1 cause for subtle bugs. :) > > I''m waiting for the ack of Xen folks before taking it into tip.They are OK by me. Konrad?
Konrad Rzeszutek Wilk
2012-Aug-22 13:57 UTC
Re: [PATCH v2 0/5] X86/XEN: Merge x86_init.paging.pagetable_setup_start and x86_init.paging.pagetable_setup_done setup functions and document its semantic
On Tue, Aug 21, 2012 at 11:22:03PM +0200, Thomas Gleixner wrote:> On Tue, 21 Aug 2012, Attilio Rao wrote: > > Differences with v1: > > - The patch serie is re-arranged in a way that it helps reviews, following > > a plan by Thomas Gleixner > > - The PVOPS nomenclature is not used as it is not correct > > - The front-end message is adjusted with feedback by Thomas Gleixner, > > Stefano Stabellini and Konrad Rzeszutek Wilk > > This is much simpler to read and review. Just have a look at the > diffstats of the two series: > > 6 files changed, 9 insertions(+), 8 deletions(-) > 6 files changed, 11 insertions(+), 9 deletions(-) > 5 files changed, 50 insertions(+), 2 deletions(-) > 6 files changed, 2 insertions(+), 65 deletions(-) > 1 files changed, 5 insertions(+), 0 deletions(-) > > versus > > 6 files changed, 10 insertions(+), 9 deletions(-) > 6 files changed, 11 insertions(+), 11 deletions(-) > 5 files changed, 3 insertions(+), 3 deletions(-) > 6 files changed, 4 insertions(+), 20 deletions(-) > 1 files changed, 5 insertions(+), 0 deletions(-) > > The overall result is basically the same, but it''s way simpler to look > at obvious and well done patches than checking whether a subtle copy > and paste bug happened in 3/5 of the first version. Copy and paste is > the #1 cause for subtle bugs. :) > > I''m waiting for the ack of Xen folks before taking it into tip.I''ve some extra patches that modify the new "paginig_init" in the Xen code that I am going to propose for v3.7 - so will have some merge conflicts. Let me figure that out and also run this set of patches (and also the previous one .. which I think you didn''t have a chance to look since you were on vacation?) on an overnight test to make sure there are no fallout. With the merge issues that are going to prop up (x86 tip tree and my tree in linux-next) should I just take these patches in my tree with your Ack? Or should I just ingest your tiptree in my tree and that way solve the merge issue? What''s your preference!> > Thanks for following up!Thank you for providing valuable feedback! Much appreciated.> > tglx
Thomas Gleixner
2012-Aug-22 14:19 UTC
Re: [PATCH v2 0/5] X86/XEN: Merge x86_init.paging.pagetable_setup_start and x86_init.paging.pagetable_setup_done setup functions and document its semantic
On Wed, 22 Aug 2012, Konrad Rzeszutek Wilk wrote:> On Tue, Aug 21, 2012 at 11:22:03PM +0200, Thomas Gleixner wrote: > > On Tue, 21 Aug 2012, Attilio Rao wrote: > > > Differences with v1: > > > - The patch serie is re-arranged in a way that it helps reviews, following > > > a plan by Thomas Gleixner > > > - The PVOPS nomenclature is not used as it is not correct > > > - The front-end message is adjusted with feedback by Thomas Gleixner, > > > Stefano Stabellini and Konrad Rzeszutek Wilk > > > > This is much simpler to read and review. Just have a look at the > > diffstats of the two series: > > > > 6 files changed, 9 insertions(+), 8 deletions(-) > > 6 files changed, 11 insertions(+), 9 deletions(-) > > 5 files changed, 50 insertions(+), 2 deletions(-) > > 6 files changed, 2 insertions(+), 65 deletions(-) > > 1 files changed, 5 insertions(+), 0 deletions(-) > > > > versus > > > > 6 files changed, 10 insertions(+), 9 deletions(-) > > 6 files changed, 11 insertions(+), 11 deletions(-) > > 5 files changed, 3 insertions(+), 3 deletions(-) > > 6 files changed, 4 insertions(+), 20 deletions(-) > > 1 files changed, 5 insertions(+), 0 deletions(-) > > > > The overall result is basically the same, but it''s way simpler to look > > at obvious and well done patches than checking whether a subtle copy > > and paste bug happened in 3/5 of the first version. Copy and paste is > > the #1 cause for subtle bugs. :) > > > > I''m waiting for the ack of Xen folks before taking it into tip. > > I''ve some extra patches that modify the new "paginig_init" in the Xen > code that I am going to propose for v3.7 - so will have some merge > conflicts. Let me figure that out and also run this set of patches > (and also the previous one .. which I think you didn''t have a > chance to look since you were on vacation?) on an overnightWhich previous one ?> test to make sure there are no fallout. > > With the merge issues that are going to prop up (x86 tip tree > and my tree in linux-next) should I just take these patches > in my tree with your Ack? Or should I just ingest your tiptree > in my tree and that way solve the merge issue? What''s your > preference!Having it in tip in an extra branch which you pull into your tree. That''s the easiest one. Thanks, tglx
Attilio Rao
2012-Aug-22 14:47 UTC
Re: [PATCH v2 0/5] X86/XEN: Merge x86_init.paging.pagetable_setup_start and x86_init.paging.pagetable_setup_done setup functions and document its semantic
On 22/08/12 15:19, Thomas Gleixner wrote:> On Wed, 22 Aug 2012, Konrad Rzeszutek Wilk wrote: > >> On Tue, Aug 21, 2012 at 11:22:03PM +0200, Thomas Gleixner wrote: >> >>> On Tue, 21 Aug 2012, Attilio Rao wrote: >>> >>>> Differences with v1: >>>> - The patch serie is re-arranged in a way that it helps reviews, following >>>> a plan by Thomas Gleixner >>>> - The PVOPS nomenclature is not used as it is not correct >>>> - The front-end message is adjusted with feedback by Thomas Gleixner, >>>> Stefano Stabellini and Konrad Rzeszutek Wilk >>>> >>> This is much simpler to read and review. Just have a look at the >>> diffstats of the two series: >>> >>> 6 files changed, 9 insertions(+), 8 deletions(-) >>> 6 files changed, 11 insertions(+), 9 deletions(-) >>> 5 files changed, 50 insertions(+), 2 deletions(-) >>> 6 files changed, 2 insertions(+), 65 deletions(-) >>> 1 files changed, 5 insertions(+), 0 deletions(-) >>> >>> versus >>> >>> 6 files changed, 10 insertions(+), 9 deletions(-) >>> 6 files changed, 11 insertions(+), 11 deletions(-) >>> 5 files changed, 3 insertions(+), 3 deletions(-) >>> 6 files changed, 4 insertions(+), 20 deletions(-) >>> 1 files changed, 5 insertions(+), 0 deletions(-) >>> >>> The overall result is basically the same, but it''s way simpler to look >>> at obvious and well done patches than checking whether a subtle copy >>> and paste bug happened in 3/5 of the first version. Copy and paste is >>> the #1 cause for subtle bugs. :) >>> >>> I''m waiting for the ack of Xen folks before taking it into tip. >>> >> I''ve some extra patches that modify the new "paginig_init" in the Xen >> code that I am going to propose for v3.7 - so will have some merge >> conflicts. Let me figure that out and also run this set of patches >> (and also the previous one .. which I think you didn''t have a >> chance to look since you were on vacation?) on an overnight >> > Which previous one ? >This one: https://lkml.org/lkml/2012/8/21/369 but I would like to repost the patch serie skipping the referral to PVOPS in the commit logs, I will do so right now, so please wait for another patch serie. Attilio
Attilio Rao
2012-Aug-23 09:28 UTC
Re: [Xen-devel] [PATCH v2 0/5] X86/XEN: Merge x86_init.paging.pagetable_setup_start and x86_init.paging.pagetable_setup_done setup functions and document its semantic
On 22/08/12 15:47, Attilio Rao wrote:> On 22/08/12 15:19, Thomas Gleixner wrote: > >> On Wed, 22 Aug 2012, Konrad Rzeszutek Wilk wrote: >> >> >>> On Tue, Aug 21, 2012 at 11:22:03PM +0200, Thomas Gleixner wrote: >>> >>> >>>> On Tue, 21 Aug 2012, Attilio Rao wrote: >>>> >>>> >>>>> Differences with v1: >>>>> - The patch serie is re-arranged in a way that it helps reviews, following >>>>> a plan by Thomas Gleixner >>>>> - The PVOPS nomenclature is not used as it is not correct >>>>> - The front-end message is adjusted with feedback by Thomas Gleixner, >>>>> Stefano Stabellini and Konrad Rzeszutek Wilk >>>>> >>>>> >>>> This is much simpler to read and review. Just have a look at the >>>> diffstats of the two series: >>>> >>>> 6 files changed, 9 insertions(+), 8 deletions(-) >>>> 6 files changed, 11 insertions(+), 9 deletions(-) >>>> 5 files changed, 50 insertions(+), 2 deletions(-) >>>> 6 files changed, 2 insertions(+), 65 deletions(-) >>>> 1 files changed, 5 insertions(+), 0 deletions(-) >>>> >>>> versus >>>> >>>> 6 files changed, 10 insertions(+), 9 deletions(-) >>>> 6 files changed, 11 insertions(+), 11 deletions(-) >>>> 5 files changed, 3 insertions(+), 3 deletions(-) >>>> 6 files changed, 4 insertions(+), 20 deletions(-) >>>> 1 files changed, 5 insertions(+), 0 deletions(-) >>>> >>>> The overall result is basically the same, but it''s way simpler to look >>>> at obvious and well done patches than checking whether a subtle copy >>>> and paste bug happened in 3/5 of the first version. Copy and paste is >>>> the #1 cause for subtle bugs. :) >>>> >>>> I''m waiting for the ack of Xen folks before taking it into tip. >>>> >>>> >>> I''ve some extra patches that modify the new "paginig_init" in the Xen >>> code that I am going to propose for v3.7 - so will have some merge >>> conflicts. Let me figure that out and also run this set of patches >>> (and also the previous one .. which I think you didn''t have a >>> chance to look since you were on vacation?) on an overnight >>> >>> >> Which previous one ? >> >> > This one: > https://lkml.org/lkml/2012/8/21/369 > > but I would like to repost the patch serie skipping the referral to > PVOPS in the commit logs, I will do so right now, so please wait for > another patch serie. >For your convenience: http://lkml.org/lkml/2012/8/22/450 Attilio
Konrad Rzeszutek Wilk
2012-Aug-23 13:50 UTC
Re: [Xen-devel] [PATCH v2 0/5] X86/XEN: Merge x86_init.paging.pagetable_setup_start and x86_init.paging.pagetable_setup_done setup functions and document its semantic
On Thu, Aug 23, 2012 at 10:28:29AM +0100, Attilio Rao wrote:> On 22/08/12 15:47, Attilio Rao wrote: > >On 22/08/12 15:19, Thomas Gleixner wrote: > >>On Wed, 22 Aug 2012, Konrad Rzeszutek Wilk wrote: > >> > >>>On Tue, Aug 21, 2012 at 11:22:03PM +0200, Thomas Gleixner wrote: > >>> > >>>>On Tue, 21 Aug 2012, Attilio Rao wrote: > >>>> > >>>>>Differences with v1: > >>>>>- The patch serie is re-arranged in a way that it helps reviews, following > >>>>> a plan by Thomas Gleixner > >>>>>- The PVOPS nomenclature is not used as it is not correct > >>>>>- The front-end message is adjusted with feedback by Thomas Gleixner, > >>>>> Stefano Stabellini and Konrad Rzeszutek Wilk > >>>>> > >>>>This is much simpler to read and review. Just have a look at the > >>>>diffstats of the two series: > >>>> > >>>> 6 files changed, 9 insertions(+), 8 deletions(-) > >>>> 6 files changed, 11 insertions(+), 9 deletions(-) > >>>> 5 files changed, 50 insertions(+), 2 deletions(-) > >>>> 6 files changed, 2 insertions(+), 65 deletions(-) > >>>> 1 files changed, 5 insertions(+), 0 deletions(-) > >>>> > >>>>versus > >>>> > >>>> 6 files changed, 10 insertions(+), 9 deletions(-) > >>>> 6 files changed, 11 insertions(+), 11 deletions(-) > >>>> 5 files changed, 3 insertions(+), 3 deletions(-) > >>>> 6 files changed, 4 insertions(+), 20 deletions(-) > >>>> 1 files changed, 5 insertions(+), 0 deletions(-) > >>>> > >>>>The overall result is basically the same, but it''s way simpler to look > >>>>at obvious and well done patches than checking whether a subtle copy > >>>>and paste bug happened in 3/5 of the first version. Copy and paste is > >>>>the #1 cause for subtle bugs. :) > >>>> > >>>>I''m waiting for the ack of Xen folks before taking it into tip.Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> on all patches. Please tell me which branch its going in so I can merge that one in my tree. Thanks!> >>>> > >>>I''ve some extra patches that modify the new "paginig_init" in the Xen > >>>code that I am going to propose for v3.7 - so will have some merge > >>>conflicts. Let me figure that out and also run this set of patches > >>>(and also the previous one .. which I think you didn''t have a > >>>chance to look since you were on vacation?) on an overnight > >>> > >>Which previous one ? > >> > >This one: > >https://lkml.org/lkml/2012/8/21/369 > > > >but I would like to repost the patch serie skipping the referral to > >PVOPS in the commit logs, I will do so right now, so please wait for > >another patch serie. > > For your convenience: > http://lkml.org/lkml/2012/8/22/450 > > Attilio
Thomas Gleixner
2012-Aug-23 15:15 UTC
Re: [Xen-devel] [PATCH v2 0/5] X86/XEN: Merge x86_init.paging.pagetable_setup_start and x86_init.paging.pagetable_setup_done setup functions and document its semantic
On Thu, 23 Aug 2012, Attilio Rao wrote:> On 22/08/12 15:47, Attilio Rao wrote: > > but I would like to repost the patch serie skipping the referral to > > PVOPS in the commit logs, I will do so right now, so please wait for > > another patch serie. > > > > For your convenience: > http://lkml.org/lkml/2012/8/22/450Not very convenient. I really prefer e-mail :)
Attilio Rao
2012-Aug-23 15:20 UTC
Re: [Xen-devel] [PATCH v2 0/5] X86/XEN: Merge x86_init.paging.pagetable_setup_start and x86_init.paging.pagetable_setup_done setup functions and document its semantic
On 23/08/12 16:15, Thomas Gleixner wrote:> On Thu, 23 Aug 2012, Attilio Rao wrote: > >> On 22/08/12 15:47, Attilio Rao wrote: >> >>> but I would like to repost the patch serie skipping the referral to >>> PVOPS in the commit logs, I will do so right now, so please wait for >>> another patch serie. >>> >>> >> For your convenience: >> http://lkml.org/lkml/2012/8/22/450 >> > Not very convenient. I really prefer e-mail :) >Actually you are in the "to" line for that patch serie. Can you see the e-mail? Attilio
Thomas Gleixner
2012-Aug-23 15:48 UTC
Re: [Xen-devel] [PATCH v2 0/5] X86/XEN: Merge x86_init.paging.pagetable_setup_start and x86_init.paging.pagetable_setup_done setup functions and document its semantic
On Thu, 23 Aug 2012, Attilio Rao wrote:> On 23/08/12 16:15, Thomas Gleixner wrote: > > On Thu, 23 Aug 2012, Attilio Rao wrote: > > > > > On 22/08/12 15:47, Attilio Rao wrote: > > > > > > > but I would like to repost the patch serie skipping the referral to > > > > PVOPS in the commit logs, I will do so right now, so please wait for > > > > another patch serie. > > > > > > > > > > > For your convenience: > > > http://lkml.org/lkml/2012/8/22/450 > > > > > Not very convenient. I really prefer e-mail :) > > > > Actually you are in the "to" line for that patch serie.Right. So why should I look at a website?> Can you see the e-mail?Replied to it already :)
Konrad Rzeszutek Wilk
2012-Sep-11 12:43 UTC
Re: [PATCH v2 0/5] X86/XEN: Merge x86_init.paging.pagetable_setup_start and x86_init.paging.pagetable_setup_done setup functions and document its semantic
> > > The overall result is basically the same, but it''s way simpler to look > > > at obvious and well done patches than checking whether a subtle copy > > > and paste bug happened in 3/5 of the first version. Copy and paste is > > > the #1 cause for subtle bugs. :) > > > > > > I''m waiting for the ack of Xen folks before taking it into tip.In case you are waiting for that - Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>> > > > I''ve some extra patches that modify the new "paginig_init" in the Xen > > code that I am going to propose for v3.7 - so will have some merge > > conflicts. Let me figure that out and also run this set of patches > > (and also the previous one .. which I think you didn''t have a > > chance to look since you were on vacation?) on an overnight > > Which previous one ? > > > test to make sure there are no fallout. > > > > With the merge issues that are going to prop up (x86 tip tree > > and my tree in linux-next) should I just take these patches > > in my tree with your Ack? Or should I just ingest your tiptree > > in my tree and that way solve the merge issue? What''s your > > preference! > > Having it in tip in an extra branch which you pull into your > tree. That''s the easiest one.ping? Which branch should I pull?> > Thanks, > > tglx
Thomas Gleixner
2012-Sep-12 13:36 UTC
Re: [PATCH v2 0/5] X86/XEN: Merge x86_init.paging.pagetable_setup_start and x86_init.paging.pagetable_setup_done setup functions and document its semantic
On Tue, 11 Sep 2012, Konrad Rzeszutek Wilk wrote:> > > > The overall result is basically the same, but it''s way simpler to look > > > > at obvious and well done patches than checking whether a subtle copy > > > > and paste bug happened in 3/5 of the first version. Copy and paste is > > > > the #1 cause for subtle bugs. :) > > > > > > > > I''m waiting for the ack of Xen folks before taking it into tip. > > In case you are waiting for that - Acked-by: Konrad Rzeszutek Wilk > <konrad.wilk@oracle.com>Sorry missed the previous ack over traveling.> > Having it in tip in an extra branch which you pull into your > > tree. That''s the easiest one. > > ping? Which branch should I pull?tip/x86/platform head commit: 6428227 Thanks, tglx
tip-bot for Attilio Rao
2012-Sep-12 13:46 UTC
[tip:x86/platform] x86: Remove base argument from x86_init.paging. pagetable_setup_start
Commit-ID: 73090f8993a40a2f67fed1ab866a928c68cd3765 Gitweb: http://git.kernel.org/tip/73090f8993a40a2f67fed1ab866a928c68cd3765 Author: Attilio Rao <attilio.rao@citrix.com> AuthorDate: Tue, 21 Aug 2012 21:22:37 +0100 Committer: Thomas Gleixner <tglx@linutronix.de> CommitDate: Wed, 12 Sep 2012 15:33:06 +0200 x86: Remove base argument from x86_init.paging.pagetable_setup_start We either use swapper_pg_dir or the argument is unused. Preparatory patch to simplify platform pagetable setup further. Signed-off-by: Attilio Rao <attilio.rao@citrix.com> Ackedb-by: <konrad.wilk@oracle.com> Cc: <Ian.Campbell@citrix.com> Cc: <Stefano.Stabellini@eu.citrix.com> Cc: <xen-devel@lists.xensource.com> Link: http://lkml.kernel.org/r/1345580561-8506-2-git-send-email-attilio.rao@citrix.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- arch/x86/include/asm/pgtable_types.h | 6 +++--- arch/x86/include/asm/x86_init.h | 2 +- arch/x86/kernel/setup.c | 2 +- arch/x86/kernel/x86_init.c | 3 ++- arch/x86/mm/init_32.c | 4 ++-- arch/x86/xen/mmu.c | 2 +- 6 files changed, 10 insertions(+), 9 deletions(-) diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h index 013286a..e02b875 100644 --- a/arch/x86/include/asm/pgtable_types.h +++ b/arch/x86/include/asm/pgtable_types.h @@ -303,11 +303,11 @@ void set_pte_vaddr(unsigned long vaddr, pte_t pte); extern void native_pagetable_reserve(u64 start, u64 end); #ifdef CONFIG_X86_32 -extern void native_pagetable_setup_start(pgd_t *base); +extern void native_pagetable_setup_start(void); extern void native_pagetable_setup_done(pgd_t *base); #else -#define native_pagetable_setup_start x86_init_pgd_noop -#define native_pagetable_setup_done x86_init_pgd_noop +#define native_pagetable_setup_start x86_init_pgd_start_noop +#define native_pagetable_setup_done x86_init_pgd_done_noop #endif struct seq_file; diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h index 38155f6..782ba0c 100644 --- a/arch/x86/include/asm/x86_init.h +++ b/arch/x86/include/asm/x86_init.h @@ -85,7 +85,7 @@ struct x86_init_mapping { * @pagetable_setup_done: platform specific post paging_init() call */ struct x86_init_paging { - void (*pagetable_setup_start)(pgd_t *base); + void (*pagetable_setup_start)(void); void (*pagetable_setup_done)(pgd_t *base); }; diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index f4b9b80..90cbbe0 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -961,7 +961,7 @@ void __init setup_arch(char **cmdline_p) kvmclock_init(); #endif - x86_init.paging.pagetable_setup_start(swapper_pg_dir); + x86_init.paging.pagetable_setup_start(); paging_init(); x86_init.paging.pagetable_setup_done(swapper_pg_dir); diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c index 9f3167e..3b88493 100644 --- a/arch/x86/kernel/x86_init.c +++ b/arch/x86/kernel/x86_init.c @@ -26,7 +26,8 @@ void __cpuinit x86_init_noop(void) { } void __init x86_init_uint_noop(unsigned int unused) { } -void __init x86_init_pgd_noop(pgd_t *unused) { } +void __init x86_init_pgd_start_noop(void) { } +void __init x86_init_pgd_done_noop(pgd_t *unused) { } int __init iommu_init_noop(void) { return 0; } void iommu_shutdown_noop(void) { } diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index 575d86f..c4aa1b2 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c @@ -445,10 +445,10 @@ static inline void permanent_kmaps_init(pgd_t *pgd_base) } #endif /* CONFIG_HIGHMEM */ -void __init native_pagetable_setup_start(pgd_t *base) +void __init native_pagetable_setup_start(void) { unsigned long pfn, va; - pgd_t *pgd; + pgd_t *pgd, *base = swapper_pg_dir; pud_t *pud; pmd_t *pmd; pte_t *pte; diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 5141d80..32e66c8 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c @@ -1174,7 +1174,7 @@ static void xen_exit_mmap(struct mm_struct *mm) spin_unlock(&mm->page_table_lock); } -static void __init xen_pagetable_setup_start(pgd_t *base) +static void __init xen_pagetable_setup_start(void) { }
tip-bot for Attilio Rao
2012-Sep-12 13:47 UTC
[tip:x86/platform] x86: Rename pagetable_setup_start() to pagetable_init()
Commit-ID: 7737b215ad0f94d20a87d98315da9f6cadaf35c9 Gitweb: http://git.kernel.org/tip/7737b215ad0f94d20a87d98315da9f6cadaf35c9 Author: Attilio Rao <attilio.rao@citrix.com> AuthorDate: Tue, 21 Aug 2012 21:22:38 +0100 Committer: Thomas Gleixner <tglx@linutronix.de> CommitDate: Wed, 12 Sep 2012 15:33:06 +0200 x86: Rename pagetable_setup_start() to pagetable_init() In preparation for unifying the pagetable_setup_start() and pagetable_setup_done() setup functions, rename appropriately all the infrastructure related to pagetable_setup_start(). Signed-off-by: Attilio Rao <attilio.rao@citrix.com> Ackedd-by: <konrad.wilk@oracle.com> Cc: <Ian.Campbell@citrix.com> Cc: <Stefano.Stabellini@eu.citrix.com> Cc: <xen-devel@lists.xensource.com> Link: http://lkml.kernel.org/r/1345580561-8506-3-git-send-email-attilio.rao@citrix.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- arch/x86/include/asm/pgtable_types.h | 4 ++-- arch/x86/include/asm/x86_init.h | 4 ++-- arch/x86/kernel/setup.c | 2 +- arch/x86/kernel/x86_init.c | 4 ++-- arch/x86/mm/init_32.c | 4 ++-- arch/x86/xen/mmu.c | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h index e02b875..0c01e07 100644 --- a/arch/x86/include/asm/pgtable_types.h +++ b/arch/x86/include/asm/pgtable_types.h @@ -303,10 +303,10 @@ void set_pte_vaddr(unsigned long vaddr, pte_t pte); extern void native_pagetable_reserve(u64 start, u64 end); #ifdef CONFIG_X86_32 -extern void native_pagetable_setup_start(void); +extern void native_pagetable_init(void); extern void native_pagetable_setup_done(pgd_t *base); #else -#define native_pagetable_setup_start x86_init_pgd_start_noop +#define native_pagetable_init x86_init_pgd_init_noop #define native_pagetable_setup_done x86_init_pgd_done_noop #endif diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h index 782ba0c..24084b2 100644 --- a/arch/x86/include/asm/x86_init.h +++ b/arch/x86/include/asm/x86_init.h @@ -81,11 +81,11 @@ struct x86_init_mapping { /** * struct x86_init_paging - platform specific paging functions - * @pagetable_setup_start: platform specific pre paging_init() call + * @pagetable_init: platform specific paging initialization call * @pagetable_setup_done: platform specific post paging_init() call */ struct x86_init_paging { - void (*pagetable_setup_start)(void); + void (*pagetable_init)(void); void (*pagetable_setup_done)(pgd_t *base); }; diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 90cbbe0..61b7d98 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -961,7 +961,7 @@ void __init setup_arch(char **cmdline_p) kvmclock_init(); #endif - x86_init.paging.pagetable_setup_start(); + x86_init.paging.pagetable_init(); paging_init(); x86_init.paging.pagetable_setup_done(swapper_pg_dir); diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c index 3b88493..0e1e950 100644 --- a/arch/x86/kernel/x86_init.c +++ b/arch/x86/kernel/x86_init.c @@ -26,7 +26,7 @@ void __cpuinit x86_init_noop(void) { } void __init x86_init_uint_noop(unsigned int unused) { } -void __init x86_init_pgd_start_noop(void) { } +void __init x86_init_pgd_init_noop(void) { } void __init x86_init_pgd_done_noop(pgd_t *unused) { } int __init iommu_init_noop(void) { return 0; } void iommu_shutdown_noop(void) { } @@ -69,7 +69,7 @@ struct x86_init_ops x86_init __initdata = { }, .paging = { - .pagetable_setup_start = native_pagetable_setup_start, + .pagetable_init = native_pagetable_init, .pagetable_setup_done = native_pagetable_setup_done, }, diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index c4aa1b2..0e38e0e 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c @@ -445,7 +445,7 @@ static inline void permanent_kmaps_init(pgd_t *pgd_base) } #endif /* CONFIG_HIGHMEM */ -void __init native_pagetable_setup_start(void) +void __init native_pagetable_init(void) { unsigned long pfn, va; pgd_t *pgd, *base = swapper_pg_dir; @@ -493,7 +493,7 @@ void __init native_pagetable_setup_done(pgd_t *base) * 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_setup_start() will set up swapper_pg_dir + * 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 diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 32e66c8..624efbe 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c @@ -1174,7 +1174,7 @@ static void xen_exit_mmap(struct mm_struct *mm) spin_unlock(&mm->page_table_lock); } -static void __init xen_pagetable_setup_start(void) +static void __init xen_pagetable_init(void) { } @@ -2068,7 +2068,7 @@ static const struct pv_mmu_ops xen_mmu_ops __initconst = { void __init xen_init_mmu_ops(void) { x86_init.mapping.pagetable_reserve = xen_mapping_pagetable_reserve; - x86_init.paging.pagetable_setup_start = xen_pagetable_setup_start; + x86_init.paging.pagetable_init = xen_pagetable_init; x86_init.paging.pagetable_setup_done = xen_pagetable_setup_done; pv_mmu_ops = xen_mmu_ops;
tip-bot for Attilio Rao
2012-Sep-12 13:48 UTC
[tip:x86/platform] x86: Move paging_init() call to x86_init.paging .pagetable_init()
Commit-ID: 843b8ed2ec598aae5e3516b21957ede62a070e36 Gitweb: http://git.kernel.org/tip/843b8ed2ec598aae5e3516b21957ede62a070e36 Author: Attilio Rao <attilio.rao@citrix.com> AuthorDate: Tue, 21 Aug 2012 21:22:39 +0100 Committer: Thomas Gleixner <tglx@linutronix.de> CommitDate: Wed, 12 Sep 2012 15:33:06 +0200 x86: Move paging_init() call to x86_init.paging.pagetable_init() Move the paging_init() call to the platform specific pagetable_init() function, so we can get rid of the extra pagetable_setup_done() function pointer. Signed-off-by: Attilio Rao <attilio.rao@citrix.com> Acked-by: <konrad.wilk@oracle.com> Cc: <Ian.Campbell@citrix.com> Cc: <Stefano.Stabellini@eu.citrix.com> Cc: <xen-devel@lists.xensource.com> Link: http://lkml.kernel.org/r/1345580561-8506-4-git-send-email-attilio.rao@citrix.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- arch/x86/include/asm/pgtable_types.h | 2 +- arch/x86/kernel/setup.c | 1 - arch/x86/kernel/x86_init.c | 1 - arch/x86/mm/init_32.c | 1 + arch/x86/xen/mmu.c | 1 + 5 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h index 0c01e07..c93cb8e 100644 --- a/arch/x86/include/asm/pgtable_types.h +++ b/arch/x86/include/asm/pgtable_types.h @@ -306,7 +306,7 @@ extern void native_pagetable_reserve(u64 start, u64 end); extern void native_pagetable_init(void); extern void native_pagetable_setup_done(pgd_t *base); #else -#define native_pagetable_init x86_init_pgd_init_noop +#define native_pagetable_init paging_init #define native_pagetable_setup_done x86_init_pgd_done_noop #endif diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 61b7d98..315fd24 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -962,7 +962,6 @@ void __init setup_arch(char **cmdline_p) #endif x86_init.paging.pagetable_init(); - paging_init(); x86_init.paging.pagetable_setup_done(swapper_pg_dir); if (boot_cpu_data.cpuid_level >= 0) { diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c index 0e1e950..5f2478f 100644 --- a/arch/x86/kernel/x86_init.c +++ b/arch/x86/kernel/x86_init.c @@ -26,7 +26,6 @@ void __cpuinit x86_init_noop(void) { } void __init x86_init_uint_noop(unsigned int unused) { } -void __init x86_init_pgd_init_noop(void) { } void __init x86_init_pgd_done_noop(pgd_t *unused) { } int __init iommu_init_noop(void) { return 0; } void iommu_shutdown_noop(void) { } diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index 0e38e0e..e35b4b1 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c @@ -475,6 +475,7 @@ void __init native_pagetable_init(void) pte_clear(NULL, va, pte); } paravirt_alloc_pmd(&init_mm, __pa(base) >> PAGE_SHIFT); + paging_init(); } void __init native_pagetable_setup_done(pgd_t *base) diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 624efbe..c2ff7ea 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c @@ -1176,6 +1176,7 @@ static void xen_exit_mmap(struct mm_struct *mm) static void __init xen_pagetable_init(void) { + paging_init(); } static __init void xen_mapping_pagetable_reserve(u64 start, u64 end)
tip-bot for Attilio Rao
2012-Sep-12 13:49 UTC
[tip:x86/platform] x86: xen: Cleanup and remove x86_init.paging. pagetable_setup_done()
Commit-ID: c711288727a62f74d48032e56e51333dd104bf58 Gitweb: http://git.kernel.org/tip/c711288727a62f74d48032e56e51333dd104bf58 Author: Attilio Rao <attilio.rao@citrix.com> AuthorDate: Tue, 21 Aug 2012 21:22:40 +0100 Committer: Thomas Gleixner <tglx@linutronix.de> CommitDate: Wed, 12 Sep 2012 15:33:06 +0200 x86: xen: Cleanup and remove x86_init.paging.pagetable_setup_done() At this stage x86_init.paging.pagetable_setup_done is only used in the XEN case. Move its content in the x86_init.paging.pagetable_init setup function and remove the now unused x86_init.paging.pagetable_setup_done remaining infrastructure. Signed-off-by: Attilio Rao <attilio.rao@citrix.com> Acked-by: <konrad.wilk@oracle.com> Cc: <Ian.Campbell@citrix.com> Cc: <Stefano.Stabellini@eu.citrix.com> Cc: <xen-devel@lists.xensource.com> Link: http://lkml.kernel.org/r/1345580561-8506-5-git-send-email-attilio.rao@citrix.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- arch/x86/include/asm/pgtable_types.h | 2 -- arch/x86/include/asm/x86_init.h | 2 -- arch/x86/kernel/setup.c | 1 - arch/x86/kernel/x86_init.c | 2 -- arch/x86/mm/init_32.c | 4 ---- arch/x86/xen/mmu.c | 13 ++++--------- 6 files changed, 4 insertions(+), 20 deletions(-) diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h index c93cb8e..db8fec6 100644 --- a/arch/x86/include/asm/pgtable_types.h +++ b/arch/x86/include/asm/pgtable_types.h @@ -304,10 +304,8 @@ void set_pte_vaddr(unsigned long vaddr, pte_t pte); extern void native_pagetable_reserve(u64 start, u64 end); #ifdef CONFIG_X86_32 extern void native_pagetable_init(void); -extern void native_pagetable_setup_done(pgd_t *base); #else #define native_pagetable_init paging_init -#define native_pagetable_setup_done x86_init_pgd_done_noop #endif struct seq_file; diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h index 24084b2..995ea5c 100644 --- a/arch/x86/include/asm/x86_init.h +++ b/arch/x86/include/asm/x86_init.h @@ -82,11 +82,9 @@ struct x86_init_mapping { /** * struct x86_init_paging - platform specific paging functions * @pagetable_init: platform specific paging initialization call - * @pagetable_setup_done: platform specific post paging_init() call */ struct x86_init_paging { void (*pagetable_init)(void); - void (*pagetable_setup_done)(pgd_t *base); }; /** diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 315fd24..4f16547 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -962,7 +962,6 @@ void __init setup_arch(char **cmdline_p) #endif x86_init.paging.pagetable_init(); - x86_init.paging.pagetable_setup_done(swapper_pg_dir); if (boot_cpu_data.cpuid_level >= 0) { /* A CPU has %cr4 if and only if it has CPUID */ diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c index 5f2478f..7a3d075 100644 --- a/arch/x86/kernel/x86_init.c +++ b/arch/x86/kernel/x86_init.c @@ -26,7 +26,6 @@ void __cpuinit x86_init_noop(void) { } void __init x86_init_uint_noop(unsigned int unused) { } -void __init x86_init_pgd_done_noop(pgd_t *unused) { } int __init iommu_init_noop(void) { return 0; } void iommu_shutdown_noop(void) { } @@ -69,7 +68,6 @@ struct x86_init_ops x86_init __initdata = { .paging = { .pagetable_init = native_pagetable_init, - .pagetable_setup_done = native_pagetable_setup_done, }, .timers = { diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index e35b4b1..4f04db1 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c @@ -478,10 +478,6 @@ void __init native_pagetable_init(void) paging_init(); } -void __init native_pagetable_setup_done(pgd_t *base) -{ -} - /* * Build a proper pagetable for the kernel mappings. Up until this * point, we''ve been running on some set of pagetables constructed by diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index c2ff7ea..7a769b7 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c @@ -1174,9 +1174,13 @@ static void xen_exit_mmap(struct mm_struct *mm) spin_unlock(&mm->page_table_lock); } +static void xen_post_allocator_init(void); + static void __init xen_pagetable_init(void) { paging_init(); + xen_setup_shared_info(); + xen_post_allocator_init(); } static __init void xen_mapping_pagetable_reserve(u64 start, u64 end) @@ -1193,14 +1197,6 @@ static __init void xen_mapping_pagetable_reserve(u64 start, u64 end) } } -static void xen_post_allocator_init(void); - -static void __init xen_pagetable_setup_done(pgd_t *base) -{ - xen_setup_shared_info(); - xen_post_allocator_init(); -} - static void xen_write_cr2(unsigned long cr2) { this_cpu_read(xen_vcpu)->arch.cr2 = cr2; @@ -2070,7 +2066,6 @@ void __init xen_init_mmu_ops(void) { x86_init.mapping.pagetable_reserve = xen_mapping_pagetable_reserve; x86_init.paging.pagetable_init = xen_pagetable_init; - x86_init.paging.pagetable_setup_done = xen_pagetable_setup_done; pv_mmu_ops = xen_mmu_ops; memset(dummy_mapping, 0xff, PAGE_SIZE);
tip-bot for Attilio Rao
2012-Sep-12 13:50 UTC
[tip:x86/platform] x86: Document x86_init.paging.pagetable_init()
Commit-ID: 64282278989d5b0398dcb3ba7904cb00c621dc35 Gitweb: http://git.kernel.org/tip/64282278989d5b0398dcb3ba7904cb00c621dc35 Author: Attilio Rao <attilio.rao@citrix.com> AuthorDate: Tue, 21 Aug 2012 21:22:41 +0100 Committer: Thomas Gleixner <tglx@linutronix.de> CommitDate: Wed, 12 Sep 2012 15:33:07 +0200 x86: Document x86_init.paging.pagetable_init() Signed-off-by: Attilio Rao <attilio.rao@citrix.com> Acked-by: <konrad.wilk@oracle.com> Cc: <Ian.Campbell@citrix.com> Cc: <Stefano.Stabellini@eu.citrix.com> Cc: <xen-devel@lists.xensource.com> Link: http://lkml.kernel.org/r/1345580561-8506-6-git-send-email-attilio.rao@citrix.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- arch/x86/include/asm/x86_init.h | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h index 995ea5c..5769349 100644 --- a/arch/x86/include/asm/x86_init.h +++ b/arch/x86/include/asm/x86_init.h @@ -81,7 +81,10 @@ struct x86_init_mapping { /** * struct x86_init_paging - platform specific paging functions - * @pagetable_init: platform specific paging initialization call + * @pagetable_init: platform specific paging initialization call to setup + * the kernel pagetables and prepare accessors functions. + * Callback must call paging_init(). Called once after the + * direct mapping for phys memory is available. */ struct x86_init_paging { void (*pagetable_init)(void);