From: Oliver Kurth Date: Fri, 15 Sep 2017 18:23:39 +0000 (-0700) Subject: ARM: Better decode CPU Model Name X-Git-Tag: stable-10.2.0~218 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=17de351b6300c16aa91ea609bfae22c71ac8fc39;p=thirdparty%2Fopen-vm-tools.git ARM: Better decode CPU Model Name Instead of always returning "ARM64", the CPU model name will now be the CPU vendor followed by the core name and revisio, eg. ARM Limited Cortex-A57 r1p2 hostinfoPosix arm64 hack to always return "armv8 unknown" is removed, and will forward the CPU Model Name. --- diff --git a/open-vm-tools/lib/misc/hostinfoPosix.c b/open-vm-tools/lib/misc/hostinfoPosix.c index 6c7bf358f..ca161e23e 100644 --- a/open-vm-tools/lib/misc/hostinfoPosix.c +++ b/open-vm-tools/lib/misc/hostinfoPosix.c @@ -2433,28 +2433,19 @@ Hostinfo_GetCpuDescription(uint32 cpuNumber) // IN: return HostinfoGetSysctlStringAlloc("machdep.cpu.brand_string"); #elif defined(__FreeBSD__) return HostinfoGetSysctlStringAlloc("hw.model"); -#else -#ifdef VMX86_SERVER -#ifdef VM_ARM_64 - return strdup("armv8 unknown"); -#else - if (HostType_OSIsVMK()) { - char mName[48]; +#elif defined VMX86_SERVER + /* VMKernel treats mName as an in/out parameter so terminate it. */ + char mName[64] = { 0 }; - /* VMKernel treats mName as an in/out parameter so terminate it. */ - mName[0] = '\0'; - if (VMKernel_GetCPUModelName(cpuNumber, mName, - sizeof(mName)) == VMK_OK) { - mName[sizeof(mName) - 1] = '\0'; + if (VMKernel_GetCPUModelName(cpuNumber, mName, + sizeof(mName)) == VMK_OK) { + mName[sizeof(mName) - 1] = '\0'; - return strdup(mName); - } - - return NULL; + return strdup(mName); } -#endif // VM_ARM_64 -#endif // VMX86_SERVER + return NULL; +#else return HostinfoGetCpuInfo(cpuNumber, "model name"); #endif }