History log of /gem5/src/arch/x86/cpuid.cc
Revision Date Author Comments
# 14165:44b5b61846e1 14-Aug-2019 Gabe Black <gabeblack@google.com>

x86: Stop CPUID from claiming we support xsave.

xsave is a fairly complex feature which we don't support in gem5, but
we do report that we support it through CPUID. It looks like I confused
it with FXSAVE which is an instruction related to SSE. This change
turns that bit back off again.

Change-Id: I00fc79168c5f7095b5241e870a4c8782e4385425
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/20169
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Pouya Fotouhi <pfotouhi@ucdavis.edu>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>


# 12463:84f365522633 15-Jan-2018 Swapnil Haria <swapnilster@gmail.com>

arch-x86: Adding clflush, clflushopt, clwb instructions

This patch adds support for cache flushing instructions in x86.
It piggybacks on support for similar instructions in arm ISA
added by Nikos Nikoleris. I have tested each instruction using
microbenchmarks.

Change-Id: I72b6b8dc30c236a21eff7958fa231f0663532d7d
Reviewed-on: https://gem5-review.googlesource.com/7401
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 11793:ef606668d247 09-Nov-2016 Brandon Potter <brandon.potter@amd.com>

style: [patch 1/22] use /r/3648/ to reorganize includes


# 11321:02e930db812d 06-Feb-2016 Steve Reinhardt <steve.reinhardt@amd.com>

style: fix missing spaces in control statements

Result of running 'hg m5style --skip-all --fix-control -a'.


# 11320:42ecb523c64a 06-Feb-2016 Steve Reinhardt <steve.reinhardt@amd.com>

style: remove trailing whitespace

Result of running 'hg m5style --skip-all --fix-white -a'.


# 11217:b29d5816936f 16-Nov-2015 Bjoern A. Zeeb <baz21@cam.ac.uk>

x86: cpuid: add family to warn() message

doCpuid() has to identical warn messages about unimplemented functions. Add
the family to the log message to make them distinguishable.

Committed by: Nilay Vaish <nilay@cs.wisc.edu>


# 10638:5d119a460f15 07-Jan-2015 Gabe Black <gabeblack@google.com>

x86: Enable three bits in the FamilyModelStepping ECX CPUID bitfield.

These are for the monitor/mwait instructions, SSSE3, and XSAVE.


# 10637:e9bc4cde5d8e 07-Jan-2015 Gabe Black <gabeblack@google.com>

cpuid, x86: Revert "Enabling more features in CPUid"

That change enables CPUID bits for features that aren't implemented in gem5.
If a simulated system tries to use those features because it was told it
could, bad things can happen.


# 10552:41ebfed1dc89 23-Nov-2014 Alexandru Dutu <alexandru.dutu@amd.com>

cpuid, x86: Enabling more features in CPUid
Adding more features in the CPUid with the purpose of supporting running the
KvmCPU in SE mode.


# 10539:cd107abe79dd 17-Nov-2014 Gabe Black <gabeblack@google.com>

x86: Fix the CPUID Long Mode Address Size function.

The value in EAX has an 8 bit field for the linear address size and one for
the physical address size when calling that function. A recent change
implemented it but returned 0xff for both of those fields. That implies that
linear and physical addresses are 255 bits wide which is wrong. When using the
KVM CPU model this causes an error, presumably because some of those bits are
actually reserved, or the CPU or kernel realizes 255 bits is a bad value.

This change makes those values 48.


# 10439:1bd64b294fe4 13-Jun-2014 Jiuyue Ma <majiuyue@ncic.ac.cn>

x86: add LongModeAddressSize function to cpuid

LongModeAddressSize was used by kernel 2.6.28.4 for physical address
validation, if not properly implemented, PCI resource allocation may
failed because of ioremap failed:

- linux-2.6.28.4/arch/x86/mm/ioremap.c:27-30
27 static inline int phys_addr_valid(unsigned long addr)
28 {
29 return addr < (1UL << boot_cpu_data.x86_phys_bits);
30 }

- linux-2.6.28.4/arch/x86/kernel/cpu/common.c:475-482
475 #ifdef CONFIG_X86_64
476 if (c->extended_cpuid_level >= 0x80000008) {
477 u32 eax = cpuid_eax(0x80000008);
478
479 c->x86_virt_bits = (eax >> 8) & 0xff;
480 c->x86_phys_bits = eax & 0xff;
481 }
482 #endif

- linux-2.6.28.4/arch/x86/mm/ioremap.c:209-214
209 if (!phys_addr_valid(phys_addr)) {
210 printk(KERN_WARNING "ioremap: invalid physical address %llx\n",
211 (unsigned long long)phys_addr);
212 WARN_ON_ONCE(1);
213 return NULL;
214 }

This patch return 0x0000ffff for LongModeAddressSize, which guarantee phys_addr_valid never failed.

Committed by: Nilay Vaish <nilay@cs.wisc.edu>


# 9473:da05a322fa4d 15-Jan-2013 Nilay Vaish <nilay@cs.wisc.edu>

x86 cpuid: enable clflush
Note that clflush is only being enabled. It is not implemented
in actual. A warning is printed if the cpu encounters a clflush
instruction. We need to enable this instruction in cpuid since
JRE 1.7 tests for it.


# 9124:3476c436d248 22-Jul-2012 Nilay Vaish <nilay@cs.wisc.edu>

X86 CPUID: Return false if unknown processor family


# 7811:a8fc35183c10 03-Jan-2011 Steve Reinhardt <steve.reinhardt@amd.com>

Make commenting on close namespace brackets consistent.

Ran all the source files through 'perl -pi' with this script:

s|\s*(};?\s*)?/\*\s*(end\s*)?namespace\s*(\S+)\s*\*/(\s*})?|} // namespace $3|;
s|\s*};?\s*//\s*(end\s*)?namespace\s*(\S+)\s*|} // namespace $2\n|;
s|\s*};?\s*//\s*(\S+)\s*namespace\s*|} // namespace $1\n|;

Also did a little manual editing on some of the arch/*/isa_traits.hh files
and src/SConscript.


# 7072:d9823ce926fa 02-May-2010 Gabe Black <gblack@eecs.umich.edu>

X86: Sometimes CPUID depends on ecx, so pass that in.


# 6068:f70c90e29577 19-Apr-2009 Gabe Black <gblack@eecs.umich.edu>

X86: Fix the ordering of the vendor string reported by CPUID.


# 6052:2b660729f136 19-Apr-2009 Gabe Black <gblack@eecs.umich.edu>

X86: Only use %eax to select a function and look like we support sse2.


# 6040:818914aeebc1 19-Apr-2009 Gabe Black <gblack@eecs.umich.edu>

X86: Don't pretend to be an AMD CPU any more. We're not good enough at it.


# 5659:f4b9c344d1ca 12-Oct-2008 Gabe Black <gblack@eecs.umich.edu>

X86: Implement CPUID with a magical function instead of microcode.