From mboxrd@z Thu Jan 1 00:00:00 1970 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 83BE2C38145 for ; Wed, 7 Sep 2022 09:12:06 +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:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=k+ZOsTItC5d3AI0WJhX7kjjAsSq2FIrEJdT0vTx4ifg=; b=CRhotfDvYyixoe kAmCvYioYAArhievk8hrezWwWfQ0OYImvzV5pb46Ok/E7z/Kkvgz+Yn85V40eqhVvu56XdvXyHY8b yEYEZq+WN9LvoV3GTVPWie3mRd/xaJegMWjdXSy36SzAUkTMphF8vV895Y9EnlqA1BQ6pFhs3Ex/7 oqz008j00MUAjb3e1x/1GbjdSWhxWThlEzzHX4pbuE87QuXwi2oDDKSBXUF2fVziCQiOYhuK0dkdL hri8eEmw9IymzK9+G+TN0ijAYTVZRV+1lv908ZqaYUsLdZaT+qjnwC19q6P/35p3bYx3CNrSnSTTJ byktK1OZDd28cKEEbDKQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVr56-004hAy-2C; Wed, 07 Sep 2022 09:10:48 +0000 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVqwF-004blp-UP for linux-arm-kernel@lists.infradead.org; Wed, 07 Sep 2022 09:01:41 +0000 Received: by mail-pf1-x429.google.com with SMTP id b144so9176367pfb.7 for ; Wed, 07 Sep 2022 02:01:38 -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=ELHyy9g5JRbfhKbhnhJOnuhdaHcEpPG9qj9a/5f8Kwg=; b=VOYtGdgtdkV8vp8Blh4Ol8K/8wn14f6F4+jLWUhWrYO0tb0bu7ZuQlUVq+aLyAS0rp R34HmstexRj3/pL5NOhYihAFoKKtJ+z7S5pgkqwB54hm4ULsrdy4auxOB2cw/ecSQf08 hyRaoyx77iru9pL2CcOP4w+wtEK9ybUqcODsKmCsYD3PhOwTEAE0xzexFbhlSTqUd9/H NesIrO53RHkfa9QVOaDWEr8srFZn1T+aG+k6l1b30kq0r7EhjMVj7lQqqbyIPe0hzL4j ijC00cuDu6B/BDJPA5QvN2HV0QcOSUwbVgSxzloHG5PNv/pa6SNZBvlvISKOApRF66Il 7vBA== 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=ELHyy9g5JRbfhKbhnhJOnuhdaHcEpPG9qj9a/5f8Kwg=; b=BC+225GU0eSFSIgd6A/KxhvHOo5uPeb/nsK+UyjBmBbPmVkwKClHsUQTyK+W1QfQsA J28v866tjxl1aOxyBvj7ZU1oZZYE2hWOKnv4SG5wPEL0l9EZRBVJTDRqDQ3lYQGaobK8 pUgk+0C3NIv4+P04MFzx1rqh9eO6jgej0DzfxfszVn1kw1VNWhm9vAAImaVv/34OVJgr TDadpWmzFqMggTpF2byILOLvcnGithMLlnXjUumQr8vpezjKm2iQTzGRThL++5PDzJTA 0SAI0tQcSMpbF8fDi0+H0bK2OffEuk5ntwshlwSID9C0WotlGmJ4JBOIk+/XPqWVMRvT kkNw== X-Gm-Message-State: ACgBeo1728/v6O010arcbZgxwNrsSaAgC8JC3kiC24pmxNIJp+/NDHeE gNFrrgsn4qo5MjRw3eA8+h3LVoft+PvGEmmV/kRplA== X-Google-Smtp-Source: AA6agR7I+o8bSYOvyVGo/YjKwv8NK6ti1P4v5vZFfGP57JboHhl2jnqU0sIu8B+AddxliSXBsQrwncKnC++7Rwq8pWg= X-Received: by 2002:a05:6a00:1a04:b0:52a:d4dc:5653 with SMTP id g4-20020a056a001a0400b0052ad4dc5653mr2705863pfv.69.1662541297803; Wed, 07 Sep 2022 02:01:37 -0700 (PDT) MIME-Version: 1.0 References: <20220902124032.788488-1-sudeep.holla@arm.com> <20220902124032.788488-10-sudeep.holla@arm.com> In-Reply-To: <20220902124032.788488-10-sudeep.holla@arm.com> From: Jens Wiklander Date: Wed, 7 Sep 2022 11:01:27 +0200 Message-ID: Subject: Re: [PATCH v2 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220907_020140_059881_DB04AACA X-CRM114-Status: GOOD ( 22.02 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Sep 2, 2022 at 2:40 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 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) Shouldn't this be !(tpbuf->properties & FFA_PARTITION_AARCH64_EXEC)? Before this, we used 64-bit calling convention by default for FF-A v1.0. I suppose we would like to keep that behaviour. Cheers, Jens > + _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 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel