agora inbox for pgsql-committers@postgresql.org
help / color / mirror / Atom feedFrom: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: instrumentation: Avoid CPUID 0x15/0x16 for Hypervisor TSC freque
Date: Thu, 09 Apr 2026 15:51:36 +0000
Message-ID: <E1wArfL-000A62-1V@gemulon.postgresql.org> (raw)
instrumentation: Avoid CPUID 0x15/0x16 for Hypervisor TSC frequency
This restricts the retrieval of the TSC frequency whilst under a Hypervisor to
either Hypervisor-specific CPUID registers (0x40000010), or TSC
calibration. We previously allowed retrieving from the traditional CPUID
registers for TSC frequency (0x15/0x16) like on bare metal, but it turns out
that they are not trustworthy when virtualized and can report wildly incorrect
frequencies, like 7 kHz when the actual calibrated frequencty is 2.5 GHz.
Per report from buildfarm member drongo.
Author: Lukas Fittl <lukas@fittl.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/jr4hk2sxhqcfpb67ftz5g4vw33nm67cgf7go3wwmqsafu5aclq%405m67ukuhyszz
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/7fc36c5db55016f7a1d89b5e2efd82fe6fd39632
Modified Files
--------------
src/port/pg_cpu_x86.c | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
Message-ID: <E1wArfL-000A62-1V@gemulon.postgresql.org>
Permalink: ../E1wArfL-000A62-1V@gemulon.postgresql.org/
Also on: postgresql.org/message-id/E1wArfL-000A62-1V@gemulon.postgresql.org
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: andres@anarazel.de, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: instrumentation: Avoid CPUID 0x15/0x16 for Hypervisor TSC freque
In-Reply-To: <E1wArfL-000A62-1V@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox