Re: [PATCH v4 6/6] irqchip/gic-v3-its: Remove redundant check in its_vpe_db_proxy_unmap_locked()

From: Kemeng Shi

Date: Mon Jul 13 2026 - 08:13:27 EST


在 2026/7/5 0:32:44, Radu Rendec 写道:
> On Thu, 2026-07-02 at 11:30 +0800, Kemeng Shi wrote:
>> The high level functions already ensure that gic_rdists->has_rvpeid
>> is false before calling its_vpe_db_proxy_unmap_locked(), so we can
>> remove the redundant check in its_vpe_db_proxy_unmap_locked()
>
> That's true for what the code is *today*. By removing the check, you're
> setting up a trap in case a new call to its_vpe_db_proxy_unmap_locked()
> is added in the future with the assumption that it will do "the right
> thing". The way I see these functions, they are not really "high level"
> and "low level". For example, its_vpe_db_proxy_map_locked() is called
> both by its_vpe_db_proxy_move() (which is another db_proxy function)
> and by its_vpe_send_cmd() directly.
>
> FWIW, the code you're removing is just this:
> 0xffff8000806cf934 <+44>: adrp x0, 0xffff80008177e000 <static_ltree+784>
> 0xffff8000806cf938 <+48>: add x4, x0, #0x348
> 0xffff8000806cf93c <+52>: ldr x0, [x0, #840]
> 0xffff8000806cf940 <+56>: ldrb w0, [x0, #45]
> 0xffff8000806cf944 <+60>: tbnz w0, #0, 0xffff8000806cf9dc <its_vpe_db_proxy_unmap_locked+212>
>
> I would argue that the gain in terms of both code size and speed is
> negligible (and these functions are subject to inlining anyway).
>
Sure. Will drop this one in next version. Thanks.>> Signed-off-by: Kemeng Shi <shikemeng@xxxxxxxxxxxxxxx>
>> ---
>>  drivers/irqchip/irq-gic-v3-its.c | 4 ----
>>  1 file changed, 4 deletions(-)
>>
>> diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
>> index 120f6f29e978..b0069fbe1e69 100644
>> --- a/drivers/irqchip/irq-gic-v3-its.c
>> +++ b/drivers/irqchip/irq-gic-v3-its.c
>> @@ -3801,10 +3801,6 @@ static const struct irq_domain_ops its_domain_ops = {
>>   */
>>  static void its_vpe_db_proxy_unmap_locked(struct its_vpe *vpe)
>>  {
>> - /* GICv4.1 doesn't use a proxy, so nothing to do here */
>> - if (gic_rdists->has_rvpeid)
>> - return;
>> -
>>   /* Already unmapped? */
>>   if (vpe->vpe_proxy_event == -1)
>>   return;