diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2014-04-09 17:21:57 +0200 |
---|---|---|
committer | Cornelia Huck <cornelia.huck@de.ibm.com> | 2014-04-30 14:39:58 +0200 |
commit | 48add816cf7697509debaee0a36f5bb54e4a121b (patch) | |
tree | 112bafe6324bf1b7c8346410b541ec2136aae097 /target-ppc/kvm.c | |
parent | e080f0fdff4a321a461638963b619b77b4307fdd (diff) | |
download | hqemu-48add816cf7697509debaee0a36f5bb54e4a121b.zip hqemu-48add816cf7697509debaee0a36f5bb54e4a121b.tar.gz |
ppc: use kvm_vcpu_enable_cap()
Convert existing users of KVM_ENABLE_CAP to new helper.
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'target-ppc/kvm.c')
-rw-r--r-- | target-ppc/kvm.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c index 9974b10..4b81e5f 100644 --- a/target-ppc/kvm.c +++ b/target-ppc/kvm.c @@ -151,7 +151,6 @@ static int kvm_booke206_tlb_init(PowerPCCPU *cpu) CPUState *cs = CPU(cpu); struct kvm_book3e_206_tlb_params params = {}; struct kvm_config_tlb cfg = {}; - struct kvm_enable_cap encap = {}; unsigned int entries = 0; int ret, i; @@ -178,10 +177,7 @@ static int kvm_booke206_tlb_init(PowerPCCPU *cpu) cfg.params = (uintptr_t)¶ms; cfg.mmu_type = KVM_MMU_FSL_BOOKE_NOHV; - encap.cap = KVM_CAP_SW_TLB; - encap.args[0] = (uintptr_t)&cfg; - - ret = kvm_vcpu_ioctl(cs, KVM_ENABLE_CAP, &encap); + ret = kvm_vcpu_enable_cap(cs, KVM_CAP_SW_TLB, 0, (uintptr_t)&cfg); if (ret < 0) { fprintf(stderr, "%s: couldn't enable KVM_CAP_SW_TLB: %s\n", __func__, strerror(-ret)); @@ -1292,7 +1288,6 @@ int kvmppc_set_tcr(PowerPCCPU *cpu) int kvmppc_booke_watchdog_enable(PowerPCCPU *cpu) { CPUState *cs = CPU(cpu); - struct kvm_enable_cap encap = {}; int ret; if (!kvm_enabled()) { @@ -1304,8 +1299,7 @@ int kvmppc_booke_watchdog_enable(PowerPCCPU *cpu) return -1; } - encap.cap = KVM_CAP_PPC_BOOKE_WATCHDOG; - ret = kvm_vcpu_ioctl(cs, KVM_ENABLE_CAP, &encap); + ret = kvm_vcpu_enable_cap(cs, KVM_CAP_PPC_BOOKE_WATCHDOG, 0); if (ret < 0) { fprintf(stderr, "%s: couldn't enable KVM_CAP_PPC_BOOKE_WATCHDOG: %s\n", __func__, strerror(-ret)); @@ -1505,12 +1499,9 @@ int kvmppc_get_hypercall(CPUPPCState *env, uint8_t *buf, int buf_len) void kvmppc_set_papr(PowerPCCPU *cpu) { CPUState *cs = CPU(cpu); - struct kvm_enable_cap cap = {}; int ret; - cap.cap = KVM_CAP_PPC_PAPR; - ret = kvm_vcpu_ioctl(cs, KVM_ENABLE_CAP, &cap); - + ret = kvm_vcpu_enable_cap(cs, KVM_CAP_PPC_PAPR, 0); if (ret) { cpu_abort(cs, "This KVM version does not support PAPR\n"); } @@ -1523,13 +1514,9 @@ void kvmppc_set_papr(PowerPCCPU *cpu) void kvmppc_set_mpic_proxy(PowerPCCPU *cpu, int mpic_proxy) { CPUState *cs = CPU(cpu); - struct kvm_enable_cap cap = {}; int ret; - cap.cap = KVM_CAP_PPC_EPR; - cap.args[0] = mpic_proxy; - ret = kvm_vcpu_ioctl(cs, KVM_ENABLE_CAP, &cap); - + ret = kvm_vcpu_enable_cap(cs, KVM_CAP_PPC_EPR, 0, mpic_proxy); if (ret && mpic_proxy) { cpu_abort(cs, "This KVM version does not support EPR\n"); } |