On 6/20/23 17:16, Paolo Bonzini wrote:
RDPID corresponds to a RDMSR(TSC_AUX); however, it is unprivileged
so for user-mode emulation we must provide the value that the kernel
places in the MSR.  For Linux, it is a combination of the current CPU
and the current NUMA node, both of which can be retrieved with getcpu(2).
For BSD, just return 0.

RDTSCP is reimplemented as RDTSC + RDPID ECX; the differences in terms
of serializability are not relevant to QEMU.

Signed-off-by: Paolo Bonzini<pbonz...@redhat.com>
---
  meson.build                   |  1 +
  target/i386/cpu.c             | 10 +++++++++-
  target/i386/helper.h          |  2 +-
  target/i386/tcg/misc_helper.c | 23 +++++++++++++++++------
  target/i386/tcg/translate.c   | 15 +++++++++++++--
  5 files changed, 41 insertions(+), 10 deletions(-)

Reviewed-by: Richard Henderson <richard.hender...@linaro.org>

r~

Reply via email to