linux/arch/mips/include/asm
Sean Christopherson 152482580a KVM: Call kvm_arch_memslots_updated() before updating memslots
kvm_arch_memslots_updated() is at this point in time an x86-specific
hook for handling MMIO generation wraparound.  x86 stashes 19 bits of
the memslots generation number in its MMIO sptes in order to avoid
full page fault walks for repeat faults on emulated MMIO addresses.
Because only 19 bits are used, wrapping the MMIO generation number is
possible, if unlikely.  kvm_arch_memslots_updated() alerts x86 that
the generation has changed so that it can invalidate all MMIO sptes in
case the effective MMIO generation has wrapped so as to avoid using a
stale spte, e.g. a (very) old spte that was created with generation==0.

Given that the purpose of kvm_arch_memslots_updated() is to prevent
consuming stale entries, it needs to be called before the new generation
is propagated to memslots.  Invalidating the MMIO sptes after updating
memslots means that there is a window where a vCPU could dereference
the new memslots generation, e.g. 0, and incorrectly reuse an old MMIO
spte that was created with (pre-wrap) generation==0.

Fixes: e59dbe09f8 ("KVM: Introduce kvm_arch_memslots_updated()")
Cc: <stable@vger.kernel.org>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-02-20 22:48:32 +01:00
..
dec
emma
fw License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ip32
lasat License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mach-ar7 MIPS: Make (UN)CAC_ADDR() PHYS_OFFSET-agnostic 2018-07-30 10:27:20 -07:00
mach-ath25 MIPS: ath25: use generic dma noncoherent ops 2018-06-24 09:27:27 -07:00
mach-ath79 MIPS: ath79: finetune cpu-overrides 2018-07-24 18:57:59 -07:00
mach-au1x00 MIPS: Alchemy: update cpu-feature-overrides 2018-12-23 07:58:26 -08:00
mach-bcm47xx MIPS: BCM47XX: Add support for Netgear WNR1000 V3 2018-04-23 16:39:34 +01:00
mach-bcm63xx MIPS: BCM63XX: drop unused and broken DSP platform device 2018-12-31 07:12:35 -08:00
mach-bmips MIPS: bmips: use generic dma noncoherent ops 2018-06-24 09:27:27 -07:00
mach-cavium-octeon MIPS: Octeon: move swiotlb declarations out of dma-coherence.h 2018-06-24 09:26:03 -07:00
mach-cobalt
mach-db1x00 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mach-dec
mach-emma2rh
mach-generic MIPS: Only include mmzone.h when CONFIG_NEED_MULTIPLE_NODES=y 2018-11-21 19:54:59 -08:00
mach-ip22
mach-ip27 MIPS: IP27: use dma_direct_ops 2018-06-24 09:26:04 -07:00
mach-ip28
mach-ip32 MIPS: IP32: use generic dma noncoherent ops 2018-06-24 09:27:27 -07:00
mach-jazz MIPS: jazz: split dma mapping operations from dma-default 2018-06-24 09:27:27 -07:00
mach-jz4740 mmc: jz4740: Use GPIO descriptor for power 2018-12-17 08:26:24 +01:00
mach-lantiq MIPS: lantiq: Use CP0_LEGACY_COMPARE_IRQ 2019-01-07 13:38:35 -08:00
mach-lasat License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mach-loongson32
mach-loongson64 Kconfig file consolidation for v4.21 2018-12-29 13:40:29 -08:00
mach-malta Update MIPS email addresses 2017-11-03 09:02:30 -07:00
mach-netlogic
mach-paravirt
mach-pic32 MIPS: Make (UN)CAC_ADDR() PHYS_OFFSET-agnostic 2018-07-30 10:27:20 -07:00
mach-pistachio
mach-pmcs-msp71xx
mach-pnx833x
mach-ralink License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mach-rc32434 ata: rb532_cf: Convert to use GPIO descriptors 2018-12-04 17:15:25 -07:00
mach-rm
mach-sibyte
mach-tx39xx License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mach-tx49xx License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mach-vr41xx License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mach-xilfpga
mips-boards License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
netlogic MIPS: netlogic: xlr: Remove erroneous check in nlm_fmn_send() 2018-08-08 09:48:32 -07:00
octeon MIPS: OCTEON: delete redundant register definitions 2018-12-04 15:57:30 -08:00
pci
sgi License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sibyte
sn License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
txx9 JFFS2 changes: 2018-08-14 10:57:44 -07:00
vr41xx gpio: vr41xx: Delete vr41xx_gpio_pullupdown() callback 2018-09-17 10:55:24 -07:00
xtalk
abi.h
addrspace.h
amon.h
arch_hweight.h
asm-eva.h MIPS: Add kernel_pref & user_pref helpers 2018-10-15 23:11:13 -07:00
asm-offsets.h
asm-prototypes.h MIPS: Export tlbmiss_handler_setup_pgd near its definition 2018-08-10 17:27:51 -07:00
asm.h MIPS: Remove unused PREF, PREFE & PREFX macros 2018-10-15 23:11:14 -07:00
asmmacro-32.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
asmmacro-64.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
asmmacro.h MIPS: Fix odd fp register warnings with MIPS64r2 2017-11-10 20:58:56 +00:00
atomic.h MIPS: Loongson: Introduce and use loongson_llsc_mb() 2019-02-04 10:53:34 -08:00
barrier.h MIPS: Loongson: Introduce and use loongson_llsc_mb() 2019-02-04 10:53:34 -08:00
bcache.h
bitops.h MIPS: Loongson: Introduce and use loongson_llsc_mb() 2019-02-04 10:53:34 -08:00
bitrev.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
bmips-spaces.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
bmips.h MIPS: bmips: use generic dma noncoherent ops 2018-06-24 09:27:27 -07:00
bootinfo.h MIPS: platform: add machtype IDs for more Ingenic SoCs 2018-01-18 22:07:16 +00:00
branch.h
break.h
bug.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
bugs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cache.h
cacheflush.h
cacheops.h
cdmm.h
cevt-r4k.h
checksum.h Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
clock.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
clocksource.h
cmp.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cmpxchg.h MIPS: Avoid using .set mips0 to restore ISA 2018-11-09 10:23:19 -08:00
compat-signal.h Merge branch 'misc.compat' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-11-17 11:54:55 -08:00
compat.h asm-generic: Move common compat types to asm-generic/compat.h 2018-08-29 15:42:20 +02:00
compiler.h MIPS: Simplify GCC_OFF_SMALL_ASM definition 2018-11-07 16:26:42 -08:00
cop2.h
cpu-features.h MIPS: Hardcode cpu_has_mips* where target ISA allows 2018-11-26 22:49:20 -08:00
cpu-info.h MIPS: Expand MIPS32 ASIDs to 64 bits 2018-12-05 14:46:44 -08:00
cpu-type.h
cpu.h MIPS: Loongson: Add Loongson-3A R2.1 basic support 2018-11-19 15:20:31 -08:00
cpufeature.h
debug.h
delay.h
div64.h
dma-coherence.h dma-mapping: move the dma_coherent flag to struct device 2018-09-20 09:01:15 +02:00
dma-direct.h MIPS: consolidate the swiotlb implementations 2018-06-24 09:26:03 -07:00
dma-mapping.h dma-mapping: bypass indirect calls for dma-direct 2018-12-13 21:06:18 +01:00
dma.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ds1287.h
dsemul.h MIPS: Don't compile math-emu when CONFIG_MIPS_FP_SUPPORT=n 2018-11-09 10:23:18 -08:00
dsp.h
edac.h MIPS: Avoid using .set mips0 to restore ISA 2018-11-09 10:23:19 -08:00
elf.h MIPS: Avoid FP ELF checks when CONFIG_MIPS_FP_SUPPORT=n 2018-11-09 10:23:18 -08:00
errno.h
eva.h
exec.h
extable.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
fb.h
fixmap.h
floppy.h
fpregdef.h
fpu.h MIPS: Stub asm/fpu.h functions 2018-11-09 10:23:15 -08:00
fpu_emulator.h MIPS: Simplify FP context initialization 2018-11-09 10:23:13 -08:00
ftrace.h
futex.h MIPS: Loongson: Introduce and use loongson_llsc_mb() 2019-02-04 10:53:34 -08:00
gio_device.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
gt64120.h
hardirq.h
hazards.h MIPS: Avoid using .set mips0 to restore ISA 2018-11-09 10:23:19 -08:00
highmem.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hpet.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hugetlb.h hugetlb: introduce generic version of huge_ptep_get 2018-10-26 16:26:34 -07:00
hw_irq.h
i8259.h
ide.h
idle.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
inst.h
io.h MIPS: Avoid using .set mips0 to restore ISA 2018-11-09 10:23:19 -08:00
irq.h
irq_cpu.h
irq_gt641xx.h
irq_regs.h
irqflags.h
isa-rev.h MIPS: Introduce isa-rev.h to define MIPS_ISA_REV 2018-03-09 11:22:45 +00:00
isadep.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
jazz.h
jazzdma.h mips/jazz: remove the mapping_error dma_map_ops method 2018-12-06 06:56:38 -08:00
jump_label.h
Kbuild mips: generate uapi header and system call table files 2018-12-14 11:19:02 -08:00
kdebug.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
kexec.h MIPS: kexec: Relax memory restriction 2018-09-22 10:32:34 -07:00
kgdb.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
kmap_types.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
kprobes.h MIPS/kprobes: Remove jprobe implementation 2018-06-21 12:33:09 +02:00
kvm_host.h KVM: Call kvm_arch_memslots_updated() before updating memslots 2019-02-20 22:48:32 +01:00
kvm_para.h KVM: Introduce paravirtualization hints and KVM_HINTS_DEDICATED 2018-03-06 18:40:44 +01:00
linkage.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
llsc.h
local.h MIPS: Avoid using .set mips0 to restore ISA 2018-11-09 10:23:19 -08:00
m48t37.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
maar.h Update MIPS email addresses 2017-11-03 09:02:30 -07:00
machine.h MIPS: generic: Fix machine compatible matching 2018-02-05 10:37:48 +00:00
mc146818-time.h MIPS: Convert read_persistent_clock() to read_persistent_clock64() 2018-05-14 23:58:23 +01:00
mc146818rtc.h
mips-cm.h Update MIPS email addresses 2017-11-03 09:02:30 -07:00
mips-cpc.h Update MIPS email addresses 2017-11-03 09:02:30 -07:00
mips-cps.h Update MIPS email addresses 2017-11-03 09:02:30 -07:00
mips-gic.h Update MIPS email addresses 2017-11-03 09:02:30 -07:00
mips-r2-to-r6-emul.h
mips_machine.h
mips_mt.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mipsmtregs.h MIPS: Avoid using .set mips0 to restore ISA 2018-11-09 10:23:19 -08:00
mipsprom.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mipsregs.h MIPS: Avoid using .set mips0 to restore ISA 2018-11-09 10:23:19 -08:00
mmu.h MIPS: Remove struct mm_context_t fp_mode_switching field 2018-12-17 22:05:40 -08:00
mmu_context.h MIPS: Expand MIPS32 ASIDs to 64 bits 2018-12-05 14:46:44 -08:00
mmzone.h MIPS: Only include mmzone.h when CONFIG_NEED_MULTIPLE_NODES=y 2018-11-21 19:54:59 -08:00
module.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
msa.h MIPS: MSA: Update helpers to use new asm macros 2018-01-22 20:52:27 +00:00
msc01_ic.h
nile4.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
paccess.h
page.h MIPS: Enable IOREMAP_PROT config option for MIPS cpus 2018-11-05 10:15:28 -08:00
pci.h PCI: remove PCI_DMA_BUS_IS_PHYS 2018-05-07 07:15:41 +02:00
perf_event.h
pgalloc.h mm: treewide: remove unused address argument from pte_alloc functions 2019-01-04 13:13:47 -08:00
pgtable-32.h
pgtable-64.h MIPS: Ensure pmd_present() returns false after pmd_mknotpresent() 2018-11-20 21:05:39 -08:00
pgtable-bits.h
pgtable.h MIPS: Loongson: Introduce and use loongson_llsc_mb() 2019-02-04 10:53:34 -08:00
pm-cps.h Update MIPS email addresses 2017-11-03 09:02:30 -07:00
pm.h
pmon.h
prefetch.h
processor.h MIPS: Remove struct task_struct fpu state when CONFIG_MIPS_FP_SUPPORT=n 2018-11-09 10:23:19 -08:00
prom.h
ptrace.h
r4k-timer.h
r4kcache.h MIPS: c-r4k: Add r4k_blast_scache_node for Loongson-3 2018-11-20 21:04:17 -08:00
reboot.h
reg.h
regdef.h
rtlx.h
seccomp.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
serial.h MIPS: Add custom serial.h with BASE_BAUD override for generic kernel 2017-11-28 16:53:24 +01:00
setup.h mips: unify prom_putchar() declarations 2018-07-17 09:40:17 -07:00
sgialib.h mips: unify prom_putchar() declarations 2018-07-17 09:40:17 -07:00
sgiarcs.h
shmparam.h
sigcontext.h
signal.h
sim.h MIPS: Remove nabi_no_regargs 2018-08-01 13:20:15 -07:00
smp-cps.h Update MIPS email addresses 2017-11-03 09:02:30 -07:00
smp-ops.h MIPS: kexec: Make a framework for both jumping and halting on nonboot CPUs 2018-09-22 10:31:50 -07:00
smp.h MIPS: kexec: Make a framework for both jumping and halting on nonboot CPUs 2018-09-22 10:31:50 -07:00
sni.h
socket.h
sparsemem.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
spinlock.h locking/arch: Remove dummy arch_{read,spin,write}_lock_flags() implementations 2017-10-10 11:50:19 +02:00
spinlock_types.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
spram.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
stackframe.h MIPS: Avoid using .set mips0 to restore ISA 2018-11-09 10:23:19 -08:00
stackprotector.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
stacktrace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
string.h
switch_to.h MIPS: Avoid FCSR sanitization when CONFIG_MIPS_FP_SUPPORT=n 2018-11-09 10:23:18 -08:00
syscall.h mips: fix mips_get_syscall_arg o32 check 2018-11-21 11:21:52 -08:00
termios.h Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
thread_info.h Construct init thread stack in the linker script rather than by union 2018-01-09 23:21:02 +00:00
time.h MIPS: Convert update_persistent_clock() to update_persistent_clock64() 2018-05-14 23:58:23 +01:00
timex.h
tlb.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tlbdebug.h
tlbex.h MIPS: Consistently declare TLB functions 2018-08-10 17:27:53 -07:00
tlbflush.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tlbmisc.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
topology.h
traps.h
txx9irq.h
txx9pio.h
txx9tmr.h
types.h
uaccess.h Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
uasm.h mips: bpf: implement jitting of BPF_ALU | BPF_ARSH | BPF_X 2018-12-07 13:30:48 -08:00
unistd.h mips: generate uapi header and system call table files 2018-12-14 11:19:02 -08:00
uprobes.h
vdso.h locking/atomics: COCCINELLE/treewide: Convert trivial ACCESS_ONCE() patterns to READ_ONCE()/WRITE_ONCE() 2017-10-25 11:01:08 +02:00
vga.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vpe.h
war.h
watch.h
wbflush.h
yamon-dt.h Update MIPS email addresses 2017-11-03 09:02:30 -07:00