From d43fb11b47dcc39559bfe8c1585f55cc2b781dc3 Mon Sep 17 00:00:00 2001 From: The Tumultuous Unicorn Of Darkness Date: Mon, 8 May 2023 17:53:22 +0200 Subject: [PATCH] DB: add Intel Sapphire Rapids-SP --- libcpuid/libcpuid_internal.h | 1 + libcpuid/libcpuid_util.h | 2 +- libcpuid/recog_intel.c | 19 +++++++++++++------ .../sapphire-rapids-ws-xeon-w7.test | 0 4 files changed, 15 insertions(+), 7 deletions(-) rename tests/intel/{sapphire_rapids => golden-cove}/sapphire-rapids-ws-xeon-w7.test (100%) diff --git a/libcpuid/libcpuid_internal.h b/libcpuid/libcpuid_internal.h index 994a69b..94e30cb 100644 --- a/libcpuid/libcpuid_internal.h +++ b/libcpuid/libcpuid_internal.h @@ -134,6 +134,7 @@ enum _intel_bits_t { _SILVER_ = LBIT( 24 ), _GOLD_ = LBIT( 25 ), _PLATINIUM_ = LBIT( 26 ), + _MAX_ = LBIT( 27 ), }; typedef enum _intel_bits_t intel_bits_t; diff --git a/libcpuid/libcpuid_util.h b/libcpuid/libcpuid_util.h index 4fd3833..560820f 100644 --- a/libcpuid/libcpuid_util.h +++ b/libcpuid/libcpuid_util.h @@ -43,7 +43,7 @@ struct match_entry_t { int ncores, l2cache, l3cache, brand_code; uint64_t model_bits; int model_code; - char name[32]; + char name[36]; }; // returns the match score: diff --git a/libcpuid/recog_intel.c b/libcpuid/recog_intel.c index 8267bd2..7a5305a 100644 --- a/libcpuid/recog_intel.c +++ b/libcpuid/recog_intel.c @@ -69,7 +69,7 @@ enum _intel_model_t { _x1xx, /* Xeon Bronze/Silver/Gold/Platinum x1xx */ _x2xx, /* Xeon Bronze/Silver/Gold/Platinum x2xx */ _x3xx, /* Xeon Bronze/Silver/Gold/Platinum x3xx */ - _x4xx, /* Xeon Bronze/Silver/Gold/Platinum x4xx */ + _x4xx, /* Xeon Bronze/Silver/Gold/Platinum/Max x4xx */ }; typedef enum _intel_model_t intel_model_t; @@ -499,11 +499,16 @@ const struct match_entry_t cpudb_intel[] = { { 6, 10, 3, -1, 186, -1, -1, -1, NC, CORE_|_I_|_3 ,_13xxx, "Raptor Lake-U (Core i3)" }, /* Sapphire Rapids CPUs (2023, 4th Xeon Scalable gen, Intel 7) => https://en.wikichip.org/wiki/intel/microarchitectures/sapphire_rapids */ - { 6, 15, -1, -1, 143, -1, -1, -1, NC, XEON_|_W_|_9 , 0, "Sapphire Rapids-WS (Xeon w9)" }, - { 6, 15, -1, -1, 143, -1, -1, -1, NC, XEON_|_W_|_7 , 0, "Sapphire Rapids-WS (Xeon w7)" }, - { 6, 15, -1, -1, 143, -1, -1, -1, NC, XEON_|_W_|_5 , 0, "Sapphire Rapids-WS (Xeon w5)" }, - { 6, 15, -1, -1, 143, -1, -1, -1, NC, XEON_|_W_|_3 , 0, "Sapphire Rapids-WS (Xeon w3)" }, - /* F M S EF EM C L2 L3 Brand */ + { 6, 15, -1, -1, 143, -1, -1, -1, NC, XEON_|_W_|_9 , _x4xx, "Sapphire Rapids-WS (Xeon w9)" }, + { 6, 15, -1, -1, 143, -1, -1, -1, NC, XEON_|_W_|_7 , _x4xx, "Sapphire Rapids-WS (Xeon w7)" }, + { 6, 15, -1, -1, 143, -1, -1, -1, NC, XEON_|_W_|_5 , _x4xx, "Sapphire Rapids-WS (Xeon w5)" }, + { 6, 15, -1, -1, 143, -1, -1, -1, NC, XEON_|_W_|_3 , _x4xx, "Sapphire Rapids-WS (Xeon w3)" }, + { 6, 15, -1, -1, 143, -1, -1, -1, NC, XEON_|_MAX_ , _x4xx, "Sapphire Rapids-SP (Xeon Max)" }, + { 6, 15, -1, -1, 143, -1, -1, -1, NC, XEON_|_PLATINIUM_, _x4xx, "Sapphire Rapids-SP (Xeon Platinum)" }, + { 6, 15, -1, -1, 143, -1, -1, -1, NC, XEON_|_GOLD_ , _x4xx, "Sapphire Rapids-SP (Xeon Gold)" }, + { 6, 15, -1, -1, 143, -1, -1, -1, NC, XEON_|_SILVER_ , _x4xx, "Sapphire Rapids-SP (Xeon Silver)" }, + { 6, 15, -1, -1, 143, -1, -1, -1, NC, XEON_|_BRONZE_ , _x4xx, "Sapphire Rapids-SP (Xeon Bronze)" }, + /* F M S EF EM #cores L2$ L3$ BC ModelBits ModelCode Name */ /* Itaniums */ @@ -758,6 +763,7 @@ static intel_code_and_bits_t get_brand_code_and_bits(struct cpu_id_t* data) { _SILVER_, "Silver" }, { _GOLD_, "Gold" }, { _PLATINIUM_, "Platinum" }, + { _MAX_, "Max" }, }; for (i = 0; i < COUNT_OF(bit_matchtable); i++) { @@ -905,6 +911,7 @@ static intel_model_t get_model_code(struct cpu_id_t* data) else if ((i == 0) && ((i = match_pattern(bs, "Xeon(R) Silver")) != 0)) i += 15; else if ((i == 0) && ((i = match_pattern(bs, "Xeon(R) Gold")) != 0)) i += 13; else if ((i == 0) && ((i = match_pattern(bs, "Xeon(R) Platinum")) != 0)) i += 17; + else if ((i == 0) && ((i = match_pattern(bs, "Xeon(R) Max")) != 0)) i += 12; if (i == 0) return UNKNOWN; if (bs[i] == '1') return _x1xx; diff --git a/tests/intel/sapphire_rapids/sapphire-rapids-ws-xeon-w7.test b/tests/intel/golden-cove/sapphire-rapids-ws-xeon-w7.test similarity index 100% rename from tests/intel/sapphire_rapids/sapphire-rapids-ws-xeon-w7.test rename to tests/intel/golden-cove/sapphire-rapids-ws-xeon-w7.test