diff options
Diffstat (limited to 'target')
-rw-r--r-- | target/arm/helper.c | 4 | ||||
-rw-r--r-- | target/arm/vfp_helper.c | 4 | ||||
-rw-r--r-- | target/i386/kvm.c | 7 | ||||
-rw-r--r-- | target/i386/machine.c | 5 |
4 files changed, 10 insertions, 10 deletions
diff --git a/target/arm/helper.c b/target/arm/helper.c index 2df7152a9c..20f8728be1 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -5283,10 +5283,10 @@ uint32_t sve_zcr_len_for_el(CPUARMState *env, int el) if (el <= 1) { zcr_len = MIN(zcr_len, 0xf & (uint32_t)env->vfp.zcr_el[1]); } - if (el < 2 && arm_feature(env, ARM_FEATURE_EL2)) { + if (el <= 2 && arm_feature(env, ARM_FEATURE_EL2)) { zcr_len = MIN(zcr_len, 0xf & (uint32_t)env->vfp.zcr_el[2]); } - if (el < 3 && arm_feature(env, ARM_FEATURE_EL3)) { + if (arm_feature(env, ARM_FEATURE_EL3)) { zcr_len = MIN(zcr_len, 0xf & (uint32_t)env->vfp.zcr_el[3]); } return zcr_len; diff --git a/target/arm/vfp_helper.c b/target/arm/vfp_helper.c index 46041e3294..9710ef1c3e 100644 --- a/target/arm/vfp_helper.c +++ b/target/arm/vfp_helper.c @@ -197,6 +197,8 @@ void HELPER(vfp_set_fpscr)(CPUARMState *env, uint32_t val) val &= 0xf7c0009f; } + vfp_set_fpscr_to_host(env, val); + /* * We don't implement trapped exception handling, so the * trap enable bits, IDE|IXE|UFE|OFE|DZE|IOE are all RAZ/WI (not RES0!) @@ -217,8 +219,6 @@ void HELPER(vfp_set_fpscr)(CPUARMState *env, uint32_t val) env->vfp.qc[1] = 0; env->vfp.qc[2] = 0; env->vfp.qc[3] = 0; - - vfp_set_fpscr_to_host(env, val); } void vfp_set_fpscr(CPUARMState *env, uint32_t val) diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 473a17e9a5..ec7870c6af 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -1043,14 +1043,15 @@ static int hv_cpuid_check_and_set(CPUState *cs, struct kvm_cpuid2 *cpuid, CPUX86State *env = &cpu->env; uint32_t r, fw, bits; uint64_t deps; - int i, dep_feat = 0; + int i, dep_feat; if (!hyperv_feat_enabled(cpu, feature) && !cpu->hyperv_passthrough) { return 0; } deps = kvm_hyperv_properties[feature].dependencies; - while ((dep_feat = find_next_bit(&deps, 64, dep_feat)) < 64) { + while (deps) { + dep_feat = ctz64(deps); if (!(hyperv_feat_enabled(cpu, dep_feat))) { fprintf(stderr, "Hyper-V %s requires Hyper-V %s\n", @@ -1058,7 +1059,7 @@ static int hv_cpuid_check_and_set(CPUState *cs, struct kvm_cpuid2 *cpuid, kvm_hyperv_properties[dep_feat].desc); return 1; } - dep_feat++; + deps &= ~(1ull << dep_feat); } for (i = 0; i < ARRAY_SIZE(kvm_hyperv_properties[feature].flags); i++) { diff --git a/target/i386/machine.c b/target/i386/machine.c index 851b249d1a..704ba6de46 100644 --- a/target/i386/machine.c +++ b/target/i386/machine.c @@ -997,9 +997,8 @@ static bool vmx_nested_state_needed(void *opaque) { struct kvm_nested_state *nested_state = opaque; - return ((nested_state->format == KVM_STATE_NESTED_FORMAT_VMX) && - ((nested_state->hdr.vmx.vmxon_pa != -1ull) || - (nested_state->hdr.vmx.smm.flags & KVM_STATE_NESTED_SMM_VMXON))); + return (nested_state->format == KVM_STATE_NESTED_FORMAT_VMX && + nested_state->hdr.vmx.vmxon_pa != -1ull); } static const VMStateDescription vmstate_vmx_nested_state = { |