0);
env->interrupt_request &= ~(CPU_INTERRUPT_HARD | CPU_INTERRUPT_VIRQ);
intno = cpu_get_pic_interrupt(env);
- qemu_log_mask(CPU_LOG_TB_IN_ASM, "Servicing hardware INT=0x%02x\n", intno);
- do_interrupt_x86_hardirq(env, intno, 1);
- /* ensure that no TB jump will be modified as
- the program flow was changed */
- next_tb = 0;
+ if (intno >= 0) {
+ qemu_log_mask(CPU_LOG_TB_IN_ASM,
+ "Servicing hardware INT=0x%02x\n",
+ intno);
+ do_interrupt_x86_hardirq(env, intno, 1);
+ /* ensure that no TB jump will be modified as
+ the program flow was changed */
+ next_tb = 0;
+ }
#if !defined(CONFIG_USER_ONLY)
} else if ((interrupt_request & CPU_INTERRUPT_VIRQ) &&
(env->eflags & IF_MASK) &&
#include "isa.h"
#include "monitor.h"
#include "qemu-timer.h"
+#include "sysemu.h"
#include "i8259_internal.h"
/* debug PIC */
pic_intack(slave_pic, irq2);
} else {
/* spurious IRQ on slave controller */
+ if (no_spurious_interrupt_hack) {
+ /* Pretend it was delivered and acknowledged. If
+ * it was spurious due to slave_pic->imr, then
+ * as soon as the mask is cleared, the slave will
+ * re-trigger IRQ2 on the master. If it is spurious for
+ * some other reason, make sure we don't keep trying
+ * to half-process the same spurious interrupt over
+ * and over again.
+ */
+ s->irr &= ~(1<<irq);
+ s->last_irr &= ~(1<<irq);
+ s->isr &= ~(1<<irq);
+ return -1;
+ }
irq2 = 7;
}
intno = slave_pic->irq_base + irq2;
pic_intack(s, irq);
} else {
/* spurious IRQ on host controller */
+ if (no_spurious_interrupt_hack) {
+ return -1;
+ }
irq = 7;
intno = s->irq_base + irq;
}
slows down the IDE transfers).
ETEXI
+DEF("no-spurious-interrupt-hack", 0, QEMU_OPTION_no_spurious_interrupt_hack,
+ "-no-spurious-interrupt-hack disable delivery of spurious interrupts\n",
+ QEMU_ARCH_I386)
+STEXI
+@item -no-spurious-interrupt-hack
+@findex -no-spurious-interrupt-hack
+Use it as a workaround for operating systems that drive PICs in a way that
+can generate spurious interrupts, but the OS doesn't handle spurious
+interrupts gracefully. (e.g. late 80s/early 90s versions of ATT UNIX
+and derivatives)
+ETEXI
+
HXCOMM Deprecated by -rtc
DEF("rtc-td-hack", 0, QEMU_OPTION_rtc_td_hack, "", QEMU_ARCH_I386)
extern DisplayType display_type;
extern const char *keyboard_layout;
extern int win2k_install_hack;
+extern int no_spurious_interrupt_hack;
extern int alt_grab;
extern int ctrl_grab;
extern int usb_enabled;
CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
CharDriverState *virtcon_hds[MAX_VIRTIO_CONSOLES];
int win2k_install_hack = 0;
+int no_spurious_interrupt_hack = 0;
int usb_enabled = 0;
int singlestep = 0;
int smp_cpus = 1;
case QEMU_OPTION_win2k_hack:
win2k_install_hack = 1;
break;
+ case QEMU_OPTION_no_spurious_interrupt_hack:
+ no_spurious_interrupt_hack = 1;
+ break;
case QEMU_OPTION_rtc_td_hack: {
static GlobalProperty slew_lost_ticks[] = {
{