From: Kruti Pendharkar Date: Tue, 22 Jul 2025 07:06:53 +0000 (-0700) Subject: Change to common source file not applicable to open-vm-tools. X-Git-Tag: stable-13.1.0~134 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a19f158e24a5b8f18648ea5aedf443d5c804c1fe;p=thirdparty%2Fopen-vm-tools.git Change to common source file not applicable to open-vm-tools. --- diff --git a/open-vm-tools/lib/include/vm_atomic.h b/open-vm-tools/lib/include/vm_atomic.h index 809472e17..2586a1d04 100644 --- a/open-vm-tools/lib/include/vm_atomic.h +++ b/open-vm-tools/lib/include/vm_atomic.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (c) 1998-2024 Broadcom. All rights reserved. + * Copyright (c) 1998-2024 Broadcom. All Rights Reserved. * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or modify it diff --git a/open-vm-tools/lib/misc/hostinfoPosix.c b/open-vm-tools/lib/misc/hostinfoPosix.c index 542195776..10b3a0605 100644 --- a/open-vm-tools/lib/misc/hostinfoPosix.c +++ b/open-vm-tools/lib/misc/hostinfoPosix.c @@ -3540,7 +3540,7 @@ Hostinfo_GetRatedCpuMhz(int32 cpuNumber, // IN: return FALSE; } - *mHz = hz / 1000000; + *mHz = (hz + 500000) / 1000000; return TRUE; # else @@ -3549,16 +3549,16 @@ Hostinfo_GetRatedCpuMhz(int32 cpuNumber, // IN: #else #if defined(VMX86_SERVER) if (HostType_OSIsVMK()) { - uint32 tscKhzEstimate; - VMK_ReturnStatus status = VMKernel_GetTSCkhzEstimate(&tscKhzEstimate); + uint64 cpuHzEstimate; + VMK_ReturnStatus status = VMKPrivate_GetProcessorHzEstimate(&cpuHzEstimate); /* - * The TSC frequency matches the CPU frequency in all modern CPUs. - * Regardless, the TSC frequency is a much better estimate of - * reality than failing or returning zero. + * TSC and CPU frequencies match on the modern x86 processors but + * not on the Arm processors. Therefore, use the processor frequency + * estimate directly. */ - *mHz = tscKhzEstimate / 1000; + *mHz = (cpuHzEstimate + 500000) / 1000000; return (status == VMK_OK); }