kernel-fxtec-pro1x/arch/arm64
Marc Zyngier 1fa2c32e37 KVM: arm64: Assume write fault on S1PTW permission fault on instruction fetch
commit c4ad98e4b72cb5be30ea282fce935248f2300e62 upstream.

KVM currently assumes that an instruction abort can never be a write.
This is in general true, except when the abort is triggered by
a S1PTW on instruction fetch that tries to update the S1 page tables
(to set AF, for example).

This can happen if the page tables have been paged out and brought
back in without seeing a direct write to them (they are thus marked
read only), and the fault handling code will make the PT executable(!)
instead of writable. The guest gets stuck forever.

In these conditions, the permission fault must be considered as
a write so that the Stage-1 update can take place. This is essentially
the I-side equivalent of the problem fixed by 60e21a0ef5 ("arm64: KVM:
Take S1 walks into account when determining S2 write faults").

Update kvm_is_write_fault() to return true on IABT+S1PTW, and introduce
kvm_vcpu_trap_is_exec_fault() that only return true when no faulting
on a S1 fault. Additionally, kvm_vcpu_dabt_iss1tw() is renamed to
kvm_vcpu_abt_iss1tw(), as the above makes it plain that it isn't
specific to data abort.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Will Deacon <will@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20200915104218.1284701-2-maz@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-10-01 13:14:54 +02:00
..
boot arm64: dts: ns2: Fixed QSPI compatible string 2020-09-17 13:45:23 +02:00
configs arm64: defconfig: Re-enable bcm2835-thermal driver 2020-01-27 14:50:10 +01:00
crypto
include KVM: arm64: Assume write fault on S1PTW permission fault on instruction fetch 2020-10-01 13:14:54 +02:00
kernel arm64/cpufeature: Drop TraceFilt feature exposure from ID_DFR0 register 2020-10-01 13:14:45 +02:00
kvm KVM: arm64: Assume write fault on S1PTW permission fault on instruction fetch 2020-10-01 13:14:54 +02:00
lib arm64: lib: use C string functions with KASAN enabled 2019-12-01 09:17:01 +01:00
mm arm64: hugetlb: avoid potential NULL dereference 2020-05-14 07:57:21 +02:00
net
xen
Kconfig arm64: errata: Hide CTR_EL0.DIC on systems affected by Neoverse-N1 #1542419 2020-04-29 16:31:08 +02:00
Kconfig.debug
Kconfig.platforms
Makefile arm64: makefile fix build of .i file in external module case 2019-12-01 09:17:14 +01:00