[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0b68496d-1d75-d358-c94f-62f534ee342d@redhat.com>
Date: Mon, 20 Feb 2017 18:51:47 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: Andy Lutomirski <luto@...nel.org>, X86 ML <x86@...nel.org>
Cc: kvm list <kvm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Borislav Petkov <bpetkov@...e.de>,
Thomas Garnier <thgarnie@...gle.com>,
Jim Mattson <jmattson@...gle.com>
Subject: Re: [PATCH 6/6] x86/kvm/vmx: Defer TR reload after VM exit
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);
Powered by blists - more mailing lists