x86/tlb: allow disabling the TLB clock
authorRoger Pau Monné <roger.pau@citrix.com>
Wed, 29 Apr 2020 07:07:32 +0000 (09:07 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 29 Apr 2020 07:07:32 +0000 (09:07 +0200)
commitc2b4e23fdda41e7e8da316e02c94f063752e04cc
treea1a4776141d37c9092b2218d1143e5a5580dd9e9
parent3174835ba825427ab49177ef710657a226fdab01
x86/tlb: allow disabling the TLB clock

The TLB clock is helpful when running Xen on bare metal because when
doing a TLB flush each CPU is IPI'ed and can keep a timestamp of the
last flush.

This is not the case however when Xen is running virtualized, and the
underlying hypervisor provides mechanism to assist in performing TLB
flushes: Xen itself for example offers a HVMOP_flush_tlbs hypercall in
order to perform a TLB flush without having to IPI each CPU. When
using such mechanisms it's no longer possible to keep a timestamp of
the flushes on each CPU, as they are performed by the underlying
hypervisor.

Offer a boolean in order to signal Xen that the timestamped TLB
shouldn't be used. This avoids keeping the timestamps of the flushes,
and also forces NEED_FLUSH to always return true.

No functional change intended, as this change doesn't introduce any
user that disables the timestamped TLB.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Wei Liu <wl@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/flushtlb.c
xen/include/asm-x86/flushtlb.h