Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1105058pxj; Fri, 11 Jun 2021 21:45:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/EQmDj0Gl0rJj748Qy/kbwgvfaQ5Quz8MaspAc2AIoBMw+B4FoKCNJ7iy/Qav4xc04hJe X-Received: by 2002:a17:907:628d:: with SMTP id nd13mr6284363ejc.299.1623473154683; Fri, 11 Jun 2021 21:45:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623473154; cv=none; d=google.com; s=arc-20160816; b=nuO+5kdLm4T2i26DXt/cGhVCRW64uzDaZPcT+eZ+hFqOgDGlILUM1J1eXaN/sf7FMq M9A7zjVpUGIvWKQgz/eFQGgWQ5qho//xn11YZRHrvEvHTA40+M3DBhlDNM/HrykwXc61 kaamc9QbXZDoLpWEvdaE91x0GioxkNBpfWq1MehU9c8HALB/O8Uc8XcXCH7JYVGpqpGl DtneJJ++yHhsKZfZCJMDeRCvXoVC0aEgkrvf1JVNj4ekFU8LI/73mTZGKIbdAxcCqfEn 9c7SigyEwcASciTjwdkd31T/tWtzgdpF7d5gKgFusIKinSAwt5JpQvxpj1RveipuGUcv Ki2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=BhtisDRssXQT2it4jQW/bgYjuS/QsE3H+8BKWcr+zPM=; b=KTzDyNsO1Ox2kVWfW4nvj3G5+NLHRx1bNgrGYedPz15HzionrE1Ws89u5THXiugs14 ba0J8JlC3Vgaqt+JRAmnJNeyf6DEiwoS+9gqs/mgTy4I3ftpNqy7myCs/JCctuDJgkhf jhhzXCgFdWKEGby0vMo7uhv1Ws+ro1dJ4sVErp3UeTxtX1e4S/qdonQoB+TNcdLKP803 LZwUEDVl0p7S77uh0rRVOmU5uMdOJc8Qxwv6adFuRfAG9+GucJO6NSKk0eEkAJzI0Ide pBngHI5+4DUQZdhpG/rFX0FlKRnJSk/Apop9IO+JzRbjln2ME+eltlZtYl4cqIlIHByW RoNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jFCvl+zQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a14si6326624ejy.671.2021.06.11.21.45.19; Fri, 11 Jun 2021 21:45:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jFCvl+zQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229446AbhFLEnI (ORCPT + 99 others); Sat, 12 Jun 2021 00:43:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:35829 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229985AbhFLEnI (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=1623472869; 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=jFCvl+zQdcrdUFhgXXr2kySd7hwh6ROMQOHhboc0h+VTPyKsK/THxHKsXVYXda8k9PnDUi IsQdil+5Bso+0yxSkdUhzYQjjsSF1sABc3FU46hWNHHSBZ7n43sQ9ZRupOdV+gqe57YTTi AQKIIxeBwiLECfobQL4SVNrl1J2btvQ= 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-kernel@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; }