]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Slightly improve debug save/restore functions
authorChristoffer Dall <christoffer.dall@linaro.org>
Tue, 10 Oct 2017 17:55:56 +0000 (19:55 +0200)
committerMarc Zyngier <marc.zyngier@arm.com>
Mon, 19 Mar 2018 10:53:12 +0000 (10:53 +0000)
commitb6f0dd66dad0b69ecfd6e60a9131499b45ddcbd2
tree6c541aaddd29ea4b14e0586caadac5aa84e34d5d
parentd1dbb43b940c0d6405b37e3e34c9a190ae040c81
KVM: arm64: Slightly improve debug save/restore functions

The debug save/restore functions can be improved by using the has_vhe()
static key instead of the instruction alternative.  Using the static key
uses the same paradigm as we're going to use elsewhere, it makes the
code more readable, and it generates slightly better code (no
stack setups and function calls unless necessary).

We also use a static key on the restore path, because it will be
marginally faster than loading a value from memory.

Finally, we don't have to conditionally clear the debug dirty flag if
it's set, we can just clear it.

Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
arch/arm64/kvm/hyp/debug-sr.c