[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 24/24] linux-user: Use X86CPU property to retrieve CP
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PULL 24/24] linux-user: Use X86CPU property to retrieve CPUID family |
Date: |
Tue, 23 Jul 2013 04:53:56 +0200 |
Avoids duplicating the calculation.
Reviewed-by: Igor Mammedov <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
---
linux-user/cpu-uname.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/linux-user/cpu-uname.c b/linux-user/cpu-uname.c
index 59cd647..cc713e6 100644
--- a/linux-user/cpu-uname.c
+++ b/linux-user/cpu-uname.c
@@ -55,12 +55,14 @@ const char *cpu_to_uname_machine(void *cpu_env)
return "x86-64";
#elif defined(TARGET_I386)
/* see arch/x86/kernel/cpu/bugs.c: check_bugs(), 386, 486, 586, 686 */
- uint32_t cpuid_version = ((CPUX86State *)cpu_env)->cpuid_version;
- int family = ((cpuid_version >> 8) & 0x0f) + ((cpuid_version >> 20) &
0xff);
- if (family == 4)
+ CPUState *cpu = ENV_GET_CPU((CPUX86State *)cpu_env);
+ int family = object_property_get_int(OBJECT(cpu), "family", NULL);
+ if (family == 4) {
return "i486";
- if (family == 5)
+ }
+ if (family == 5) {
return "i586";
+ }
return "i686";
#else
/* default is #define-d in each arch/ subdir */
--
1.8.1.4
- [Qemu-devel] [PULL 12/24] gdbstub: Update gdb_handlesig() and gdb_signalled() Coding Style, (continued)
- [Qemu-devel] [PULL 12/24] gdbstub: Update gdb_handlesig() and gdb_signalled() Coding Style, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 13/24] cpu: Change cpu_single_step() argument to CPUState, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 08/24] cpu: Introduce CPUClass::synchronize_from_tb() for cpu_pc_from_tb(), Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 14/24] kvm: Change kvm_{insert, remove}_breakpoint() argument to CPUState, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 15/24] gdbstub: Change syscall callback argument to CPUState, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 17/24] gdbstub: Change gdb_{read, write}_register() argument to CPUState, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 16/24] gdbstub: Change gdb_handlesig() argument to CPUState, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 20/24] cpu: Introduce CPUClass::memory_rw_debug() for target_memory_rw_debug(), Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 11/24] cpu: Move singlestep_enabled field from CPU_COMMON to CPUState, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 22/24] cpu: Move gdb_regs field from CPU_COMMON to CPUState, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 24/24] linux-user: Use X86CPU property to retrieve CPUID family,
Andreas Färber <=
- [Qemu-devel] [PULL 23/24] gdbstub: Change gdb_register_coprocessor() argument to CPUState, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 21/24] gdbstub: Change GDBState::{c, g}_cpu and find_cpu() to CPUState, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 19/24] exec: Change cpu_memory_rw_debug() argument to CPUState, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 18/24] cpu: Turn cpu_get_phys_page_debug() into a CPUClass hook, Andreas Färber, 2013/07/22