1
0
Fork 0
mirror of https://github.com/anrieff/libcpuid synced 2025-10-03 11:01:30 +00:00
Commit graph

535 commits

Author SHA1 Message Date
Xorg
d5c892e002 RDMSR: fix cpu_msrinfo() function with AMD CPUs 2017-02-12 20:17:51 +01:00
Veselin Georgiev
0cb7023828 Merge pull request #82 from X0rg/master
Add a switch to cpuid_tool to dump MSR values to a file.

This is very similar to the --save=... feature.
2017-02-10 01:55:05 +00:00
Veselin Georgiev
86bf8e8269 Fixed issue #81: Misdiagnosis microarchitecture for i3-3220T
It's a mystery to me why this CPU doesn't have RdRand.
A quick-n-dirty workaround is inserted to fix that.
2017-02-10 03:48:00 +02:00
Xorg
9b038c94c4 Add a msr_serialize_raw_data() function 2017-02-09 20:55:28 +01:00
Veselin Georgiev
e36a08deb9 Fixed issue #76: Skylake Core i5 badly recognized
Add support for detecting RDSEED and ADX instructions.
Use RDSEED instead of RTM to ascertain that the CPU is
Broadwell or later in recog_intel.c. This fixes
detection discrepancies on Linux, where RTM is not
made available (I guess there's no kernel support for it).

The two new flags are also now detected in the Broadwell
and Skylake tests. Update them as well.
2016-10-25 05:16:44 +03:00
Veselin Georgiev
ee88463079 Fix a compilation error on MSVC. 2016-10-18 02:15:36 +02:00
Veselin Georgiev
6907241564 Related to issue #75: Improve documentation of cpuid_get_total_cpus(). 2016-10-18 01:54:27 +03:00
Veselin Georgiev
e632d1287c Fix issue #69: clang LTO error
Replace named asm label with unnamed (local) label.
2016-10-03 13:17:01 +03:00
Veselin Georgiev
4cf8cfa862 Related to issue #67: Information about the availability of SGX
Initial commit adding support for detection of SGX. Not tested yet.
Increment version number due to binary incompatibility of the
sizes of cpu_raw_data_t and cpu_id_t.
2016-10-03 13:07:22 +03:00
Xorg
4b4b49b288 Fix build on GhostBSD 10.3 2016-09-22 17:11:47 +02:00
Veselin Georgiev
a7a31743a2 Fix issue #66: Manpage for cpuid_tool
The man-page is generated with Doxygen, similar to the lib docs.
2016-09-20 15:36:40 +03:00
Xorg
581ca840fa Replace binary literals by hex literals
Fix #52, again.
2016-09-03 18:39:55 +02:00
Xorg
77c6a9a666 Increase CPU clock accuracy in bus clock calculation
The CPU clock is computed once and cached, so it needs to be accurate. In libcpuid.h, 100ms is recommended.
2016-08-30 11:13:17 +02:00
Xorg
4a077265fd Fixed issue #52: Wrong CPU multipliers on AMD APU
Properly use formulas from AMD BKDG, it should fix CPU multipliers report from 10h family to 16h family.
Some tests are available in #52.
2016-08-30 11:07:06 +02:00
Veselin Georgiev
3f38efb6c9 Fixed issue #54: Intel Atom N450 not recognised properly
Improved parsing of brand strings for both Pineview and Cedarview
Atoms.

Add tests for both the Pineview Atom, and also Broadwell-E
(forgotten in a previous commit).
2016-08-24 15:06:40 +03:00
Veselin Georgiev
1599fd5a27 Fixed issue #53: Broadwell-E not recognised properly
The presence of RTM was previously incorrectly attributed to a Skylake
or later only CPUs. Broadwells have this as well, so the detected
intel_code_t for Broadwell-E was wrong (it was CORE_HASWELL*).
2016-08-24 08:50:28 +03:00
Veselin Georgiev
50530f7618 Fix issue #51: Undefined behavior. 2016-07-31 17:48:49 +03:00
Veselin Georgiev
e0505af4f6 Fix issue #50: On some virtual machines, library returns zero number of cores.
As proposed in the issue discussion.
2016-07-18 09:07:51 +03:00
Veselin Georgiev
ea7ae60ccb Add libcpuid_internal.h, intel_code_t.h and amd_code_t.h to Makefile.am.
Otherwise they don't end up in the source tarball and it doesn't compile.
2016-07-10 04:33:02 +03:00
Veselin Georgiev
51aac9f852 Update .am files about the vc9->vc10 file change. 2016-07-10 04:27:35 +03:00
Veselin Georgiev
bb9f03f2ba Replace VC9 project files with improved ones for VC10.
The new project files are for Microsoft Visual Studio 2010.

The configurations now support building both 32- and 64-bit targets,
and the "Release DLL" target is supported much like in the vc71 project.

The output layout is as follows:

32-bit, Debug static library goes to libcpuid/x32/Debug
32-bit, Release static library goes to libcpuid/x32/Release
32-bit, DLL (only release) goes to libcpuid/x32/ReleaseDLL. It includes
the .dll and the export library .lib as well.
64-bit DLL goes to libcpuid/x64/ReleaseDLL.

and so forth.
2016-07-10 02:51:23 +02:00
Veselin Georgiev
647d737db8 Set version to 0.3.0 in libcpuid.h, update release date. 2016-07-09 06:54:07 +03:00
Veselin Georgiev
91dad77e6e Similar to the previous commit: additions to the VC9 project file. 2016-07-09 06:53:12 +03:00
Veselin Georgiev
03d54ae61c Port to MSVC7.1: C89 compliance and project updates. 2016-07-09 05:48:35 +03:00
Veselin Georiev
568db71156 Fix a bunch of warnings (emitted from MSVC). 2016-07-09 05:24:12 +03:00
Veselin Georiev
296b1efe7a Rename ATOM enum value as it clashes with some Windows headers. 2016-07-09 05:24:12 +03:00
Xorg
298539b4b0 Add Athlon 64 FX X2 (Toledo) in database 2016-06-16 12:58:42 +02:00
Xorg
bc84f0c71d cpu_msrinfo(): Fix value of CPU_INVALID_VALUE in 'double' subfunctions
It returns 0x7FFFFFFF instead of 0x3FFFFFFF
0x3FFFFFFF is a 29-bit value, but become a 36-bit value when multiplied by 100, causing a value out-of-range
2016-06-16 12:40:41 +02:00
Veselin Georgiev
3f51d3ca25 Add detection of L4 cache. 2016-06-09 15:42:57 +03:00
Veselin Georgiev
571fe75d88 Remove redundant MSRINFO_DEFINED macro. 2016-06-06 11:38:40 +03:00
Veselin Georgiev
24d7c318d0 Resolve warnings on Mac OS X. 2016-06-06 01:50:05 +03:00
Veselin Georgiev
dbf9991553 Merge pull request #48 from X0rg/master
MSRs rework and man-pages
2016-06-05 14:39:57 +01:00
Xorg
ec445b0a54 Add load_driver() support for GNU/Linux & FreeBSD in cpu_msr_driver_open_core() 2016-06-05 14:10:19 +02:00
Xorg
023f0307f0 Minor changes for cpu_msrinfo() 2016-06-05 13:16:15 +02:00
Xorg
462ec75c79 Fix Doxygen warnings, don't warn if undocmented 2016-06-05 12:19:49 +02:00
Xorg
8fda5a74f1 Generate and install man-pages if Doxygen is installed 2016-06-05 12:09:59 +02:00
Xorg
240a862c45 Fix warnings
recog_intel.c:589:22: warning: implicit conversion from enumeration type 'enum _common_codes_t' to different enumeration type 'intel_code_t' (aka 'enum _intel_code_t')
recog_amd.c:449:9: warning: implicit conversion from enumeration type 'enum _common_codes_t' to different enumeration type 'amd_code_t' (aka 'enum _amd_code_t')
2016-06-05 11:07:00 +02:00
Xorg
cba9a1e19a Replace hardcoded addresses by define in cpu_msrinfo() 2016-06-04 20:52:27 +02:00
Xorg
9059fb6ff5 Add INFO_BUS_CLOCK in cpu_msrinfo() as a more generic term (same as INFO_BCLK)
BCLK is specific to Intel
2016-06-04 20:31:01 +02:00
Xorg
eeb7a6f3c7 Report CPU minimum multiplier (INFO_MIN_MULTIPLIER) in cpu_msrinfo() 2016-06-04 20:11:09 +02:00
Xorg
24cd11fea9 In cpu_msrinfo(), add experimental support for AMD CPUs for INFO_CUR_MULTIPLIER, INFO_MAX_MULTIPLIER and INFO_BCLK
get_amd_multipliers() allow to share a maximum of code
2016-06-04 19:50:21 +02:00
Xorg
14cfc77b17 Improve/clean code for cpu_msrinfo()
* Add AMD and Intel doc links
* Use 'return' only if there is no error; on error, the end-function 'return CPU_INVALID_VALUE' is used
* Add more comments about MSRs
* Simplify a lot of things
* Avoid cpu_rdmsr_range() to override cpu_rdmsr() error
* Remove int casting in cpu_msrinfo()
2016-06-04 17:51:48 +02:00
Xorg
8fc0cc0d4a Use internal code for MSR, replace cpuid_get_vendor() by id->vendor 2016-06-04 14:13:24 +02:00
Xorg
1ef4615d8f Use cpu_id_t in cpu_msrinfo()
It can be useful to have more informations on CPU
2016-06-04 13:16:41 +02:00
Veselin Georgiev
5f99a4528c Change version to 0.3.0 throughout the project. Update ChangeLog. 2016-06-03 21:15:37 +03:00
Xorg
5467504680 Use cpu_ident_internal() in cpu_msrinfo() 2016-06-03 15:58:45 +02:00
Xorg
93cdd0de75 Merge upstream changes
Conflicts:
	libcpuid/rdmsr.c
2016-06-03 14:36:24 +02:00
Veselin Georgiev
c31b5c0ae8 Add up to 8 entries for CPUID leaf 04; push version to 0.3.0.
This is a backwards-incompatible binary change, which increases
sizeof(cpu_raw_data_t). Specifically, the cpu_raw_data_t::intel_fn4
array is increased from 4 to 8 elements, because on recent Hasells
(Crystalwell) there is a Level 4 cache, which should be encoded in
CPUID eax=4 ecx=4. However, we were only storing levels for eax=4
for ecx <= 3. Thus the raw data didn't have the relevant info.

There will be further changes to this, specifically to store
and print the level 4 cache in cpuid_tool.
2016-06-03 04:35:01 +03:00
Veselin Georgiev
3f36114b19 Fix a few legit warnings (passing 'int*', where 'uint64*' is expected). 2016-06-03 03:34:08 +03:00
Veselin Georgiev
a2550463a9 Reorganize library a bit.
- Expose intel_code_t and amd_code_t enums - they are no longer
  limited to just recog_{intel,amd}.c.
- Add libcpuid_internal.h lists those enums and provides the,
  cpu_ident_internal() function, which is the same as cpu_identify(),
  but also has a third parameter - a internal_id_info_t structure,
  which holds detection internals.

All of this is intended to be used in rdmsr, which needs to know
specifics on what CPU it is running.
2016-06-03 03:30:36 +03:00