From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754684AbdCILza (ORCPT ); Thu, 9 Mar 2017 06:55:30 -0500 Received: from mail-io0-f181.google.com ([209.85.223.181]:34086 "EHLO mail-io0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753861AbdCILzZ (ORCPT ); Thu, 9 Mar 2017 06:55:25 -0500 MIME-Version: 1.0 In-Reply-To: <20170309095408.GA17883@vader> References: <20170308201616.GC8598@vader> <20170309063806.GB17257@dhcp-128-65.nay.redhat.com> <20170309095408.GA17883@vader> From: Ard Biesheuvel Date: Thu, 9 Mar 2017 12:53:36 +0100 Message-ID: Subject: Re: kexec regression since 4.9 caused by efi To: Omar Sandoval , Matt Fleming Cc: Dave Young , Ingo Molnar , "linux-kernel@vger.kernel.org" , kernel-team@fb.com, "kexec@lists.infradead.org" , "linux-efi@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9 March 2017 at 10:54, Omar Sandoval wrote: > On Thu, Mar 09, 2017 at 02:38:06PM +0800, Dave Young wrote: >> Add efi/kexec list. >> >> On 03/08/17 at 12:16pm, Omar Sandoval wrote: > > [snip] > >> I have no more clue yet from your provided log, but the runtime value is >> odd to me. It is set in below code: >> >> arch/x86/platform/efi/efi.c: efi_systab_init() >> efi_systab.runtime = data ? >> (void *)(unsigned long)data->runtime : >> (void *)(unsigne long)systab64->runtime; >> >> Here data is the setup_data passed by kexec-tools from normal kernel to >> kexec kernel, efi_setup_data structure is like below: >> struct efi_setup_data { >> u64 fw_vendor; >> u64 runtime; >> u64 tables; >> u64 smbios; >> u64 reserved[8]; >> }; >> >> kexec-tools get the runtime address from /sys/firmware/efi/runtime >> >> So can you do some debuggin on your side, eg. see the sysfs runtime >> value is correct or not. And add some printk in efi init path etc. > > The attached patch fixes this for me. Hi Omar, Thanks for tracking this down. I wonder if this is an unintended side effect of the way we repurpose the EFI_MEMORY_RUNTIME attribute in efi_arch_mem_reserve(). AFAIUI, splitting memory map entries should only be necessary for regions that are not runtime memory regions to begin with, and so whether their virtual mapping address makes sense or not should be irrelevant. Perhaps this only illustrates my lack of understanding of the x86 way of doing this, so perhaps Matt can shed some light on this? Thanks, Ard.