[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH-for-9.0 06/16] target/arm/kvm: Have kvm_arm_set_device_attr take
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH-for-9.0 06/16] target/arm/kvm: Have kvm_arm_set_device_attr take a ARMCPU argument |
Date: |
Thu, 23 Nov 2023 19:35:07 +0100 |
Unify the "kvm_arm.h" API: All functions related to ARM vCPUs
take a ARMCPU* argument. Use the CPU() QOM cast macro When
calling the generic vCPU API from "sysemu/kvm.h".
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/arm/kvm.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/target/arm/kvm.c b/target/arm/kvm.c
index 766a077bcf..73f4e5a0fa 100644
--- a/target/arm/kvm.c
+++ b/target/arm/kvm.c
@@ -1691,18 +1691,18 @@ void kvm_arch_remove_all_hw_breakpoints(void)
}
}
-static bool kvm_arm_set_device_attr(CPUState *cs, struct kvm_device_attr *attr,
+static bool kvm_arm_set_device_attr(ARMCPU *cpu, struct kvm_device_attr *attr,
const char *name)
{
int err;
- err = kvm_vcpu_ioctl(cs, KVM_HAS_DEVICE_ATTR, attr);
+ err = kvm_vcpu_ioctl(CPU(cpu), KVM_HAS_DEVICE_ATTR, attr);
if (err != 0) {
error_report("%s: KVM_HAS_DEVICE_ATTR: %s", name, strerror(-err));
return false;
}
- err = kvm_vcpu_ioctl(cs, KVM_SET_DEVICE_ATTR, attr);
+ err = kvm_vcpu_ioctl(CPU(cpu), KVM_SET_DEVICE_ATTR, attr);
if (err != 0) {
error_report("%s: KVM_SET_DEVICE_ATTR: %s", name, strerror(-err));
return false;
@@ -1721,7 +1721,7 @@ void kvm_arm_pmu_init(CPUState *cs)
if (!ARM_CPU(cs)->has_pmu) {
return;
}
- if (!kvm_arm_set_device_attr(cs, &attr, "PMU")) {
+ if (!kvm_arm_set_device_attr(ARM_CPU(cs), &attr, "PMU")) {
error_report("failed to init PMU");
abort();
}
@@ -1738,7 +1738,7 @@ void kvm_arm_pmu_set_irq(CPUState *cs, int irq)
if (!ARM_CPU(cs)->has_pmu) {
return;
}
- if (!kvm_arm_set_device_attr(cs, &attr, "PMU")) {
+ if (!kvm_arm_set_device_attr(ARM_CPU(cs), &attr, "PMU")) {
error_report("failed to set irq for PMU");
abort();
}
@@ -1755,7 +1755,7 @@ void kvm_arm_pvtime_init(CPUState *cs, uint64_t ipa)
if (ARM_CPU(cs)->kvm_steal_time == ON_OFF_AUTO_OFF) {
return;
}
- if (!kvm_arm_set_device_attr(cs, &attr, "PVTIME IPA")) {
+ if (!kvm_arm_set_device_attr(ARM_CPU(cs), &attr, "PVTIME IPA")) {
error_report("failed to init PVTIME IPA");
abort();
}
--
2.41.0
- [PATCH-for-9.0 02/16] target/arm/kvm: Remove unused includes, (continued)
- [PATCH-for-9.0 02/16] target/arm/kvm: Remove unused includes, Philippe Mathieu-Daudé, 2023/11/23
- [PATCH-for-9.0 03/16] target/arm/kvm: Have kvm_arm_add_vcpu_properties take a ARMCPU argument, Philippe Mathieu-Daudé, 2023/11/23
- [PATCH-for-9.0 04/16] target/arm/kvm: Have kvm_arm_sve_set_vls take a ARMCPU argument, Philippe Mathieu-Daudé, 2023/11/23
- [PATCH-for-9.0 05/16] target/arm/kvm: Have kvm_arm_sve_get_vls take a ARMCPU argument, Philippe Mathieu-Daudé, 2023/11/23
- [PATCH-for-9.0 06/16] target/arm/kvm: Have kvm_arm_set_device_attr take a ARMCPU argument,
Philippe Mathieu-Daudé <=
- [PATCH-for-9.0 08/16] target/arm/kvm: Have kvm_arm_pmu_init take a ARMCPU argument, Philippe Mathieu-Daudé, 2023/11/23
- [PATCH-for-9.0 09/16] target/arm/kvm: Have kvm_arm_pmu_set_irq take a ARMCPU argument, Philippe Mathieu-Daudé, 2023/11/23
- [PATCH-for-9.0 07/16] target/arm/kvm: Have kvm_arm_pvtime_init take a ARMCPU argument, Philippe Mathieu-Daudé, 2023/11/23
- [PATCH-for-9.0 10/16] target/arm/kvm: Have kvm_arm_vcpu_init take a ARMCPU argument, Philippe Mathieu-Daudé, 2023/11/23