[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] target-i386: Postpone cpuid_level update to realize
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [PATCH] target-i386: Postpone cpuid_level update to realize time |
Date: |
Fri, 7 Dec 2012 16:00:31 -0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
From: Igor Mammedov <address@hidden>
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 <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
---
The patch in the pull request sent by Andreas is not the right one (a
patch chunk is missing). I'm resending the correct patch.
---
target-i386/cpu.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index a631ae9..7be3ad8 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:
@@ -2074,6 +2071,11 @@ static void x86_cpu_apic_init(X86CPU *cpu, Error **errp)
void x86_cpu_realize(Object *obj, Error **errp)
{
X86CPU *cpu = X86_CPU(obj);
+ CPUX86State *env = &cpu->env;
+
+ if (env->cpuid_7_0_ebx_features && env->cpuid_level < 7) {
+ env->cpuid_level = 7;
+ }
#ifndef CONFIG_USER_ONLY
qemu_register_reset(x86_cpu_machine_reset_cb, cpu);
--
1.7.11.7
- [Qemu-devel] [PATCH 01/13] user: Move *-user/qemu-types.h to main directory, (continued)
- [Qemu-devel] [PATCH 01/13] user: Move *-user/qemu-types.h to main directory, Andreas Färber, 2012/12/06
- [Qemu-devel] [PATCH 03/13] ui/vnc-palette.c: Include headers it needs, Andreas Färber, 2012/12/06
- [Qemu-devel] [PATCH 11/13] target-i386: Separate feature string parsing from CPU model lookup, Andreas Färber, 2012/12/06
- [Qemu-devel] [PATCH 05/13] qga/channel-posix.c: Include headers it needs, Andreas Färber, 2012/12/06
- [Qemu-devel] [PATCH 09/13] qdev: qdev_create(): use error_report() instead of hw_error(), Andreas Färber, 2012/12/06
- [Qemu-devel] [PATCH 08/13] sysemu.h: Include qemu-types.h instead of qemu-common.h, Andreas Färber, 2012/12/06
- [Qemu-devel] [PATCH 07/13] Create qemu-types.h for struct typedefs, Andreas Färber, 2012/12/06
- [Qemu-devel] [PATCH 13/13] target-i386: Postpone cpuid_level update to realize time, Andreas Färber, 2012/12/06
- [Qemu-devel] [PATCH 10/13] target-i386/cpu.c: Coding style fixes, Andreas Färber, 2012/12/06
- [Qemu-devel] [PATCH 12/13] target-i386: Use define for cpuid vendor string size, Andreas Färber, 2012/12/06
- Re: [Qemu-devel] [PULL] QOM CPUState patch queue 2012-12-06, Andreas Färber, 2012/12/07
- Re: [Qemu-devel] [PULL] QOM CPUState patch queue 2012-12-06, Anthony Liguori, 2012/12/10