From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D945C48BE5 for ; Sat, 12 Jun 2021 04:41:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4E5D76120D for ; Sat, 12 Jun 2021 04:41:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230028AbhFLEnI (ORCPT ); Sat, 12 Jun 2021 00:43:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:41218 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbhFLEnI (ORCPT ); Sat, 12 Jun 2021 00:43:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623472868; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BhtisDRssXQT2it4jQW/bgYjuS/QsE3H+8BKWcr+zPM=; b=IuG67rIBmJ6Smol1eVUyuKfbxGr4uPWHWSityOBw0myhevhYafcILUAVGTdRxg2L4FoqeW YgpFCSGZcpRc53KDKAF8006s3oDqBNM0r3aZjr/aRdCmSPC21QShk/xLY5Y+M/PKyGZXwe 0aM+ehSG5KzI7YqfcEKl06qV4R+21WM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-537-2k_2Xow2PWGwwTFLf8unag-1; Sat, 12 Jun 2021 00:41:07 -0400 X-MC-Unique: 2k_2Xow2PWGwwTFLf8unag-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 04C7C1850600; Sat, 12 Jun 2021 04:41:05 +0000 (UTC) Received: from dhcp-128-65.nay.redhat.com (ovpn-12-26.pek2.redhat.com [10.72.12.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C6F7C60E3A; Sat, 12 Jun 2021 04:41:00 +0000 (UTC) Date: Sat, 12 Jun 2021 12:40:57 +0800 From: Dave Young To: Andy Shevchenko Cc: Andy Shevchenko , Jean Delvare , Linux Kernel Mailing List , Mika Westerberg , Javier =?iso-8859-1?B?VGnh?= , kexec@lists.infradead.org, Eric Biederman , linux-efi , Matt Fleming , Ard Biesheuvel Subject: Re: [PATCH v1 0/2] firmware: dmi_scan: Make it work in kexec'ed kernel Message-ID: References: <20161202195416.58953-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org > Probably it is doable to have kexec on 32bit efi working > without runtime service support, that means no need the trick of fixed > mapping. > > If I can restore my vm to boot 32bit efi on this weekend then I may provide some draft > patches for test. Unfortunately I failed to setup a 32bit efi guest, here are some untested draft patches, please have a try. ========= kernel draft patch ============== --- arch/x86/boot/header.S | 2 +- arch/x86/platform/efi/efi.c | 6 +++--- arch/x86/platform/efi/quirks.c | 3 --- 3 files changed, 4 insertions(+), 7 deletions(-) --- linux-x86.orig/arch/x86/boot/header.S +++ linux-x86/arch/x86/boot/header.S @@ -416,7 +416,7 @@ xloadflags: # define XLF23 0 #endif -#if defined(CONFIG_X86_64) && defined(CONFIG_EFI) && defined(CONFIG_KEXEC_CORE) +#if defined(CONFIG_EFI) && defined(CONFIG_KEXEC_CORE) # define XLF4 XLF_EFI_KEXEC #else # define XLF4 0 --- linux-x86.orig/arch/x86/platform/efi/efi.c +++ linux-x86/arch/x86/platform/efi/efi.c @@ -710,10 +710,10 @@ static void __init kexec_enter_virtual_m unsigned int num_pages; /* - * We don't do virtual mode, since we don't do runtime services, on - * non-native EFI. + * We don't do virtual mode, since we don't do runtime services + * on non-native or IA32 EFI. */ - if (efi_is_mixed()) { + if (!efi_enabled(EFI_64BIT)) { efi_memmap_unmap(); clear_bit(EFI_RUNTIME_SERVICES, &efi.flags); return; --- linux-x86.orig/arch/x86/platform/efi/quirks.c +++ linux-x86/arch/x86/platform/efi/quirks.c @@ -524,9 +524,6 @@ int __init efi_reuse_config(u64 tables, if (!efi_setup) return 0; - if (!efi_enabled(EFI_64BIT)) - return 0; - data = early_memremap(efi_setup, sizeof(*data)); if (!data) { ret = -ENOMEM; ========= kexec-tools draft patch ========= --- kexec/arch/i386/kexec-bzImage.c | 5 +++++ 1 file changed, 5 insertions(+) --- kexec-tools.orig/kexec/arch/i386/kexec-bzImage.c +++ kexec-tools/kexec/arch/i386/kexec-bzImage.c @@ -83,6 +83,11 @@ int bzImage_probe(const char *buf, off_t if (probe_debug) { fprintf(stderr, "It's a bzImage\n"); } + +#define XLF_EFI_KEXEC (1 << 4) + if ((header->xloadflags & XLF_EFI_KEXEC) == XLF_EFI_KEXEC) + bzImage_support_efi_boot = 1; + return 0; }