configure: enable --s390-pgste linker option
KVM guests on s390 need a different page table layout than normal processes (2kb page table + 2kb page status extensions vs 2kb page table only). As of today this has to be enabled via the vm.allocate_pgste sysctl.
Newer kernels (>= 4.12) on s390 check for an S390_PGSTE program header and enable the pgste page table extensions in that case. This makes the vm.allocate_pgste sysctl unnecessary. We enable this program header for the s390 system emulation (qemu-system-s390x) if
- the linker supports --s390-pgste (binutils >= 2.29)
- KVM is enabled
This will allow distributions to disable the global vm.allocate_pgste sysctl, which will improve the page table allocation for non KVM processes as only 2kb chunks are necessary.
--- configure | 13 +++++++++++++ 1 file changed, 13 insertions(+)
configure +13 -0
@@ -6522,6 +6522,19 @@ if test "$target_linux_user" = "yes" -o "$target_bsd_user" = "yes" ; then ldflags="$ldflags $textseg_ldflags" fi +# Newer kernels on s390 check for an S390_PGSTE program header and +# enable the pgste page table extensions in that case. This makes +# the vm.allocate_pgste sysctl unnecessary. We enable this program +# header if +# - the linker support --s390-pgste +# - we build the system emulation (qemu-system-s390x) +# - KVM is enabled +if $ld --help 2>/dev/null | grep ".--s390-pgste" >/dev/null 2>/dev/null ; then + if test "$target_softmmu" = "yes" -a "$ARCH" = "s390x" -a "$kvm" = "yes" ; then + ldflags="-Wl,--s390-pgste $ldflags" + fi +fi + echo "LDFLAGS+=$ldflags" >> $config_target_mak echo "QEMU_CFLAGS+=$cflags" >> $config_target_mak
Signature · 1 line
2.7.4
Quoted 43 lines · Christian Borntraeger
KVM guests on s390 need a different page table layout than normal processes (2kb page table + 2kb page status extensions vs 2kb page table only). As of today this has to be enabled via the vm.allocate_pgste sysctl.
Newer kernels (>= 4.12) on s390 check for an
S390_PGSTEprogram header and enable the pgste page table extensions in that case. This makes the vm.allocate_pgste sysctl unnecessary. We enable this program header for the s390 system emulation (qemu-system-s390x) if
- the linker supports --s390-pgste (binutils >= 2.29)
- KVM is enabledThis will allow distributions to disable the global vm.allocate_pgste sysctl, which will improve the page table allocation for non KVM processes as only 2kb chunks are necessary.
Cc Christian Ehrhardt <[email protected]>Cc Alexander Graf <[email protected]>Cc Dan Horak <[email protected]>Cc David Hildenbrand <[email protected]>Signed-off-by Christian Borntraeger <[email protected]>Acked-by Janosch Frank <[email protected]>--- configure | 13 +++++++++++++ 1 file changed, 13 insertions(+)configure +8
-0@@ -6522,6 +6522,19 @@ if test "$target_linux_user" = "yes" -o "$target_bsd_user" = "yes" ; then ldflags="$ldflags $textseg_ldflags" fi +# Newer kernels on s390 check for an S390_PGSTE program header and +# enable the pgste page table extensions in that case. This makes +# the vm.allocate_pgste sysctl unnecessary. We enable this program +# header if +# - the linker support --s390-pgste +# - we build the system emulation (qemu-system-s390x) +# - KVM is enabled +if $ld --help 2>/dev/null | grep ".--s390-pgste" >/dev/null 2>/dev/null ; then
Quoted 1 line
/dev/null2>&1
(from has(){} definiton)
maybe even introduce
ld_has() {
$ld --help 2>/dev/null | grep ".$1" >/dev/null 2>&1
}I guess it also makes sense to test for s390x first, before checking for ld support.
configure if test "$target_linux_user" = "yes" -o "$target_bsd_user" = "yes" ; then · line 6539
Quoted 9 lines
configure +5
-0+ if test "$target_softmmu" = "yes" -a "$ARCH" = "s390x" -a "$kvm" = "yes" ; then + ldflags="-Wl,--s390-pgste $ldflags" + fi +fi + echo "LDFLAGS+=$ldflags" >> $config_target_mak echo "QEMU_CFLAGS+=$cflags" >> $config_target_mak
Happy to see this change :)
Signature · 3 lines
Thanks, David