Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1722664pxj; Sat, 5 Jun 2021 00:58:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+NMFlD92CFZhX2UgkmkJ/VtiU49odOCNMUeFdVWOAIF428cjdpnKcUE8f83Neurigw0HC X-Received: by 2002:a05:6402:40d6:: with SMTP id z22mr9049549edb.125.1622879898895; Sat, 05 Jun 2021 00:58:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622879898; cv=none; d=google.com; s=arc-20160816; b=M9nya3NCsdPLwY6RPCXZb6mRVCWe03+q7scXllRJXXJ+IrjdEymWFhvksNmifXIRK+ GAcg4Eg58DTQSPIWn0Fifh/RUjE/TaI53/fyJsf1Yw4Y/RG29p8EQoY3l3lvzsqbWJik 85LBEWpkBINs2HuTIEkqvxxZgXVlTlxl/kVVrKe1B+Mj851fSTvLuxEJly7lVgLal/N6 GVIyLr9BJBFg3kSqLyeo8GXOLJpcQqs6ChoOO9CTGGySfYhEOuJvM6JuHqAKEqU2sBhr TYwLAV+QpIESclxKXUU79xDFKxSHliKL1/5i2Bak30YCCja9fGvR3I+Tu7iIZ0gsgN9Y CMgA== 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=AFxfbRh44tx3itGF+2reHu0Dp0ddlJOouXymhxZA6d8=; b=qPTXF5XbMkyDKtyFWvfHFO2k30OFsf1wu+GdoNcLooUxHYgqDTqo9Jhm4kw8lJKSpJ uarTBN/NFa2mBOxSIBLYVmfstRrAFrV3TlLx+Uv0Py6tZd7rCVbS6lAX1NPfSroapx7A M2tur99VdAdJaJ4D3z4iWEPAL9t4cENY8DBUpKMw4WAeIJv68Lxxr86E43i5HcTFrEhT cLkn0MfRbl47yNB+fn3t9KpFBicqkQe4Mz8JC91Us3kVl0eDtL1VAu9GcyB81lVp/Le0 aRlwaBEOXZWfvuQUxOuFhKN3oC4O87CGqKZiSbAFZrnQukWLFsKUsPrikvRA6wS56ojx /kHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Nm366a6v; 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 l6si6635696ejr.184.2021.06.05.00.57.55; Sat, 05 Jun 2021 00:58:18 -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=Nm366a6v; 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 S230010AbhFEHxN (ORCPT + 99 others); Sat, 5 Jun 2021 03:53:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:55262 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229994AbhFEHxN (ORCPT ); Sat, 5 Jun 2021 03:53:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622879485; 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=AFxfbRh44tx3itGF+2reHu0Dp0ddlJOouXymhxZA6d8=; b=Nm366a6vgCQ2PUM+0FY3vHaH0hLfBwu2Ge238/N7SGVBDf5ViWAqHeT/9Vf0Y0eL3mR1ux fkSvhZkro7IFKYXU+0ieO40RkiBShcSgO2QGvuh0QLyNBfMGtmu1Ro8gSkY14rI6xUIjrd pm+pZ+yFxloBO7nL/ybhpwZGgD5nG1U= 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-286-fqSHjizUNGWV-HX4g9qZow-1; Sat, 05 Jun 2021 03:51:21 -0400 X-MC-Unique: fqSHjizUNGWV-HX4g9qZow-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 652ED801B12; Sat, 5 Jun 2021 07:51:20 +0000 (UTC) Received: from dhcp-128-65.nay.redhat.com (ovpn-12-110.pek2.redhat.com [10.72.12.110]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7BCB71B5B7; Sat, 5 Jun 2021 07:51:16 +0000 (UTC) Date: Sat, 5 Jun 2021 15:51:05 +0800 From: Dave Young To: Andy Shevchenko Cc: Jean Delvare , linux-kernel@vger.kernel.org, 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.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 06/02/21 at 11:53am, Andy Shevchenko wrote: > +Cc: Ard > > On Wed, Jun 02, 2021 at 11:42:14AM +0300, Andy Shevchenko wrote: > > On Fri, Dec 02, 2016 at 09:54:14PM +0200, Andy Shevchenko wrote: > > > Until now DMI information is lost when kexec'ing. Fix this in the same way as > > > it has been done for ACPI RSDP. > > > > > > Series has been tested on Galileo Gen2 where DMI is used by drivers, in > > > particular the default I2C host speed is choosen based on DMI system > > > information and now gets it correct. > > > > Still nothing happens for a while and problem still exists. > > Can we do something about it, please? Seems I totally missed this thread. Old emails lost. The question Ard asked is to confirm if the firmware converted the SMBIOS3 addr to a virtual address after exit boot service. I do not remember some easy way to check it due to lost the context of the code. But you can try to check it via dmesg|grep SMBIOS both in normal boot and kexeced boot log. And then compare if those addresses are identical. If the SMBIOS3 addr in kexec kernel is different then it should have been modified by firmware. Then we need patch kernel and kexec-tools to support it. You can try below patch to see if it works: apply a kexec-tools patch to kexec-tools if you do not use kexec -s (kexec_file_load): --- kexec-tools.orig/kexec/arch/i386/x86-linux-setup.c +++ kexec-tools/kexec/arch/i386/x86-linux-setup.c @@ -533,7 +533,8 @@ struct efi_setup_data { uint64_t runtime; uint64_t tables; uint64_t smbios; - uint64_t reserved[8]; + uint64_t smbios3; + uint64_t reserved[7]; }; struct setup_data { @@ -580,6 +581,8 @@ static int get_efi_values(struct efi_set ret = get_efi_value("/sys/firmware/efi/systab", "SMBIOS=0x", &esd->smbios); + ret |= get_efi_value("/sys/firmware/efi/systab", "SMBIOS3=0x", + &esd->smbios3); ret |= get_efi_value("/sys/firmware/efi/fw_vendor", "0x", &esd->fw_vendor); ret |= get_efi_value("/sys/firmware/efi/runtime", "0x", ============================================= Kernel patch: --- linux-x86.orig/arch/x86/include/asm/efi.h +++ linux-x86/arch/x86/include/asm/efi.h @@ -167,7 +167,8 @@ struct efi_setup_data { u64 __unused; u64 tables; u64 smbios; - u64 reserved[8]; + u64 smbios3; + u64 reserved[7]; }; extern u64 efi_setup; --- linux-x86.orig/arch/x86/kernel/kexec-bzimage64.c +++ linux-x86/arch/x86/kernel/kexec-bzimage64.c @@ -144,6 +144,7 @@ prepare_add_efi_setup_data(struct boot_p esd->fw_vendor = efi_fw_vendor; esd->tables = efi_config_table; esd->smbios = efi.smbios; + esd->smbios3 = efi.smbios3; sd->type = SETUP_EFI; sd->len = sizeof(struct efi_setup_data); --- linux-x86.orig/arch/x86/platform/efi/quirks.c +++ linux-x86/arch/x86/platform/efi/quirks.c @@ -497,8 +497,8 @@ void __init efi_free_boot_services(void) * their physical addresses therefore we pass them via setup_data and * correct those entries to their respective physical addresses here. * - * Currently only handles smbios which is necessary for some firmware - * implementation. + * Currently only handles smbios and smbios3 which is necessary for + * some firmware implementation. */ int __init efi_reuse_config(u64 tables, int nr_tables) { @@ -521,7 +521,7 @@ int __init efi_reuse_config(u64 tables, goto out; } - if (!data->smbios) + if (!data->smbios && !data->smbios3) goto out_memremap; sz = sizeof(efi_config_table_64_t); @@ -538,8 +538,10 @@ int __init efi_reuse_config(u64 tables, guid = ((efi_config_table_64_t *)p)->guid; - if (!efi_guidcmp(guid, SMBIOS_TABLE_GUID)) + if (!efi_guidcmp(guid, SMBIOS_TABLE_GUID) && data->smbios) ((efi_config_table_64_t *)p)->table = data->smbios; + else if (!efi_guidcmp(guid, SMBIOS3_TABLE_GUID) && data->smbios3) + ((efi_config_table_64_t *)p)->table = data->smbios3; p += sz; } early_memunmap(tablep, nr_tables * sz); Thanks Dave