[PATCH v3 04/29] alpha: Add <bits/pagesize.h>
Florian Weimer
fweimer@redhat.com
Sat Oct 5 18:22:30 GMT 2024
* Richard Henderson:
>> (Note: We could XFAIL the gaps test added later and fix the page size at
>> 8 KiB, despite what binutils does today.)
>> ---
>> sysdeps/alpha/bits/pagesize.h | 2 ++
>> 1 file changed, 2 insertions(+)
>> create mode 100644 sysdeps/alpha/bits/pagesize.h
>> diff --git a/sysdeps/alpha/bits/pagesize.h
>> b/sysdeps/alpha/bits/pagesize.h
>> new file mode 100644
>> index 0000000000..81824b5ab6
>> --- /dev/null
>> +++ b/sysdeps/alpha/bits/pagesize.h
>> @@ -0,0 +1,2 @@
>> +#define __GLIBC_PAGE_SHIFT_MIN 13
>> +#define __GLIBC_PAGE_SHIFT_MAX 16
>
> FWIW, qemu 9.1 supports aligning the guest page size to the host page
> size, for a subset of guests: alpha, aarch64, ppc*. This fixes a
> number of edge cases with mmap that cannot be properly emulated
> otherwise (especially wrt SIGBUS within the final guest page beyond
> the end of a file). I intend to extend this to other guests as and
> when I have time, but have not done the legwork you have done to
> identify which guests need attention.
Hmm, I'm surprised that a smaller page size isn't compatible. I suppose
there could be an issue regarding the tail if the file is subsequently
resized. The end of the tail might not be writable with 4K pages, but
is writable with 8K pages.
Do you suggest to lower PAGE_SIZE_MIN to 4096 for QEMU compatibility?
It's not clear to me based on your message.
I should probably update the documentation in the manual that
PAGE_SIZE_MIN is not a suitable boundary for over-reading because it's
incompatible with (future introduction of) pointer tagging. The alpha
memchr in glibc uses cache line boundaries for overreading, so it's fine
with 4K pages at least.
Thanks,
Florian
More information about the Libc-alpha
mailing list