From patchwork Thu Apr 14 00:04:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 8829961 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 27995C0554 for ; Thu, 14 Apr 2016 00:07:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 438AB20274 for ; Thu, 14 Apr 2016 00:07:16 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4FA00201B9 for ; Thu, 14 Apr 2016 00:07:15 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aqUmT-0007Qc-VS; Thu, 14 Apr 2016 00:05:09 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aqUmT-0007Pw-2u for xen-devel@lists.xensource.com; Thu, 14 Apr 2016 00:05:09 +0000 Received: from [85.158.137.68] by server-14.bemta-3.messagelabs.com id 0F/80-03098-4BEDE075; Thu, 14 Apr 2016 00:05:08 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrJLMWRWlGSWpSXmKPExsVybKJsh+7me3z hBsuOqVvcm/Ke3YHRY3vfLvYAxijWzLyk/IoE1oy5fdwFpwUqtl6awNTA+I+3i5GLQ0hgKqPE ybctLBDODCaJXUsmsXcxcnCwCehK3Lwt0cXIySEikCBx9+k3ZpAaZoFjrBLzVs1lBUkIC3hIP O1ezwZiswioSsx7vgXM5hWwl3h4dwk7iC0hICfR8mM3WD2ngIPEgp0rwGwhoJr+2wcYIWoyJO b1zGGFsL0kFt24BGWrSVw9t4l5AiPfAkaGVYzqxalFZalFusZ6SUWZ6RkluYmZObqGBsZ6uan FxYnpqTmJScV6yfm5mxiBQcIABDsYm784HWKU5GBSEuU1WcUXLsSXlJ9SmZFYnBFfVJqTWnyI UYaDQ0mC9/BdoJxgUWp6akVaZg4wXGHSEhw8SiK820HSvMUFibnFmekQqVOMilLivDNAEgIgi YzSPLg2WIxcYpSVEuZlBDpEiKcgtSg3swRV/hWjOAejkjDvFJApPJl5JXDTXwEtZgJaXPaOF2 RxSSJCSqqBUbYlP0RE6frtZZ2sW1a7P7glXLf4497vvoYff1VHvtqU+e6U5puzv9fceqQVsmu 5Ylvcx4zIxVt3/NgvNf1W0lSGjSZmfI9mNjz8vkvM+X7hpLATgqtnbxUtj2baISax7lfIbf+f ctOUFrL1xXz7Xsx3VmnaxK+NzTmbJPq83mze4B24gjvLKkqJpTgj0VCLuag4EQBy+9nWjAIAA A== X-Env-Sender: mcgrof@kernel.org X-Msg-Ref: server-5.tower-31.messagelabs.com!1460592306!34694726!1 X-Originating-IP: [198.145.29.136] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.28; banners=-,-,- X-VirusChecked: Checked Received: (qmail 35993 invoked from network); 14 Apr 2016 00:05:07 -0000 Received: from mail.kernel.org (HELO mail.kernel.org) (198.145.29.136) by server-5.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 14 Apr 2016 00:05:07 -0000 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 34FE3201BB; Thu, 14 Apr 2016 00:05:05 +0000 (UTC) Received: from garbanzo.do-not-panic.com (c-73-15-241-2.hsd1.ca.comcast.net [73.15.241.2]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6070D2037C; Thu, 14 Apr 2016 00:05:03 +0000 (UTC) From: "Luis R. Rodriguez" To: bp@alien8.de, hpa@zytor.com, tglx@linutronix.de, mingo@redhat.com, rusty@rustcorp.com.au Date: Wed, 13 Apr 2016 17:04:36 -0700 Message-Id: <1460592286-300-7-git-send-email-mcgrof@kernel.org> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1460592286-300-1-git-send-email-mcgrof@kernel.org> References: <1460592286-300-1-git-send-email-mcgrof@kernel.org> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Cc: kozerkov@parallels.com, matt@codeblueprint.co.uk, bigeasy@linutronix.de, lv.zheng@intel.com, ffainelli@freebox.fr, mbizon@freebox.fr, xen-devel@lists.xensource.com, x86@kernel.org, robert.moore@intel.com, linux-acpi@vger.kernel.org, glin@suse.com, lenb@kernel.org, julien.grall@linaro.org, josh@joshtriplett.org, george.dunlap@citrix.com, jlee@suse.com, lguest@lists.ozlabs.org, boris.ostrovsky@oracle.com, andriy.shevchenko@linux.intel.com, jgross@suse.com, toshi.kani@hp.com, andrew.cooper3@citrix.com, rjw@rjwysocki.net, linux-kernel@vger.kernel.org, luto@amacapital.net, "Luis R. Rodriguez" , david.vrabel@citrix.com, tiwai@suse.de Subject: [Xen-devel] [PATCH v6 06/16] x86/init: use a platform legacy quirk for ebda X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP This replaces the paravirt_enabled() check with a proper x86 legacy platform quirk. As per 0-day, this bumps the vmlinux size using i386-tinyconfig as follows: TOTAL TEXT init.text x86_early_init_platform_quirks() +39 +35 +35 +25 That's a 4 byte total overhead, the rest is all cleared out upon init as its all __init text. v2: document 0-day vmlinux size impact Signed-off-by: Luis R. Rodriguez --- arch/x86/include/asm/x86_init.h | 3 +++ arch/x86/kernel/head.c | 2 +- arch/x86/kernel/platform-quirks.c | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h index 8bb8c1a4615a..89d9d57e145d 100644 --- a/arch/x86/include/asm/x86_init.h +++ b/arch/x86/include/asm/x86_init.h @@ -145,9 +145,12 @@ struct timespec; * struct x86_legacy_features - legacy x86 features * * @rtc: this device has a CMOS real-time clock present + * @ebda_search: it's safe to search for the EBDA signature in the hardware's + * low RAM */ struct x86_legacy_features { int rtc; + int ebda_search; }; /** diff --git a/arch/x86/kernel/head.c b/arch/x86/kernel/head.c index 992f442ca155..afe65dffee80 100644 --- a/arch/x86/kernel/head.c +++ b/arch/x86/kernel/head.c @@ -38,7 +38,7 @@ void __init reserve_ebda_region(void) * that the paravirt case can handle memory setup * correctly, without our help. */ - if (paravirt_enabled()) + if (!x86_platform.legacy.ebda_search) return; /* end of low (conventional) memory */ diff --git a/arch/x86/kernel/platform-quirks.c b/arch/x86/kernel/platform-quirks.c index 021a5f973ce3..01b159781d96 100644 --- a/arch/x86/kernel/platform-quirks.c +++ b/arch/x86/kernel/platform-quirks.c @@ -7,8 +7,12 @@ void __init x86_early_init_platform_quirks(void) { x86_platform.legacy.rtc = 1; + x86_platform.legacy.ebda_search = 0; switch (boot_params.hdr.hardware_subarch) { + case X86_SUBARCH_PC: + x86_platform.legacy.ebda_search = 1; + break; case X86_SUBARCH_XEN: case X86_SUBARCH_LGUEST: case X86_SUBARCH_INTEL_MID: