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>
master commit:
c5746b021e573184fb92b601a0e93a295485054e
master date: 2024-06-21 15:09:26 +0100
!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);