lkml.org 
[lkml]   [2017]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 6/6] x86/kvm/vmx: Defer TR reload after VM exit
From
Date


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);

\
 
 \ /
  Last update: 2017-02-20 18:53    [W:0.081 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site