xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/vioapic: clear remote IRR when switching RTE to edge triggered mode
@ 2011-11-21  8:17 Jan Beulich
  2011-11-21  8:25 ` Keir Fraser
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2011-11-21  8:17 UTC (permalink / raw)
  To: xen-devel@lists.xensource.com; +Cc: Olaf Hering

[-- Attachment #1: Type: text/plain, Size: 781 bytes --]

Xen itself (as much as Linux) relies on this behavior, so it should
also emulate it properly. Not doing so reportedly gets in the way of
kexec inside a HVM guest.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Olaf Hering <olaf@aepfle.de>

--- a/xen/arch/x86/hvm/vioapic.c
+++ b/xen/arch/x86/hvm/vioapic.c
@@ -154,8 +154,9 @@ static void vioapic_write_redirent(
     {
         vlapic_adjust_i8259_target(d);
     }
-    else if ( (ent.fields.trig_mode == VIOAPIC_LEVEL_TRIG) &&
-              !ent.fields.mask &&
+    else if ( ent.fields.trig_mode == VIOAPIC_EDGE_TRIG )
+        pent->fields.remote_irr = 0;
+    else if ( !ent.fields.mask &&
               !ent.fields.remote_irr &&
               hvm_irq->gsi_assert_count[idx] )
     {




[-- Attachment #2: x86-vioapic-clear-remote_irr.patch --]
[-- Type: text/plain, Size: 850 bytes --]

x86/vioapic: clear remote IRR when switching RTE to edge triggered mode

Xen itself (as much as Linux) relies on this behavior, so it should
also emulate it properly. Not doing so reportedly gets in the way of
kexec inside a HVM guest.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Olaf Hering <olaf@aepfle.de>

--- a/xen/arch/x86/hvm/vioapic.c
+++ b/xen/arch/x86/hvm/vioapic.c
@@ -154,8 +154,9 @@ static void vioapic_write_redirent(
     {
         vlapic_adjust_i8259_target(d);
     }
-    else if ( (ent.fields.trig_mode == VIOAPIC_LEVEL_TRIG) &&
-              !ent.fields.mask &&
+    else if ( ent.fields.trig_mode == VIOAPIC_EDGE_TRIG )
+        pent->fields.remote_irr = 0;
+    else if ( !ent.fields.mask &&
               !ent.fields.remote_irr &&
               hvm_irq->gsi_assert_count[idx] )
     {

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

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

* Re: [PATCH] x86/vioapic: clear remote IRR when switching RTE to edge triggered mode
  2011-11-21  8:17 [PATCH] x86/vioapic: clear remote IRR when switching RTE to edge triggered mode Jan Beulich
@ 2011-11-21  8:25 ` Keir Fraser
  2011-11-21  8:30   ` Jan Beulich
  0 siblings, 1 reply; 4+ messages in thread
From: Keir Fraser @ 2011-11-21  8:25 UTC (permalink / raw)
  To: Jan Beulich, xen-devel@lists.xensource.com; +Cc: Olaf Hering

On 21/11/2011 08:17, "Jan Beulich" <JBeulich@suse.com> wrote:

> Xen itself (as much as Linux) relies on this behavior, so it should
> also emulate it properly. Not doing so reportedly gets in the way of
> kexec inside a HVM guest.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> Tested-by: Olaf Hering <olaf@aepfle.de>

Acked-by: Keir Fraser <keir@xen.org>

> --- a/xen/arch/x86/hvm/vioapic.c
> +++ b/xen/arch/x86/hvm/vioapic.c
> @@ -154,8 +154,9 @@ static void vioapic_write_redirent(
>      {
>          vlapic_adjust_i8259_target(d);
>      }
> -    else if ( (ent.fields.trig_mode == VIOAPIC_LEVEL_TRIG) &&
> -              !ent.fields.mask &&
> +    else if ( ent.fields.trig_mode == VIOAPIC_EDGE_TRIG )
> +        pent->fields.remote_irr = 0;
> +    else if ( !ent.fields.mask &&
>                !ent.fields.remote_irr &&
>                hvm_irq->gsi_assert_count[idx] )
>      {
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

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

* Re: [PATCH] x86/vioapic: clear remote IRR when switching RTE to edge triggered mode
  2011-11-21  8:25 ` Keir Fraser
@ 2011-11-21  8:30   ` Jan Beulich
  2011-11-21  8:39     ` Keir Fraser
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2011-11-21  8:30 UTC (permalink / raw)
  To: Keir Fraser; +Cc: Olaf Hering, xen-devel@lists.xensource.com

>>> On 21.11.11 at 09:25, Keir Fraser <keir.xen@gmail.com> wrote:
> On 21/11/2011 08:17, "Jan Beulich" <JBeulich@suse.com> wrote:
> 
>> Xen itself (as much as Linux) relies on this behavior, so it should
>> also emulate it properly. Not doing so reportedly gets in the way of
>> kexec inside a HVM guest.
>> 
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> Tested-by: Olaf Hering <olaf@aepfle.de>
> 
> Acked-by: Keir Fraser <keir@xen.org>

Committed. Could that also be added to the older maintained trees,
please (once it made it though stage testing)?

Thanks, Jan

>> --- a/xen/arch/x86/hvm/vioapic.c
>> +++ b/xen/arch/x86/hvm/vioapic.c
>> @@ -154,8 +154,9 @@ static void vioapic_write_redirent(
>>      {
>>          vlapic_adjust_i8259_target(d);
>>      }
>> -    else if ( (ent.fields.trig_mode == VIOAPIC_LEVEL_TRIG) &&
>> -              !ent.fields.mask &&
>> +    else if ( ent.fields.trig_mode == VIOAPIC_EDGE_TRIG )
>> +        pent->fields.remote_irr = 0;
>> +    else if ( !ent.fields.mask &&
>>                !ent.fields.remote_irr &&
>>                hvm_irq->gsi_assert_count[idx] )
>>      {
>> 
>> 
>> 
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com 
>> http://lists.xensource.com/xen-devel 

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

* Re: [PATCH] x86/vioapic: clear remote IRR when switching RTE to edge triggered mode
  2011-11-21  8:30   ` Jan Beulich
@ 2011-11-21  8:39     ` Keir Fraser
  0 siblings, 0 replies; 4+ messages in thread
From: Keir Fraser @ 2011-11-21  8:39 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Olaf Hering, xen-devel@lists.xensource.com

On 21/11/2011 08:30, "Jan Beulich" <JBeulich@suse.com> wrote:

>>>> On 21.11.11 at 09:25, Keir Fraser <keir.xen@gmail.com> wrote:
>> On 21/11/2011 08:17, "Jan Beulich" <JBeulich@suse.com> wrote:
>> 
>>> Xen itself (as much as Linux) relies on this behavior, so it should
>>> also emulate it properly. Not doing so reportedly gets in the way of
>>> kexec inside a HVM guest.
>>> 
>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>> Tested-by: Olaf Hering <olaf@aepfle.de>
>> 
>> Acked-by: Keir Fraser <keir@xen.org>
> 
> Committed. Could that also be added to the older maintained trees,
> please (once it made it though stage testing)?

Will do. I think we're still having test problems, possibly another
regression from Jean's patch series.

> Thanks, Jan
> 
>>> --- a/xen/arch/x86/hvm/vioapic.c
>>> +++ b/xen/arch/x86/hvm/vioapic.c
>>> @@ -154,8 +154,9 @@ static void vioapic_write_redirent(
>>>      {
>>>          vlapic_adjust_i8259_target(d);
>>>      }
>>> -    else if ( (ent.fields.trig_mode == VIOAPIC_LEVEL_TRIG) &&
>>> -              !ent.fields.mask &&
>>> +    else if ( ent.fields.trig_mode == VIOAPIC_EDGE_TRIG )
>>> +        pent->fields.remote_irr = 0;
>>> +    else if ( !ent.fields.mask &&
>>>                !ent.fields.remote_irr &&
>>>                hvm_irq->gsi_assert_count[idx] )
>>>      {
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> Xen-devel mailing list
>>> Xen-devel@lists.xensource.com
>>> http://lists.xensource.com/xen-devel
> 
> 
> 

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

end of thread, other threads:[~2011-11-21  8:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-21  8:17 [PATCH] x86/vioapic: clear remote IRR when switching RTE to edge triggered mode Jan Beulich
2011-11-21  8:25 ` Keir Fraser
2011-11-21  8:30   ` Jan Beulich
2011-11-21  8:39     ` Keir Fraser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).