qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH v2 13/15] cpu-model/s390: Add processor prop


From: Michael Mueller
Subject: Re: [Qemu-devel] [RFC PATCH v2 13/15] cpu-model/s390: Add processor property routines
Date: Fri, 20 Feb 2015 17:04:08 +0100

On Fri, 20 Feb 2015 16:41:49 +0100
Andreas Färber <address@hidden> wrote:

> Can't you just implement the class-level name-to-ObjectClass callback
> that other CPUs have grown for the above use case?

If it fulfills the requirements sure. Please point me to an example, sounds that
s390_select_cpu_model() is doing something similar to that, just that it hooks 
in
the s390_set_processor_props() call.

const char *s390_select_cpu_model(const char *model)
{
    S390ProcessorProps proc;
    const char *typename;
    S390CPUClass *cc;

    /* return already selected cpu typename */
    typename = s390_cpu_typename();
    if (typename) {
        goto out;
    }

    /* return standard cpu typename when cpu models are unavailable */
    typename = TYPE_S390_CPU;
    if (!s390_cpu_classes_initialized() || !model) {
        goto out;
    }
    cc = S390_CPU_CLASS(s390_cpu_class_by_name(model));
    if (!cc) {
        goto out;
    }
    proc.cpuid = cpuid(cc->proc);
    proc.ibc = cc->proc->ibc;
    memcpy(proc.fac_list, cc->fac_list, S390_ARCH_FAC_LIST_SIZE_BYTE);
    if (s390_set_processor_props(&proc)) {
        goto out;
    }

    /* return requested cpu typename in success case */
    typename = object_class_get_name((ObjectClass *) cc);
out:
    selected_cpu_typename = typename;
    trace_select_cpu_model(model, typename);
    return typename;
}


> 
> Also a general comment: cpu-model/ is not an existing directory nor one
> you add, so please use "target-s390x: Add foo to S390CPU" or so.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]