[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 59/64] KVM: PPC: Use HIOR setting for -M pseries wit
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PATCH 59/64] KVM: PPC: Use HIOR setting for -M pseries with PR KVM |
Date: |
Thu, 6 Oct 2011 10:06:01 +0200 |
When running with PR KVM, we need to set HIOR directly. Thankfully there
is now a new interface to set registers individually so we can just use that
and poke HIOR into the guest vcpu's HIOR register.
While at it, this also sets SDR1 because -M pseries requires it to run.
With this patch, -M pseries works properly with PR KVM.
Signed-off-by: Alexander Graf <address@hidden>
---
target-ppc/kvm.c | 25 ++++++++++++++++++++++---
1 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
index 35a6f10..75832d8 100644
--- a/target-ppc/kvm.c
+++ b/target-ppc/kvm.c
@@ -705,10 +705,11 @@ int kvmppc_get_hypercall(CPUState *env, uint8_t *buf, int
buf_len)
void kvmppc_set_papr(CPUState *env)
{
- struct kvm_enable_cap cap;
+ struct kvm_enable_cap cap = {};
+ struct kvm_one_reg reg = {};
+ struct kvm_sregs sregs = {};
int ret;
- memset(&cap, 0, sizeof(cap));
cap.cap = KVM_CAP_PPC_PAPR;
ret = kvm_vcpu_ioctl(env, KVM_ENABLE_CAP, &cap);
@@ -723,7 +724,25 @@ void kvmppc_set_papr(CPUState *env)
* Once we have qdev CPUs, move HIOR to a qdev property and
* remove this chunk.
*/
- /* XXX Set HIOR using new ioctl */
+ reg.id = KVM_ONE_REG_PPC_HIOR;
+ reg.u.reg64 = env->spr[SPR_HIOR];
+ ret = kvm_vcpu_ioctl(env, KVM_SET_ONE_REG, ®);
+ if (ret) {
+ goto fail;
+ }
+
+ /* Set SDR1 so kernel space finds the HTAB */
+ ret = kvm_vcpu_ioctl(env, KVM_GET_SREGS, &sregs);
+ if (ret) {
+ goto fail;
+ }
+
+ sregs.u.s.sdr1 = env->spr[SPR_SDR1];
+
+ ret = kvm_vcpu_ioctl(env, KVM_SET_SREGS, &sregs);
+ if (ret) {
+ goto fail;
+ }
return;
--
1.6.0.2
- [Qemu-devel] [PATCH 40/64] PPC: Fix sync instructions problem in SMP, (continued)
- [Qemu-devel] [PATCH 40/64] PPC: Fix sync instructions problem in SMP, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 13/64] PPC: E500: Generate IRQ lines for many CPUs, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 10/64] PPC: MPIC: Fix CI bit definitions, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 03/64] spapr: make irq customizable via qdev, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 34/64] PPC: Enable to use PAPR with PR style KVM, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 37/64] pseries: Add a phandle to the xicp interrupt controller device tree node, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 60/64] PPC: booke timers, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 51/64] ppc405: use RAM_ADDR_FMT instead of %08lx, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 63/64] pseries: Implement set-time-of-day RTAS function, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 59/64] KVM: PPC: Use HIOR setting for -M pseries with PR KVM,
Alexander Graf <=
- [Qemu-devel] [PATCH 64/64] ppc64: Fix linker script, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 48/64] pseries: Implement hcall-bulk hypervisor interface, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 58/64] KVM: Update kernel headers, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 45/64] ppc: booke206: add "info tlb" support, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 02/64] spapr: prepare for qdevification of irq, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 12/64] PPC: E500: create multiple envs, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 61/64] PPC: Clean up BookE timer code, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 41/64] pseries: Add real mode debugging hcalls, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 62/64] pseries: Refactor spapr irq allocation, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 49/64] vscsi: send the CHECK_CONDITION status down together with autosense data, Alexander Graf, 2011/10/06