[linux-next PATCH] arm64: fix kernel crash with 48-bit VA and 64KB granule

Catalin Marinas catalin.marinas at arm.com
Tue Jan 5 01:56:03 PST 2016


On Tue, Jan 05, 2016 at 04:40:44PM +0800, Dennis Chen wrote:
> On Tue, Jan 05, 2016 at 09:38:11AM +0100, Ard Biesheuvel wrote:
> > >> On 5 January 2016 at 03:18, Dennis Chen <dennis.chen at arm.com> wrote:
> > >> > The commit 3400749b5a22 ("arm64/efi: refactor EFI init and runtime
> > >> > code for reuse by 32-bit ARM") uses pgd_alloc() to allocate space for
> > >> > efi_mm.pgd while not the static efi_pgd[], since this function will be
> > >> > called with early_initcall, which results in the pgd_cache used by
> > >> > pgd_alloc() has not been initialized yet, kernel will hang in this
> > >> > case. This patch is trying to make the pgd_cache_init() called before
> > >> > arm_enable_runtime_services() by changing its core_initcall to
> > >> > early_initcall.
> > >> >
> > >> > Signed-off-by: Dennis Chen <dennis.chen at arm.com>
> > >> > Tested-by: Sudeep Holla <sudeep.holla at arm.com>
> > >> >
> > >> > Cc: Will Deacon <will.deacon at arm.com>
> > >> > Cc: Catalin Marinas <catalin.marinas at arm.com>
> > >> > Cc: Ard Biesheuvel <ard.biesheuvel at linaro.org>
> > >> > Cc: Sudeep Holla <sudeep.holla at arm.com>
> > >> > ---
> > >> >  arch/arm64/mm/pgd.c | 2 +-
> > >> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >> >
> > >> > diff --git a/arch/arm64/mm/pgd.c b/arch/arm64/mm/pgd.c
> > >> > index cb3ba1b..859a788 100644
> > >> > --- a/arch/arm64/mm/pgd.c
> > >> > +++ b/arch/arm64/mm/pgd.c
> > >> > @@ -56,4 +56,4 @@ static int __init pgd_cache_init(void)
> > >> >                                               SLAB_PANIC, NULL);
> > >> >         return 0;
> > >> >  }
> > >> > -core_initcall(pgd_cache_init);
> > >> > +early_initcall(pgd_cache_init);
[...]
> > Well, since arm_enable_runtime_services() is an early_initcall()
> > itself, how are you guaranteeing the ordering between the two? Link
> > order?
> 
> Link order.

And can you explain how this works, what guarantees it gives?

> IMPORTANT NOTICE: The contents of this email and any attachments are
> confidential and may also be privileged. If you are not the intended
> recipient, please notify the sender immediately and do not disclose
> the contents to any other person, use it for any purpose, or store or
> copy the information in any medium. Thank you.

BTW, please sort out the legal disclaimer (raise an IT ticket).

-- 
Catalin



More information about the linux-arm-kernel mailing list