Due to unwanted sign extension, we set all high bits in the mangled
flags on x86-64. Harmless on current CPUs, but that may change one day.

Signed-off-by: Jan Kiszka <[email protected]>
---
 arch/x86/include/asm/irqflags.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/include/asm/irqflags.h b/arch/x86/include/asm/irqflags.h
index 6e316c0..fe9c928 100644
--- a/arch/x86/include/asm/irqflags.h
+++ b/arch/x86/include/asm/irqflags.h
@@ -143,7 +143,7 @@ static inline void halt(void)
 /* Merge virtual+real interrupt mask bits into a single word. */
 static inline unsigned long arch_mangle_irq_bits(int virt, unsigned long real)
 {
-       return (real & ~(1L << 31)) | ((virt != 0) << 31);
+       return (real & ~(1L << 31)) | ((unsigned long)(virt != 0) << 31);
 }
 
 /* Converse operation of arch_mangle_irq_bits() */
-- 
1.7.1


_______________________________________________
Adeos-main mailing list
[email protected]
https://mail.gna.org/listinfo/adeos-main

Reply via email to