From: Paolo Bonzini <pbonzini@redhat.com>
To: Jim Mattson <jmattson@google.com>, kvm@vger.kernel.org
Subject: Re: [kvm-unit-tests PATCH 3/3] x86: Define wrtsc(tsc) as wrmsr(MSR_IA32_TSC, tsc)
Date: Fri, 28 Jan 2022 16:17:18 +0100 [thread overview]
Message-ID: <3f5d9eb7-7ad7-ae08-c31d-a41eef6659e4@redhat.com> (raw)
In-Reply-To: <20220127215548.2016946-3-jmattson@google.com>
On 1/27/22 22:55, Jim Mattson wrote:
> Remove some inline assembly code duplication and opportunistically
> replace the magic constant, "0x10," with "MSR_IA32_TSC."
>
> Signed-off-by: Jim Mattson <jmattson@google.com>
> ---
> lib/x86/processor.h | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/lib/x86/processor.h b/lib/x86/processor.h
> index fe5add548261..117032a4895c 100644
> --- a/lib/x86/processor.h
> +++ b/lib/x86/processor.h
> @@ -592,9 +592,7 @@ static inline unsigned long long rdtscp(u32 *aux)
>
> static inline void wrtsc(u64 tsc)
> {
> - unsigned a = tsc, d = tsc >> 32;
> -
> - asm volatile("wrmsr" : : "a"(a), "d"(d), "c"(0x10));
> + wrmsr(MSR_IA32_TSC, tsc);
> }
>
> static inline void irq_disable(void)
Queued all three, thanks.
Paolo
prev parent reply other threads:[~2022-01-28 15:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-27 21:55 [kvm-unit-tests PATCH 1/3] x86: tsc_adjust: Remove flaky timing test Jim Mattson
2022-01-27 21:55 ` [kvm-unit-tests PATCH 2/3] x86: tsc_adjust: Use report_skip when skipping test Jim Mattson
2022-01-27 21:55 ` [kvm-unit-tests PATCH 3/3] x86: Define wrtsc(tsc) as wrmsr(MSR_IA32_TSC, tsc) Jim Mattson
2022-01-28 15:17 ` Paolo Bonzini [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3f5d9eb7-7ad7-ae08-c31d-a41eef6659e4@redhat.com \
--to=pbonzini@redhat.com \
--cc=jmattson@google.com \
--cc=kvm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).