[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 27/34] target/arm/kvm: Inline set_feature() calls
From: |
Peter Maydell |
Subject: |
[PULL 27/34] target/arm/kvm: Inline set_feature() calls |
Date: |
Mon, 11 May 2020 14:33:58 +0100 |
From: Philippe Mathieu-Daudé <address@hidden>
We want to move the inlined declarations of set_feature()
from cpu*.c to cpu.h. To avoid clashing with the KVM
declarations, inline the few KVM calls.
Suggested-by: Richard Henderson <address@hidden>
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Message-id: address@hidden
Signed-off-by: Peter Maydell <address@hidden>
---
target/arm/kvm32.c | 13 ++++---------
target/arm/kvm64.c | 22 ++++++----------------
2 files changed, 10 insertions(+), 25 deletions(-)
diff --git a/target/arm/kvm32.c b/target/arm/kvm32.c
index f271181ab8e..7b3a19e9aef 100644
--- a/target/arm/kvm32.c
+++ b/target/arm/kvm32.c
@@ -22,11 +22,6 @@
#include "internals.h"
#include "qemu/log.h"
-static inline void set_feature(uint64_t *features, int feature)
-{
- *features |= 1ULL << feature;
-}
-
static int read_sys_reg32(int fd, uint32_t *pret, uint64_t id)
{
struct kvm_one_reg idreg = { .id = id, .addr = (uintptr_t)pret };
@@ -146,14 +141,14 @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures
*ahcf)
* timers; this in turn implies most of the other feature
* bits, but a few must be tested.
*/
- set_feature(&features, ARM_FEATURE_V7VE);
- set_feature(&features, ARM_FEATURE_GENERIC_TIMER);
+ features |= 1ULL << ARM_FEATURE_V7VE;
+ features |= 1ULL << ARM_FEATURE_GENERIC_TIMER;
if (extract32(id_pfr0, 12, 4) == 1) {
- set_feature(&features, ARM_FEATURE_THUMB2EE);
+ features |= 1ULL << ARM_FEATURE_THUMB2EE;
}
if (extract32(ahcf->isar.mvfr1, 12, 4) == 1) {
- set_feature(&features, ARM_FEATURE_NEON);
+ features |= 1ULL << ARM_FEATURE_NEON;
}
ahcf->features = features;
diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c
index be5b31c2b0f..cd8ab6b8aed 100644
--- a/target/arm/kvm64.c
+++ b/target/arm/kvm64.c
@@ -447,16 +447,6 @@ void kvm_arm_pmu_set_irq(CPUState *cs, int irq)
}
}
-static inline void set_feature(uint64_t *features, int feature)
-{
- *features |= 1ULL << feature;
-}
-
-static inline void unset_feature(uint64_t *features, int feature)
-{
- *features &= ~(1ULL << feature);
-}
-
static int read_sys_reg32(int fd, uint32_t *pret, uint64_t id)
{
uint64_t ret;
@@ -648,11 +638,11 @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures
*ahcf)
* with VFPv4+Neon; this in turn implies most of the other
* feature bits.
*/
- set_feature(&features, ARM_FEATURE_V8);
- set_feature(&features, ARM_FEATURE_NEON);
- set_feature(&features, ARM_FEATURE_AARCH64);
- set_feature(&features, ARM_FEATURE_PMU);
- set_feature(&features, ARM_FEATURE_GENERIC_TIMER);
+ features |= 1ULL << ARM_FEATURE_V8;
+ features |= 1ULL << ARM_FEATURE_NEON;
+ features |= 1ULL << ARM_FEATURE_AARCH64;
+ features |= 1ULL << ARM_FEATURE_PMU;
+ features |= 1ULL << ARM_FEATURE_GENERIC_TIMER;
ahcf->features = features;
@@ -802,7 +792,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
if (cpu->has_pmu) {
cpu->kvm_init_features[0] |= 1 << KVM_ARM_VCPU_PMU_V3;
} else {
- unset_feature(&env->features, ARM_FEATURE_PMU);
+ env->features &= ~(1ULL << ARM_FEATURE_PMU);
}
if (cpu_isar_feature(aa64_sve, cpu)) {
assert(kvm_arm_sve_supported(cs));
--
2.20.1
- [PULL 18/34] target/arm: Use SVEContLdSt in sve_ld1_r, (continued)
- [PULL 18/34] target/arm: Use SVEContLdSt in sve_ld1_r, Peter Maydell, 2020/05/11
- [PULL 12/34] accel/tcg: Add probe_access_flags, Peter Maydell, 2020/05/11
- [PULL 17/34] target/arm: Adjust interface of sve_ld1_host_fn, Peter Maydell, 2020/05/11
- [PULL 19/34] target/arm: Handle watchpoints in sve_ld1_r, Peter Maydell, 2020/05/11
- [PULL 20/34] target/arm: Use SVEContLdSt for multi-register contiguous loads, Peter Maydell, 2020/05/11
- [PULL 24/34] target/arm: Reuse sve_probe_page for scatter stores, Peter Maydell, 2020/05/11
- [PULL 23/34] target/arm: Reuse sve_probe_page for gather first-fault loads, Peter Maydell, 2020/05/11
- [PULL 22/34] target/arm: Use SVEContLdSt for contiguous stores, Peter Maydell, 2020/05/11
- [PULL 26/34] target/arm: Remove sve_memopidx, Peter Maydell, 2020/05/11
- [PULL 21/34] target/arm: Update contiguous first-fault and no-fault loads, Peter Maydell, 2020/05/11
- [PULL 27/34] target/arm/kvm: Inline set_feature() calls,
Peter Maydell <=
- [PULL 28/34] target/arm: Make set_feature() available for other files, Peter Maydell, 2020/05/11
- [PULL 29/34] target/arm/cpu: Use ARRAY_SIZE() to iterate over ARMCPUInfo[], Peter Maydell, 2020/05/11
- [PULL 30/34] target/arm/cpu: Restrict v8M IDAU interface to Aarch32 CPUs, Peter Maydell, 2020/05/11
- [PULL 25/34] target/arm: Reuse sve_probe_page for gather loads, Peter Maydell, 2020/05/11
- [PULL 32/34] hw/arm/musicpal: Map the UART devices unconditionally, Peter Maydell, 2020/05/11
- [PULL 33/34] target/arm: Use tcg_gen_gvec_5_ptr for sve FMLA/FCMLA, Peter Maydell, 2020/05/11
- [PULL 34/34] target/arm: Fix tcg_gen_gvec_dup_imm vs DUP (indexed), Peter Maydell, 2020/05/11
- [PULL 31/34] target/arm: Restrict TCG cpus to TCG accel, Peter Maydell, 2020/05/11
- Re: [PULL 00/34] target-arm queue, Peter Maydell, 2020/05/11