diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2024-01-02 12:58:00 +1100 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2024-02-29 11:35:37 -1000 |
commit | 6ada8619510002e7b0ad5925597232c750282592 (patch) | |
tree | 673159ed9708b177649d19f1c70e5c90a3649ddb /tests | |
parent | e9206163d9d9cdd962abb00e40b22141a5e29684 (diff) | |
download | qemu-6ada8619510002e7b0ad5925597232c750282592.zip qemu-6ada8619510002e7b0ad5925597232c750282592.tar.gz qemu-6ada8619510002e7b0ad5925597232c750282592.tar.bz2 |
tests/tcg: Extend file in linux-madvise.c
When guest page size > host page size, this test can fail
due to the SIGBUS protection hack. Avoid this by making
sure that the file size is at least one guest page.
Visible with alpha guest on x86_64 host.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-26-richard.henderson@linaro.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tcg/multiarch/linux/linux-madvise.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/tcg/multiarch/linux/linux-madvise.c b/tests/tcg/multiarch/linux/linux-madvise.c index 29d0997..539fb3b 100644 --- a/tests/tcg/multiarch/linux/linux-madvise.c +++ b/tests/tcg/multiarch/linux/linux-madvise.c @@ -42,6 +42,8 @@ static void test_file(void) assert(ret == 0); written = write(fd, &c, sizeof(c)); assert(written == sizeof(c)); + ret = ftruncate(fd, pagesize); + assert(ret == 0); page = mmap(NULL, pagesize, PROT_READ, MAP_PRIVATE, fd, 0); assert(page != MAP_FAILED); |