All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] x86/vpic: minor fixes
@ 2020-08-20 15:34 Roger Pau Monne
  2020-08-20 15:34 ` [PATCH 1/2] x86/vpic: rename irq to pin in vpic_ioport_write Roger Pau Monne
  2020-08-20 15:34 ` [PATCH 2/2] x86/vpic: also execute dpci callback for non-specific EOI Roger Pau Monne
  0 siblings, 2 replies; 11+ messages in thread
From: Roger Pau Monne @ 2020-08-20 15:34 UTC (permalink / raw)
  To: xen-devel; +Cc: Roger Pau Monne, Jan Beulich, Andrew Cooper, Wei Liu

Hello,

This series contains one non-functional change and one small fix for
pci-passthrough when using the 8259A PIC. I very much doubt anyone has
done pci-passthrough on guests using the legacy PIC, but nonetheless
let's aim for it to be correct.

Thanks, Roger.

Roger Pau Monne (2):
  x86/vpic: rename irq to pin in vpic_ioport_write
  x86/vpic: also execute dpci callback for non-specific EOI

 xen/arch/x86/hvm/vpic.c | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

-- 
2.28.0



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/2] x86/vpic: rename irq to pin in vpic_ioport_write
  2020-08-20 15:34 [PATCH 0/2] x86/vpic: minor fixes Roger Pau Monne
@ 2020-08-20 15:34 ` Roger Pau Monne
  2020-08-20 16:17   ` Andrew Cooper
  2020-08-20 15:34 ` [PATCH 2/2] x86/vpic: also execute dpci callback for non-specific EOI Roger Pau Monne
  1 sibling, 1 reply; 11+ messages in thread
From: Roger Pau Monne @ 2020-08-20 15:34 UTC (permalink / raw)
  To: xen-devel; +Cc: Roger Pau Monne, Jan Beulich, Andrew Cooper, Wei Liu

The irq variable is wrongly named, as it's used to store the pin on
the 8259 chip, but not the global irq value. While renaming reduce
it's scope and make it unsigned.

No functional change intended.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hvm/vpic.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/hvm/vpic.c b/xen/arch/x86/hvm/vpic.c
index 936c7b27c6..feb1db2ee3 100644
--- a/xen/arch/x86/hvm/vpic.c
+++ b/xen/arch/x86/hvm/vpic.c
@@ -184,7 +184,7 @@ static int vpic_intack(struct hvm_hw_vpic *vpic)
 static void vpic_ioport_write(
     struct hvm_hw_vpic *vpic, uint32_t addr, uint32_t val)
 {
-    int priority, cmd, irq;
+    int priority, cmd;
     uint8_t mask, unmasked = 0;
 
     vpic_lock(vpic);
@@ -230,6 +230,8 @@ static void vpic_ioport_write(
         }
         else
         {
+            unsigned int pin;
+
             /* OCW2 */
             cmd = val >> 5;
             switch ( cmd )
@@ -246,22 +248,22 @@ static void vpic_ioport_write(
                 priority = vpic_get_priority(vpic, mask);
                 if ( priority == VPIC_PRIO_NONE )
                     break;
-                irq = (priority + vpic->priority_add) & 7;
-                vpic->isr &= ~(1 << irq);
+                pin = (priority + vpic->priority_add) & 7;
+                vpic->isr &= ~(1 << pin);
                 if ( cmd == 5 )
-                    vpic->priority_add = (irq + 1) & 7;
+                    vpic->priority_add = (pin + 1) & 7;
                 break;
             case 3: /* Specific EOI                */
             case 7: /* Specific EOI & Rotate       */
-                irq = val & 7;
-                vpic->isr &= ~(1 << irq);
+                pin = val & 7;
+                vpic->isr &= ~(1 << pin);
                 if ( cmd == 7 )
-                    vpic->priority_add = (irq + 1) & 7;
+                    vpic->priority_add = (pin + 1) & 7;
                 /* Release lock and EOI the physical interrupt (if any). */
                 vpic_update_int_output(vpic);
                 vpic_unlock(vpic);
                 hvm_dpci_eoi(current->domain,
-                             hvm_isa_irq_to_gsi((addr >> 7) ? (irq|8) : irq),
+                             hvm_isa_irq_to_gsi((addr >> 7) ? (pin | 8) : pin),
                              NULL);
                 return; /* bail immediately */
             case 6: /* Set Priority                */
-- 
2.28.0



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/2] x86/vpic: also execute dpci callback for non-specific EOI
  2020-08-20 15:34 [PATCH 0/2] x86/vpic: minor fixes Roger Pau Monne
  2020-08-20 15:34 ` [PATCH 1/2] x86/vpic: rename irq to pin in vpic_ioport_write Roger Pau Monne
@ 2020-08-20 15:34 ` Roger Pau Monne
  2020-08-20 16:28   ` Andrew Cooper
  1 sibling, 1 reply; 11+ messages in thread
From: Roger Pau Monne @ 2020-08-20 15:34 UTC (permalink / raw)
  To: xen-devel; +Cc: Roger Pau Monne, Jan Beulich, Andrew Cooper, Wei Liu

Currently the dpci EOI callback is only executed for specific EOIs.
This is wrong as non-specific EOIs will also clear the ISR bit and
thus end the interrupt. Re-arrange the code a bit so that the common
EOI handling path can be shared between all EOI modes.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hvm/vpic.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/vpic.c b/xen/arch/x86/hvm/vpic.c
index feb1db2ee3..3cf12581e9 100644
--- a/xen/arch/x86/hvm/vpic.c
+++ b/xen/arch/x86/hvm/vpic.c
@@ -249,15 +249,15 @@ static void vpic_ioport_write(
                 if ( priority == VPIC_PRIO_NONE )
                     break;
                 pin = (priority + vpic->priority_add) & 7;
-                vpic->isr &= ~(1 << pin);
-                if ( cmd == 5 )
-                    vpic->priority_add = (pin + 1) & 7;
-                break;
+                goto common_eoi;
+
             case 3: /* Specific EOI                */
             case 7: /* Specific EOI & Rotate       */
                 pin = val & 7;
+
+            common_eoi:
                 vpic->isr &= ~(1 << pin);
-                if ( cmd == 7 )
+                if ( cmd == 7 || cmd == 5 )
                     vpic->priority_add = (pin + 1) & 7;
                 /* Release lock and EOI the physical interrupt (if any). */
                 vpic_update_int_output(vpic);
-- 
2.28.0



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/2] x86/vpic: rename irq to pin in vpic_ioport_write
  2020-08-20 15:34 ` [PATCH 1/2] x86/vpic: rename irq to pin in vpic_ioport_write Roger Pau Monne
@ 2020-08-20 16:17   ` Andrew Cooper
  0 siblings, 0 replies; 11+ messages in thread
From: Andrew Cooper @ 2020-08-20 16:17 UTC (permalink / raw)
  To: Roger Pau Monne, xen-devel; +Cc: Jan Beulich, Wei Liu

On 20/08/2020 16:34, Roger Pau Monne wrote:
> The irq variable is wrongly named, as it's used to store the pin on
> the 8259 chip, but not the global irq value. While renaming reduce
> it's scope and make it unsigned.
>
> No functional change intended.
>
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] x86/vpic: also execute dpci callback for non-specific EOI
  2020-08-20 15:34 ` [PATCH 2/2] x86/vpic: also execute dpci callback for non-specific EOI Roger Pau Monne
@ 2020-08-20 16:28   ` Andrew Cooper
  2020-08-20 16:33     ` Roger Pau Monné
  2020-08-21  7:45     ` Jan Beulich
  0 siblings, 2 replies; 11+ messages in thread
From: Andrew Cooper @ 2020-08-20 16:28 UTC (permalink / raw)
  To: Roger Pau Monne, xen-devel; +Cc: Jan Beulich, Wei Liu

On 20/08/2020 16:34, Roger Pau Monne wrote:
> Currently the dpci EOI callback is only executed for specific EOIs.
> This is wrong as non-specific EOIs will also clear the ISR bit and
> thus end the interrupt. Re-arrange the code a bit so that the common
> EOI handling path can be shared between all EOI modes.
>
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
>  xen/arch/x86/hvm/vpic.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/xen/arch/x86/hvm/vpic.c b/xen/arch/x86/hvm/vpic.c
> index feb1db2ee3..3cf12581e9 100644
> --- a/xen/arch/x86/hvm/vpic.c
> +++ b/xen/arch/x86/hvm/vpic.c
> @@ -249,15 +249,15 @@ static void vpic_ioport_write(
>                  if ( priority == VPIC_PRIO_NONE )
>                      break;
>                  pin = (priority + vpic->priority_add) & 7;
> -                vpic->isr &= ~(1 << pin);
> -                if ( cmd == 5 )
> -                    vpic->priority_add = (pin + 1) & 7;
> -                break;
> +                goto common_eoi;
> +
>              case 3: /* Specific EOI                */
>              case 7: /* Specific EOI & Rotate       */
>                  pin = val & 7;

You'll need a /* Fallthrough */ here to keep various things happy.

Otherwise, Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

Can fix on commit if you're happy.

> +
> +            common_eoi:
>                  vpic->isr &= ~(1 << pin);
> -                if ( cmd == 7 )
> +                if ( cmd == 7 || cmd == 5 )
>                      vpic->priority_add = (pin + 1) & 7;
>                  /* Release lock and EOI the physical interrupt (if any). */
>                  vpic_update_int_output(vpic);



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] x86/vpic: also execute dpci callback for non-specific EOI
  2020-08-20 16:28   ` Andrew Cooper
@ 2020-08-20 16:33     ` Roger Pau Monné
  2020-08-21  7:45     ` Jan Beulich
  1 sibling, 0 replies; 11+ messages in thread
From: Roger Pau Monné @ 2020-08-20 16:33 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: xen-devel, Jan Beulich, Wei Liu

On Thu, Aug 20, 2020 at 05:28:21PM +0100, Andrew Cooper wrote:
> On 20/08/2020 16:34, Roger Pau Monne wrote:
> > Currently the dpci EOI callback is only executed for specific EOIs.
> > This is wrong as non-specific EOIs will also clear the ISR bit and
> > thus end the interrupt. Re-arrange the code a bit so that the common
> > EOI handling path can be shared between all EOI modes.
> >
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> > ---
> >  xen/arch/x86/hvm/vpic.c | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/xen/arch/x86/hvm/vpic.c b/xen/arch/x86/hvm/vpic.c
> > index feb1db2ee3..3cf12581e9 100644
> > --- a/xen/arch/x86/hvm/vpic.c
> > +++ b/xen/arch/x86/hvm/vpic.c
> > @@ -249,15 +249,15 @@ static void vpic_ioport_write(
> >                  if ( priority == VPIC_PRIO_NONE )
> >                      break;
> >                  pin = (priority + vpic->priority_add) & 7;
> > -                vpic->isr &= ~(1 << pin);
> > -                if ( cmd == 5 )
> > -                    vpic->priority_add = (pin + 1) & 7;
> > -                break;
> > +                goto common_eoi;
> > +
> >              case 3: /* Specific EOI                */
> >              case 7: /* Specific EOI & Rotate       */
> >                  pin = val & 7;
> 
> You'll need a /* Fallthrough */ here to keep various things happy.
> 
> Otherwise, Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> Can fix on commit if you're happy.

Sure, I was borderline to add it but somehow assumed that
/* Fallthrough */ was required for cases but not labels.

Thanks, Roger.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] x86/vpic: also execute dpci callback for non-specific EOI
  2020-08-20 16:28   ` Andrew Cooper
  2020-08-20 16:33     ` Roger Pau Monné
@ 2020-08-21  7:45     ` Jan Beulich
  2020-09-21 10:05       ` Ping: " Jan Beulich
  1 sibling, 1 reply; 11+ messages in thread
From: Jan Beulich @ 2020-08-21  7:45 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: Roger Pau Monne, xen-devel, Wei Liu

On 20.08.2020 18:28, Andrew Cooper wrote:
> On 20/08/2020 16:34, Roger Pau Monne wrote:
>> Currently the dpci EOI callback is only executed for specific EOIs.
>> This is wrong as non-specific EOIs will also clear the ISR bit and
>> thus end the interrupt. Re-arrange the code a bit so that the common
>> EOI handling path can be shared between all EOI modes.
>>
>> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
>> ---
>>  xen/arch/x86/hvm/vpic.c | 10 +++++-----
>>  1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/xen/arch/x86/hvm/vpic.c b/xen/arch/x86/hvm/vpic.c
>> index feb1db2ee3..3cf12581e9 100644
>> --- a/xen/arch/x86/hvm/vpic.c
>> +++ b/xen/arch/x86/hvm/vpic.c
>> @@ -249,15 +249,15 @@ static void vpic_ioport_write(
>>                  if ( priority == VPIC_PRIO_NONE )
>>                      break;
>>                  pin = (priority + vpic->priority_add) & 7;
>> -                vpic->isr &= ~(1 << pin);
>> -                if ( cmd == 5 )
>> -                    vpic->priority_add = (pin + 1) & 7;
>> -                break;
>> +                goto common_eoi;
>> +
>>              case 3: /* Specific EOI                */
>>              case 7: /* Specific EOI & Rotate       */
>>                  pin = val & 7;
> 
> You'll need a /* Fallthrough */ here to keep various things happy.

Are you sure? There's ...

> Otherwise, Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> Can fix on commit if you're happy.
> 
>> +
>> +            common_eoi:

... an ordinary label here, not a case one.

Jan


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Ping: [PATCH 2/2] x86/vpic: also execute dpci callback for non-specific EOI
  2020-08-21  7:45     ` Jan Beulich
@ 2020-09-21 10:05       ` Jan Beulich
  2020-09-29 10:27         ` Roger Pau Monné
  0 siblings, 1 reply; 11+ messages in thread
From: Jan Beulich @ 2020-09-21 10:05 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: Roger Pau Monne, xen-devel, Wei Liu

On 21.08.2020 09:45, Jan Beulich wrote:
> On 20.08.2020 18:28, Andrew Cooper wrote:
>> On 20/08/2020 16:34, Roger Pau Monne wrote:
>>> Currently the dpci EOI callback is only executed for specific EOIs.
>>> This is wrong as non-specific EOIs will also clear the ISR bit and
>>> thus end the interrupt. Re-arrange the code a bit so that the common
>>> EOI handling path can be shared between all EOI modes.
>>>
>>> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
>>> ---
>>>  xen/arch/x86/hvm/vpic.c | 10 +++++-----
>>>  1 file changed, 5 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/xen/arch/x86/hvm/vpic.c b/xen/arch/x86/hvm/vpic.c
>>> index feb1db2ee3..3cf12581e9 100644
>>> --- a/xen/arch/x86/hvm/vpic.c
>>> +++ b/xen/arch/x86/hvm/vpic.c
>>> @@ -249,15 +249,15 @@ static void vpic_ioport_write(
>>>                  if ( priority == VPIC_PRIO_NONE )
>>>                      break;
>>>                  pin = (priority + vpic->priority_add) & 7;
>>> -                vpic->isr &= ~(1 << pin);
>>> -                if ( cmd == 5 )
>>> -                    vpic->priority_add = (pin + 1) & 7;
>>> -                break;
>>> +                goto common_eoi;
>>> +
>>>              case 3: /* Specific EOI                */
>>>              case 7: /* Specific EOI & Rotate       */
>>>                  pin = val & 7;
>>
>> You'll need a /* Fallthrough */ here to keep various things happy.
> 
> Are you sure? There's ...
> 
>> Otherwise, Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>
>> Can fix on commit if you're happy.
>>
>>> +
>>> +            common_eoi:
> 
> ... an ordinary label here, not a case one.

I would have wanted to commit this, but it's still not clear to me
whether the adjustment you ask for is really needed.

Thanks for following up,
Jan


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Ping: [PATCH 2/2] x86/vpic: also execute dpci callback for non-specific EOI
  2020-09-21 10:05       ` Ping: " Jan Beulich
@ 2020-09-29 10:27         ` Roger Pau Monné
  2020-09-29 10:58           ` Jan Beulich
  0 siblings, 1 reply; 11+ messages in thread
From: Roger Pau Monné @ 2020-09-29 10:27 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Andrew Cooper, xen-devel, Wei Liu

On Mon, Sep 21, 2020 at 12:05:51PM +0200, Jan Beulich wrote:
> On 21.08.2020 09:45, Jan Beulich wrote:
> > On 20.08.2020 18:28, Andrew Cooper wrote:
> >> On 20/08/2020 16:34, Roger Pau Monne wrote:
> >>> Currently the dpci EOI callback is only executed for specific EOIs.
> >>> This is wrong as non-specific EOIs will also clear the ISR bit and
> >>> thus end the interrupt. Re-arrange the code a bit so that the common
> >>> EOI handling path can be shared between all EOI modes.
> >>>
> >>> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> >>> ---
> >>>  xen/arch/x86/hvm/vpic.c | 10 +++++-----
> >>>  1 file changed, 5 insertions(+), 5 deletions(-)
> >>>
> >>> diff --git a/xen/arch/x86/hvm/vpic.c b/xen/arch/x86/hvm/vpic.c
> >>> index feb1db2ee3..3cf12581e9 100644
> >>> --- a/xen/arch/x86/hvm/vpic.c
> >>> +++ b/xen/arch/x86/hvm/vpic.c
> >>> @@ -249,15 +249,15 @@ static void vpic_ioport_write(
> >>>                  if ( priority == VPIC_PRIO_NONE )
> >>>                      break;
> >>>                  pin = (priority + vpic->priority_add) & 7;
> >>> -                vpic->isr &= ~(1 << pin);
> >>> -                if ( cmd == 5 )
> >>> -                    vpic->priority_add = (pin + 1) & 7;
> >>> -                break;
> >>> +                goto common_eoi;
> >>> +
> >>>              case 3: /* Specific EOI                */
> >>>              case 7: /* Specific EOI & Rotate       */
> >>>                  pin = val & 7;
> >>
> >> You'll need a /* Fallthrough */ here to keep various things happy.
> > 
> > Are you sure? There's ...
> > 
> >> Otherwise, Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
> >>
> >> Can fix on commit if you're happy.
> >>
> >>> +
> >>> +            common_eoi:
> > 
> > ... an ordinary label here, not a case one.
> 
> I would have wanted to commit this, but it's still not clear to me
> whether the adjustment you ask for is really needed.

Hello,

Was about to send a further series I have on top of this and saw this
is still on my patch queue. I'm happy with either way, but I would
like to get this committed if possible (as I think from a technical
PoV we all agree it's correct).

Thanks, Roger.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Ping: [PATCH 2/2] x86/vpic: also execute dpci callback for non-specific EOI
  2020-09-29 10:27         ` Roger Pau Monné
@ 2020-09-29 10:58           ` Jan Beulich
  2020-09-29 11:08             ` Roger Pau Monné
  0 siblings, 1 reply; 11+ messages in thread
From: Jan Beulich @ 2020-09-29 10:58 UTC (permalink / raw)
  To: Roger Pau Monné; +Cc: Andrew Cooper, xen-devel, Wei Liu

On 29.09.2020 12:27, Roger Pau Monné wrote:
> On Mon, Sep 21, 2020 at 12:05:51PM +0200, Jan Beulich wrote:
>> On 21.08.2020 09:45, Jan Beulich wrote:
>>> On 20.08.2020 18:28, Andrew Cooper wrote:
>>>> On 20/08/2020 16:34, Roger Pau Monne wrote:
>>>>> Currently the dpci EOI callback is only executed for specific EOIs.
>>>>> This is wrong as non-specific EOIs will also clear the ISR bit and
>>>>> thus end the interrupt. Re-arrange the code a bit so that the common
>>>>> EOI handling path can be shared between all EOI modes.
>>>>>
>>>>> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
>>>>> ---
>>>>>  xen/arch/x86/hvm/vpic.c | 10 +++++-----
>>>>>  1 file changed, 5 insertions(+), 5 deletions(-)
>>>>>
>>>>> diff --git a/xen/arch/x86/hvm/vpic.c b/xen/arch/x86/hvm/vpic.c
>>>>> index feb1db2ee3..3cf12581e9 100644
>>>>> --- a/xen/arch/x86/hvm/vpic.c
>>>>> +++ b/xen/arch/x86/hvm/vpic.c
>>>>> @@ -249,15 +249,15 @@ static void vpic_ioport_write(
>>>>>                  if ( priority == VPIC_PRIO_NONE )
>>>>>                      break;
>>>>>                  pin = (priority + vpic->priority_add) & 7;
>>>>> -                vpic->isr &= ~(1 << pin);
>>>>> -                if ( cmd == 5 )
>>>>> -                    vpic->priority_add = (pin + 1) & 7;
>>>>> -                break;
>>>>> +                goto common_eoi;
>>>>> +
>>>>>              case 3: /* Specific EOI                */
>>>>>              case 7: /* Specific EOI & Rotate       */
>>>>>                  pin = val & 7;
>>>>
>>>> You'll need a /* Fallthrough */ here to keep various things happy.
>>>
>>> Are you sure? There's ...
>>>
>>>> Otherwise, Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>>>
>>>> Can fix on commit if you're happy.
>>>>
>>>>> +
>>>>> +            common_eoi:
>>>
>>> ... an ordinary label here, not a case one.
>>
>> I would have wanted to commit this, but it's still not clear to me
>> whether the adjustment you ask for is really needed.
> 
> Was about to send a further series I have on top of this and saw this
> is still on my patch queue. I'm happy with either way, but I would
> like to get this committed if possible (as I think from a technical
> PoV we all agree it's correct).

Hmm, did you mean to send this _to_ Andrew, with me on _cc_? There's
nothing I can do without his further input.

Jan


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Ping: [PATCH 2/2] x86/vpic: also execute dpci callback for non-specific EOI
  2020-09-29 10:58           ` Jan Beulich
@ 2020-09-29 11:08             ` Roger Pau Monné
  0 siblings, 0 replies; 11+ messages in thread
From: Roger Pau Monné @ 2020-09-29 11:08 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: xen-devel, Wei Liu, Jan Beulich

On Tue, Sep 29, 2020 at 12:58:20PM +0200, Jan Beulich wrote:
> On 29.09.2020 12:27, Roger Pau Monné wrote:
> > On Mon, Sep 21, 2020 at 12:05:51PM +0200, Jan Beulich wrote:
> >> On 21.08.2020 09:45, Jan Beulich wrote:
> >>> On 20.08.2020 18:28, Andrew Cooper wrote:
> >>>> On 20/08/2020 16:34, Roger Pau Monne wrote:
> >>>>> Currently the dpci EOI callback is only executed for specific EOIs.
> >>>>> This is wrong as non-specific EOIs will also clear the ISR bit and
> >>>>> thus end the interrupt. Re-arrange the code a bit so that the common
> >>>>> EOI handling path can be shared between all EOI modes.
> >>>>>
> >>>>> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> >>>>> ---
> >>>>>  xen/arch/x86/hvm/vpic.c | 10 +++++-----
> >>>>>  1 file changed, 5 insertions(+), 5 deletions(-)
> >>>>>
> >>>>> diff --git a/xen/arch/x86/hvm/vpic.c b/xen/arch/x86/hvm/vpic.c
> >>>>> index feb1db2ee3..3cf12581e9 100644
> >>>>> --- a/xen/arch/x86/hvm/vpic.c
> >>>>> +++ b/xen/arch/x86/hvm/vpic.c
> >>>>> @@ -249,15 +249,15 @@ static void vpic_ioport_write(
> >>>>>                  if ( priority == VPIC_PRIO_NONE )
> >>>>>                      break;
> >>>>>                  pin = (priority + vpic->priority_add) & 7;
> >>>>> -                vpic->isr &= ~(1 << pin);
> >>>>> -                if ( cmd == 5 )
> >>>>> -                    vpic->priority_add = (pin + 1) & 7;
> >>>>> -                break;
> >>>>> +                goto common_eoi;
> >>>>> +
> >>>>>              case 3: /* Specific EOI                */
> >>>>>              case 7: /* Specific EOI & Rotate       */
> >>>>>                  pin = val & 7;
> >>>>
> >>>> You'll need a /* Fallthrough */ here to keep various things happy.
> >>>
> >>> Are you sure? There's ...
> >>>
> >>>> Otherwise, Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
> >>>>
> >>>> Can fix on commit if you're happy.
> >>>>
> >>>>> +
> >>>>> +            common_eoi:
> >>>
> >>> ... an ordinary label here, not a case one.
> >>
> >> I would have wanted to commit this, but it's still not clear to me
> >> whether the adjustment you ask for is really needed.
> > 
> > Was about to send a further series I have on top of this and saw this
> > is still on my patch queue. I'm happy with either way, but I would
> > like to get this committed if possible (as I think from a technical
> > PoV we all agree it's correct).
> 
> Hmm, did you mean to send this _to_ Andrew, with me on _cc_? There's
> nothing I can do without his further input.

Yes, it's fixed now.

Please see above Andrew.

Roger.


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-09-29 11:08 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-20 15:34 [PATCH 0/2] x86/vpic: minor fixes Roger Pau Monne
2020-08-20 15:34 ` [PATCH 1/2] x86/vpic: rename irq to pin in vpic_ioport_write Roger Pau Monne
2020-08-20 16:17   ` Andrew Cooper
2020-08-20 15:34 ` [PATCH 2/2] x86/vpic: also execute dpci callback for non-specific EOI Roger Pau Monne
2020-08-20 16:28   ` Andrew Cooper
2020-08-20 16:33     ` Roger Pau Monné
2020-08-21  7:45     ` Jan Beulich
2020-09-21 10:05       ` Ping: " Jan Beulich
2020-09-29 10:27         ` Roger Pau Monné
2020-09-29 10:58           ` Jan Beulich
2020-09-29 11:08             ` Roger Pau Monné

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.