diff --git a/Add-new-cpu-model-name-of-arm-Kunpeng.patch b/Add-new-cpu-model-name-of-arm-Kunpeng.patch new file mode 100644 index 0000000000000000000000000000000000000000..993ffc3dd2a8ecd664356cc8acdf4ace50885804 --- /dev/null +++ b/Add-new-cpu-model-name-of-arm-Kunpeng.patch @@ -0,0 +1,82 @@ +From 07141f3ff3e5da75b2b7246e715d521d203cff46 Mon Sep 17 00:00:00 2001 +From: YunYi Yang +Date: Sat, 29 Mar 2025 15:31:39 +0800 +Subject: [PATCH] Add new cpu model name of arm Kunpeng + +Add the display of the CPU model name when the CPU part id is 0xd02/0xd03 +for Kunpeng. The ID may correspond to multiple cpu model names. Therefore, +refer to the bios model name. + +https://gitee.com/src-openeuler/util-linux/issues/IBBNGQ +Signed-off-by: Huaxin Lu +--- + sys-utils/lscpu-arm.c | 31 +++++++++++++++++++++++++++---- + 1 file changed, 27 insertions(+), 4 deletions(-) + +diff --git a/sys-utils/lscpu-arm.c b/sys-utils/lscpu-arm.c +index d83e948..8f1d3af 100644 +--- a/sys-utils/lscpu-arm.c ++++ b/sys-utils/lscpu-arm.c +@@ -29,6 +29,7 @@ + struct id_part { + const int id; + const char* name; ++ char* (*inner)(const int, const char*, struct lscpu_cputype *ct); + }; + + static const struct id_part arm_part[] = { +@@ -251,10 +252,13 @@ static const struct id_part fujitsu_part[] = { + { -1, "unknown" }, + }; + ++char* hisi_get_inner_name_compatible(const int id, const char* name, struct lscpu_cputype *ct); ++ + static const struct id_part hisi_part[] = { +- { 0xd01, "Kunpeng-920" }, /* aka tsv110 */ +- { 0xd40, "Cortex-A76" }, /* HiSilicon uses this ID though advertises A76 */ +- { -1, "unknown" }, ++ { 0xd01, "Kunpeng-920", NULL }, /* aka tsv110 */ ++ { 0xd02, "unknown", hisi_get_inner_name_compatible }, ++ { 0xd40, "Cortex-A76", NULL }, /* HiSilicon uses this ID though advertises A76 */ ++ { -1, "unknown", NULL }, + }; + + static const struct id_part ampere_part[] = { +@@ -329,6 +333,19 @@ static inline int parse_implementer_id(struct lscpu_cputype *ct) + return ct->vendor_id; + } + ++char* hisi_get_inner_name_compatible(const int id __attribute__((unused)), const char* name, struct lscpu_cputype *ct) ++{ ++ char* bios_modelname = ct->bios_modelname; ++ if (bios_modelname == NULL) { ++ return (char*)name; ++ } ++ // Compatible with HUAWEI Kunpeng 920 7282C models ++ if (strstr(bios_modelname, "7282C") != NULL) { ++ return "Kunpeng 920 7282C"; ++ } ++ return bios_modelname; ++} ++ + /* + * Use model and vendor IDs to decode to human readable names. + */ +@@ -362,7 +379,13 @@ static int arm_ids_decode(struct lscpu_cputype *ct) + for (j = 0; parts[j].id != -1; j++) { + if (parts[j].id == part) { + free(ct->modelname); +- ct->modelname = xstrdup(parts[j].name); ++ char* real_name = NULL; ++ if (parts[j].inner != NULL) { ++ real_name = parts[j].inner(parts[j].id, parts[j].name, ct); ++ } else { ++ real_name = (char*)parts[j].name; ++ } ++ ct->modelname = xstrdup(real_name); + break; + } + } +-- +2.33.0 + diff --git a/util-linux.spec b/util-linux.spec index c8b140212432030e9041d3be4b3db76f27a8c968..90780c602d7824a3dc4953ce1726eb895ce20ff1 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -3,7 +3,7 @@ Name: util-linux Version: 2.39.1 -Release: 23 +Release: 24 Summary: A random collection of Linux utilities License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain URL: https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git @@ -111,6 +111,7 @@ Patch9001: util-linux-Add-sw64-architecture.patch Patch9002: sfdisk-fix-crash-casued-by-out-of-bounds-access.patch Patch9003: add-new-gmo-file.patch Patch9004: mount-fix-use-option-owner-mount-failed.patch +Patch9005: Add-new-cpu-model-name-of-arm-Kunpeng.patch BuildRequires: audit-libs-devel >= 1.0.6 gettext-devel libselinux-devel ncurses-devel pam-devel zlib-devel popt-devel BuildRequires: libutempter-devel systemd-devel systemd libuser-devel libcap-ng-devel python3-devel gcc autoconf automake @@ -469,6 +470,12 @@ fi %endif %changelog +* Mon June 30 2025 luhuaxin - 2.39.1-24 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC: Add new cpu model name of arm Kunpeng + * Mon Jun 16 2025 markeryang - 2.39.1-23 - Type:bugfix - CVE:NA