| Index: third_party/crashpad/crashpad/minidump/minidump_system_info_writer.cc
|
| diff --git a/third_party/crashpad/crashpad/minidump/minidump_system_info_writer.cc b/third_party/crashpad/crashpad/minidump/minidump_system_info_writer.cc
|
| index 066363cb990709b51b218ea3a892c79f15dd0734..9c665f4fa675247689fa39e4fdd11ea6bbf836df 100644
|
| --- a/third_party/crashpad/crashpad/minidump/minidump_system_info_writer.cc
|
| +++ b/third_party/crashpad/crashpad/minidump/minidump_system_info_writer.cc
|
| @@ -20,6 +20,7 @@
|
| #include "minidump/minidump_string_writer.h"
|
| #include "snapshot/system_snapshot.h"
|
| #include "util/file/file_writer.h"
|
| +#include "util/misc/arraysize_unsafe.h"
|
| #include "util/misc/implicit_cast.h"
|
|
|
| namespace crashpad {
|
| @@ -64,10 +65,12 @@ uint64_t AMD64FeaturesFromSystemSnapshot(
|
| MAP_FEATURE(cpuid_features, F_RDRAND, PF_RDRAND_INSTRUCTION_AVAILABLE);
|
|
|
| #define FX_XD 20
|
| +#define FX_RDTSCP 27
|
| #define FX_3DNOW 31
|
|
|
| uint64_t extended_features = system_snapshot->CPUX86ExtendedFeatures();
|
|
|
| + MAP_FEATURE(extended_features, FX_RDTSCP, PF_RDTSCP_INSTRUCTION_AVAILABLE);
|
| MAP_FEATURE(extended_features, FX_3DNOW, PF_3DNOW_INSTRUCTIONS_AVAILABLE);
|
|
|
| #define F7_FSGSBASE 0
|
| @@ -76,8 +79,8 @@ uint64_t AMD64FeaturesFromSystemSnapshot(
|
|
|
| MAP_FEATURE(leaf7_features, F7_FSGSBASE, PF_RDWRFSGSBASE_AVAILABLE);
|
|
|
| - // This feature bit should be set if NX (XD, DEP) is enabled, not just if
|
| - // it’s available on the CPU as indicated by the XF_XD bit.
|
| + // This feature bit should be set if NX (XD, DEP) is enabled, not just if it’s
|
| + // available on the CPU as indicated by the FX_XD bit.
|
| if (system_snapshot->NXEnabled()) {
|
| minidump_features |= ADD_FEATURE(PF_NX_ENABLED);
|
| }
|
| @@ -86,10 +89,10 @@ uint64_t AMD64FeaturesFromSystemSnapshot(
|
| minidump_features |= ADD_FEATURE(PF_SSE_DAZ_MODE_AVAILABLE);
|
| }
|
|
|
| - // PF_SECOND_LEVEL_ADDRESS_TRANSLATION can’t be determined without
|
| - // consulting model-specific registers, a privileged operation. The exact
|
| - // use of PF_VIRT_FIRMWARE_ENABLED is unknown. PF_FASTFAIL_AVAILABLE is
|
| - // irrelevant outside of Windows.
|
| + // PF_SECOND_LEVEL_ADDRESS_TRANSLATION can’t be determined without consulting
|
| + // model-specific registers, a privileged operation. The exact use of
|
| + // PF_VIRT_FIRMWARE_ENABLED is unknown. PF_FASTFAIL_AVAILABLE is irrelevant
|
| + // outside of Windows.
|
|
|
| #undef MAP_FEATURE
|
| #undef ADD_FEATURE
|
| @@ -194,7 +197,7 @@ void MinidumpSystemInfoWriter::SetCPUX86Vendor(uint32_t ebx,
|
| system_info_.ProcessorArchitecture ==
|
| kMinidumpCPUArchitectureX86Win64);
|
|
|
| - static_assert(arraysize(system_info_.Cpu.X86CpuInfo.VendorId) == 3,
|
| + static_assert(ARRAYSIZE_UNSAFE(system_info_.Cpu.X86CpuInfo.VendorId) == 3,
|
| "VendorId must have 3 elements");
|
|
|
| system_info_.Cpu.X86CpuInfo.VendorId[0] = ebx;
|
| @@ -252,8 +255,9 @@ void MinidumpSystemInfoWriter::SetCPUOtherFeatures(uint64_t features_0,
|
| system_info_.ProcessorArchitecture !=
|
| kMinidumpCPUArchitectureX86Win64);
|
|
|
| - static_assert(arraysize(system_info_.Cpu.OtherCpuInfo.ProcessorFeatures) == 2,
|
| - "ProcessorFeatures must have 2 elements");
|
| + static_assert(
|
| + ARRAYSIZE_UNSAFE(system_info_.Cpu.OtherCpuInfo.ProcessorFeatures) == 2,
|
| + "ProcessorFeatures must have 2 elements");
|
|
|
| system_info_.Cpu.OtherCpuInfo.ProcessorFeatures[0] = features_0;
|
| system_info_.Cpu.OtherCpuInfo.ProcessorFeatures[1] = features_1;
|
|
|