qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/1] x86: add CPU flags supported inside libvirt


From: Denis V. Lunev
Subject: Re: [Qemu-devel] [PATCH 1/1] x86: add CPU flags supported inside libvirt
Date: Fri, 19 Jul 2019 13:00:16 +0000

On 7/18/19 4:52 PM, Paolo Bonzini wrote:
> On 18/07/19 15:45, Denis V. Lunev wrote:
>> There are the following flags available in libvirt inside cpu_map.xm
>>     <feature name='cvt16'>
>>       <cpuid function='0x80000001' ecx='0x00040000'/>
>>     </feature>
>>     <feature name='cmt'> <!-- cqm -->
>>       <cpuid eax_in='0x07' ecx_in='0x00' ebx='0x00001000'/>
>>     </feature>
>> We have faced the problem that QEMU does not start once these flags are
>> present in the domain.xml.
>>
>> This patch just adds proper names into the map.
>>
>> Signed-off-by: Denis V. Lunev <address@hidden>
>> CC: Paolo Bonzini <address@hidden>
>> CC: Richard Henderson <address@hidden>
>> CC: Eduardo Habkost <address@hidden>
>> CC: Nikolay Shirokovskiy <address@hidden>
>> CC: Peter Krempa <address@hidden>
>> CC: Daniel P. Berrangé <address@hidden>
>> ---
>>  target/i386/cpu.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/target/i386/cpu.c b/target/i386/cpu.c
>> index 805ce95247..88ba4dad47 100644
>> --- a/target/i386/cpu.c
>> +++ b/target/i386/cpu.c
>> @@ -870,7 +870,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] 
>> = {
>>              "lahf-lm", "cmp-legacy", "svm", "extapic",
>>              "cr8legacy", "abm", "sse4a", "misalignsse",
>>              "3dnowprefetch", "osvw", "ibs", "xop",
>> -            "skinit", "wdt", NULL, "lwp",
>> +            "skinit", "wdt", "cvt16", "lwp",
>>              "fma4", "tce", NULL, "nodeid-msr",
>>              NULL, "tbm", "topoext", "perfctr-core",
>>              "perfctr-nb", NULL, NULL, NULL,
>> @@ -1044,7 +1044,7 @@ static FeatureWordInfo 
>> feature_word_info[FEATURE_WORDS] = {
>>              "fsgsbase", "tsc-adjust", NULL, "bmi1",
>>              "hle", "avx2", NULL, "smep",
>>              "bmi2", "erms", "invpcid", "rtm",
>> -            NULL, NULL, "mpx", NULL,
>> +            "cmt", NULL, "mpx", NULL,
>>              "avx512f", "avx512dq", "rdseed", "adx",
>>              "smap", "avx512ifma", "pcommit", "clflushopt",
>>              "clwb", "intel-pt", "avx512pf", "avx512er",
>>
> Oops, nice catch!  I've queued the patch for 4.1.
>
> Paolo
I have written small script to find differences between
CPU features in QEMU and libvirt.

#!/bin/bash
LIST=`awk "/name/{split(\\\$2, arr, \"'\"); print arr[2]}" x86_features.xml`
for feat in $LIST; do
    var=`grep \"$feat\" target/i386/cpu.c`
    if [ -z "$var" ]; then
        echo $feat
    fi
done

There are the following list of features present in libvirt
and missed in QEMU:

osxsave - removed in qemu in f1a23522b03
ospke - removed in qemu in 9ccb9784b57
pconfig - removed in qemu in 712f807e196.
mbm_total
mbm_local

Two last features are described as follows:
  <!-- cpuid level 0x0000000f:1 (edx) -->
  <feature name='mbm_total'>
    <cpuid eax_in='0x0f' ecx_in='0x01' edx='0x00000002'/>
  </feature>
  <feature name='mbm_local'>
    <cpuid eax_in='0x0f' ecx_in='0x01' edx='0x00000004'/>
  </feature>
This leaf is not supported in QEMU at all.

According to Intel 64 and IA-32 Architecture Developer manual
vol. 2a these bits are used for
EDX Bit 00: Supports L3 occupancy monitoring if 1.
Bit 01: Supports L3 Total Bandwidth monitoring if 1.
Bit 02: Supports L3 Local Bandwidth monitoring if 1.
Bits 31 - 03: Reserved.

Thus technically these 5 bits are able to produce problems
for QEMU if they will be found in domain.xml

Den

reply via email to

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