diff options
author | Christoffer Dall <christoffer.dall@linaro.org> | 2016-04-22 13:12:09 +0200 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2016-04-22 12:26:01 +0100 |
commit | ee1e0f8e5d3682c561edcdceccff72b9d9b16d8b (patch) | |
tree | fe030b442c0f06597ff1c48a089f4e6542592723 /stubs/Makefile.objs | |
parent | df7b97ff89319ccf392a16748081482a3d22b35a (diff) |
util: align memory allocations to 2M on AArch64
For KVM to use Transparent Huge Pages (THP) we have to ensure that the
alignment of the userspace address of the KVM memory slot and the IPA
that the guest sees for a memory region have the same offset from the 2M
huge page size boundary.
One way to achieve this is to always align the IPA region at a 2M
boundary and ensure that the mmap alignment is also at 2M.
Unfortunately, we were only doing this for __arm__, not for __aarch64__,
so add this simple condition.
This fixes a performance regression using KVM/ARM on AArch64 platforms
that showed a performance penalty of more than 50%, introduced by the
following commit:
9fac18f (oslib: allocate PROT_NONE pages on top of RAM, 2015-09-10)
We were only lucky before the above commit, because we were allocating
large regions and naturally getting a 2M alignment on those allocations
then.
Cc: qemu-stable@nongnu.org
Reported-by: Shih-Wei Li <shihwei@cs.columbia.edu>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
[PMM: wrapped long line]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'stubs/Makefile.objs')
0 files changed, 0 insertions, 0 deletions