All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	Wei Liu <wei.liu2@citrix.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH 2/4] x86/IRQ: bail early from irq_guest_eoi_timer_fn() when nothing is in flight
Date: Thu, 6 Jun 2019 12:45:43 +0100	[thread overview]
Message-ID: <1c8264aa-78bc-ec40-e69d-2d5ab5cca655@citrix.com> (raw)
In-Reply-To: <5CF8FC580200007800235E9A@prv1-mh.provo.novell.com>

On 06/06/2019 12:43, Jan Beulich wrote:
>>>> On 06.06.19 at 13:34, <andrew.cooper3@citrix.com> wrote:
>> On 06/06/2019 09:17, Jan Beulich wrote:
>>>>>> On 05.06.19 at 19:15, <andrew.cooper3@citrix.com> wrote:
>>>> On 08/05/2019 13:46, Jan Beulich wrote:
>>>>> @@ -1130,8 +1130,10 @@ static void irq_guest_eoi_timer_fn(void
>>>>>          }
>>>>>      }
>>>>>  
>>>>> -    if ( action->in_flight != 0 )
>>>>> -        goto out;
>>>>> +    if ( action->in_flight )
>>>>> +        printk(XENLOG_G_WARNING
>>>>> +               "IRQ%d: %d handlers still in flight at forced EOI\n",
>>>>> +               desc->irq, action->in_flight);
>>>> AFACIT, this condition can be triggered by a buggy/malicious guest, by
>>>> it simply ignoring or masking the line interrupt at the vIO-APIC.
>>> I don't think it can, no. Or else the ASSERT_UNREACHABLE() below
>>> here would be invalid to add.
>> Which ASSERT_UNREACHABLE() ?  I know Roger asked for one, but I don't
>> see it anywhere in the code.
> Because so far there was no real reason to re-post. It's right here,
> as Roger did ask for, and as I did (hesitantly) agree:
>
>     if ( action->in_flight )
>     {
>         printk(XENLOG_G_WARNING
>                "IRQ%u: %d/%d handler(s) still in flight at forced EOI\n",
>                irq, action->in_flight, action->nr_guests);
>         ASSERT_UNREACHABLE();
>     }
>
>>>> The message would be far more useful if it identified the domain in
>>>> question, which looks like it can be obtained from the middle of the loop.
>>> That very loop has just taken care of decrementing ->in_flight for
>>> all such guests.
>>>
>>> Also note that there could be more than one offending domain, for
>>> shared IRQs. Plus the loop you're referring to can specifically _not_
>>> be used for identifying the domain(s), because for the ones
>>> processed there we _did_ decrement ->in_flight. If this message
>>> gets logged, we simply have no idea why ->in_flight is _still_ non-
>>> zero. This could be a BUG_ON(), but it seems more in line with our
>>> general idea of how we would like to deal with such cases to try
>>> and keep the system running here in release builds.
>> Ok - lets go with this for now.  It is a net improvement, and we can
>> evaluate the guest-triggerability at a later point.
>>
>> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Thanks much. I'll assume this holds also for the adjustments
> requested by Roger.

Fine.  At least that should make things obvious in a debug build.

~Andrew

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

  reply	other threads:[~2019-06-06 11:46 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 [this message]
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é
2019-05-16 13:52     ` [Xen-devel] " 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=1c8264aa-78bc-ec40-e69d-2d5ab5cca655@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=roger.pau@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.