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

Re: [PATCH 4/7] xen/events: remove some simple helpers from events_base.c


  • To: Juergen Gross <jgross@xxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>
  • From: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>
  • Date: Mon, 13 Nov 2023 17:35:09 +0000
  • Accept-language: en-US, ru-RU
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • 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=IU1ZBET48SFJ5Db+KERuoW8LzvKxMjzZ5Erc4wFI+RY=; b=Puy5RkpwNed1CivZi4JVlw4ZQfSccnulGg63E/eQuWM/+CA3T29MWZwyzksnMJJVjDW26f24nTK3KKOyHcBLhGqJNDjBUv6VKdfGyMLZPErVtjh7xP7Yae+QZOzP95yd1AbxamHBIjuUMTRhzrU561WY+oepMoIY3wWv14oWEXbVWc+IvLNq6fbwU+bV+S0uUK7wXaLPCt+tp4Jl+P/3s/7pqcEW1Y8VbuUuKMKhmQzy4M/2VSE8fBEnVxV1ozTXj8oG1g1GAxt+BKWPi749Xgw9GMOKa904GT7+9PRSqD85gGnqqLx4Dt/PDyrGt9onaiOu8AKt/OrTRrcxI4DGPQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ah3HkxcEToNoneCuziNDnwbuTMcgqGUdcSXzvGKLcTNpIffVyo5KZAkHnWZfJN8A8tUYqn+BHRdtp2KV7A+mKnY/WkyQQtLcJgkF7f+vL2/qDmCjIgFOXSiMs17SguICEFVtxnDDBP1ZudSoJhQW+hfcoHvc3waI+rwo5Z50+ZD7bScuS8TJDZ/LhS/Oe05+RVdu9hk9M8Vsba4Nv4gUo/2D1oAwufvkHpwtF3cV/pkEAHQYKKyR4yZKcojkVmKA0BuX31eEoOJxLDDYj1bZXEkEcLKAUliBL8hSRhoaBbkqusbSY7TNHN0GX22i9ADR6TNTEBv5W6J7t7yCxGaBrw==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 13 Nov 2023 17:35:29 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHZ//oOreX4qMNCvEGaw1AG2hRTp7B4r4qA
  • Thread-topic: [PATCH 4/7] xen/events: remove some simple helpers from events_base.c


On 16.10.23 09:28, Juergen Gross wrote:


Hello Juergen.


> The helper functions type_from_irq() and cpu_from_irq() are just one
> line functions used only internally.
> 
> Open code them where needed. At the same time modify and rename
> get_evtchn_to_irq() to return a struct irq_info instead of the IRQ
> number.
> 
> Signed-off-by: Juergen Gross <jgross@xxxxxxxx>



[snip]



> 
> @@ -1181,15 +1172,16 @@ static int bind_evtchn_to_irq_chip(evtchn_port_t 
> evtchn, struct irq_chip *chip,
>   {
>       int irq;
>       int ret;
> +     struct irq_info *info;
>   
>       if (evtchn >= xen_evtchn_max_channels())
>               return -ENOMEM;


I assume this check is called here (*before* holding a lock) by 
intention, as evtchn_to_info() below contains the same check.

>   
>       mutex_lock(&irq_mapping_update_lock);
>   
> -     irq = get_evtchn_to_irq(evtchn);
> +     info = evtchn_to_info(evtchn) >
> -     if (irq == -1) {
> +     if (!info) {
>               irq = xen_allocate_irq_dynamic();
>               if (irq < 0)
>                       goto out;
> @@ -1212,8 +1204,8 @@ static int bind_evtchn_to_irq_chip(evtchn_port_t 
> evtchn, struct irq_chip *chip,
>                */
>               bind_evtchn_to_cpu(evtchn, 0, false);
>       } else {
> -             struct irq_info *info = info_for_irq(irq);
> -             WARN_ON(info == NULL || info->type != IRQT_EVTCHN);
> +             WARN_ON(info->type != IRQT_EVTCHN);
> +             irq = info->irq;
>       }


This hunk doesn't apply clearly to the latest state, because of 
"9e90e58c11b7 xen: evtchn: Allow shared registration of IRQ handers" 
went in. Please rebase.


With that:
Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>


Also checkpatch.pl warns about BUG_ON usage in several places, but again 
you didn't introduce them in current patch, just touched their args.


[snip]

 


Rackspace

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