From: Paolo Bonzini <pbonzini@redhat.com>
To: Andy Lutomirski <luto@kernel.org>, X86 ML <x86@kernel.org>
Cc: kvm list <kvm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Borislav Petkov <bpetkov@suse.de>,
Thomas Garnier <thgarnie@google.com>,
Jim Mattson <jmattson@google.com>
Subject: Re: [PATCH 6/6] x86/kvm/vmx: Defer TR reload after VM exit
Date: Mon, 20 Feb 2017 18:51:47 +0100 [thread overview]
Message-ID: <0b68496d-1d75-d358-c94f-62f534ee342d@redhat.com> (raw)
In-Reply-To: <af8238e8655cd8390428d6133ef8f5e3ce119d54.1487609329.git.luto@kernel.org>
On 20/02/2017 17:56, Andy Lutomirski wrote:
> +{
> + DEBUG_LOCKS_WARN_ON(preemptible());
> +
> + if (unlikely(this_cpu_read(need_tr_refresh))) {
> + force_reload_TR();
> + this_cpu_write(need_tr_refresh, false);
> + }
> +}
> +
> +/*
> + * If you do something evil that corrupts the cached TSS limit (I'm looking
> + * at you, VMX exits), call this function.
> + *
> + * The optimization here is that the TSS limit only matters for Linux if the
> + * IO bitmap is in use. If the TSS limit gets forced to its minimum value,
> + * everything works except that IO bitmap will be ignored and all CPL 3 IO
> + * instructions will #GP, which is exactly what we want for normal tasks.
> + */
> +static inline void invalidate_tss_limit(void)
> +{
> + DEBUG_LOCKS_WARN_ON(preemptible());
> +
> + if (unlikely(test_thread_flag(TIF_IO_BITMAP)))
> + refresh_TR();
This must be force_reload_TR, not refresh_TR.
Paolo
> + else
> + this_cpu_write(need_tr_refresh, true);
next prev parent reply other threads:[~2017-02-20 17:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-20 16:56 [PATCH 0/6] KVM TSS cleanups and speedups Andy Lutomirski
2017-02-20 16:56 ` [PATCH 1/6] x86/asm: Define the kernel TSS limit in a macro Andy Lutomirski
2017-02-20 16:56 ` [PATCH 2/6] x86/kvm/vmx: Don't fetch the TSS base from the GDT Andy Lutomirski
2017-02-20 16:56 ` [PATCH 3/6] x86/kvm/vmx: Get rid of segment_base() on 64-bit kernels Andy Lutomirski
2017-02-20 16:56 ` [PATCH 4/6] x86/kvm/vmx: Simplify segment_base() Andy Lutomirski
2017-02-20 17:49 ` Thomas Garnier
2017-02-20 16:56 ` [PATCH 5/6] x86/asm/64: Drop __cacheline_aligned from struct x86_hw_tss Andy Lutomirski
2017-02-20 16:56 ` [PATCH 6/6] x86/kvm/vmx: Defer TR reload after VM exit Andy Lutomirski
2017-02-20 17:51 ` Paolo Bonzini [this message]
2017-02-20 17:52 ` [PATCH 0/6] KVM TSS cleanups and speedups Paolo Bonzini
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=0b68496d-1d75-d358-c94f-62f534ee342d@redhat.com \
--to=pbonzini@redhat.com \
--cc=bpetkov@suse.de \
--cc=jmattson@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=thgarnie@google.com \
--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®