qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] target-i386: add a list of enforceable CPU mode


From: Peter Lieven
Subject: Re: [Qemu-devel] [PATCH] target-i386: add a list of enforceable CPU models to the help output
Date: Wed, 26 Aug 2015 20:38:35 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

Am 26.08.2015 um 17:54 schrieb Eduardo Habkost:
> On Mon, Aug 24, 2015 at 11:17:04AM +0200, Peter Lieven wrote:
>> this patch adds a probe that lists all enforceable and migrateable
>> CPU models to the -cpu help output. The idea is to know a priory
>> which CPU modules can be exposed to the user without loosing any
>> feature flags.
>>
>> Signed-off-by: Peter Lieven <address@hidden>
> [...]
>> +/*
>> + * Check if the CPU Definition is enforcable on the current host CPU
>> + * and contains no unmigratable flags.
>> + *
>> + * Returns: true if the CPU can be enforced and migrated.
>> + */
>> +static bool x86_cpu_enforce_and_migratable(X86CPUDefinition *def)
>> +{
>> +    int i;
>> +    for (i = 0; i < ARRAY_SIZE(feature_word_info); i++) {
>> +        FeatureWordInfo *fw = &feature_word_info[i];
>> +        uint32_t eax, ebx, ecx, edx, host;
>> +        host_cpuid(fw->cpuid_eax, 0, &eax, &ebx, &ecx, &edx);
> This isn't how you check if the CPU model can run in "enforce" mode.
> Please read x86_cpu_filter_features().

I did, but will do again. The problem is that x86_cpu_filter_features
requires enabled KVM to run. I believed internally it does something
similar to what I do here.

>
> Also, you can't tell if a CPU model is runnable in enforce mode unless
> you know what's the accelerator being used (see
> x86_cpu_filter_features()). How do you suggest we show
> accelerator-specific information in help output?
>

The subject was missing that the goal was to list enforceable models
in KVM mode. The output of the help page mentions this.

Andreas suggested to make annotations to the list of CPU models.
In theory it would be possible to have different annotations for different
accelerators.

Peter




reply via email to

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