]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Make vcpu_cp1x() work on Big Endian hosts
authorMarc Zyngier <maz@kernel.org>
Tue, 9 Jun 2020 07:40:35 +0000 (08:40 +0100)
committerMarc Zyngier <maz@kernel.org>
Wed, 10 Jun 2020 15:03:57 +0000 (16:03 +0100)
commit422e3903bbb59d61110420b54bed72acb2e9ea47
tree26da96016b68da0a7132b158e832eea77ab8ac2a
parentc3deeab8cfe2916d8e0db6a16fdf49f54de1a4f7
KVM: arm64: Make vcpu_cp1x() work on Big Endian hosts

AArch32 CP1x registers are overlayed on their AArch64 counterparts
in the vcpu struct. This leads to an interesting problem as they
are stored in their CPU-local format, and thus a CP1x register
doesn't "hit" the lower 32bit portion of the AArch64 register on
a BE host.

To workaround this unfortunate situation, introduce a bias trick
in the vcpu_cp1x() accessors which picks the correct half of the
64bit register.

Cc: stable@vger.kernel.org
Reported-by: James Morse <james.morse@arm.com>
Tested-by: James Morse <james.morse@arm.com>
Acked-by: James Morse <james.morse@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/include/asm/kvm_host.h