[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:18:45 +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=HjydwI3EtAJBIiT7QQhDZsOClx81GsqRlrzfKou/s7c=; b=BCXICMkmJGcD+sQd96f7Z40Bbl6dcW9DRXupXR9MVeO1F2IkKhyxyN+D3A+NuIKJrtPrkj9xM9N6he9hm3Q36pfHd4Lvs5h355/I1Rd4EWaV3/abuP36+oj2kX5gN4pMBLRFvGQMMH3NLr6asCwWc9b6MNwPrROIzbL9PDd44DjmosutIC0bUf02qfDLlreuRhFXVS+tITqir4JJ+zG05qa5KjSGMMTqXs+e7KOfkT7j3GiYE4eQO9dlhzerYtS5k6gWbBYSMWCyoU3JhvwhkTJEM37NDOiNo25ICgyfRHZ2+iUGzgfRCnaS1GdbTrSHk1/WZecMcj6E/Q95D8ZL5Q==
- 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=HjydwI3EtAJBIiT7QQhDZsOClx81GsqRlrzfKou/s7c=; b=Qu6zmaA4xtCbWJhjdq4yuR7HJJN+SeRYFJMlBXnKaIso1BKa98yrpkCUqU8eFAgQHQ6lJDu7rcaBmeMz+7Nz+jqjHujrqxBrvYsvilhH7nPkzzJrbH/zBHVh9ERTEvaVTWJiatxNWKPD4P6P1pGmz2k0HhJaI0zx9x/g37g+ZQ/T7ZbNxvQHm2jDxKv8wjhDI5geAS91b4ZEr94JvoSUmfG/7+HTWLxB/O9BIFc9EckdR3Cm8hqOzOVSe8+LfXsPqap/5vMJfS87GyGc+qFOUd/+2AMKRxSEebRgIon07I3rNEJyaqBjlsTZ5qaQflAUEuqywfm9zqI7mKQPq2eSyQ==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=EsXzfigCCaLtMOrC31dcgH0ojHyUm4xLUi6W/LEqfgZHsptf3cwZ7P8PKChacEr4Wnl7xeRuR9i8R/X31WVOy2wqGbEROAHANMLjb4AYZbGJkABC0xyv11lOrQN4OkQwi4dOlGPKNzF/BaDXcBkQuRBjB55StkajnPreaO6zcsUKCTNhH0/LgiLF8MyxqBMk4u4Njihp9kj2GsRoYrwS1TKNfgKdzRJkdtjKKCaSrJWGrQR1Cqq0Ok0Um/P8BkePMjWdaeNOhZ5YJihKcnFLtdGATJBH2M9IhMPJBrAECUlHdOjf90/5hF2nW/HlisDFrrsDxEqibo2N58O1oigjEw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c284nvR/RGRnnX4JRTFaJjwa2TNOkeb0Q9CsWjk3CxpYzgRXrns9xpjhIWws6xlBsTcrKTbxCesQG47y3SCHYIYAfnphNHxZjlDW+0W6dxznKV40eHIpk+Ss5xayjgbgbwDeobWm/F283UVtNRlAeWEgB/LcstTpi1f3lmZrVOFv0KE3jQo6KSBk59YGsDJTbCvm4s+b5kvsVU0WJLxHBeqf5MxAQSrQHffMxQcK1B8eLJ1iLaBFblU+ZRwWHlz0uuv2lOYHpjCgQz8UzQUJcDEw7Gpfwg53Mw5/uAXiUzUIeTZJNpRumltp3f7hi/KF+fRtcKz3fKGmH5ZyvR9zYQ==
- 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:19:13 +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: AQHalIgAe9tsdsjGFU69yRnUHUkm77F0KqiAgAHNdQCAAAExAIAAAKaA
- Thread-topic: [XEN PATCH v2 5/5] xen/arm: ffa: support notification
Hi Julien,
> On 23 Apr 2024, at 17:16, Julien Grall <julien@xxxxxxx> wrote:
>
> Hi Bertrand,
>
> On 23/04/2024 16:12, Bertrand Marquis wrote:
>> 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.
>
> Sorry I should have been clearer. The values in the public headers are not
> meant for the guest. They are meant for a common understanding between the
> toolstack and Xen of the guest layout (memory + interrupts).
>
> I know that some of the guests started to rely on it. But this is against our
> policy:
>
> * These are defined for consistency between the tools and the
> * hypervisor. Guests must not rely on these hardcoded values but
> * should instead use the FDT.
>
> In this case, even if this is only used by Xen (today), I would argue they
> should defined at the same place because it is easier to understand the
> layout if it is in one place.
I see, that makes sense then to add them there.
Cheers
Bertrand
>
> Cheers,
>
> --
> Julien Grall
|