Add support for Hygon Dhyana CPU

This patch is used to add support Hygon Dhyana x86
vendor id (HygonGenuine).

More details can be found on:
http://lkml.kernel.org/r/5ce86123a7b9dad925ac583d88d2f921040e859b.1538583282.git.puwen@hygon.cn

Change-Id: I53445a8a63421811401b6a6a40e664d2600a3ec8
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1640959
Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
Jinke Fan 2019-06-03 16:44:04 +08:00 committed by Mark Mentovai
parent 7500e2ef45
commit e1b3bd11cd
3 changed files with 4 additions and 3 deletions

View File

@ -214,7 +214,7 @@ union __attribute__((packed, aligned(4))) CPU_INFORMATION {
//! `cpuid 0x80000001` `edx`. //! `cpuid 0x80000001` `edx`.
//! //!
//! This field is only valid if #VendorId identifies the CPU vendor as //! This field is only valid if #VendorId identifies the CPU vendor as
//! “AuthenticAMD”. //! “AuthenticAMD” or "HygonGenuine".
uint32_t AMDExtendedCpuFeatures; uint32_t AMDExtendedCpuFeatures;
} X86CpuInfo; } X86CpuInfo;

View File

@ -151,7 +151,7 @@ void MinidumpSystemInfoWriter::InitializeFromSnapshot(
SetCPUX86VersionAndFeatures(system_snapshot->CPUX86Signature(), SetCPUX86VersionAndFeatures(system_snapshot->CPUX86Signature(),
system_snapshot->CPUX86Features() & 0xffffffff); system_snapshot->CPUX86Features() & 0xffffffff);
if (cpu_vendor == "AuthenticAMD") { if (cpu_vendor == "AuthenticAMD" || cpu_vendor == "HygonGenuine") {
SetCPUX86AMDExtendedFeatures( SetCPUX86AMDExtendedFeatures(
system_snapshot->CPUX86ExtendedFeatures() & 0xffffffff); system_snapshot->CPUX86ExtendedFeatures() & 0xffffffff);
} }

View File

@ -77,7 +77,8 @@ TEST(SystemSnapshotLinux, Basic) {
EXPECT_PRED1( EXPECT_PRED1(
[](std::string vendor) { [](std::string vendor) {
return vendor == "GenuineIntel" || vendor == "AuthenticAMD"; return vendor == "GenuineIntel" || vendor == "AuthenticAMD" ||
vendor == "HygonGenuine";
}, },
system.CPUVendor()); system.CPUVendor());