From: Alexander Graf <agraf@suse.de>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 2/4] Set PVR in sregs
Date: Thu, 16 Jul 2009 18:22:49 +0200 [thread overview]
Message-ID: <1247761371-16980-3-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1247761371-16980-2-git-send-email-agraf@suse.de>
We need to tell the kernel about some initial CPU state we don't have yet,
so let's use the "sregs" IOCTL for that and simply put the Processor Version
Register in there.
Now the kernel knows which guest CPU to virtualize.
---
target-ppc/kvm.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
index acbb1ab..24828bd 100644
--- a/target-ppc/kvm.c
+++ b/target-ppc/kvm.c
@@ -44,7 +44,13 @@ int kvm_arch_init(KVMState *s, int smp_cpus)
int kvm_arch_init_vcpu(CPUState *cenv)
{
- return 0;
+ int ret = 0;
+ struct kvm_sregs sregs;
+
+ sregs.pvr = cenv->spr[SPR_PVR];
+ ret = kvm_vcpu_ioctl(cenv, KVM_SET_SREGS, &sregs);
+
+ return ret;
}
int kvm_arch_put_registers(CPUState *env)
@@ -127,7 +133,8 @@ int kvm_arch_pre_run(CPUState *env, struct kvm_run *run)
* interrupt, reset, etc) in PPC-specific env->irq_input_state. */
if (run->ready_for_interrupt_injection &&
(env->interrupt_request & CPU_INTERRUPT_HARD) &&
- (env->irq_input_state & (1<<PPC40x_INPUT_INT)))
+// (env->irq_input_state & (1<<PPC40x_INPUT_INT)))
+ (env->irq_input_state & (1<<PPC6xx_INPUT_INT)))
{
/* For now KVM disregards the 'irq' argument. However, in the
* future KVM could cache it in-kernel to avoid a heavyweight exit
--
1.6.0.2
next prev parent reply other threads:[~2009-07-16 16:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-16 16:22 [Qemu-devel] [PATCH 0/4] Add preliminary KVM support for non-embedded PPC Alexander Graf
2009-07-16 16:22 ` [Qemu-devel] [PATCH 1/4] Enable PPC KVM for non-embedded Alexander Graf
2009-07-16 16:22 ` Alexander Graf [this message]
2009-07-16 16:22 ` [Qemu-devel] [PATCH 3/4] Add mp_state to PPC CPU struct Alexander Graf
2009-07-16 16:22 ` [Qemu-devel] [PATCH 4/4] Fix warning in kvm-all.c Alexander Graf
[not found] ` <m3skgweej9.fsf@neno.mitica>
2009-07-16 17:20 ` [Qemu-devel] Re: [PATCH 3/4] Add mp_state to PPC CPU struct Alexander Graf
-- strict thread matches above, loose matches on Subject: below --
2009-07-16 17:52 [Qemu-devel] [PATCH 0/4] Add preliminary KVM support for non-embedded PPC v2 Alexander Graf
2009-07-16 17:52 ` [Qemu-devel] [PATCH 1/4] Enable PPC KVM for non-embedded Alexander Graf
2009-07-16 17:52 ` [Qemu-devel] [PATCH 2/4] Set PVR in sregs Alexander Graf
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=1247761371-16980-3-git-send-email-agraf@suse.de \
--to=agraf@suse.de \
--cc=qemu-devel@nongnu.org \
/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;
as well as URLs for NNTP newsgroup(s).