All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	Wei Liu <wei.liu2@citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH 4/4] x86/IRQ: ACKTYPE_NONE cannot make it into irq_guest_eoi_timer_fn()
Date: Thu, 16 May 2019 15:52:08 +0200	[thread overview]
Message-ID: <20190516135208.h4njprgd477gfww2@Air-de-Roger> (raw)
In-Reply-To: <5CD2D010020000780022CCCC@prv1-mh.provo.novell.com>

On Wed, May 08, 2019 at 06:48:16AM -0600, Jan Beulich wrote:
> action->ack_type is set once before the timer even gets initialized, and
> is never changed later. The timer gets activated only for EOI and UNMASK
> types. Hence there's no need to have a respective if() in there. Replace
> it by an ASSERT().
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

Just one comment below which I'm not overly fussed about.

> 
> --- a/xen/arch/x86/irq.c
> +++ b/xen/arch/x86/irq.c
> @@ -1103,7 +1103,7 @@ static void set_eoi_ready(void *data);
>  static void irq_guest_eoi_timer_fn(void *data)
>  {
>      struct irq_desc *desc = data;
> -    unsigned int irq = desc - irq_desc;
> +    unsigned int i, irq = desc - irq_desc;
>      irq_guest_action_t *action;
>      cpumask_t cpu_eoi_map;
>  
> @@ -1114,19 +1114,18 @@ static void irq_guest_eoi_timer_fn(void
>  
>      action = (irq_guest_action_t *)desc->action;
>  
> +    ASSERT(action->ack_type != ACKTYPE_NONE);
> +
>      if ( !action->in_flight || timer_is_active(&action->eoi_timer) )
>          goto out;
>  
> -    if ( action->ack_type != ACKTYPE_NONE )
> +    for ( i = 0; i < action->nr_guests; i++ )
>      {
> -        unsigned int i;
> -        for ( i = 0; i < action->nr_guests; i++ )
> -        {
> -            struct domain *d = action->guest[i];

I think you could constify d here.

Thanks.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

WARNING: multiple messages have this Message-ID (diff)
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	Wei Liu <wei.liu2@citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [Xen-devel] [PATCH 4/4] x86/IRQ: ACKTYPE_NONE cannot make it into irq_guest_eoi_timer_fn()
Date: Thu, 16 May 2019 15:52:08 +0200	[thread overview]
Message-ID: <20190516135208.h4njprgd477gfww2@Air-de-Roger> (raw)
Message-ID: <20190516135208.qmOyiefkJRr8Zeeh89nOKNPZN6jacD8RI_-BfevowHU@z> (raw)
In-Reply-To: <5CD2D010020000780022CCCC@prv1-mh.provo.novell.com>

On Wed, May 08, 2019 at 06:48:16AM -0600, Jan Beulich wrote:
> action->ack_type is set once before the timer even gets initialized, and
> is never changed later. The timer gets activated only for EOI and UNMASK
> types. Hence there's no need to have a respective if() in there. Replace
> it by an ASSERT().
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

Just one comment below which I'm not overly fussed about.

> 
> --- a/xen/arch/x86/irq.c
> +++ b/xen/arch/x86/irq.c
> @@ -1103,7 +1103,7 @@ static void set_eoi_ready(void *data);
>  static void irq_guest_eoi_timer_fn(void *data)
>  {
>      struct irq_desc *desc = data;
> -    unsigned int irq = desc - irq_desc;
> +    unsigned int i, irq = desc - irq_desc;
>      irq_guest_action_t *action;
>      cpumask_t cpu_eoi_map;
>  
> @@ -1114,19 +1114,18 @@ static void irq_guest_eoi_timer_fn(void
>  
>      action = (irq_guest_action_t *)desc->action;
>  
> +    ASSERT(action->ack_type != ACKTYPE_NONE);
> +
>      if ( !action->in_flight || timer_is_active(&action->eoi_timer) )
>          goto out;
>  
> -    if ( action->ack_type != ACKTYPE_NONE )
> +    for ( i = 0; i < action->nr_guests; i++ )
>      {
> -        unsigned int i;
> -        for ( i = 0; i < action->nr_guests; i++ )
> -        {
> -            struct domain *d = action->guest[i];

I think you could constify d here.

Thanks.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-05-16 13:52 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-08 12:39 [PATCH 0/4] x86: EOI timer corrections / improvements Jan Beulich
2019-05-08 12:39 ` [Xen-devel] " Jan Beulich
2019-05-08 12:46 ` [PATCH 1/4] x86/IRQ: don't keep EOI timer running without need Jan Beulich
2019-05-08 12:46   ` [Xen-devel] " Jan Beulich
2019-05-16 10:32   ` Roger Pau Monné
2019-05-16 10:32     ` [Xen-devel] " Roger Pau Monné
2019-05-16 10:50     ` Jan Beulich
2019-05-16 10:50       ` [Xen-devel] " Jan Beulich
2019-05-16 11:03       ` Roger Pau Monné
2019-05-16 11:03         ` [Xen-devel] " Roger Pau Monné
2019-06-05 17:04   ` Andrew Cooper
2019-06-06  8:08     ` Jan Beulich
2019-06-06  9:30       ` Andrew Cooper
2019-05-08 12:46 ` [PATCH 2/4] x86/IRQ: bail early from irq_guest_eoi_timer_fn() when nothing is in flight Jan Beulich
2019-05-08 12:46   ` [Xen-devel] " Jan Beulich
2019-05-16 11:37   ` Roger Pau Monné
2019-05-16 11:37     ` [Xen-devel] " Roger Pau Monné
2019-05-16 12:02     ` Jan Beulich
2019-05-16 12:02       ` [Xen-devel] " Jan Beulich
2019-05-16 13:44       ` Roger Pau Monné
2019-05-16 13:44         ` [Xen-devel] " Roger Pau Monné
2019-06-05 17:15   ` Andrew Cooper
2019-06-06  8:17     ` Jan Beulich
2019-06-06 11:34       ` Andrew Cooper
2019-06-06 11:43         ` Jan Beulich
2019-06-06 11:45           ` Andrew Cooper
2019-05-08 12:47 ` [PATCH 3/4] x86/IRQ: relax locking in irq_guest_eoi_timer_fn() Jan Beulich
2019-05-08 12:47   ` [Xen-devel] " Jan Beulich
2019-05-16 13:48   ` Roger Pau Monné
2019-05-16 13:48     ` [Xen-devel] " Roger Pau Monné
2019-06-05 17:16   ` Andrew Cooper
2019-05-08 12:48 ` [PATCH 4/4] x86/IRQ: ACKTYPE_NONE cannot make it into irq_guest_eoi_timer_fn() Jan Beulich
2019-05-08 12:48   ` [Xen-devel] " Jan Beulich
2019-05-16 13:52   ` Roger Pau Monné [this message]
2019-05-16 13:52     ` Roger Pau Monné
2019-05-16 14:48     ` Jan Beulich
2019-05-16 14:48       ` [Xen-devel] " Jan Beulich
2019-05-17  7:04     ` Jan Beulich
2019-05-17  7:04       ` [Xen-devel] " Jan Beulich
2019-06-05 17:18   ` Andrew Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190516135208.h4njprgd477gfww2@Air-de-Roger \
    --to=roger.pau@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.