Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp2052832rwe; Fri, 2 Sep 2022 07:53:11 -0700 (PDT) X-Google-Smtp-Source: AA6agR50UDQ2tjAi1TJEo9hvFAcyCwhuHD9QVrQr1Z7KDVW3qctKI4WcGLh9/nxZPR3A/Tppufgk X-Received: by 2002:aa7:8397:0:b0:535:933b:54c with SMTP id u23-20020aa78397000000b00535933b054cmr36248366pfm.38.1662130391288; Fri, 02 Sep 2022 07:53:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662130391; cv=none; d=google.com; s=arc-20160816; b=QqdIUyqfJH2jfu8BRA2AqA8yyIfws6ExNKLvEhPhoe2i0E0/dDno2Z56FVW2eGl+M7 iY4qMSaL/3K/jrEhwt2jEZnGr/u3PekMdkW0heX/gmMBzUdCCRJYD16GVDZlds9lGVwL x89hqd7O457b5PWpYpy+xxQ88W5nH3cO/uff5JlpaY3zA/+0OZwSLTgWFsy6mve1F3is S0brEz5ktFzQBJk49P4E/+JEFIBoqQH8IH8RcCmwp8vuiOzsmwQmOaz8VtpLjWqISaKz lDI6gg/7tg5sEaKipZG2GVHX2iNj74LoniZpWR0aNc2y6m+pvlZx+/GCxxPnwqUeuyaP Jt2Q== 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=I9x2xkABdAX9BzIph0qCv6T1M2TWWKYA6xgUBL0aSUw=; b=SMnxKKLYBi2HWKgNCqoiel0HWVMXKDATRA+g8K0ZGmRxyk8yoHREKndrhSWi+7G1mt to4BwsYx1HiixzJNc499zFcXMi0nXQPHECI+tOkpH5t8D3Dv8QRhaG3BjqUFV7ENqB51 yzavNSSboe8ch1IeyC4Q8iFokIqbWw9UGgVo3TAIerzFa5Do1idILQ7sDeQ5UXFxIVGh Pt5+LWRy0pGi97YUGUj7pRxCv0XQHKoLomFruuaidya+kuoR44iCDlhmg4PBV7u8/x+V 6NsnMpz1aQpDCCJBQOk8D3cUXxQDTib/9U8w5lI3w6N35UiZHkfhAXMjeg4e5l4yRFKJ K63A== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r15-20020a6560cf000000b0041b64ff7fe9si2136127pgv.79.2022.09.02.07.52.59; Fri, 02 Sep 2022 07:53:11 -0700 (PDT) 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 S238955AbiIBOMF (ORCPT + 99 others); Fri, 2 Sep 2022 10:12:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238877AbiIBOLl (ORCPT ); Fri, 2 Sep 2022 10:11:41 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 92A111181D for ; Fri, 2 Sep 2022 06:39:48 -0700 (PDT) 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 6E7FC1596; Fri, 2 Sep 2022 05:41:02 -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 E59503F766; Fri, 2 Sep 2022 05:40:54 -0700 (PDT) From: Sudeep Holla To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, op-tee@lists.trustedfirmware.org Cc: Sudeep Holla , Marc Bonnici , Achin Gupta , Jens Wiklander , Valentin Laurent , Lukas Hanel , Coboy Chen Subject: [PATCH v2 09/10] firmware: arm_ffa: Set up 32bit execution mode flag using partiion property Date: Fri, 2 Sep 2022 13:40:31 +0100 Message-Id: <20220902124032.788488-10-sudeep.holla@arm.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220902124032.788488-1-sudeep.holla@arm.com> References: <20220902124032.788488-1-sudeep.holla@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org FF-A v1.1 adds a flag in the partition properties to indicate if the partition runs in the AArch32 or AArch64 execution state. Use the same to set-up the 32-bit execution flag mode in the ffa_dev automatically and ignore any requests to do the same from the ffa_driver. Signed-off-by: Sudeep Holla --- drivers/firmware/arm_ffa/driver.c | 13 ++++++++++++- include/linux/arm_ffa.h | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c index dd6ab2f81580..dbbe15592173 100644 --- a/drivers/firmware/arm_ffa/driver.c +++ b/drivers/firmware/arm_ffa/driver.c @@ -647,11 +647,19 @@ static int ffa_partition_info_get(const char *uuid_str, return 0; } -static void ffa_mode_32bit_set(struct ffa_device *dev) +static void _ffa_mode_32bit_set(struct ffa_device *dev) { dev->mode_32bit = true; } +static void ffa_mode_32bit_set(struct ffa_device *dev) +{ + if (drv_info->version > FFA_VERSION_1_0) + return; + + _ffa_mode_32bit_set(dev); +} + static int ffa_sync_send_receive(struct ffa_device *dev, struct ffa_send_direct_data *data) { @@ -743,6 +751,9 @@ static void ffa_setup_partitions(void) __func__, tpbuf->id); continue; } + + if (tpbuf->properties & FFA_PARTITION_AARCH64_EXEC) + _ffa_mode_32bit_set(ffa_dev); } kfree(pbuf); } diff --git a/include/linux/arm_ffa.h b/include/linux/arm_ffa.h index 09567ffd1f49..5964b6104996 100644 --- a/include/linux/arm_ffa.h +++ b/include/linux/arm_ffa.h @@ -106,6 +106,8 @@ struct ffa_partition_info { #define FFA_PARTITION_DIRECT_SEND BIT(1) /* partition can send and receive indirect messages. */ #define FFA_PARTITION_INDIRECT_MSG BIT(2) +/* partition runs in the AArch64 execution state. */ +#define FFA_PARTITION_AARCH64_EXEC BIT(8) u32 properties; u32 uuid[4]; }; -- 2.37.3