[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 29/43] target/arm/kvm: Have kvm_arm_pmu_init take a ARMCPU argumen
From: |
Peter Maydell |
Subject: |
[PULL 29/43] target/arm/kvm: Have kvm_arm_pmu_init take a ARMCPU argument |
Date: |
Tue, 19 Dec 2023 19:12:53 +0000 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
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>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Message-id: 20231123183518.64569-9-philmd@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
target/arm/kvm_arm.h | 4 ++--
hw/arm/virt.c | 2 +-
target/arm/kvm.c | 6 +++---
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h
index 4404ffeb1e3..0a79545aa12 100644
--- a/target/arm/kvm_arm.h
+++ b/target/arm/kvm_arm.h
@@ -200,8 +200,8 @@ int kvm_arm_get_max_vm_ipa_size(MachineState *ms, bool
*fixed_ipa);
int kvm_arm_vgic_probe(void);
+void kvm_arm_pmu_init(ARMCPU *cpu);
void kvm_arm_pmu_set_irq(CPUState *cs, int irq);
-void kvm_arm_pmu_init(CPUState *cs);
/**
* kvm_arm_pvtime_init:
@@ -263,7 +263,7 @@ static inline void kvm_arm_pmu_set_irq(CPUState *cs, int
irq)
g_assert_not_reached();
}
-static inline void kvm_arm_pmu_init(CPUState *cs)
+static inline void kvm_arm_pmu_init(ARMCPU *cpu)
{
g_assert_not_reached();
}
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index b6efe9da4dd..63f3c0b7502 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2000,7 +2000,7 @@ static void virt_cpu_post_init(VirtMachineState *vms,
MemoryRegion *sysmem)
if (kvm_irqchip_in_kernel()) {
kvm_arm_pmu_set_irq(cpu, VIRTUAL_PMU_IRQ);
}
- kvm_arm_pmu_init(cpu);
+ kvm_arm_pmu_init(ARM_CPU(cpu));
}
if (steal_time) {
kvm_arm_pvtime_init(ARM_CPU(cpu), pvtime_reg_base
diff --git a/target/arm/kvm.c b/target/arm/kvm.c
index dbaebe9cd2c..1e52077a9ce 100644
--- a/target/arm/kvm.c
+++ b/target/arm/kvm.c
@@ -1709,17 +1709,17 @@ static bool kvm_arm_set_device_attr(ARMCPU *cpu, struct
kvm_device_attr *attr,
return true;
}
-void kvm_arm_pmu_init(CPUState *cs)
+void kvm_arm_pmu_init(ARMCPU *cpu)
{
struct kvm_device_attr attr = {
.group = KVM_ARM_VCPU_PMU_V3_CTRL,
.attr = KVM_ARM_VCPU_PMU_V3_INIT,
};
- if (!ARM_CPU(cs)->has_pmu) {
+ if (!cpu->has_pmu) {
return;
}
- if (!kvm_arm_set_device_attr(ARM_CPU(cs), &attr, "PMU")) {
+ if (!kvm_arm_set_device_attr(cpu, &attr, "PMU")) {
error_report("failed to init PMU");
abort();
}
--
2.34.1
- [PULL 31/43] target/arm/kvm: Have kvm_arm_vcpu_init take a ARMCPU argument, (continued)
- [PULL 31/43] target/arm/kvm: Have kvm_arm_vcpu_init take a ARMCPU argument, Peter Maydell, 2023/12/19
- [PULL 32/43] target/arm/kvm: Have kvm_arm_vcpu_finalize take a ARMCPU argument, Peter Maydell, 2023/12/19
- [PULL 34/43] target/arm/kvm: Have kvm_arm_verify_ext_dabt_pending take a ARMCPU arg, Peter Maydell, 2023/12/19
- [PULL 22/43] hw/intc/arm_gicv3: Include missing 'qemu/error-report.h' header, Peter Maydell, 2023/12/19
- [PULL 38/43] target/arm: Don't implement *32_EL2 registers when EL1 is AArch64 only, Peter Maydell, 2023/12/19
- [PULL 39/43] target/arm: Restrict TCG specific helpers, Peter Maydell, 2023/12/19
- [PULL 40/43] target/arm: Restrict DC CVAP & DC CVADP instructions to TCG accel, Peter Maydell, 2023/12/19
- [PULL 42/43] target/arm/helper: Propagate MDCR_EL2.HPMN into PMCR_EL0.N, Peter Maydell, 2023/12/19
- [PULL 26/43] target/arm/kvm: Have kvm_arm_sve_get_vls take a ARMCPU argument, Peter Maydell, 2023/12/19
- [PULL 30/43] target/arm/kvm: Have kvm_arm_pmu_set_irq take a ARMCPU argument, Peter Maydell, 2023/12/19
- [PULL 29/43] target/arm/kvm: Have kvm_arm_pmu_init take a ARMCPU argument,
Peter Maydell <=
- [PULL 35/43] target/arm/kvm: Have kvm_arm_handle_dabt_nisv take a ARMCPU argument, Peter Maydell, 2023/12/19
- [PULL 41/43] target/arm/tcg: Including missing 'exec/exec-all.h' header, Peter Maydell, 2023/12/19
- [PULL 43/43] fsl-imx: add simple RTC emulation for i.MX6 and i.MX7 boards, Peter Maydell, 2023/12/19
- [PULL 25/43] target/arm/kvm: Have kvm_arm_sve_set_vls take a ARMCPU argument, Peter Maydell, 2023/12/19
- Re: [PULL 00/43] target-arm queue, Stefan Hajnoczi, 2023/12/20