Re: [PATCH 6/6] x86/kvm/vmx: Defer TR reload after VM exit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux