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: Prevent user space APIC code execution with in-kernel irqchip
Date: Mon, 06 Feb 2012 12:51:17 +0100 [thread overview]
Message-ID: <4F2FBEB5.9080802@siemens.com> (raw)
As qemu-kvm merged the kernel APIC into the user space model, we need to
replicate the kernel APIC's logic here until the mess is cleaned up. So
far we triggered the timer start and apic_update_irq calls unwillingly.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
hw/apic.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/hw/apic.c b/hw/apic.c
index dbf05a1..42865da 100644
--- a/hw/apic.c
+++ b/hw/apic.c
@@ -270,6 +270,9 @@ static void apic_set_base(APICCommonState *s, uint64_t val)
static void apic_set_tpr(APICCommonState *s, uint8_t val)
{
s->tpr = (val & 0x0f) << 4;
+ if (kvm_enabled() && kvm_irqchip_in_kernel()) {
+ return;
+ }
apic_update_irq(s);
}
@@ -878,6 +881,9 @@ void kvm_save_lapic(CPUState *env)
static void apic_post_load(APICCommonState *s)
{
+ if (kvm_enabled() && kvm_irqchip_in_kernel()) {
+ return;
+ }
if (s->timer_expiry != -1) {
qemu_mod_timer(s->timer, s->timer_expiry);
} else {
--
1.7.3.4
reply other threads:[~2012-02-06 11:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4F2FBEB5.9080802@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