qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 10/10] target/i386: implement RDPID in TCG


From: Richard Henderson
Subject: Re: [PATCH v2 10/10] target/i386: implement RDPID in TCG
Date: Tue, 20 Jun 2023 18:23:28 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0

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<pbonzini@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.henderson@linaro.org>

r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]