Skip to contentSkip to conversation

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

PATCH In review Jan Beulich 2 participants 4 messages Nov 21, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

xen/arch/x86/hvm/vioapic.c +3 -2
@@ -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] )
     {

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.

xen/arch/x86/hvm/vioapic.c +3 -2
@@ -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
[email protected]
http://lists.xensource.com/xen-devel

Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Jan Beulich

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.

Quoted 21 lines
xen/arch/x86/hvm/vioapic.c +3 -2
@@ -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
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw
Quoted 11 lines
Quoted 1 line
Quoted 1 line · Keir Fraser
Quoted 6 lines · Jan Beulich

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.

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

Thanks, Jan

Quoted 21 lines
Quoted 21 lines
xen/arch/x86/hvm/vioapic.c +3 -2
@@ -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
[email protected]
http://lists.xensource.com/xen-devel

#3 lore raw
Quoted 7 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · Keir Fraser
Quoted 4 lines · Jan Beulich

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.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

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.

Quoted 26 lines

Thanks, Jan

Quoted 21 lines
Quoted 21 lines
xen/arch/x86/hvm/vioapic.c +3 -2
@@ -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
[email protected]
http://lists.xensource.com/xen-devel