Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3010310imu; Fri, 18 Jan 2019 03:16:00 -0800 (PST) X-Google-Smtp-Source: ALg8bN4x143u3na4F17ZPFtaTVBRCay5snCjk7DG+763zMI6J7eAisPEmMI9VS9nnFC9k4USRX/5 X-Received: by 2002:a17:902:c5:: with SMTP id a63mr19079328pla.267.1547810160080; Fri, 18 Jan 2019 03:16:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547810160; cv=none; d=google.com; s=arc-20160816; b=Y2RfFQVEc3dx4B7ybVZQaREHWvSd2Jup1eb3lZXMJenin4hE7uQ/laazmvefKIEWdL ysD8/8WZ7Xyj8fwhRCXwU7Ua7cb3cUtS5qiidfaqZcNBOw8/GXuzl7rCkoqLR9hWJHPR 7Z149CPWc9iFA3nh7gSUjL2OzH8mleUS0K6iM23ACnifNQk0YBkARxY8si22OF5zADOP l8kRbMt7yGo59NNp5QOgk1G1dNEOolu1xVumSTrqN53O06ayDAdOsYveO0WC8W+8Jf5x 5oH+9YhD8MgxLiQZcGQW7f9X/QzFE8+CRWfrgpEVQkG4DSHpYsC4QA7xJJe/gXbbdH1E U12g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=bz/PbelI6GCZwfhWgmPFjit8Ak57ndjqCjK6mxLwkDE=; b=yIrcKsY63fegnMQDVmfxYOvvl3g6vehqDIm6XjMfY9RT/laZxmzCn4IKiunDEN9SsN n8BaazBr5vPVXhSW+wa0C6r/mRsstENZr2bY8YyQZ9ORe3ZgK491SzU1iS2gXNqwy0V6 9mXAPBgjc/7K3wNh4gIGT5xOetikSJrcv+uOyRruKt3T0EtqBKYMfoykWDtQgSXmerAK Fn7acqh29Zk8mLymr34gVU7LTxvUZU6/0Wwfh07I21QpKLWRhg2MHLUQhly2JBrSx95X 2x8AOTS+vPxsthGIWRJ19nUbSOXVLzpqrMW0JwR1fFMYFWbZuxvmJeXSRJU7bkpsvc+b CG2w== 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 j11si4269693pgk.265.2019.01.18.03.15.44; Fri, 18 Jan 2019 03:16: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 S1727448AbfARLOI (ORCPT + 99 others); Fri, 18 Jan 2019 06:14:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40580 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726722AbfARLOH (ORCPT ); Fri, 18 Jan 2019 06:14:07 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6FF0BA6DE0; Fri, 18 Jan 2019 11:14:07 +0000 (UTC) Received: from kasong-desktop-nay-redhat-com.nay.redhat.com (unknown [10.66.128.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 69B37101960A; Fri, 18 Jan 2019 11:13:55 +0000 (UTC) From: Kairui Song To: linux-kernel@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, x86@kernel.org, dyoung@redhat.com, bhe@redhat.com, kexec@lists.infradead.org, akpm@linux-foundation.org, robert.moore@intel.com, erik.schmauss@intel.com, rafael.j.wysocki@intel.com, lenb@kernel.org, fanc.fnst@cn.fujitsu.com, linux-acpi@vger.kernel.org, Kairui Song Subject: [PATCH v3 2/3] acpi: store acpi_rsdp address for later kexec usage Date: Fri, 18 Jan 2019 19:13:09 +0800 Message-Id: <20190118111310.29589-3-kasong@redhat.com> In-Reply-To: <20190118111310.29589-1-kasong@redhat.com> References: <20190118111310.29589-1-kasong@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 18 Jan 2019 11:14:07 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently we have acpi_os_get_root_pointer as the universal function to get RSDP address. But the function itself and some functions it depends on are in .init section and make it not easy to retrieve the RSDP value once kernel is initialized. And for kexec, it need to retrive RSDP again if EFI is disabled, because the second kernel will not be able get the RSDP value in such case, so it expects either the user specify the RSDP value using kernel cmdline, or kexec could retrive and pass the RSDP value using boot_params. This patch stores the RSDP address when initialized is done, and introduce an acpi_os_get_root_pointer_late for later kexec usage. Signed-off-by: Kairui Song --- drivers/acpi/osl.c | 10 ++++++++++ include/linux/acpi.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index f29e427d0d1d..6340d34d0df1 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -187,6 +187,16 @@ static int __init setup_acpi_rsdp(char *arg) return kstrtoul(arg, 16, &acpi_rsdp); } early_param("acpi_rsdp", setup_acpi_rsdp); + +acpi_physical_address acpi_os_get_root_pointer_late(void) { + return acpi_rsdp; +} + +static int __init acpi_store_root_pointer(void) { + acpi_rsdp = acpi_os_get_root_pointer(); + return 0; +} +late_initcall(acpi_store_root_pointer); #endif acpi_physical_address __init acpi_os_get_root_pointer(void) diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 87715f20b69a..226f2572eb8e 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -892,6 +892,9 @@ static inline void arch_reserve_mem_area(acpi_physical_address addr, { } #endif /* CONFIG_X86 */ +#ifdef CONFIG_KEXEC +acpi_physical_address acpi_os_get_root_pointer_late(void); +#endif #else #define acpi_os_set_prepare_sleep(func, pm1a_ctrl, pm1b_ctrl) do { } while (0) #endif -- 2.20.1