* [PATCH] qemu-kvm: Fix in-kernel PIC reset
@ 2011-06-27 10:22 Jan Kiszka
2011-06-28 8:19 ` Avi Kivity
0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2011-06-27 10:22 UTC (permalink / raw)
To: Avi Kivity, Marcelo Tosatti; +Cc: kvm
Lacking sync of the user space state to the kernel after system reset
left the PIC behind in an undefined state. This broke IRQ delivery in
some scenarios, e.g. when resetting while in the BIOS.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
hw/i8259.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/hw/i8259.c b/hw/i8259.c
index 1c545c7..463ce72 100644
--- a/hw/i8259.c
+++ b/hw/i8259.c
@@ -278,6 +278,8 @@ int pic_read_irq(PicState2 *s)
return intno;
}
+static int kvm_kernel_pic_load_from_user(PicState *s);
+
static void pic_reset(void *opaque)
{
PicState *s = opaque;
@@ -298,6 +300,10 @@ static void pic_reset(void *opaque)
s->init4 = 0;
s->single_mode = 0;
/* Note: ELCR is not reset */
+
+ if (kvm_enabled() && kvm_irqchip_in_kernel()) {
+ kvm_kernel_pic_load_from_user(s);
+ }
}
static void pic_ioport_write(void *opaque, uint32_t addr, uint32_t val)
@@ -465,7 +471,6 @@ static uint32_t elcr_ioport_read(void *opaque, uint32_t addr1)
}
static void kvm_kernel_pic_save_to_user(PicState *s);
-static int kvm_kernel_pic_load_from_user(PicState *s);
static void pic_pre_save(void *opaque)
{
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] qemu-kvm: Fix in-kernel PIC reset
2011-06-27 10:22 [PATCH] qemu-kvm: Fix in-kernel PIC reset Jan Kiszka
@ 2011-06-28 8:19 ` Avi Kivity
0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2011-06-28 8:19 UTC (permalink / raw)
To: Jan Kiszka; +Cc: Marcelo Tosatti, kvm
On 06/27/2011 01:22 PM, Jan Kiszka wrote:
> Lacking sync of the user space state to the kernel after system reset
> left the PIC behind in an undefined state. This broke IRQ delivery in
> some scenarios, e.g. when resetting while in the BIOS.
Applied, thanks.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-06-28 8:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-27 10:22 [PATCH] qemu-kvm: Fix in-kernel PIC reset Jan Kiszka
2011-06-28 8:19 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox