[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [XEN PATCH v2 5/5] xen/arm: ffa: support notification
- To: Julien Grall <julien@xxxxxxx>
- From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
- Date: Tue, 23 Apr 2024 15:12:10 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=H6Q2rAEaiC++SkwNWoBcN4EvFSyaKpbpvyRIDF7u5F4=; b=fU7cK49bi14bU49K2EoyEzI9fBX1xU1CJcUDQO067jNXwmR1pMtBfBH/Ai7GqXKmRmuD54kZxTHnYlu9Ot6FuJQSIgyzX8lryPa5MMU110fyqFwAa3JdQWvwxwmWPHwHFYIzJJ3rmVmv4eUU4HEUqDqsi/sc4g6uabCWisor8iJEUsVBnCITGyITqco7YBtOxPl7K2WQDblOa4pfUfrRAXliQ1DSTTid/8KtTu045PtKn61lqE/m7FTcrWb+vIB/59XBtOmF3CNtFmXl7+TGc3qHOUysLSy3jGCaE9DSf8Mu6YZHG+ghBn0avOJSokWPtCS3fFpfT1Ps/tUVuqn12g==
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=H6Q2rAEaiC++SkwNWoBcN4EvFSyaKpbpvyRIDF7u5F4=; b=Wn59+6ddXfPdnM0NZUFzeMD8YxRl9ZHxjQu6LlklQrtJJpmpAsDxB2cxrTphAmhDj395EwrbDErpu56aIv8BpeuRCXpsBuHpVhm2aIOnFil0Xc8WnhAWpDgc4faJPTOoPZeOEmWIjIglU8MavXd/SCFNKAyO9Y6dvetzdWEz2eLQPy1xEMAptz3Z4iw6yML2a2ouB2mwATGx8ngVz0XLolB6oMjwweLAv7PuyPhIKguS4IUjahQIpGRA9iQ+95Qqmtxp3sbpQC+PafThxW5r6ocxbFwczw9Scn4NUGVzvm1Rynao0Y7WFlQqhs++nAjYJah8vRwV2ae31JfxE0nAzw==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=VuWX/gCGWmhJTCqLWpTJsGDUzNj+RlIxOTT+mJ8NcE14cedtC7MyzOaOJ8q8TOvy+M/A5pBpCnRcDl00EncsvtgRFdfqzu8h8n/sg4jSvxQwlNpUanYEfI90LCNqNzA/Uouv4hbajg+TQ/EEAuIdhShRKZkzUwjmQTNmAINYa631UGglsTCgKp4J32fw0H9al3Xl5Mhg5oBwlZqMswpwyIImLslUbaQGU2+l4otgHrxj4qlmvRIuviVevigTaBtc4Dzn7wp+AVq7lkF5jfm1qPO4eaYxoGLiQcvyW26x5ofdNy9MUkHS+m830rAanRZwEWXXYDYOs/k3zdSxKKLPtQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b9Hj+91bKe2kUTMcN0c18Duf4nndamycRveC76hjGLXJai9EW+WEYY4Ol/odfH5GS1v4oEDcYx22mEKCqBBvfMdeFcM+C5yviWU50hkD3BSxYhlfWvBKt7Ik4yeY5kf6FqILthKXK1Ka3nXHC6LzZN/g+w+WR2vIhuOhbc3TWSZKOZzqnTkd18Vw4HUQOYhmr5Cpx31wy5j7Sj/DZS3iSWlWe7NFRogHKXfPhp8dZFnzH1b1fKv73eJ2Er6nLpNK0Cbu57CG64xI6AXNsCGAKD8kJfAEdsXcvADkhrmksr6H1HoOLELBGcfS7dJ7zwN3qpQB6nQ64YZ3d0wE+OovxQ==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: Jens Wiklander <jens.wiklander@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "patches@xxxxxxxxxx" <patches@xxxxxxxxxx>, Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
- Delivery-date: Tue, 23 Apr 2024 15:12:35 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Thread-index: AQHalIgAe9tsdsjGFU69yRnUHUkm77F0KqiAgAHNdQA=
- Thread-topic: [XEN PATCH v2 5/5] xen/arm: ffa: support notification
Hi Julien,
> On 22 Apr 2024, at 13:40, Julien Grall <julien@xxxxxxx> wrote:
>
> Hi Jens,
>
> This is not a full review of the code. I will let Bertrand doing it.
>
> On 22/04/2024 08:37, Jens Wiklander wrote:
>> +void ffa_notif_init(void)
>> +{
>> + const struct arm_smccc_1_2_regs arg = {
>> + .a0 = FFA_FEATURES,
>> + .a1 = FFA_FEATURE_SCHEDULE_RECV_INTR,
>> + };
>> + struct arm_smccc_1_2_regs resp;
>> + unsigned int irq;
>> + int ret;
>> +
>> + arm_smccc_1_2_smc(&arg, &resp);
>> + if ( resp.a0 != FFA_SUCCESS_32 )
>> + return;
>> +
>> + irq = resp.a2;
>> + if ( irq >= NR_GIC_SGI )
>> + irq_set_type(irq, IRQ_TYPE_EDGE_RISING);
>> + ret = request_irq(irq, 0, notif_irq_handler, "FF-A notif", NULL);
>
> If I am not mistaken, ffa_notif_init() is only called once on the boot CPU.
> However, request_irq() needs to be called on every CPU so the callback is
> registered every where and the interrupt enabled.
>
> I know the name of the function is rather confusing. So can you confirm this
> is what you expected?
>
> [...]
>
>> diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
>> index 98236cbf14a3..ef8ffd4526bd 100644
>> --- a/xen/arch/arm/tee/ffa_private.h
>> +++ b/xen/arch/arm/tee/ffa_private.h
>> @@ -25,6 +25,7 @@
>> #define FFA_RET_DENIED -6
>> #define FFA_RET_RETRY -7
>> #define FFA_RET_ABORTED -8
>> +#define FFA_RET_NO_DATA -9
>> /* FFA_VERSION helpers */
>> #define FFA_VERSION_MAJOR_SHIFT 16U
>> @@ -97,6 +98,18 @@
>> */
>> #define FFA_MAX_SHM_COUNT 32
>> +/*
>> + * TODO How to manage the available SGIs? SGI 8-15 seem to be entirely
>> + * unused, but that may change.
>
> Are the value below intended for the guests? If so, can they be moved in
> public/arch-arm.h along with the others guest interrupts?
The values are to be used by the guest but they will discover them through the
FFA_FEATURES ABI so I do not think those
should belong the public headers.
Cheers
Bertrand
>
>> + *
>> + * SGI is the preferred delivery mechanism. SGIs 8-15 are normally not used
>> + * by a guest as they in a non-virtualized system typically are assigned to
>> + * the secure world. Here we're free to use SGI 8-15 since they are virtual
>> + * and have nothing to do with the secure world.
>
> Do you have a pointer to the specification?
>
> [...]
>
> Cheers,
>
> --
> Julien Grall
|