There exists bitshifts in the IOAPIC code where signed integers are
shifted to the left by up to 31 bits, which is undefined behaviour.
This patch fixes this by changing the integers from signed to unsigned.
Signed-off-by: Matthew Barnes <matthew.barnes@cloud.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
!io_apic_level_ack_pending(desc->irq))
move_masked_irq(desc);
- if ( !(v & (1 << (i & 0x1f))) ) {
+ if ( !(v & (1U << (i & 0x1f))) )
+ {
spin_lock(&ioapic_lock);
__edge_IO_APIC_irq(desc->irq);
__level_IO_APIC_irq(desc->irq);
!io_apic_level_ack_pending(desc->irq) )
move_native_irq(desc);
- if (!(v & (1 << (i & 0x1f)))) {
+ if ( !(v & (1U << (i & 0x1f))) )
+ {
spin_lock(&ioapic_lock);
__mask_IO_APIC_irq(desc->irq);
__edge_IO_APIC_irq(desc->irq);