Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp809521rdb; Tue, 19 Sep 2023 10:43:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH9EWYEwb5kXE8giMNTLefOVBF0S4+9Q7obZjZyiA7Ei/kJ4GEy5sqc12dsV1mrn7iEh9Su X-Received: by 2002:a05:6a00:158a:b0:68f:bd37:13df with SMTP id u10-20020a056a00158a00b0068fbd3713dfmr430354pfk.16.1695145407408; Tue, 19 Sep 2023 10:43:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695145407; cv=none; d=google.com; s=arc-20160816; b=hJuCXfLiIj28PYDGwXjg5E749UaaFBnwTRoSLYYo5SCKfOXvqL877GQbuuMtIV7Oxv 2bJ8KYQtPFRDnDFaJUBhALhPCBEIpAGfpcX4gyqVQnOVJXlQrZ5knttqQcefFAFg9Q7w QEyclR6NB/mHLFk6l62YL8i4b+4ddOZa9dPowP+XN0V33/DGUYG4T53LqmSMRTuIImcc rmuyuyIXyHnWLxv+bXarV3uG8lfhWYP1Fa8OI2X0lIxdlO/ZToGAIcfHF8To7BGTPbkP kI4MJGKmrpQ6HBmv+e1poXmnMP1sqgubHPT05wYEZdlatl/sD9r7cug9/mmg02SMpM9N rjkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from; bh=zPabK+1X/nBViT84CO/YbyZQqT4ZKko7+5wYK3Pg7Kw=; fh=vcyxKNiHD7TmKqmM0/rwqxGOTauIz60tMzPVV7I2N7Q=; b=LBHwmRofMYKfjCcc+jQSCDqV0mBvxJ4yFk3vSktrjDDRkr8FBiXaGUuedF/I5ABAtH qUuIEgMFZIVvoxnKvyq/m+vcGLvWC64jFcg4MOwU/tySf8UvLql/y+ORpeXUpfYhPVYk WcGKp9EBqL2kRbzr6RTMbMMOADvil8npBI0mtjnJ9kHi3arkxlNdyr69Wn1kwaZMKKkq HJW9qB2PsmLbO0SsfN2eaQmVVfU9e3kMQ8CKzuwP9LUl6M1UbBOPd25otqi8dP2mMALk 3NoKKF2m6Gq1mFodUMXmjhoNVVJshqzqwhYT15MYR7S9I6dkvoflDy6CNSlC8COznn6q 1DYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id d190-20020a6336c7000000b005709caba61dsi10024296pga.574.2023.09.19.10.43.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 10:43:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id DCAC280BB9B6; Tue, 19 Sep 2023 10:41:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232366AbjISRlm (ORCPT + 99 others); Tue, 19 Sep 2023 13:41:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232210AbjISRla (ORCPT ); Tue, 19 Sep 2023 13:41:30 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AF4CCAD for ; Tue, 19 Sep 2023 10:41:24 -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 E6D40143D; Tue, 19 Sep 2023 10:42:01 -0700 (PDT) Received: from e103737-lin.cambridge.arm.com (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9A08E3F5A1; Tue, 19 Sep 2023 10:41:23 -0700 (PDT) From: Sudeep Holla Date: Tue, 19 Sep 2023 18:40:53 +0100 Subject: [PATCH RFT v2 05/18] firmware: arm_ffa: Implement the FFA_NOTIFICATION_SET interface MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230919-ffa_v1-1_notif-v2-5-6f3a3ca3923c@arm.com> References: <20230919-ffa_v1-1_notif-v2-0-6f3a3ca3923c@arm.com> In-Reply-To: <20230919-ffa_v1-1_notif-v2-0-6f3a3ca3923c@arm.com> To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sudeep Holla , Jens Wiklander , Marc Bonnici , Coboy Chen , Lorenzo Pieralisi , Olivier Deprez X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1504; i=sudeep.holla@arm.com; h=from:subject:message-id; bh=PMF7W8gP08NmJpWmNAG8MEfkwerfmt6TtimmzyfxT6Q=; b=owEBbQKS/ZANAwAIAQBBurwxfuKYAcsmYgBlCd062+rtFD+44yL0Ekw5PGXXJ+O+CH2hxDgPl oo7XyQZC7+JAjMEAAEIAB0WIQS6ceUSBvMeskPdk+EAQbq8MX7imAUCZQndOgAKCRAAQbq8MX7i mMz3D/978oazRdsQBQ1CfVAgN3UMUwEFY2s+U2EOyTnNCCkLb08bn2TmY2Ul4Q8yulS8Z/d1yEF ryXH87x53jlhDFOUOoVxQWBx1ZGsYXbWr9SS4uc17T8VTQPZ/Yj2Zs7m5ErtJn7kJ3vgOvYJUY2 mko5cDfNqAzdB9dHEXdTaO3FcKFaYlTFU+W003LnYIh8Yo29I16e1YgasLGcuvalBfGOcdVedRM 66m2ZXyT+gYg0Hj4mjPR08uYczTQJgSQWVPvL818HDQP6VRABdd3SS2NqKK4B/dajuzs2Ox05yI l92A8zoQSSgjnmj8DJ84mDGx0GdX+cOaDDrUfBsYKo0E84BeCoJOctELSMOWEpwt03n07/nBW6L /h9ttmhBiv4Nq73pxfn6MhR9PswwrFy5N7VYXb4Kn2DhqcQdcAn2DHcWBgfWGVA5l16L0VzNOrF ncBqYr9daRg8RsR0RYjMju005j/a1mKUKWUEiA94M/KfwPvs7PMKu6/GL2I08ZbO+ptfevIEVC3 j4a7B6ZQBSL657Jsi3TuCDcqH5kEO9zMVI3KqciVFyfvoChioz64DaksuJWS8YTN1i4mzG2yyYq bq3dMS2llQLJnJsMyS6kB4t6bRwZHST1A/iI05lAn9t/kk8RNFkPVsCYjnvVnTTcjJ7mfR37Zx/ MKPBzzt1GqU5hqw== X-Developer-Key: i=sudeep.holla@arm.com; a=openpgp; fpr=7360A21742ADF5A11767C1C139CFD4755FE2D5B4 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 19 Sep 2023 10:41:47 -0700 (PDT) The framework provides an interface to the sender to specify the notification to signal to the receiver. A sender signals a notification by requesting its partition manager to set the corresponding bit in the notifications bitmap of the receiver invoking FFA_NOTIFICATION_SET. Implement the FFA_NOTIFICATION_SET to enable the caller(sender) to send the notifications for any other partitions in the system. Signed-off-by: Sudeep Holla --- drivers/firmware/arm_ffa/driver.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c index ebe1ecc57099..2aae838ba46a 100644 --- a/drivers/firmware/arm_ffa/driver.c +++ b/drivers/firmware/arm_ffa/driver.c @@ -604,6 +604,26 @@ static int ffa_notification_bind_common(u16 dst_id, u64 bitmap, return 0; } +static +int ffa_notification_set(u16 src_id, u16 dst_id, u32 flags, u64 bitmap) +{ + ffa_value_t ret; + u32 src_dst_ids = PACK_TARGET_INFO(src_id, dst_id); + + invoke_ffa_fn((ffa_value_t) { + .a0 = FFA_NOTIFICATION_SET, .a1 = src_dst_ids, .a2 = flags, + .a3 = NOTIFICATION_BITMAP_LOW(bitmap), + .a4 = NOTIFICATION_BITMAP_HIGH(bitmap), + }, &ret); + + if (ret.a0 == FFA_ERROR) + return ffa_to_linux_errno((int)ret.a2); + else if (ret.a0 != FFA_SUCCESS) + return -EINVAL; + + return 0; +} + static int ffa_run(struct ffa_device *dev, u16 vcpu) { ffa_value_t ret; -- 2.42.0