Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1811860imu; Thu, 17 Jan 2019 03:44:01 -0800 (PST) X-Google-Smtp-Source: ALg8bN6ITTC9InRN+N8OD/GGaES7qngGijoxCEZkYJL/SwF5giE6fa7xPCWKZOJdHUrzUdPZcSVC X-Received: by 2002:a62:c42:: with SMTP id u63mr14311065pfi.73.1547725440998; Thu, 17 Jan 2019 03:44:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547725440; cv=none; d=google.com; s=arc-20160816; b=nSokZ5i3gVaV+SKvhrtGTZlfbswLSzgK6vmbidOekrkBI2pudh2CRvK2pvCdlWWaIv DjnowTc7lE1qMyw6ITfUzYOmI0HzizwOj8HD8UEXjsOmSUVM8ebfjd8mktDAchwQ5Glf OgDXeD8swRXfcYLhpl6tFPeTqhaPAQmWrxuTcZkkBsP/UDyBWUJMJTI3O4eed7Qwmf70 Sq1/wh5GjFOoc5ZhQyIstkvO6vl/6VRG4FZH7LsUjY5y5nXEeuUL0jiTftXyOwuJcf25 Vy8ZzqsG2RCw06g3XDT+XzPp0mou4diu3fU34HuVs3Cmwkk3dWPBpfCzvNU0fxwqI16V tcHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=jA0TkCllVwgIRb/r1q0SuNS5wOkSm5ei+H5meuSv86U=; b=qx1eZ0q6XssrP6Qu37paPWLhCkEj32hc4ZoPx72dgu7lhowbNk0dTAzfsSJbOGWEPP kuZlUrFhJ/LoOZCoiFLb6vuGFK9mGYYPlbJ1sH5ApqtZ0UcaNSDFmZdGunA9p8YQksPo GuuP2TJaWqAtU49769HlYLepDVk12momr3rl/RHty/8ohAWpW1E+kjrCb86VRw9L5IdR IobJoq1I+KsYDdsk71zMmZVHfKCPKo2RBRhpdeXeLKKPx90h1hJY82sD8C1M4QfUdkpQ z2zzSEpNTBzDTrQb1mFkOXQTLI3ki1/dwd246dI8v+RTTgopmEepXerW1Jc1h8m4Q67W SxMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i39si1547249plb.256.2019.01.17.03.43.45; Thu, 17 Jan 2019 03:44:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727486AbfAQIx2 (ORCPT + 99 others); Thu, 17 Jan 2019 03:53:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45154 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725848AbfAQIx2 (ORCPT ); Thu, 17 Jan 2019 03:53:28 -0500 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 mx1.redhat.com (Postfix) with ESMTPS id 2578965855; Thu, 17 Jan 2019 08:53:27 +0000 (UTC) Received: from dhcp-128-65.nay.redhat.com (ovpn-12-70.pek2.redhat.com [10.72.12.70]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CC38260F8A; Thu, 17 Jan 2019 08:53:20 +0000 (UTC) Date: Thu, 17 Jan 2019 16:53:16 +0800 From: Dave Young To: Kairui Song Cc: Borislav Petkov , linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, Baoquan He , kexec@lists.infradead.org, akpm@linux-foundation.org, robert.moore@intel.com, erik.schmauss@intel.com, rafael.j.wysocki@intel.com, Len Brown , Chao Fan , linux-acpi@vger.kernel.org Subject: Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map Message-ID: <20190117085316.GA17940@dhcp-128-65.nay.redhat.com> References: <20190115095834.22617-1-kasong@redhat.com> <20190115095834.22617-3-kasong@redhat.com> <20190115231005.GF6596@zn.tnic> <20190116094619.GB15409@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 17 Jan 2019 08:53:27 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add linux-acpi list On 01/17/19 at 03:41pm, Kairui Song wrote: > On Wed, Jan 16, 2019 at 5:46 PM Borislav Petkov wrote: > > > > On Wed, Jan 16, 2019 at 03:08:42PM +0800, Kairui Song wrote: > > > I didn't see a way to reuse things in that patch series, situation is > > > different, in that patch it needs to get RSDP in very early boot stage > > > so it did everything from scratch, in this patch kexec_file_load need > > > to get RSDP too, but everything is well setup so things are a lot > > > easier, just read from current boot_prams, efi and fallback to > > > acpi_find_root_pointer should be good. > > > > No no. Early code should find out that venerable RSDP thing once and > > will save it somewhere for further use. No gazillion parsings of it. > > Just once and share it with the rest of the code that needs it. > > > > How about we refill the boot_params.acpi_rsdp_addr if it is not valid > in early code, so it could be used as a reliable RSDP address source? > That should make things easier. > > But if early code should parse it and store it should be done in > Chao's patch, or I can post another patch to do it if Chao's patch is > merged. > > For now I think good to have something like this in this patch series > to always keep storing acpi_rsdp in late code, > acpi_os_get_root_pointer_late (maybe comeup with a better name later) > could be used anytime to get RSDP and no extra parsing: > > --- a/drivers/acpi/osl.c > +++ b/drivers/acpi/osl.c > @@ -180,8 +180,8 @@ void acpi_os_vprintf(const char *fmt, va_list args) > #endif > } > > -#ifdef CONFIG_KEXEC > static unsigned long acpi_rsdp; > +#ifdef CONFIG_KEXEC > static int __init setup_acpi_rsdp(char *arg) > { > return kstrtoul(arg, 16, &acpi_rsdp); > @@ -189,28 +189,38 @@ static int __init setup_acpi_rsdp(char *arg) > early_param("acpi_rsdp", setup_acpi_rsdp); > #endif > > +acpi_physical_address acpi_os_get_root_pointer_late(void) { > + return acpi_rsdp; > +} > + > acpi_physical_address __init acpi_os_get_root_pointer(void) > { > acpi_physical_address pa; > > -#ifdef CONFIG_KEXEC > if (acpi_rsdp) > return acpi_rsdp; > -#endif > + > pa = acpi_arch_get_root_pointer(); > - if (pa) > + if (pa) { > + acpi_rsdp = pa; > return pa; > + } > > if (efi_enabled(EFI_CONFIG_TABLES)) { > - if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) > + if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) { > + acpi_rsdp = efi.acpi20; > return efi.acpi20; > - if (efi.acpi != EFI_INVALID_TABLE_ADDR) > + } > + if (efi.acpi != EFI_INVALID_TABLE_ADDR) { > + acpi_rsdp = efi.acpi; > return efi.acpi; > + } > pr_err(PREFIX "System description tables not found\n"); > } else if (IS_ENABLED(CONFIG_ACPI_LEGACY_TABLES_LOOKUP)) { > acpi_find_root_pointer(&pa); > } > > + acpi_rsdp = pa; > return pa; > } > > > -- > > Regards/Gruss, > > Boris. > > > > Good mailing practices for 400: avoid top-posting and trim the reply. > -- > Best Regards, > Kairui Song