linux/arch/arm
Marc Zyngier 85e84ba310 arm: KVM: force execution of HCPTR access on VM exit
On VM entry, we disable access to the VFP registers in order to
perform a lazy save/restore of these registers.

On VM exit, we restore access, test if we did enable them before,
and save/restore the guest/host registers if necessary. In this
sequence, the FPEXC register is always accessed, irrespective
of the trapping configuration.

If the guest didn't touch the VFP registers, then the HCPTR access
has now enabled such access, but we're missing a barrier to ensure
architectural execution of the new HCPTR configuration. If the HCPTR
access has been delayed/reordered, the subsequent access to FPEXC
will cause a trap, which we aren't prepared to handle at all.

The same condition exists when trapping to enable VFP for the guest.

The fix is to introduce a barrier after enabling VFP access. In the
vmexit case, it can be relaxed to only takes place if the guest hasn't
accessed its view of the VFP registers, making the access to FPEXC safe.

The set_hcptr macro is modified to deal with both vmenter/vmexit and
vmtrap operations, and now takes an optional label that is branched to
when the guest hasn't touched the VFP registers.

Reported-by: Vikram Sethi <vikrams@codeaurora.org>
Cc: stable@kernel.org	# v3.9+
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
2015-06-17 09:40:14 +01:00
..
boot Merge git://www.linux-watchdog.org/linux-watchdog 2015-04-22 11:22:55 -07:00
common ARM: SoC platform updates for v4.1 2015-04-22 09:08:39 -07:00
configs ARM: SoC defconfig updates for v4.1 2015-04-22 09:21:30 -07:00
crypto Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2015-04-15 10:42:15 -07:00
firmware
include This mostly includes the PPC changes for 4.1, which this time cover 2015-04-26 13:06:22 -07:00
kernel Merge branch 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm 2015-04-24 08:10:53 -07:00
kvm arm: KVM: force execution of HCPTR access on VM exit 2015-06-17 09:40:14 +01:00
lib ARM: ensure delay timer has sufficient accuracy for delays 2015-04-14 22:28:07 +01:00
mach-alpine ARM: alpine: add support for generic pci 2015-04-14 01:15:57 +02:00
mach-asm9260
mach-at91 Fourth batch of cleanup for 4.1: 2015-04-14 01:50:21 +02:00
mach-axxia
mach-bcm ARM: cygnus: fix const declaration bcm_cygnus_dt_compat 2015-03-24 15:13:23 -07:00
mach-berlin
mach-clps711x
mach-cns3xxx
mach-davinci ARM: DT updates for v4.1 2015-04-22 09:09:46 -07:00
mach-digicolor
mach-dove PCI: Cleanup control flow 2015-03-19 10:17:22 -05:00
mach-ebsa110
mach-efm32
mach-ep93xx
mach-exynos ARM: SoC driver updates for v4.1 2015-04-22 09:18:17 -07:00
mach-footbridge
mach-gemini
mach-highbank
mach-hisi
mach-imx ARM: SoC late changes for v4.1 2015-04-22 09:24:55 -07:00
mach-integrator
mach-iop13xx
mach-iop32x
mach-iop33x
mach-ixp4xx
mach-keystone
mach-ks8695
mach-lpc32xx
mach-mediatek
mach-meson
mach-mmp
mach-moxart
mach-mv78xx0 PCI: Cleanup control flow 2015-03-19 10:17:22 -05:00
mach-mvebu ARM: SoC platform updates for v4.1 2015-04-22 09:08:39 -07:00
mach-mxs
mach-netx
mach-nomadik
mach-nspire
mach-omap1 ARM: OMAP1: PM: fix some build warnings on 1510-only Kconfigs 2015-03-16 16:09:23 -07:00
mach-omap2 ARM: SoC late changes for v4.1 2015-04-22 09:24:55 -07:00
mach-orion5x PCI: Cleanup control flow 2015-03-19 10:17:22 -05:00
mach-picoxcell
mach-prima2
mach-pxa power supply and reset changes for the v4.1 series 2015-04-13 15:21:34 -07:00
mach-qcom
mach-realview
mach-rockchip
mach-rpc
mach-s3c24xx
mach-s3c64xx ARM: SoC platform updates for v4.1 2015-04-22 09:08:39 -07:00
mach-s5pv210 ARM: 8326/1: s5pv210: move resume code to .text section 2015-03-29 23:11:58 +01:00
mach-sa1100
mach-shmobile Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma 2015-04-24 09:49:37 -07:00
mach-socfpga
mach-spear
mach-sti
mach-sunxi
mach-tegra Power management and ACPI updates for v4.1-rc1 2015-04-14 20:21:54 -07:00
mach-u300
mach-ux500 ARM: ux500: switch from gic_arch_extn to gic_set_irqchip_flags 2015-03-15 01:28:11 +00:00
mach-versatile
mach-vexpress ARM: SoC driver updates for v4.1 2015-04-22 09:18:17 -07:00
mach-vt8500
mach-w90x900
mach-zynq ARM: zynq: switch from gic_arch_extn to gic_set_irqchip_flags 2015-03-15 01:28:12 +00:00
mm Merge branch 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm 2015-04-24 08:10:53 -07:00
net
nwfpe ARM: 8322/1: keep .text and .fixup regions closer together 2015-03-29 23:11:56 +01:00
oprofile
plat-iop
plat-omap ARM, clocksource/drivers: Provide read_boot_clock64() and read_persistent_clock64() and use them 2015-04-03 08:18:23 +02:00
plat-orion
plat-pxa ARM: plat-pxa: remove use of seq_printf return value 2015-04-15 16:35:25 -07:00
plat-samsung
plat-versatile
probes
tools
vdso ARM: 8344/1: VDSO: honor CONFIG_VDSO in Makefile 2015-04-21 15:28:02 +01:00
vfp
xen xen/privcmd: improve performance of MMAPBATCH_V2 2015-03-16 14:49:15 +00:00
Kconfig ARM: SoC multiplatform code changes for v4.1 2015-04-22 09:20:15 -07:00
Kconfig-nommu
Kconfig.debug ARM: SoC multiplatform code changes for v4.1 2015-04-22 09:20:15 -07:00
Makefile ARM: SoC platform updates for v4.1 2015-04-22 09:08:39 -07:00