[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xen/arm: irq: Use appropriate priority for SGIs in setup_irq()


  • To: Julien Grall <julien@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Wed, 3 Dec 2025 08:09:29 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=xen.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=arcselector10001; 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=d78r7dK2BNhBZRSpuf6193+G9CJ2z0umvXCKFdMSYRg=; b=LsFNnE02TWv7OUDbgT5Avh/lZWjFwRJJdzJlQV7V8mqMH3kq1sKLZ/FSC9+ljsQ0Ze7YvwytwomBbxTtxJs7pKkL7fjVmUphKjenP1jiM7UTJ4cGZIhVz9SXXr7P2MR99asRbTG7W1TBdLN04fIk5rf15fDQUN7NTUmm+YaV59XpUGFiFjJaGzfqJhOxAgVfocwTCx+N1dXv0xyU1qnS0DKEYz/sNKPKVM5z7PhQBySFDynssQ1cc/2Fmq3De57g0lqDPBEyjqd2554ri6GDjN0NFZHjJHoKnFnye66571Y0P/ryONrnQU9K9uk31rI5zAcLoxf7feSzxE6L/ib+oQ==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=d78r7dK2BNhBZRSpuf6193+G9CJ2z0umvXCKFdMSYRg=; b=uB9WbJ4KY45skRRbMLrM0vbU5UIYGsTbY+k5OenjfUbW/mUKGSweR8a0NzbxDyFt+QucrfAopRPc9h2T3khGPnFAdfr7ZSIAyLdghm0HUvtFdMGpzZCTmSkt15SWT+Aa0SmnHBHgXJ6pc7qXaYUtzKNwWVTK1hzN5W+v4zdbA06vRaQrwt0sQqmfiQpCLIMYnXxjqy8Kt7TFau7kNyDXauhkI8Qs1V6aONtIaam8a+66zqzQSnJUUfQHtOgmt9dV0VrVWmsn+LjP+fibnxljPb/jwbODyx5cgkK7o2cxiqfG69aGoWLYj/hAn5JuTF1XBEQ/6PwFzt25Pwb/S7F5xw==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=rUB8i9KE0VWVtqkPSEzjte4/scWoXUaFzlAK1qkACVU5ZGUxGL8K+V8TP1OfG1cQJvtTF+6QuFs0e6HeSmyf/9nMMEEvE1eqYsGjaBhEMqTuHF0KQW30nY/VHhN14G3zo2/QXQ97nuqpNUqnlsqkoxdMMkCZchFYKb5cUyctR/X3Cy7/dvwT4HM09hdi7Wc8pK2pS45mgiZ94/YSon6Bs3fQf+iZxlwxcBGK3QlMD4YHMgiOs5Xb+yrMS15qoaAIuDKHxqDthxLeJ1FiH0uj63ZiErKxkQX95THwveQtZPteGV/WYbuROD9vJlmxuxqGQhyZ1+7vQ88TjafTnulLVA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=I3QJcPRSjPse0p+Cly8nj+SpXbzTUpFqMuEqvu7GbjX/N32QK+lhUFmqwupnrdyXrcgDjxU+EqYR8t+T0/BgI3t1/yqeCuqJMm28O6ot+7gOWUXUDh7NDZCovw1Yk8mHpRzgNfvAZ1eiXiJdr+i+dBQSitIduoI5FgbAC98+ZM+ulkxNZtFzs9E3seQYKxTnvfGYkuQo+9MKMfm6ljehcRJ//8YNtvKdjFQev7c6PmWCVWLPzkuQKUN3NSl3KUY7zWDRt/6Vgu23Zqd0l56YqgQm6lRlac3fRZmiBOCwha5svlmwhRryMDLHsjbTRS4kEe51IdnLgbFDwNG4yFCoug==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Mykola Kvach <xakep.amatop@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Mykola Kvach <mykola_kvach@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Wed, 03 Dec 2025 08:11:01 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Thread-index: AQHcHH4xsTo+MqBrSUGlzawFWy7VyrSQKKUAgAWFLACAeYuAgIAA5fEA
  • Thread-topic: [PATCH] xen/arm: irq: Use appropriate priority for SGIs in setup_irq()

Hi Julien/Mykola,

> On 2 Dec 2025, at 19:26, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi,
> 
> Sorry for the late answer.
> 
> On 16/09/2025 11:19, Mykola Kvach wrote:
>> On Sat, Sep 13, 2025 at 1:01 AM Julien Grall <julien@xxxxxxx> wrote:
>>>> Signed-off-by: Mykola Kvach <mykola_kvach@xxxxxxxx>
>>>> ---
>>>>   xen/arch/arm/irq.c | 8 +++++++-
>>>>   1 file changed, 7 insertions(+), 1 deletion(-)
>>>> 
>>>> diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
>>>> index 02ca82c089..17c7ac92b5 100644
>>>> --- a/xen/arch/arm/irq.c
>>>> +++ b/xen/arch/arm/irq.c
>>>> @@ -397,7 +397,13 @@ int setup_irq(unsigned int irq, unsigned int 
>>>> irqflags, struct irqaction *new)
>>> AFAIK, we are not using setup_irq() to handle SGIs because they are all
>>> static and always enabled. Are you planning to handle dynamic SGIs? If
>>> yes, then can you provide more details?As far as I know, there can be at 
>>> least one “dynamic” SGI in Xen.
>> As far as I know, there is at least one “dynamic” SGI in Xen. For
>> example, see ffa_notif.c in the functions ffa_notif_init_interrupt
>> and ffa_notif_init, which handle initialization of such SGIs.
> 
> Bertrand can you comment on this? In particular, do we want the FFA SGIs to 
> have the priority of the internal ones?

The following is only an advice, definitely not a requirement. I would
be ok to ack the current way to do things as right now FF-A is unsupported and
is the only case of usage of dynamic SGI.
I would though require to have a log message to warn the user that SGI xx
has the same priority as xen internal interrupts during request_irq.

Here is what I think:

FFA SGIs can only be generated by the secure world and in practice they will
be generated mostly when coming coming back from the secure world (either
after a preemption or on a return to an smc call) but one could also be
generated from the secure world from another core, preempting whatever runs
(but same would occur when an interrupt is directly handled in the secure 
world).

Linux kernel implementation is not lowering the FF-A SGI interrupt as far as I 
know.

In my view having the FFA SGI having the same priority as ffa internal SGI 
would mean
we have some trust that the secure world will not overload us.

But in reality it would make sense to have a priority ordering like:
- Xen internal SGIs
- FF-A SGI (or any other dynamic SGI)
- any other kind of interrupt 

So that Xen internal SGIs have the highest priority, but having other SGIs 
still having
a better priority than other interrupts.

In any case, whatever we do, we should keep it possible to have one specific 
dynamic
SGI at the maximum level or even at an higher level (ie lower down xen internal 
SGIs)
for specific use cases (handling hardware errors comes to mind) but this is ok 
to make
this possible only by changing xen code or when creating such a specific driver.

Cheers
Bertrand


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.