]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
arm64: KVM: Skip MMIO insn after emulation
authorMark Rutland <mark.rutland@arm.com>
Fri, 9 Nov 2018 15:07:10 +0000 (15:07 +0000)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit2fd6db045cd5d8aad1c1b06addeae8065619fcf0
treedde44a287b8db7c8b54fd4e7e7445d32530889f3
parent357f9564afa5cfa3c2baf5e43dc8ed752e92587e
arm64: KVM: Skip MMIO insn after emulation

BugLink: https://bugs.launchpad.net/bugs/1837664
[ Upstream commit 0d640732dbebed0f10f18526de21652931f0b2f2 ]

When we emulate an MMIO instruction, we advance the CPU state within
decode_hsr(), before emulating the instruction effects.

Having this logic in decode_hsr() is opaque, and advancing the state
before emulation is problematic. It gets in the way of applying
consistent single-step logic, and it prevents us from being able to fail
an MMIO instruction with a synchronous exception.

Clean this up by only advancing the CPU state *after* the effects of the
instruction are emulated.

Cc: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Christoffer Dall <christoffer.dall@arm.com>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
virt/kvm/arm/mmio.c