linux-stable/arch/arm
Christoffer Dall c726200dd1 KVM: arm/arm64: Allow reporting non-ISV data aborts to userspace
For a long time, if a guest accessed memory outside of a memslot using
any of the load/store instructions in the architecture which doesn't
supply decoding information in the ESR_EL2 (the ISV bit is not set), the
kernel would print the following message and terminate the VM as a
result of returning -ENOSYS to userspace:

  load/store instruction decoding not implemented

The reason behind this message is that KVM assumes that all accesses
outside a memslot is an MMIO access which should be handled by
userspace, and we originally expected to eventually implement some sort
of decoding of load/store instructions where the ISV bit was not set.

However, it turns out that many of the instructions which don't provide
decoding information on abort are not safe to use for MMIO accesses, and
the remaining few that would potentially make sense to use on MMIO
accesses, such as those with register writeback, are not used in
practice.  It also turns out that fetching an instruction from guest
memory can be a pretty horrible affair, involving stopping all CPUs on
SMP systems, handling multiple corner cases of address translation in
software, and more.  It doesn't appear likely that we'll ever implement
this in the kernel.

What is much more common is that a user has misconfigured his/her guest
and is actually not accessing an MMIO region, but just hitting some
random hole in the IPA space.  In this scenario, the error message above
is almost misleading and has led to a great deal of confusion over the
years.

It is, nevertheless, ABI to userspace, and we therefore need to
introduce a new capability that userspace explicitly enables to change
behavior.

This patch introduces KVM_CAP_ARM_NISV_TO_USER (NISV meaning Non-ISV)
which does exactly that, and introduces a new exit reason to report the
event to userspace.  User space can then emulate an exception to the
guest, restart the guest, suspend the guest, or take any other
appropriate action as per the policy of the running system.

Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Christoffer Dall <christoffer.dall@arm.com>
Reviewed-by: Alexander Graf <graf@amazon.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
2019-10-21 18:59:44 +01:00
..
boot USB fixes for 5.4-rc3 2019-10-12 15:37:12 -07:00
common ARM: scoop: Use the right include 2019-09-03 22:09:46 +02:00
configs USB fixes for 5.4-rc3 2019-10-12 15:37:12 -07:00
crypto crypto: arm/aes-ce - add dependency on AES library 2019-10-01 23:06:43 +10:00
include KVM: arm/arm64: Allow reporting non-ISV data aborts to userspace 2019-10-21 18:59:44 +01:00
kernel arm: use generic mmap top-down layout and brk randomization 2019-09-24 15:54:12 -07:00
kvm kbuild: change *FLAGS_<basetarget>.o to take the path relative to $(obj) 2019-09-04 23:12:50 +09:00
lib ARM updates for 5.4-rc1: 2019-09-22 09:39:09 -07:00
mach-actions
mach-alpine
mach-artpec
mach-asm9260
mach-aspeed ARM: SoC fixes 2019-09-30 10:04:28 -07:00
mach-at91 ARM: at91: move platform-specific asm-offset.h to arch/arm/mach-at91 2019-08-23 21:50:10 +02:00
mach-axxia
mach-bcm ARM: SoC platform updates 2019-07-19 17:05:08 -07:00
mach-berlin
mach-clps711x
mach-cns3xxx
mach-davinci ARM: SoC driver updates for v5.4 2019-09-16 15:52:38 -07:00
mach-digicolor
mach-dove ARM: orion/mvebu: unify debug-ll virtual addresses 2019-08-14 19:24:58 +02:00
mach-ebsa110
mach-efm32
mach-ep93xx Merge branch 'spi-5.4' into spi-next 2019-09-15 10:32:06 +01:00
mach-exynos ARM: exynos: Enable support for ARM architected timers 2019-09-09 20:56:43 +02:00
mach-footbridge
mach-gemini
mach-highbank ARM: SoC platform updates 2019-07-19 17:05:08 -07:00
mach-hisi
mach-imx ARM: imx: stop adjusting ar8031 phy tx delay 2019-08-24 20:30:22 +02:00
mach-integrator
mach-iop32x ARM: iop32x: merge everything into mach-iop32x/ 2019-08-14 15:36:22 +02:00
mach-ixp4xx docs: arm: convert docs to ReST and rename to *.rst 2019-07-15 09:20:24 -03:00
mach-keystone ARM: SoC platform updates 2019-07-19 17:05:08 -07:00
mach-lpc18xx
mach-lpc32xx ARM: lpc32xx: allow multiplatform build 2019-08-15 21:34:08 +02:00
mach-mediatek
mach-meson
mach-milbeaut
mach-mmp irqchip/mmp: Mask off interrupts from other cores 2019-08-30 15:23:30 +01:00
mach-moxart
mach-mv78xx0 ARM: orion/mvebu: unify debug-ll virtual addresses 2019-08-14 19:24:58 +02:00
mach-mvebu
mach-mxs
mach-nomadik
mach-npcm
mach-nspire ARM: mach-nspire: Kill off CLCD auxdata 2019-08-13 15:48:23 +02:00
mach-omap1 Merge branch 'asoc-5.3' into asoc-linus 2019-09-09 14:55:18 +01:00
mach-omap2 Fixes for omaps for v5.4-rc cycle 2019-10-03 09:15:19 -07:00
mach-orion5x ARM: orion/mvebu: unify debug-ll virtual addresses 2019-08-14 19:24:58 +02:00
mach-oxnas
mach-picoxcell
mach-prima2
mach-pxa ARM: SoC platform updates 2019-07-19 17:05:08 -07:00
mach-qcom
mach-rda
mach-realview
mach-rockchip
mach-rpc ARM: riscpc: Mark expected switch fall-through 2019-08-20 19:42:48 -05:00
mach-s3c24xx docs: arm: convert docs to ReST and rename to *.rst 2019-07-15 09:20:24 -03:00
mach-s3c64xx ARM: s3c64xx: squash samsung_usb_phy.h into setup-usb-phy.c 2019-08-21 19:50:40 +02:00
mach-s5pv210
mach-sa1100 ARM: SoC platform updates 2019-07-19 17:05:08 -07:00
mach-shmobile
mach-socfpga
mach-spear
mach-sti
mach-stm32 ARM: SoC platform updates 2019-07-19 17:05:08 -07:00
mach-sunxi
mach-tango
mach-tegra ARM: tegra: Mark expected switch fall-through 2019-08-09 19:45:22 -05:00
mach-u300
mach-uniphier
mach-ux500 ARM: ux500: Stop populating the PRCMU devices early 2019-07-23 09:17:06 +02:00
mach-versatile
mach-vexpress ARM: vexpress: Cleanup cppcheck shifting warning 2019-07-31 16:36:58 +01:00
mach-vt8500
mach-zx
mach-zynq ARM: zynq: Use memcpy_toio instead of memcpy on smp bring-up 2019-08-14 09:40:43 +02:00
mm mm: treewide: clarify pgtable_page_{ctor,dtor}() naming 2019-09-26 10:10:44 -07:00
net
nwfpe
oprofile
plat-omap ARM: OMAP: dma: Mark expected switch fall-throughs 2019-08-13 04:53:37 -07:00
plat-orion
plat-pxa
plat-samsung ARM: samsung: Fix system restart on S3C6410 2019-09-09 20:54:35 +02:00
plat-versatile
probes
tools docs: arm: convert docs to ReST and rename to *.rst 2019-07-15 09:20:24 -03:00
vdso kbuild: add --hash-style= and --build-id unconditionally 2019-07-17 22:37:51 +09:00
vfp
xen xen: fixes and cleanups for 5.4-rc2 2019-10-04 11:13:09 -07:00
Kconfig arm: use generic mmap top-down layout and brk randomization 2019-09-24 15:54:12 -07:00
Kconfig-nommu
Kconfig.debug ARM updates for 5.4-rc1: 2019-09-22 09:39:09 -07:00
Makefile ARM updates for 5.4-rc1: 2019-09-22 09:39:09 -07:00