Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp421217rwn; Thu, 8 Sep 2022 03:50:02 -0700 (PDT) X-Google-Smtp-Source: AA6agR7ntKGiIR+aaRYKPQzXynum0XFnMrquY/qdilGAA5omBLYKMk1mDtNCcsM5YcxE+y2ZGQhl X-Received: by 2002:a17:903:3014:b0:176:e498:2340 with SMTP id o20-20020a170903301400b00176e4982340mr8785729pla.119.1662634202151; Thu, 08 Sep 2022 03:50:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662634202; cv=none; d=google.com; s=arc-20160816; b=ZDFpD0F2Do7md34AADrdvMF8teZrmo+GdY6/LUv+f8Yj/9D7E8bnrNc9fEw+doSsZm 3MpCgY88sdGi3EI4F0rkVdYGy/tz9EDngWHoAThe3JemVO5NKjhLnCxCV231wzWGjiFE CuFiTfIhazaoy50K+ScAIHW0igRGCc8m/LgvcVciruODFU9OY4sEwlXdMaYcCpxJfkuJ ldpIGl/xrT9Awdmlz/G8ZbgmUsUFgk8xwdLJLXn5TPBuGcDKBoDs6NdV2L2CxtCx8+2k 4TfZKvU77mp8iMV9oCJ09a+PeqqeV3H+voqYZvlb3GtHc58yT20NhMofrU/gmRbNNB2p myZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=eNsw9HCRudZI37V7FqOkLkvCnQwl5nklhqhhFtZ1w0U=; b=eUCMz2+ovzAkCdukYDSsNIDlAcSrNxaLnjidLySmZYPQcRTIPzKkTcKaJiT79prRgm 0AmJ0fZwCTdT92ioEqJ92kZOjLDN0rrzkZXdW/9qN9+aiFm0h8KLAnBgo+xv5l2y241t AD+/ckXAWj8NbyPiZ6IDJtmlYLzdYhBepb4wR356nqbJGIKDckZ5bZDqwAIGewGcEJMP 5JnHVkRJ1O7dppXAOaBNKF2pLR8UIQz3qJhHZbVYDuWYbmsRl6PVIEUyA0nFgXOMvR5a tGR9qaRehCRQEoeyFEtyYH2AE5OxFMDeA+8b6luaISt4zWkJ44jpjioij0wPxD5FTVTx 5A4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="lp489DB/"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z10-20020a170903018a00b00176a116a20csi15025232plg.567.2022.09.08.03.49.49; Thu, 08 Sep 2022 03:50:02 -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; dkim=pass header.i=@linaro.org header.s=google header.b="lp489DB/"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230481AbiIHKIO (ORCPT + 99 others); Thu, 8 Sep 2022 06:08:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230147AbiIHKIM (ORCPT ); Thu, 8 Sep 2022 06:08:12 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C567DC6FC7 for ; Thu, 8 Sep 2022 03:08:11 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id 65so7187394pfx.0 for ; Thu, 08 Sep 2022 03:08:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=eNsw9HCRudZI37V7FqOkLkvCnQwl5nklhqhhFtZ1w0U=; b=lp489DB/MU2LeSP99euMcl/rDD1m7kuWqPXn67FbLopzBRNL9CLeoXy7b7RPdiuDaV bDJJ03AN9pFnNKf4rXiZjnifDjpJ2+zy3xGDfQw58PKfDbGZ4/j0c691qEyyJLglYDbD sS7j+gQgmRRs42mfXqk7WXGdPOCr79qi8sZp2Wuu6XYyyHWjAqxsC3pSkcOFvIQ4i6Yd kvuIrKM3O3VLyWe2WvkYRp1IuCjXBv1075ix2j6Sy+HFtaOj07k+QT8Yo6EyMGxYbzMG i+SsEv1fwxEQ3BdSY6ArH+uLJJObabxoYuMwkpBKXkxrBYegP8ewIbWngo+cbB7e4FtK LR3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=eNsw9HCRudZI37V7FqOkLkvCnQwl5nklhqhhFtZ1w0U=; b=UwLXaD6w0hXBeQWLhg1Y5evwt2zCpm/FVV2AQUHaHoSWfcwPmAkqegaVV6DjH7yA4W P25qZbe7RrXjuuI9OYY6gy2Fnr98BW+OJWDEY2tOLv9nuGacKh9a0q+hLOC18FvQE8Kk d6INtyEWpEI3ur3wLe41stbFSn1ttFXJYSR2v5v0+Ct4re49iU4G0jS3701BA1klX9Zr qxj8xtdzpf/YLy4pffyFlW2Oaz/cJDem/q8Evwkw8hZ0bIXaZtGHdttm/I+tf7mAoFdz GfjL+tAOCUo0O6vO/s+0ya7oKCCq1FlRjx+iBIvq11gt9SuTVc0rIYmD78Kp20Vzy8+q Lfkg== X-Gm-Message-State: ACgBeo2KIfrjmd9XYL4O4mcdPj7LuCJcvz85Bqs7pEaVCKEquveZpB30 KcRuD1tXl8i4f6f55W8ooEHf2ZJtFFt7w7sZDP6mQ1nLqlQa6MgE X-Received: by 2002:aa7:8583:0:b0:53e:5344:2b7d with SMTP id w3-20020aa78583000000b0053e53442b7dmr8254104pfn.49.1662631691202; Thu, 08 Sep 2022 03:08:11 -0700 (PDT) MIME-Version: 1.0 References: <20220907145240.1683088-1-sudeep.holla@arm.com> <20220907145240.1683088-10-sudeep.holla@arm.com> In-Reply-To: <20220907145240.1683088-10-sudeep.holla@arm.com> From: Jens Wiklander Date: Thu, 8 Sep 2022 12:08:00 +0200 Message-ID: Subject: Re: [PATCH v3 09/10] firmware: arm_ffa: Set up 32bit execution mode flag using partiion property To: Sudeep Holla Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, op-tee@lists.trustedfirmware.org, Marc Bonnici , Achin Gupta , Valentin Laurent , Lukas Hanel , Coboy Chen Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,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 On Wed, Sep 7, 2022 at 4:53 PM Sudeep Holla wrote: > > 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); For FF-A 1.0 it looks like we change the dev->mode_32bit default value from false to true. Or am I missing something? Cheers, Jens > } > 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 >