From: Feng Tang <feng.tang@intel.com>
To: Juergen Gross <jgross@suse.com>
Cc: Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
H Peter Anvin <hpa@linux.intel.com>,
Peter Zijlstra <peterz@infradead.org>,
Michal Hocko <mhocko@kernel.org>,
x86@kernel.org, linux-kernel@vger.kernel.org,
Yinghai Lu <yinghai@kernel.org>,
Dave Hansen <dave.hansen@intel.com>,
Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH] x86/mm: Expand static page table for fixmap space
Date: Mon, 17 Sep 2018 16:07:57 +0800 [thread overview]
Message-ID: <20180917080757.psvvv3xuue5leaoq@shbuild888> (raw)
In-Reply-To: <6f3d7b9e-f635-befb-0fa8-74ceaaa1dea0@suse.com>
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@linutronix.de>
> > Signed-off-by: Feng Tang <feng.tang@intel.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
prev parent reply other threads:[~2018-09-17 8:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-17 7:34 Feng Tang
2018-09-17 7:48 ` Juergen Gross
2018-09-17 8:07 ` Feng Tang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180917080757.psvvv3xuue5leaoq@shbuild888 \
--to=feng.tang@intel.com \
--cc=ak@linux.intel.com \
--cc=dave.hansen@intel.com \
--cc=hpa@linux.intel.com \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhocko@kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=yinghai@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®