From: Paolo Bonzini <pbonzini@redhat.com>
To: Borislav Petkov <bp@alien8.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
"Nadav Amit" <nadav.amit@gmail.com>,
"Andy Lutomirski" <luto@amacapital.net>,
"Peter Zijlstra" <peterz@infradead.org>,
"H. Peter Anvin" <hpa@zytor.com>,
"Ingo Molnar" <mingo@redhat.com>,
"Joerg Roedel" <joro@8bytes.org>,
kvm@vger.kernel.org, "Radim Krčmář" <rkrcmar@redhat.com>,
"Thomas Gleixner" <tglx@linutronix.de>,
x86@kernel.org
Subject: Re: [PATCH 3/5] x86/kvm: Convert some slow-path static_cpu_has() callers to boot_cpu_has()
Date: Mon, 1 Apr 2019 09:24:06 +0200 [thread overview]
Message-ID: <86dc0d5c-88af-dddc-4618-1a0a5a545e5f@redhat.com> (raw)
In-Reply-To: <20190331151248.GB15073@zn.tnic>
On 31/03/19 17:12, Borislav Petkov wrote:
> On Sun, Mar 31, 2019 at 04:20:11PM +0200, Paolo Bonzini wrote:
>> These are not slow path.
>
> Those functions do a *lot* of stuff like a bunch of MSR reads which are
> tens of cycles each at least.
The MSR reads and writes are not done in the common case. Also, you
cannot really expect boot_cpu_data to be in L1 in these functions since
they run after the guest---or if they do, each L1 line you fill in with
host data is one line you "steal" from the guest.
Paolo
> I don't think a RIP-relative MOV and a BT:
>
> movq boot_cpu_data+20(%rip), %rax # MEM[(const long unsigned int *)&boot_cpu_data + 20B], _45
> btq $59, %rax #, _45
>
> are at all noticeable.
>
> On latest AMD and Intel uarch those are 2-4 cycles, according to
>
> https://agner.org/optimize/instruction_tables.ods
>
next prev parent reply other threads:[~2019-04-01 7:24 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-30 11:20 [PATCH 0/5] x86/asm: Remove some static_cpu_has() usage Borislav Petkov
2019-03-30 11:20 ` [PATCH 1/5] x86/asm: Clarify static_cpu_has()'s intended use Borislav Petkov
2019-04-01 8:06 ` Peter Zijlstra
2019-04-08 14:29 ` [tip:x86/asm] " tip-bot for Borislav Petkov
2019-03-30 11:20 ` [PATCH 2/5] x86: Convert some slow-path static_cpu_has() callers to boot_cpu_has() Borislav Petkov
2019-03-30 12:47 ` Rik van Riel
2019-03-30 12:50 ` Juergen Gross
2019-04-08 14:29 ` [tip:x86/asm] " tip-bot for Borislav Petkov
2019-03-30 11:20 ` [PATCH 3/5] x86/kvm: " Borislav Petkov
2019-03-31 14:20 ` Paolo Bonzini
2019-03-31 15:12 ` Borislav Petkov
2019-04-01 7:24 ` Paolo Bonzini [this message]
2019-04-01 7:33 ` Borislav Petkov
2019-03-30 11:20 ` [PATCH 4/5] x86/mm: " Borislav Petkov
2019-04-08 14:30 ` [tip:x86/asm] " tip-bot for Borislav Petkov
2019-03-30 11:20 ` [PATCH 5/5] drivers/cpufreq: " Borislav Petkov
2019-04-01 9:31 ` Rafael J. Wysocki
2019-04-01 9:32 ` Rafael J. Wysocki
2019-04-01 12:48 ` Borislav Petkov
2019-04-01 21:34 ` Rafael J. Wysocki
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=86dc0d5c-88af-dddc-4618-1a0a5a545e5f@redhat.com \
--to=pbonzini@redhat.com \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@redhat.com \
--cc=nadav.amit@gmail.com \
--cc=peterz@infradead.org \
--cc=rkrcmar@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@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
all inboxes | Powered by JetHome®