Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1693506imu; Thu, 17 Jan 2019 01:33:12 -0800 (PST) X-Google-Smtp-Source: ALg8bN4vEJI6qkUVfCytJVBfGyIBfG5yKVUfVAhA/f+0BmBFhuMdADHn/ww/8dl6zNmksQgQEJJS X-Received: by 2002:a65:4646:: with SMTP id k6mr8050851pgr.153.1547717592060; Thu, 17 Jan 2019 01:33:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547717592; cv=none; d=google.com; s=arc-20160816; b=R6hHTCCd/NC1QG0Z8hX73WY8LEm3BvnsoBstZ1Srh/dEHZPc+9uKb/Jb+bTQW+wN6M xRYn9s/6JKjh18pcOGJQf1eT4ET3R3fW0WfmhTlT2Vbh9VEPpXYE5J8zZON8i+pO0CYp 2MsUMZMuAqsq4wtN69/sAgrjc918OKI9h1namRo8QjqGxdvQ05Fwp3ESrrck5qPcCVVX WsCwWR0jePtx1uuy+WLtxU4Kd4BjS/MdENT0O77KtaY7h/9WcLFASjOlMeC6AAqC0Dse hihVYAuXh79Bw/67NkGjEj3s+kmb9SRnBkDncNWZ+VhzUzKwr8hzIrgLYBoen4rVB3Ar Psrw== 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=k7fuRWv879lJp6FIFpTq3RFmUNUJL+XyPyFOHxk0Dww=; b=0z+q72YrCsSgauWsYlNyAz6KxJs1GQ0z6jLv0L9PwHyw585ncoOCiIp4vOq1WUfiyb ASIdS5o/9z0666EJmc8XUK1j/1Z+ijfBffUrE+QJ8Z84w+J++oJuBVSepPbq7oj/j8r3 uW1v6zXuoa1mmRUJAjUs1oLjySgHkI5HtzRcPnBSdXOOEz/KfmDzsdSXRBbdXnwdJxFR PqdEe7sIuNpzIRRmcB6p6vLAUybVL2uDSXVu4WG0a0XqaBmk95wvfJ7KT9Ep2QYVPSNP M9LjPGOPPb+ltUTxAUehUrbWDgC0H4WIglmKPJ9HeCu/wunMMc/QWPT1HK9drxMfVAt/ 10Xw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f4si1109368pfc.234.2019.01.17.01.32.55; Thu, 17 Jan 2019 01:33:12 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727582AbfAQHvB (ORCPT + 99 others); Thu, 17 Jan 2019 02:51:01 -0500 Received: from mail.cn.fujitsu.com ([183.91.158.132]:40524 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727272AbfAQHvB (ORCPT ); Thu, 17 Jan 2019 02:51:01 -0500 X-IronPort-AV: E=Sophos;i="5.56,488,1539619200"; d="scan'208";a="52204647" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 17 Jan 2019 15:50:56 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (unknown [10.167.33.80]) by cn.fujitsu.com (Postfix) with ESMTP id 55B4D4BAD9D8; Thu, 17 Jan 2019 15:50:54 +0800 (CST) Received: from localhost.localdomain (10.167.225.56) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 17 Jan 2019 15:51:01 +0800 Date: Thu, 17 Jan 2019 15:49:59 +0800 From: Chao Fan To: Kairui Song CC: Borislav Petkov , , , , , , Dave Young , Baoquan He , , , , , , Len Brown Subject: Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map Message-ID: <20190117074959.GB31097@localhost.localdomain> 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.10.1 (2018-07-13) X-Originating-IP: [10.167.225.56] X-yoursite-MailScanner-ID: 55B4D4BAD9D8.AD2C1 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: fanc.fnst@cn.fujitsu.com X-Spam-Status: No Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 17, 2019 at 03:41:13PM +0800, 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. I think it's OK. Try to read it, if get RSDP, use it. If not, search in EFI/BIOS/... and refill the RSDP to boot_params.acpi_rsdp_addr. By the way, I search kernel code, I didn't find other code fill and use it, only you(KEXEC) are trying to fill it. If I miss something, please let me know. Thanks, Chao Fan > >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 > >