[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180917080757.psvvv3xuue5leaoq@shbuild888>
Date: Mon, 17 Sep 2018 16:07:57 +0800
From: Feng Tang <feng.tang@...el.com>
To: Juergen Gross <jgross@...e.com>
Cc: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...e.hu>,
H Peter Anvin <hpa@...ux.intel.com>,
Peter Zijlstra <peterz@...radead.org>,
Michal Hocko <mhocko@...nel.org>, x86@...nel.org,
linux-kernel@...r.kernel.org, Yinghai Lu <yinghai@...nel.org>,
Dave Hansen <dave.hansen@...el.com>,
Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH] x86/mm: Expand static page table for fixmap space
Hi Juergen,
On Mon, Sep 17, 2018 at 09:48:05AM +0200, Juergen Gross wrote:
> On 17/09/18 09:34, Feng Tang wrote:
> > We met a kernel panic when enabling earlycon, which is due to
> > the fixmap address of earlycon is not statically setup.
> >
> > Currently the static fixmap setup in head_64.S only covers 2M
> > virtual address space, while it acutually could be in 4M space
> > with different kernel configurations.
> >
> > So increase the static space to 4M for now by defining FIXMAP_PMD_NUM
> > to 2, and add a build time check for future possible overflow so that
> > the macro could be increased accordingly.
> >
> > Suggested-by: Thomas Gleixner <tglx@...utronix.de>
> > Signed-off-by: Feng Tang <feng.tang@...el.com>
> > ---
> > arch/x86/include/asm/fixmap.h | 3 +++
> > arch/x86/include/asm/pgtable_64.h | 3 ++-
> > arch/x86/kernel/head_64.S | 16 ++++++++++++----
> > arch/x86/mm/pgtable.c | 10 ++++++++++
> > arch/x86/xen/mmu_pv.c | 4 +++-
> > 5 files changed, 30 insertions(+), 6 deletions(-)
> >
>
> ...
>
> > diff --git a/arch/x86/xen/mmu_pv.c b/arch/x86/xen/mmu_pv.c
> > index 2fe5c9b..19077f9 100644
> > --- a/arch/x86/xen/mmu_pv.c
> > +++ b/arch/x86/xen/mmu_pv.c
> > @@ -1952,7 +1952,9 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn)
> > set_page_prot(level2_ident_pgt, PAGE_KERNEL_RO);
> > set_page_prot(level2_kernel_pgt, PAGE_KERNEL_RO);
> > set_page_prot(level2_fixmap_pgt, PAGE_KERNEL_RO);
> > - set_page_prot(level1_fixmap_pgt, PAGE_KERNEL_RO);
> > +
> > + for (i = 0; i < FIXMAP_PMD_NUM; i++)
> > + set_page_prot(level1_fixmap_pgt + i * 512, PAGE_KERNEL_RO);
>
> Please use PTRS_PER_PTE instead of the literal 512.
>
> Some lines further up level1_fixmap_pgt is mentioned in a comment.
> Please update that, too:
>
> - /* L3_k[511][506] -> level1_fixmap_pgt */
> + /* L3_k[511][506, ...] -> level1_fixmap_pgt */
Thanks for the suggestions, will handle them in v2.
- Feng
>
>
> Juergen
Powered by blists - more mailing lists