Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp5821995rwb; Wed, 7 Sep 2022 08:26:53 -0700 (PDT) X-Google-Smtp-Source: AA6agR5aKfiOzNmvhYor1qt40zu7dbA8XPi1QBEOJB3RCSfFAnAIFIj6vFJ99kUxC6nQvRclnsTI X-Received: by 2002:a17:90b:3a82:b0:1fe:45db:2c2b with SMTP id om2-20020a17090b3a8200b001fe45db2c2bmr4510156pjb.102.1662564413557; Wed, 07 Sep 2022 08:26:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662564413; cv=none; d=google.com; s=arc-20160816; b=nU9CFx40dAW0BlsyFsu4UcvIZlHRjK1ET2JvloT9DkF69qagCCnEyJFeriQfOnk+my gwty1mXzRXnnwOGoJdT+4GvuszsCXraSntfuoIgk8UlNS8S8lyOrT8Dd9u/7O4lAysTJ ob2b7wbtG/BZes6xk/L/wBG/zb1FvHP8+kZDLf8zLTylPGUadeWNgjPHR/ARU3gVkKg9 g/5YLYjV86UHzssaRUadAngKHE2caxoerkDEdiMsOsItRVmRlXnrK5+N1JznQ59RJih5 UJhGwwLAt0FQCUXZ4NdLZUsJhAonydPyT80qZrs7zUoq4omXkcKfaOgGwjtlNWAc8+Uw iSfw== 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=cXbzusJ59a6WEjPd+R30keA7bvt6whRK3K0BgJaGvz4=; b=TBc4t46yH+RJKhNeNKb8r+leTcJDV4fmFuT7XtVe18wwol0JvX5kchSkWG9QoVtzw5 GdQC4OJmOq3t7rdPSlj8QiK9Vq+Et+PfCRDpi40Ch+mtnP3SkAQGSEP/zkfzFtShKVKm B9m4nx27Ay+US89kLVxUhWJ2cFKmyZhPZA28rKn+DiQG4W1sXn/phs4P14AZ0SXsS1r1 Tw0a/6fZIirWeS0xWpFExkRqhJCKfy1s8he0wBl6KPAGXv4+47VyQjhoXDrpcgiEMX38 IlbWpaqcFdKL0FuTYzTqQvdazD0FA+8A/mRKynrXbGQJW9bHhEUxotWjwefG08h0wrZ9 u2TQ== 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 v2-20020a17090a960200b001fac75257fbsi13354869pjo.161.2022.09.07.08.26.41; Wed, 07 Sep 2022 08:26:53 -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 S230173AbiIGOx2 (ORCPT + 99 others); Wed, 7 Sep 2022 10:53:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230051AbiIGOxU (ORCPT ); Wed, 7 Sep 2022 10:53:20 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4191EB0B24 for ; Wed, 7 Sep 2022 07:52:58 -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 723911477; Wed, 7 Sep 2022 07:53:04 -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 D09873F71A; Wed, 7 Sep 2022 07:52:56 -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 v3 09/10] firmware: arm_ffa: Set up 32bit execution mode flag using partiion property Date: Wed, 7 Sep 2022 15:52:39 +0100 Message-Id: <20220907145240.1683088-10-sudeep.holla@arm.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220907145240.1683088-1-sudeep.holla@arm.com> References: <20220907145240.1683088-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 42bc22220c69..34e12a2a98fe 100644 --- a/drivers/firmware/arm_ffa/driver.c +++ b/drivers/firmware/arm_ffa/driver.c @@ -648,11 +648,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) { @@ -744,6 +752,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