[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.1809161633160.1650@nanos.tec.linutronix.de>
Date: Sun, 16 Sep 2018 16:43:55 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: Feng Tang <feng.tang@...el.com>
cc: Michal Hocko <mhocko@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
LKML <linux-kernel@...r.kernel.org>, x86@...nel.org,
Ingo Molnar <mingo@...e.hu>,
"H . Peter Anvin" <hpa@...ux.intel.com>,
Yinghai Lu <yinghai@...nel.org>,
Dave Hansen <dave.hansen@...el.com>,
Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH] x86, mm: Reserver some memory for bootmem allocator for
NO_BOOTMEM
On Sun, 16 Sep 2018, Feng Tang wrote:
> diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
> index e848a4811785..a927f5f39bee 100644
> --- a/arch/x86/mm/pgtable.c
> +++ b/arch/x86/mm/pgtable.c
> @@ -637,6 +637,16 @@ void __native_set_fixmap(enum fixed_addresses idx, pte_t pte)
> {
> unsigned long address = __fix_to_virt(idx);
>
> +#ifdef CONFIG_X86_64
> + /*
> + * In arch/x86/kernel/head_64.S, the static page table has
> + * been setup for fixmap. Add a sanity compiling check
> + * whether fixmap space has exceeded the capacity.
> + */
> + BUILD_BUG_ON((__end_of_permanent_fixed_addresses + 511)/512
> + > FIXMAP_PMD_NUM);
There exist macros for rounding up and doing this in the header file is
perfectly fine.
> +#endif
> +
> if (idx >= __end_of_fixed_addresses) {
> BUG();
> return;
> diff --git a/arch/x86/xen/mmu_pv.c b/arch/x86/xen/mmu_pv.c
> index 45b700ac5fe7..b0aa2364a3c6 100644
> --- a/arch/x86/xen/mmu_pv.c
> +++ b/arch/x86/xen/mmu_pv.c
> @@ -1953,7 +1953,10 @@ 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);
The line break is there because?
Thanks,
tglx
Powered by blists - more mailing lists