Patchwork [13/13] target-i386: Postpone cpuid_level update to realize time

login
register
mail settings
Submitter Andreas Färber
Date Dec. 6, 2012, 9:06 a.m.
Message ID <1354784817-1340-14-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/204187/
State New
Headers show

Comments

Andreas Färber - Dec. 6, 2012, 9:06 a.m.
From: Igor Mammedov <imammedo@redhat.com>

Delay capping cpuid_level to 7 to realize time so property setters
for cpuid_7_0_ebx_features and "level" could be used in any order/time
between x86_cpu_initfn() and x86_cpu_realize().

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 target-i386/cpu.c |    3 ---
 1 Datei geändert, 3 Zeilen entfernt(-)
Eduardo Habkost - Dec. 7, 2012, 5:57 p.m.
On Thu, Dec 06, 2012 at 10:06:57AM +0100, Andreas Färber wrote:
[...]
> ---
>  target-i386/cpu.c |    3 ---
>  1 Datei geändert, 3 Zeilen entfernt(-)
> 
> diff --git a/target-i386/cpu.c b/target-i386/cpu.c
> index a631ae9..f56aa0d 100644
> --- a/target-i386/cpu.c
> +++ b/target-i386/cpu.c
> @@ -1381,9 +1381,6 @@ static int cpu_x86_parse_featurestr(x86_def_t *x86_cpu_def, char *features)
>          if (kvm_check_features_against_host(x86_cpu_def) && enforce_cpuid)
>              goto error;
>      }
> -    if (x86_cpu_def->cpuid_7_0_ebx_features && x86_cpu_def->level < 7) {
> -        x86_cpu_def->level = 7;
> -    }
>      return 0;
>  
>  error:

NACK. A patch chunk is missing. I will resend the fixed version, just in
case.
Andreas Färber - Dec. 7, 2012, 6:18 p.m.
Am 07.12.2012 18:57, schrieb Eduardo Habkost:
> On Thu, Dec 06, 2012 at 10:06:57AM +0100, Andreas Färber wrote:
> [...]
>> ---
>>  target-i386/cpu.c |    3 ---
>>  1 Datei geändert, 3 Zeilen entfernt(-)
>>
>> diff --git a/target-i386/cpu.c b/target-i386/cpu.c
>> index a631ae9..f56aa0d 100644
>> --- a/target-i386/cpu.c
>> +++ b/target-i386/cpu.c
>> @@ -1381,9 +1381,6 @@ static int cpu_x86_parse_featurestr(x86_def_t *x86_cpu_def, char *features)
>>          if (kvm_check_features_against_host(x86_cpu_def) && enforce_cpuid)
>>              goto error;
>>      }
>> -    if (x86_cpu_def->cpuid_7_0_ebx_features && x86_cpu_def->level < 7) {
>> -        x86_cpu_def->level = 7;
>> -    }
>>      return 0;
>>  
>>  error:
> 
> NACK. A patch chunk is missing. I will resend the fixed version, just in
> case.

Uh, mismerge... thanks for noticing! Fixed.

https://github.com/afaerber/qemu-cpu/commits/qom-cpu

Andreas

Patch

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index a631ae9..f56aa0d 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1381,9 +1381,6 @@  static int cpu_x86_parse_featurestr(x86_def_t *x86_cpu_def, char *features)
         if (kvm_check_features_against_host(x86_cpu_def) && enforce_cpuid)
             goto error;
     }
-    if (x86_cpu_def->cpuid_7_0_ebx_features && x86_cpu_def->level < 7) {
-        x86_cpu_def->level = 7;
-    }
     return 0;
 
 error: