x86: fix off-by-one in nr_irqs_gsi calculation
PATCH v2 1/1 x86: fix off-by-one in nr_irqs_gsi calculation
highest_gsi() returns the last valid GSI, not a count.
---
v2: Retain the (debatable) use of max() here.
xen/arch/x86/io_apic.c +1 -1
@@ -2531,7 +2531,7 @@ void __init init_ioapic_mappings(void) } } - nr_irqs_gsi =max (nr_irqs_gsi,highest_gsi ()); + nr_irqs_gsi =max (nr_irqs_gsi,highest_gsi () +1 );if ( max_gsi_irqs ==0 ) max_gsi_irqs = nr_irqs ? nr_irqs /8 :PAGE_SIZE ;
x86: fix off-by-one in nr_irqs_gsi calculation
highest_gsi() returns the last valid GSI, not a count.
---
v2: Retain the (debatable) use of max() here.
xen/arch/x86/io_apic.c +1 -1
@@ -2531,7 +2531,7 @@ void __init init_ioapic_mappings(void) } } - nr_irqs_gsi =max (nr_irqs_gsi,highest_gsi ()); + nr_irqs_gsi =max (nr_irqs_gsi,highest_gsi () +1 );if ( max_gsi_irqs ==0 ) max_gsi_irqs = nr_irqs ? nr_irqs /8 :PAGE_SIZE ;
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Acked!
Thanks Jan!
Quoted 21 lines · Jan Beulich
highest_gsi()returns the last valid GSI, not a count.Signed-off-by Jan Beulich <[email protected]>---
v2: Retain the (debatable) use ofmax()here.xen/arch/x86/io_apic.c +1
-1@@ -2531,7 +2531,7 @@ void __init init_ioapic_mappings(void) } } - nr_irqs_gsi =max (nr_irqs_gsi,highest_gsi ()); + nr_irqs_gsi =max (nr_irqs_gsi,highest_gsi () +1 );if ( max_gsi_irqs ==0 ) max_gsi_irqs = nr_irqs ? nr_irqs /8 :PAGE_SIZE ;
Quoted 3 lines · Jan Beulich
highest_gsi()returns the last valid GSI, not a count.Signed-off-by Jan Beulich <[email protected]>
Quoted 21 lines
---
v2: Retain the (debatable) use ofmax()here.xen/arch/x86/io_apic.c +1
-1@@ -2531,7 +2531,7 @@ void __init init_ioapic_mappings(void) } } - nr_irqs_gsi =max (nr_irqs_gsi,highest_gsi ()); + nr_irqs_gsi =max (nr_irqs_gsi,highest_gsi () +1 );if ( max_gsi_irqs ==0 ) max_gsi_irqs = nr_irqs ? nr_irqs /8 :PAGE_SIZE ;_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 8 lines
Quoted 1 line
Quoted 1 line · Keir Fraser
Quoted 3 lines · Jan Beulich
highest_gsi()returns the last valid GSI, not a count.Signed-off-by Jan Beulich <[email protected]>Acked-by Keir Fraser <[email protected]>
Could you please also put this into 4.x-testing?
Thanks, Jan
Quoted 21 lines
Quoted 21 lines
---
v2: Retain the (debatable) use ofmax()here.xen/arch/x86/io_apic.c +1
-1@@ -2531,7 +2531,7 @@ void __init init_ioapic_mappings(void) } } - nr_irqs_gsi =max (nr_irqs_gsi,highest_gsi ()); + nr_irqs_gsi =max (nr_irqs_gsi,highest_gsi () +1 );if ( max_gsi_irqs ==0 ) max_gsi_irqs = nr_irqs ? nr_irqs /8 :PAGE_SIZE ;_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel