mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
PPC: KVM: Update HIOR code to new interface
Unfortunately the HIOR setting code slipped into upstream QEMU before it was pulled into upstream KVM. And since Murphy is always right, comments on the patches only emerged on the pull request leading to changes in the interface. So here's an update to the HIOR setting. While at it, I also relaxed it a bit since for HV KVM we can already run fine without and 3.2 works just fine with HV KVM but when not setting HIOR. We will only need this when running PAPR in PR KVM. Since we accidently changed the ABI and API along the way, we have to update the underlying kernel headers together with the code that uses it to not break bisectability. Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
1529ae1bc6
commit
a31be480a0
3 changed files with 28 additions and 21 deletions
|
@ -740,6 +740,7 @@ void kvmppc_set_papr(CPUState *env)
|
|||
struct kvm_one_reg reg = {};
|
||||
struct kvm_sregs sregs = {};
|
||||
int ret;
|
||||
uint64_t hior = env->spr[SPR_HIOR];
|
||||
|
||||
cap.cap = KVM_CAP_PPC_PAPR;
|
||||
ret = kvm_vcpu_ioctl(env, KVM_ENABLE_CAP, &cap);
|
||||
|
@ -755,11 +756,14 @@ void kvmppc_set_papr(CPUState *env)
|
|||
* Once we have qdev CPUs, move HIOR to a qdev property and
|
||||
* remove this chunk.
|
||||
*/
|
||||
reg.id = KVM_ONE_REG_PPC_HIOR;
|
||||
reg.u.reg64 = env->spr[SPR_HIOR];
|
||||
reg.id = KVM_REG_PPC_HIOR;
|
||||
reg.addr = (uintptr_t)&hior;
|
||||
ret = kvm_vcpu_ioctl(env, KVM_SET_ONE_REG, ®);
|
||||
if (ret) {
|
||||
goto fail;
|
||||
fprintf(stderr, "Couldn't set HIOR. Maybe you're running an old \n"
|
||||
"kernel with support for HV KVM but no PAPR PR \n"
|
||||
"KVM in which case things will work. If they don't \n"
|
||||
"please update your host kernel!\n");
|
||||
}
|
||||
|
||||
/* Set SDR1 so kernel space finds the HTAB */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue