]> git.baikalelectronics.ru Git - kernel.git/commit
ARM, arm64: kvm: get rid of the bounce page
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 19 Mar 2015 16:42:26 +0000 (16:42 +0000)
committerWill Deacon <will.deacon@arm.com>
Thu, 19 Mar 2015 19:21:56 +0000 (19:21 +0000)
commitd97b2539d6872c05049f5106903ed6c902e8a39e
tree84f134705f009d74aba8637f25da3f887ea40c08
parent5948862fde9344a9b06eaa1e690e0f4eead9c09a
ARM, arm64: kvm: get rid of the bounce page

The HYP init bounce page is a runtime construct that ensures that the
HYP init code does not cross a page boundary. However, this is something
we can do perfectly well at build time, by aligning the code appropriately.

For arm64, we just align to 4 KB, and enforce that the code size is less
than 4 KB, regardless of the chosen page size.

For ARM, the whole code is less than 256 bytes, so we tweak the linker
script to align at a power of 2 upper bound of the code size

Note that this also fixes a benign off-by-one error in the original bounce
page code, where a bounce page would be allocated unnecessarily if the code
was exactly 1 page in size.

On ARM, it also fixes an issue with very large kernels reported by Arnd
Bergmann, where stub sections with linker emitted veneers could erroneously
trigger the size/alignment ASSERT() in the linker script.

Tested-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm/kernel/vmlinux.lds.S
arch/arm/kvm/init.S
arch/arm/kvm/mmu.c
arch/arm64/kernel/vmlinux.lds.S