From: Jan Kiszka <jan.kiszka@siemens.com>
To: Avi Kivity <avi@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm <kvm@vger.kernel.org>
Subject: [PATCH] qemu-kvm: Fix in-kernel PIC reset
Date: Mon, 27 Jun 2011 12:22:28 +0200 [thread overview]
Message-ID: <4E0859E4.20509@siemens.com> (raw)
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
next reply other threads:[~2011-06-27 10:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-27 10:22 Jan Kiszka [this message]
2011-06-28 8:19 ` [PATCH] qemu-kvm: Fix in-kernel PIC reset Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E0859E4.20509@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox