Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3020356imu; Fri, 18 Jan 2019 03:28:12 -0800 (PST) X-Google-Smtp-Source: ALg8bN4ZUIodhka+bpu/unMtG9VmGLhPSK/n/ma7o8OnOuH3Fi6DDRvo5I6TEY7zip1pkPWViyz+ X-Received: by 2002:a63:c848:: with SMTP id l8mr17019824pgi.78.1547810892160; Fri, 18 Jan 2019 03:28:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547810892; cv=none; d=google.com; s=arc-20160816; b=zw3QekShbKD1hKiokUaHt6KBl4+BFRp1yOGo2lG/ZkPVdZtIkovcbm0IcPTrQ6375z 9Cnmv4NBh7MxOF5/TFRCxUjJ7GWeNro49XUu4QYTsxmwu+uedEuUKRvvfjJqRb6XqTHo KFxKsfFmOwxuInqROzXiARG/oMZfQvS7NCMckBzZXGnpw1iPYT7xYzCIgASI5anQ7fum c86N9PvnbZdieapWNQST/FOW2vJJ2zmSE8nSq1WhE+/JgQ6NhPngyUjpehQReBBwDldG ZGMQq7GH+6CPjK1D7b8LtO0C7dbTZ0bAr3tQecx6SHFHhLkOCz9glGT3Px3CVmWu4B84 G8Ag== 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:dkim-signature; bh=Y1dNmCKWqwwtJDRAbEC9BU5YBAZMoZ0drcObkWF/4pg=; b=gs7nF1VcbRCD1SDU61yPIPfHkl5BRG9Xl4H6lhP0UGev5mioLyyGN0/HBq/dzGbtzy zUOENgGzlNERCJqi3sfaasvJ5oklPPKMjM29KLo0AfUzlFYDDqyBszjU77m9Yx2DevaL aNiRO5O382QmFB0tCCJo7GS75EF7CJ2C47jhe/f6fxZQNsNsbIoECBYMcW6QF15qJKqo CNo24kG9Kryg/e0C+wmT7iawqr2iEOT7DHBbNohhDNoAe5T9EJF06ZziwHBjwqmoEeTt WG/59QP71qKQ3AU2X826y96kDdVb1BF+XytDP1GugIO4R1m9LriSq8hRx1imSRI54z/V tOVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=ohsRJja8; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p18si3731908plo.223.2019.01.18.03.27.53; Fri, 18 Jan 2019 03:28: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; dkim=pass header.i=@alien8.de header.s=dkim header.b=ohsRJja8; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727205AbfARL0g (ORCPT + 99 others); Fri, 18 Jan 2019 06:26:36 -0500 Received: from mail.skyhub.de ([5.9.137.197]:41052 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726722AbfARL0g (ORCPT ); Fri, 18 Jan 2019 06:26:36 -0500 Received: from zn.tnic (p200300EC2BCB1B00329C23FFFEA6A903.dip0.t-ipconnect.de [IPv6:2003:ec:2bcb:1b00:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 7A5321EC0573; Fri, 18 Jan 2019 12:26:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1547810794; 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: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=Y1dNmCKWqwwtJDRAbEC9BU5YBAZMoZ0drcObkWF/4pg=; b=ohsRJja87jWpheRc0vmMU0/7Nh6HaWXN1UsHHoNU2WeTk4FihXzM7euDltsX2dU9gftk4K pDS+QocEq1hAy/HvMdQTnggpJS4ljJH+5Uj8rReGrB/F/x855D7JVXrGNbd9xhp9AQnGXN 1mYDAinBOWgv3qI7Wf4eQZEwdl859ik= Date: Fri, 18 Jan 2019 12:26:28 +0100 From: Borislav Petkov To: Kairui Song Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, 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 Subject: Re: [PATCH v3 2/3] acpi: store acpi_rsdp address for later kexec usage Message-ID: <20190118112628.GC622@zn.tnic> References: <20190118111310.29589-1-kasong@redhat.com> <20190118111310.29589-3-kasong@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190118111310.29589-3-kasong@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 18, 2019 at 07:13:09PM +0800, Kairui Song wrote: > 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; > +} No, this is getting completely nuts: there's a bunch of functions which all end up returning boot_params's field except pvh_get_root_pointer(). And now you're adding a late variant. And the cmdline paramater acpi_rsdp is in a CONFIG_KEXEC wrapper, and and... Wait until Chao Fan's stuff is applied, then do your changes ontop an drop all that ifdeffery. We will make this RDSP thing enabled unconditionally so that there's no need for ifdeffery and function wrappers. Also, after Chao's stuff, you won't need to call acpi_os_get_root_pointer() because the early code would've done that. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.