Commit 9dc83cd9 authored by Max Reitz's avatar Max Reitz Committed by Paolo Bonzini
Browse files

i386/kvm: Fix build with -m32



find_next_bit() takes a pointer of type "const unsigned long *", but the
first argument passed here is a "uint64_t *".  These types are
incompatible when compiling qemu with -m32.

Just use ctz64() instead.

Fixes: c6861930
Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
Reviewed-by: default avatarEduardo Habkost <ehabkost@redhat.com>
Message-Id: <20190624193913.28343-1-mreitz@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent c20b1396
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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++) {