From patchwork Fri Jun 24 15:23:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 12894766 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A7C0DC43334 for ; Fri, 24 Jun 2022 15:26:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SveQDbL2KwLMWbR4zJ710zsAvd4pndxu0caKeLPW9aI=; b=oowY4Zuglf41ts 3Djla2W/ePR1EGWEO3iY3+oYJ40HF1MvRPIxa2tv6pcEmNWKNBIk1Jm6PBTGDayv4M0wJiv0oxg99 BixlAFfCW5lWoi/70au7/IIZEWopv9LWf4rViLrsTDYx86JD4GesCEWeK/afaQZGngX3s61rr88S0 ZnNHmYaBEfk7cUKLVDMTwXXT3sNbUtiI31KXQsctvS0L4gMBKVhqT+smFvDG3sDRARjnpxIGn1bL2 xUMwnTsd/kuOkVYMqmg9LBMmphOkbrxMgDzPTJbShBtYrDP8aEIbepvuEWCbJl4ZDUFAVbWAZFfBX N63sW8aiu3IJOCyBzHRA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o4lBM-002qUw-MY; Fri, 24 Jun 2022 15:25:17 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o4l9z-002pza-L4 for linux-arm-kernel@lists.infradead.org; Fri, 24 Jun 2022 15:23:54 +0000 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 F274E143D; Fri, 24 Jun 2022 08:23:45 -0700 (PDT) Received: from usa.arm.com (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A00FC3F534; Fri, 24 Jun 2022 08:23:44 -0700 (PDT) From: Sudeep Holla To: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org Cc: Sudeep Holla , Ard Biesheuvel , Catalin Marinas , Will Deacon , "Rafael J . Wysocki" , Jose Marinho Subject: [PATCH 1/3] arm64: efi: Simplify arch_efi_call_virt macro by not using efi_##f##_t type Date: Fri, 24 Jun 2022 16:23:29 +0100 Message-Id: <20220624152331.4009502-2-sudeep.holla@arm.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220624152331.4009502-1-sudeep.holla@arm.com> References: <20220624152331.4009502-1-sudeep.holla@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220624_082351_821538_38E05643 X-CRM114-Status: GOOD ( 11.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Currently, the arch_efi_call_virt() assumes all users of it will have defined a type 'efi_##f##_t' to make use of it. It is unnecessarily forcing the users to create a new typedef when __efi_rt_asm_wrapper() actually expects void pointer. Simplify the arch_efi_call_virt() macro by typecasting p->f to (void *) as required by __efi_rt_asm_wrapper() and eliminate the explicit need for efi_##f##_t type for every user of this macro. This is needed now in preparation to enable PRMT support on ARM64. Signed-off-by: Sudeep Holla --- arch/arm64/include/asm/efi.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) Hi Ard, I am not sure if you prefer to add type for each users of this or this is acceptable. I see only compile time advantage but I am not sure if it make sense to add typedefs in ACPI PRMT driver just for this reason. Let me know. Regards, Sudeep diff --git a/arch/arm64/include/asm/efi.h b/arch/arm64/include/asm/efi.h index ad55079abe47..263d7fd67207 100644 --- a/arch/arm64/include/asm/efi.h +++ b/arch/arm64/include/asm/efi.h @@ -29,9 +29,7 @@ int efi_set_mapping_permissions(struct mm_struct *mm, efi_memory_desc_t *md); #define arch_efi_call_virt(p, f, args...) \ ({ \ - efi_##f##_t *__f; \ - __f = p->f; \ - __efi_rt_asm_wrapper(__f, #f, args); \ + __efi_rt_asm_wrapper((void *)p->f, #f, args); \ }) #define arch_efi_call_virt_teardown() \ From patchwork Fri Jun 24 15:23:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 12894764 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E5218C43334 for ; Fri, 24 Jun 2022 15:25:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1jHsGGEMRWyH596EqdW+zgMrNzM9PkJTSE+41ikMCbk=; b=Ckk3SNEQSSUzBY BtNIfDVpa55/Cgf44rqh3Q0etdeTG77ApUWEbwYoeT8oEv/OFmBKJI5rDktrYnA5dDU9J3NdNGzbQ VELm4C3N7L6WiNRaGdCq75iiFwyKLAm9vyymYV36NT6v1G4kXzVa/7DROVF4HBdITb5irIO+moxWO mMrTTWxgmPN9bOdjigKY6Yqs+arCL+G/l1/HiStY7h0gqCrGhM/uLUsPhDVLf0h35ybxzmc4df4rK 0wEpvCR+nx9rM4y1710W0a69dKy0M/66jWw+0Yi9wQz9mc0S4Z25nT534Y0iIVzqL01jhBnv2MVWp LWJmVH7LNtJWbKT1mOVw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o4lAa-002qBU-R9; Fri, 24 Jun 2022 15:24:28 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o4l9y-002pzm-Q3 for linux-arm-kernel@lists.infradead.org; Fri, 24 Jun 2022 15:23:52 +0000 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 5C4161480; Fri, 24 Jun 2022 08:23:47 -0700 (PDT) Received: from usa.arm.com (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 015693F534; Fri, 24 Jun 2022 08:23:45 -0700 (PDT) From: Sudeep Holla To: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org Cc: Sudeep Holla , Ard Biesheuvel , Catalin Marinas , Will Deacon , "Rafael J . Wysocki" , Jose Marinho Subject: [PATCH 2/3] ACPI: Enable Platform Runtime Mechanism(PRM) support on ARM64 Date: Fri, 24 Jun 2022 16:23:30 +0100 Message-Id: <20220624152331.4009502-3-sudeep.holla@arm.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220624152331.4009502-1-sudeep.holla@arm.com> References: <20220624152331.4009502-1-sudeep.holla@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220624_082350_943074_A66CA564 X-CRM114-Status: UNSURE ( 9.17 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org There is interest to make use of PRM(Platform Runtime Mechanism) even on ARM64 ACPI platforms. Allow PRM to be enabled on ARM64 platforms. It will be enabled by default as on x86_64. Signed-off-by: Sudeep Holla Acked-by: Ard Biesheuvel --- drivers/acpi/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 1e34f846508f..d08b7408f0a5 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -592,7 +592,7 @@ config X86_PM_TIMER config ACPI_PRMT bool "Platform Runtime Mechanism Support" - depends on EFI && X86_64 + depends on EFI && (X86_64 || ARM64) default y help Platform Runtime Mechanism (PRM) is a firmware interface exposing a From patchwork Fri Jun 24 15:23:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 12894765 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 663BFC433EF for ; Fri, 24 Jun 2022 15:25:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Sho0W8oDNSZZbmxduHY5sJ2D4XXnJud7y96HrfDdp/4=; b=woAdMhDgNmI3wg XwaczkjvaXaaMmJcon0uAPbZsNYqqhCN20h7ddgr6nt1E2JzPv981vrINLPFn/p0gb72xVw9a0V8T rs+cWpouZ3INAL71jEthuTjLtitx+jEl8QlI1GoJQFHZ8eQ4o/PVoZed7igsMSXl8tPq6zSEyrN0K 5mL/C8apelK2hg0FqrwalVAMBbGhqfbTa7rRoaEs7X5uoRlo8JyW3Z7+yDHYCpJpOLypVVy/yX3SK gO4PdNaYySztK2ELTGDBQKFSwVvRGm+IK755veaQPEzrxm8tGITyuXt8lrZeTFEQ/RC0WafiMo0AN o5mCwx7OcjgM3vWP9Iig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o4lAt-002qHi-0Q; Fri, 24 Jun 2022 15:24:47 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o4l9z-002q07-AD for linux-arm-kernel@lists.infradead.org; Fri, 24 Jun 2022 15:23:54 +0000 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 B17C814BF; Fri, 24 Jun 2022 08:23:48 -0700 (PDT) Received: from usa.arm.com (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5F5E03F534; Fri, 24 Jun 2022 08:23:47 -0700 (PDT) From: Sudeep Holla To: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org Cc: Sudeep Holla , Ard Biesheuvel , Catalin Marinas , Will Deacon , "Rafael J . Wysocki" , Jose Marinho Subject: [PATCH 3/3] ACPI: Move PRM config option under the main ACPI config Date: Fri, 24 Jun 2022 16:23:31 +0100 Message-Id: <20220624152331.4009502-4-sudeep.holla@arm.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220624152331.4009502-1-sudeep.holla@arm.com> References: <20220624152331.4009502-1-sudeep.holla@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220624_082351_460764_2F220CC8 X-CRM114-Status: GOOD ( 10.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Currently PRM(Platform Runtime Mechanism) config options is list along with the mainA CPI (Advanced Configuration and Power Interface) option at the same level. On ARM64 platforms unlike x86, ACPI option is listed at the topmost level of configuration menu. It is rather very confusing to see PRM option also listed along with ACPI in the topmost level. Move the same under ACPI config option. No functional change, just changes the level of visibility of this option under the configuration menu. Signed-off-by: Sudeep Holla Acked-by: Ard Biesheuvel --- drivers/acpi/Kconfig | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index d08b7408f0a5..218b5b59df31 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -572,6 +572,21 @@ source "drivers/acpi/pmic/Kconfig" config ACPI_VIOT bool +config ACPI_PRMT + bool "Platform Runtime Mechanism Support" + depends on EFI && (X86_64 || ARM64) + default y + help + Platform Runtime Mechanism (PRM) is a firmware interface exposing a + set of binary executables that can be called from the AML interpreter + or directly from device drivers. + + Say Y to enable the AML interpreter to execute the PRM code. + + While this feature is optional in principle, leaving it out may + substantially increase computational overhead related to the + initialization of some server systems. + endif # ACPI config X86_PM_TIMER @@ -589,18 +604,3 @@ config X86_PM_TIMER You should nearly always say Y here because many modern systems require this timer. - -config ACPI_PRMT - bool "Platform Runtime Mechanism Support" - depends on EFI && (X86_64 || ARM64) - default y - help - Platform Runtime Mechanism (PRM) is a firmware interface exposing a - set of binary executables that can be called from the AML interpreter - or directly from device drivers. - - Say Y to enable the AML interpreter to execute the PRM code. - - While this feature is optional in principle, leaving it out may - substantially increase computational overhead related to the - initialization of some server systems.