Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2583989rdb; Tue, 12 Sep 2023 06:30:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFfG9jvdfEmlRak7nyAw0HVbcRebAqBITl/mUXM9jsadVcXNcGP8lCGw8BN5q+3V7dOi3uZ X-Received: by 2002:a17:90b:3ec6:b0:26f:b228:faef with SMTP id rm6-20020a17090b3ec600b0026fb228faefmr3354929pjb.8.1694525425414; Tue, 12 Sep 2023 06:30:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694525425; cv=none; d=google.com; s=arc-20160816; b=Wq64a9TWMDxsCkKD7P8fqiqZ3mXC3/PUD1DXh4h+HXbtSJ/Eo6hJOAKRX1/vov1mku FTFFqjYtmYaW7Hldib7RpeuSxSCN2E3UAnZSch6KBE7+5qG1ONlfiKTmlU/V8lxoobMP Y2r/sdGWkqKRNPUUAFczpLeCuBhkySTdqK4Dil7ZUehCC2T4APm3sg9lN1+nlVrDTS3r NX6TeDKcaQrQgNEQb/dMY5LwjYkSDZVpNcCleEV5jPJoyZRUpKz3T8OlhnYMZNoszR0Z V2Zxvf1gWptXxVQ21ZvWlV+gKl+1E/u6+X5ky/16Vde5Ea8Y4X3BU+JfAX3BJRfR1N+d Tvew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ji5s4rY/qOWA8pBh6XFjmkTyUce8JjhErHwecttqKIc=; fh=AOQmKaq8GBIkSXdS+PT1iunkAgyOBAr3eutMmLNhDWc=; b=0vYYiJDWl/AMl/itupMHCuuFHWa47tx0FMRR7udqMPe2Z669PliIek6Q1TgV28WP8r vSmrhPjEmGI0BR3+3nd8qHp5Z51L1mrMcXi3ZKM8NCud0rMU64e8PdAMJJRYAp+hiZb1 3Ju1rH9od/ztxfCn8PQ7dI6PgCmkfqXJLqvuP71pB0v8BBhOJ9N8KpUh0KrTZskdDKLa QZVtwb6ifKbX7qsa+CQ7KVf6p6twFRjgeHQB1z0X5eY/DnLkoCUu5OXHpgpeotx9Eod1 NSC0/5jEY+LtM2wqUM5w7LrlXDdNYqcyLqIzu80ov/yrNdjsnEjbeZmcNlV2zTErB6SX YFnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L1B9MugQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id v18-20020a17090ac91200b0026b46704d43si7644487pjt.92.2023.09.12.06.30.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 06:30:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L1B9MugQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 655C780E6C45; Tue, 12 Sep 2023 06:24:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.8 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232810AbjILNYD (ORCPT + 99 others); Tue, 12 Sep 2023 09:24:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232683AbjILNYB (ORCPT ); Tue, 12 Sep 2023 09:24:01 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87E5110D1 for ; Tue, 12 Sep 2023 06:23:57 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-500c37d479aso9138883e87.2 for ; Tue, 12 Sep 2023 06:23:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694525036; x=1695129836; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ji5s4rY/qOWA8pBh6XFjmkTyUce8JjhErHwecttqKIc=; b=L1B9MugQheqo8LDcTKJNZCjr7CgBNpq1ot2KSnyWOJxAYplpx/k1tFBet4l5JCWw2a cHqtVqSNVwVSr0zxaxHT83K+OZJ+8mESHCbPS6xC7oSNFvNDzQwgQhkajytmOC6jVl2l aMwP2Ll9exL5j4Gce384K4j3M6lT+51M01kZzn489UZhPYEJyFdBVI4fTB38G8TP9whI 8XmqMif74jE7/j1ckduQ3pRHo40dgaruIX7oqcbyMoa/Ft43YxLQyMOHtehw8FvDanCo R4DUgbFxa2etDnMeMe5uhO02J3sjPaWL2RjqZXVr1EcbpiDNTlCnCo+NQlkVEyi7NdOO EU+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694525036; x=1695129836; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ji5s4rY/qOWA8pBh6XFjmkTyUce8JjhErHwecttqKIc=; b=ZVS0JQNXKfsSSGkd77v31+mBLnxh4zyVB4mBDgTSTK5k+ucNxCUnA5VRU7lovQImhS eU0VVNbqY/xuVuWf2GWaL466WbLGir4aDZYUQw6nn3pxqBuKHUJ4HM/2eJKlUijHO0bD OZmMD1wdRFPpzeDYG+80HtmsSo5UKaywYUJx9mZKS1HZUO23VK295sEgtk9ly36x2dCw fsOCSvwlbq9dUe/QzEmPsYlpkguk5KopTOGSuqK/t7ckbJnOAS/LqOg6j80Y6k5KJAEg WdUj78alC2PyOWlg1QEcM6g8WKT024EE0o8lJOaIlAKl4ULH7glbnEY0qrqSzuRDo11o B2jg== X-Gm-Message-State: AOJu0Yz0dxqYOInukhyYb+RycVHxF6kp2Ova0rschzd3REtq7SLgOwlX HnyrQQ2wh1d16e+W+W+twAbalA== X-Received: by 2002:ac2:4ac7:0:b0:4fe:3364:6c20 with SMTP id m7-20020ac24ac7000000b004fe33646c20mr9809821lfp.16.1694525035844; Tue, 12 Sep 2023 06:23:55 -0700 (PDT) Received: from rayden (h-46-59-78-111.A175.priv.bahnhof.se. [46.59.78.111]) by smtp.gmail.com with ESMTPSA id x16-20020ac24890000000b004ffa451074dsm1749568lfc.50.2023.09.12.06.23.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 06:23:55 -0700 (PDT) Date: Tue, 12 Sep 2023 15:23:53 +0200 From: Jens Wiklander To: Sudeep Holla Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Lucian Paul-Trifu , Marc Bonnici , Coboy Chen Subject: Re: [PATCH RFT 03/12] firmware: arm_ffa: Implement the notification bind and unbind interface Message-ID: <20230912132353.GB4160483@rayden> References: <20230803-ffa_v1-1_notif-v1-0-6613ff2b1f81@arm.com> <20230803-ffa_v1-1_notif-v1-3-6613ff2b1f81@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230803-ffa_v1-1_notif-v1-3-6613ff2b1f81@arm.com> 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 (morse.vger.email [0.0.0.0]); Tue, 12 Sep 2023 06:24:15 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 morse.vger.email On Thu, Aug 03, 2023 at 08:02:07PM +0100, Sudeep Holla wrote: > A receiver endpoint must bind a notification to any sender endpoint > before the latter can signal the notification to the former. The receiver > assigns one or more doorbells to a specific sender. Only the sender can > ring these doorbells. > > A receiver uses the FFA_NOTIFICATION_BIND interface to bind one or more > notifications to the sender. A receiver un-binds a notification from a > sender endpoint to stop the notification from being signaled. It uses > the FFA_NOTIFICATION_UNBIND interface to do this. > > Allow the FF-A driver to be able to bind and unbind a given notification > ID to a specific partition ID. This will be used to register and > unregister notification callbacks from the FF-A client drivers. > > Signed-off-by: Sudeep Holla > --- > drivers/firmware/arm_ffa/driver.c | 29 +++++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > > diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c > index 022c893c9e06..a76e5d3a2422 100644 > --- a/drivers/firmware/arm_ffa/driver.c > +++ b/drivers/firmware/arm_ffa/driver.c > @@ -575,6 +575,35 @@ static int ffa_notification_bitmap_destroy(void) > return 0; > } > > +#define NOTIFICATION_LOW_MASK GENMASK(31, 0) > +#define NOTIFICATION_HIGH_MASK GENMASK(63, 32) > +#define NOTIFICATION_BITMAP_HIGH(x) \ > + ((u32)(FIELD_GET(NOTIFICATION_HIGH_MASK, (x)))) > +#define NOTIFICATION_BITMAP_LOW(x) \ > + ((u32)(FIELD_GET(NOTIFICATION_LOW_MASK, (x)))) > + > +static int ffa_notification_bind_common(u16 dst_id, u64 bitmap, > + u32 flags, bool is_bind) > +{ > + ffa_value_t ret; > + u32 func, src_dst_ids = PACK_TARGET_INFO(dst_id, drv_info->vm_id); dst_id and drv_info->vm_id should be swapped in the argument to PACK_TARGET_INFO(). Thanks, Jens > + > + func = is_bind ? FFA_NOTIFICATION_BIND : FFA_NOTIFICATION_UNBIND; > + > + invoke_ffa_fn((ffa_value_t){ > + .a0 = func, .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 void ffa_set_up_mem_ops_native_flag(void) > { > if (!ffa_features(FFA_FN_NATIVE(MEM_LEND), 0, NULL, NULL) || > > -- > 2.41.0 >