From a74470c18d8a5c579d4e405b3380ad831cf4d6b5 Mon Sep 17 00:00:00 2001 From: fanjinke Date: Tue, 21 May 2019 18:20:11 +0800 Subject: [PATCH] arch_utils: add Hygon Dhyana CPU support Add Hygon CPU vendor ID("HygonGenuine") detection and optimize arch to "athlon" in x86 and "amd64" in x86_64. Merges: https://pagure.io/pungi/pull-request/1196 Signed-off-by: fanjinke --- pungi/arch_utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pungi/arch_utils.py b/pungi/arch_utils.py index 711ccd7f..f4144b61 100644 --- a/pungi/arch_utils.py +++ b/pungi/arch_utils.py @@ -193,6 +193,8 @@ def getCanonX86Arch(arch): # pragma: no cover for line in _try_read_cpuinfo(): if line.startswith("vendor") and line.find("AuthenticAMD") != -1: return "athlon" + elif line.startswith("vendor") and line.find("HygonGenuine") != -1: + return "athlon" # i686 doesn't guarantee cmov, but we depend on it elif line.startswith("flags"): if line.find("cmov") == -1: @@ -282,6 +284,8 @@ def getCanonX86_64Arch(arch): # pragma: no cover if vendor.find("Authentic AMD") != -1 or vendor.find("AuthenticAMD") != -1: return "amd64" + if vendor.find("HygonGenuine") != -1: + return "amd64" if vendor.find("GenuineIntel") != -1: return "ia32e" return arch