Message ID | 20230109135828.879136-3-mark.rutland@arm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2169700wrt; Mon, 9 Jan 2023 05:59:41 -0800 (PST) X-Google-Smtp-Source: AMrXdXtmq4+0XK28vupSJ0VxFLYMMnyO+A99JgL03eFNfKfzQeRBAKarIQMCnv+r9R3PkHpiZ+v3 X-Received: by 2002:a05:6a20:9b87:b0:ac:44ab:be3b with SMTP id mr7-20020a056a209b8700b000ac44abbe3bmr77466553pzb.60.1673272781605; Mon, 09 Jan 2023 05:59:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673272781; cv=none; d=google.com; s=arc-20160816; b=m3XfB3M0KCt3LcpKX4if4rezoyTpC6Kmc/l8OEBGBobmEbPT7qS0Nu9HdxAa/yazmf TPB3RqVx/5j0bPdvk8DEezhwilusQY1R5K+7GgXR+SVivh7WbRvsbqGhcsIIyW/GFt1x OpTB5PPaOucfuvRLk71X0t6WXa3N9f+2mhziF0wfEnlGa/QCIEDBq7CiQR+ouatwPMVP rZWABtz/YJa5+76B3+XSktUb+V04B3+8eDiZ0++Lqh3SnTzWOy36axc0VHhBOqQPj3bM o1A1cAyOOnqLgKsxh+wblIU9AurWrbvurqyc6BAvS1NI9Nd06NGBKx2gs05L8ctUYLQP dqQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=B/d9Pij30xbOyFawkCQpqEZ9o8SJzgaQZIB7fSTKZOo=; b=h2vxt4CdnnuPBqUxzWoMgaSxLw/QiTzj3zYuJxXQwujbuPRnpsyNt4vWPxvwEMmfpX SDH1KVrHQHNe+H/o1Si1PCeHMFA7mkz3xLf3PLD7MyOH/q2PBG21pLk4BsltOHFJVbu0 7DEDfwmJ4t35qya4AOCbCiO8qwx8zq+qBH+jqutXtTos7B40S/r9wZaRjahq/wqmMB66 Lmucgswhpy4CwXBt0ky55pG72V8cuIhMHWtVUf8WuXsskasxo1EbK2+9kACTn12ylqAy NV830bn7c5f59+CpurjhgDm4X49GtdBc1W9k1yrH29xyJABc7WpL3jijakonwUcN4tsD z0hg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h17-20020a635311000000b0046ef23ae9a6si9643195pgb.848.2023.01.09.05.59.29; Mon, 09 Jan 2023 05:59:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237083AbjAIN7H (ORCPT <rfc822;274620705z@gmail.com> + 99 others); Mon, 9 Jan 2023 08:59:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237251AbjAIN6o (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 9 Jan 2023 08:58:44 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9879525FE; Mon, 9 Jan 2023 05:58:43 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5ECC71650; Mon, 9 Jan 2023 05:59:25 -0800 (PST) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 872733F23F; Mon, 9 Jan 2023 05:58:41 -0800 (PST) From: Mark Rutland <mark.rutland@arm.com> To: linux-arm-kernel@lists.infradead.org, Len Brown <lenb@kernel.org>, "Rafael J . Wysocki" <rafael.j.wysocki@intel.com>, Robert Moore <robert.moore@intel.com> Cc: catalin.marinas@arm.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, mark.rutland@arm.com, mhiramat@kernel.org, ndesaulniers@google.com, ojeda@kernel.org, peterz@infradead.org, revest@chromium.org, rostedt@goodmis.org, will@kernel.org Subject: [PATCH 2/8] ACPI: Don't build ACPICA with '-Os' Date: Mon, 9 Jan 2023 13:58:22 +0000 Message-Id: <20230109135828.879136-3-mark.rutland@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230109135828.879136-1-mark.rutland@arm.com> References: <20230109135828.879136-1-mark.rutland@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754553680140498277?= X-GMAIL-MSGID: =?utf-8?q?1754553680140498277?= |
Series |
arm64/ftrace: Add support for DYNAMIC_FTRACE_WITH_CALL_OPS
|
|
Commit Message
Mark Rutland
Jan. 9, 2023, 1:58 p.m. UTC
The ACPICA code has been built with '-Os' since the beginning of git
history, though there's no explanatory comment as to why.
This is unfortunate as building with '-Os' overrides -falign-functions,
which prevents CONFIG_FUNCITON_ALIGNMENT and
CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_64B from having their expected effect
on the ACPICA code. This is doubly unfortunate as in subsequent patches
arm64 will depend upon CONFIG_FUNCTION_ALIGNMENT for its ftrace
implementation.
Drop the '-Os' flag when building the ACPICA code. With this removed,
the code builds cleanly and works correctly in testing so far.
I've tested this by selecting CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_64B=y,
building and booting a kernel using ACPI, and looking for misaligned
text symbols:
* arm64:
Before:
# grep ' [Tt] ' /proc/kallsyms | grep -iv '[048c]0 [Tt] ' | wc -l
908
# grep ' [Tt] ' /proc/kallsyms | grep -iv '[048c]0 [Tt] ' | grep acpi | wc -l
576
After:
# grep ' [Tt] ' /proc/kallsyms | grep -iv '[048c]0 [Tt] ' | wc -l
322
# grep ' [Tt] ' /proc/kallsyms | grep -iv '[048c]0 [Tt] ' | grep acpi | wc -l
0
* x86_64:
Before:
# grep ' [Tt] ' /proc/kallsyms | grep -iv '[048c]0 [Tt] ' | wc -l
2057
# grep ' [Tt] ' /proc/kallsyms | grep -iv '[048c]0 [Tt] ' | grep acpi | wc -l
706
After:
# grep ' [Tt] ' /proc/kallsyms | grep -iv '[048c]0 [Tt] ' | wc -l
1351
# grep ' [Tt] ' /proc/kallsyms | grep -iv '[048c]0 [Tt] ' | grep acpi | wc -l
0
With the patch applied, the remaining unaligned text labels are a
combination of static call trampolines and labels in assembly, which
will be dealt with in subsequent patches.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Florent Revest <revest@chromium.org>
Cc: Len Brown <lenb@kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Robert Moore <robert.moore@intel.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Will Deacon <will@kernel.org>
Cc: linux-acpi@vger.kernel.org
---
drivers/acpi/acpica/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Mon, Jan 9, 2023 at 2:58 PM Mark Rutland <mark.rutland@arm.com> wrote: > > The ACPICA code has been built with '-Os' since the beginning of git > history, though there's no explanatory comment as to why. > > This is unfortunate as building with '-Os' overrides -falign-functions, > which prevents CONFIG_FUNCITON_ALIGNMENT and > CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_64B from having their expected effect > on the ACPICA code. This is doubly unfortunate as in subsequent patches > arm64 will depend upon CONFIG_FUNCTION_ALIGNMENT for its ftrace > implementation. > > Drop the '-Os' flag when building the ACPICA code. With this removed, > the code builds cleanly and works correctly in testing so far. Fair enough. Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> and please feel free to route this through the arch tree along with the rest of the series. Thanks! > I've tested this by selecting CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_64B=y, > building and booting a kernel using ACPI, and looking for misaligned > text symbols: > > * arm64: > > Before: > # grep ' [Tt] ' /proc/kallsyms | grep -iv '[048c]0 [Tt] ' | wc -l > 908 > # grep ' [Tt] ' /proc/kallsyms | grep -iv '[048c]0 [Tt] ' | grep acpi | wc -l > 576 > > After: > # grep ' [Tt] ' /proc/kallsyms | grep -iv '[048c]0 [Tt] ' | wc -l > 322 > # grep ' [Tt] ' /proc/kallsyms | grep -iv '[048c]0 [Tt] ' | grep acpi | wc -l > 0 > > * x86_64: > > Before: > # grep ' [Tt] ' /proc/kallsyms | grep -iv '[048c]0 [Tt] ' | wc -l > 2057 > # grep ' [Tt] ' /proc/kallsyms | grep -iv '[048c]0 [Tt] ' | grep acpi | wc -l > 706 > > After: > # grep ' [Tt] ' /proc/kallsyms | grep -iv '[048c]0 [Tt] ' | wc -l > 1351 > # grep ' [Tt] ' /proc/kallsyms | grep -iv '[048c]0 [Tt] ' | grep acpi | wc -l > 0 > > With the patch applied, the remaining unaligned text labels are a > combination of static call trampolines and labels in assembly, which > will be dealt with in subsequent patches. > > Signed-off-by: Mark Rutland <mark.rutland@arm.com> > Cc: Catalin Marinas <catalin.marinas@arm.com> > Cc: Florent Revest <revest@chromium.org> > Cc: Len Brown <lenb@kernel.org> > Cc: Masami Hiramatsu <mhiramat@kernel.org> > Cc: Peter Zijlstra <peterz@infradead.org> > Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > Cc: Robert Moore <robert.moore@intel.com> > Cc: Steven Rostedt <rostedt@goodmis.org> > Cc: Will Deacon <will@kernel.org> > Cc: linux-acpi@vger.kernel.org > --- > drivers/acpi/acpica/Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/acpi/acpica/Makefile b/drivers/acpi/acpica/Makefile > index 9e0d95d76fff7..30f3fc13c29d1 100644 > --- a/drivers/acpi/acpica/Makefile > +++ b/drivers/acpi/acpica/Makefile > @@ -3,7 +3,7 @@ > # Makefile for ACPICA Core interpreter > # > > -ccflags-y := -Os -D_LINUX -DBUILDING_ACPICA > +ccflags-y := -D_LINUX -DBUILDING_ACPICA > ccflags-$(CONFIG_ACPI_DEBUG) += -DACPI_DEBUG_OUTPUT > > # use acpi.o to put all files here into acpi.o modparam namespace > -- > 2.30.2 >
diff --git a/drivers/acpi/acpica/Makefile b/drivers/acpi/acpica/Makefile index 9e0d95d76fff7..30f3fc13c29d1 100644 --- a/drivers/acpi/acpica/Makefile +++ b/drivers/acpi/acpica/Makefile @@ -3,7 +3,7 @@ # Makefile for ACPICA Core interpreter # -ccflags-y := -Os -D_LINUX -DBUILDING_ACPICA +ccflags-y := -D_LINUX -DBUILDING_ACPICA ccflags-$(CONFIG_ACPI_DEBUG) += -DACPI_DEBUG_OUTPUT # use acpi.o to put all files here into acpi.o modparam namespace