diff options
Diffstat (limited to 'recipes-devtools/qemu/qemu-qoriq')
4 files changed, 101 insertions, 42 deletions
diff --git a/recipes-devtools/qemu/qemu-qoriq/0001-linux-user-remove-host-stime-syscall.patch b/recipes-devtools/qemu/qemu-qoriq/0001-linux-user-remove-host-stime-syscall.patch new file mode 100644 index 00000000..2d3bd7e0 --- /dev/null +++ b/recipes-devtools/qemu/qemu-qoriq/0001-linux-user-remove-host-stime-syscall.patch | |||
@@ -0,0 +1,67 @@ | |||
1 | From 0f1f2d4596aee037d3ccbcf10592466daa54107f Mon Sep 17 00:00:00 2001 | ||
2 | From: Laurent Vivier <laurent@vivier.eu> | ||
3 | Date: Tue, 12 Nov 2019 15:25:56 +0100 | ||
4 | Subject: [PATCH] linux-user: remove host stime() syscall | ||
5 | |||
6 | stime() has been withdrawn from glibc | ||
7 | (12cbde1dae6f "Use clock_settime to implement stime; withdraw stime.") | ||
8 | |||
9 | Implement the target stime() syscall using host | ||
10 | clock_settime(CLOCK_REALTIME, ...) as it is done internally in glibc. | ||
11 | |||
12 | Tested qemu-ppc/x86_64 with: | ||
13 | |||
14 | #include <time.h> | ||
15 | #include <stdio.h> | ||
16 | |||
17 | int main(void) | ||
18 | { | ||
19 | time_t t; | ||
20 | int ret; | ||
21 | |||
22 | /* date -u -d"2019-11-12T15:11:00" "+%s" */ | ||
23 | t = 1573571460; | ||
24 | ret = stime(&t); | ||
25 | printf("ret %d\n", ret); | ||
26 | return 0; | ||
27 | } | ||
28 | |||
29 | # date; ./stime; date | ||
30 | Tue Nov 12 14:18:32 UTC 2019 | ||
31 | ret 0 | ||
32 | Tue Nov 12 15:11:00 UTC 2019 | ||
33 | |||
34 | Upstream-Status: Backport | ||
35 | |||
36 | Buglink: https://bugs.launchpad.net/qemu/+bug/1852115 | ||
37 | Reported-by: Cole Robinson <crobinso@redhat.com> | ||
38 | Signed-off-by: Laurent Vivier <laurent@vivier.eu> | ||
39 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
40 | Message-Id: <20191112142556.6335-1-laurent@vivier.eu> | ||
41 | --- | ||
42 | linux-user/syscall.c | 8 +++++--- | ||
43 | 1 file changed, 5 insertions(+), 3 deletions(-) | ||
44 | |||
45 | diff --git a/linux-user/syscall.c b/linux-user/syscall.c | ||
46 | index 4e97bcf1e5..ce399a55f0 100644 | ||
47 | --- a/linux-user/syscall.c | ||
48 | +++ b/linux-user/syscall.c | ||
49 | @@ -7764,10 +7764,12 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, | ||
50 | #ifdef TARGET_NR_stime /* not on alpha */ | ||
51 | case TARGET_NR_stime: | ||
52 | { | ||
53 | - time_t host_time; | ||
54 | - if (get_user_sal(host_time, arg1)) | ||
55 | + struct timespec ts; | ||
56 | + ts.tv_nsec = 0; | ||
57 | + if (get_user_sal(ts.tv_sec, arg1)) { | ||
58 | return -TARGET_EFAULT; | ||
59 | - return get_errno(stime(&host_time)); | ||
60 | + } | ||
61 | + return get_errno(clock_settime(CLOCK_REALTIME, &ts)); | ||
62 | } | ||
63 | #endif | ||
64 | #ifdef TARGET_NR_alarm /* not on alpha */ | ||
65 | -- | ||
66 | 2.24.0 | ||
67 | |||
diff --git a/recipes-devtools/qemu/qemu-qoriq/0002-Add-subpackage-ptest-which-runs-all-unit-test-cases-.patch b/recipes-devtools/qemu/qemu-qoriq/0002-Add-subpackage-ptest-which-runs-all-unit-test-cases-.patch new file mode 100644 index 00000000..7f7da510 --- /dev/null +++ b/recipes-devtools/qemu/qemu-qoriq/0002-Add-subpackage-ptest-which-runs-all-unit-test-cases-.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | From 8ee6281516bd9210e75e91d705da8916bab3bf51 Mon Sep 17 00:00:00 2001 | ||
2 | From: Juro Bystricky <juro.bystricky@intel.com> | ||
3 | Date: Thu, 31 Aug 2017 11:06:56 -0700 | ||
4 | Subject: [PATCH] Add subpackage -ptest which runs all unit test cases for | ||
5 | qemu. | ||
6 | |||
7 | Upstream-Status: Pending | ||
8 | |||
9 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
10 | |||
11 | Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> | ||
12 | |||
13 | --- | ||
14 | tests/Makefile.include | 8 ++++++++ | ||
15 | 1 file changed, 8 insertions(+) | ||
16 | |||
17 | diff --git a/tests/Makefile.include b/tests/Makefile.include | ||
18 | index 8566f5f1..52d0320b 100644 | ||
19 | --- a/tests/Makefile.include | ||
20 | +++ b/tests/Makefile.include | ||
21 | @@ -1210,4 +1210,12 @@ all: $(QEMU_IOTESTS_HELPERS-y) | ||
22 | -include $(wildcard tests/*.d) | ||
23 | -include $(wildcard tests/libqos/*.d) | ||
24 | |||
25 | +buildtest-TESTS: $(check-unit-y) | ||
26 | + | ||
27 | +runtest-TESTS: | ||
28 | + for f in $(check-unit-y); do \ | ||
29 | + nf=$$(echo $$f | sed 's/tests\//\.\//g'); \ | ||
30 | + $$nf; \ | ||
31 | + done | ||
32 | + | ||
33 | endif | ||
diff --git a/recipes-devtools/qemu/qemu-qoriq/memfd.patch b/recipes-devtools/qemu/qemu-qoriq/memfd.patch deleted file mode 100644 index d9e7a455..00000000 --- a/recipes-devtools/qemu/qemu-qoriq/memfd.patch +++ /dev/null | |||
@@ -1,41 +0,0 @@ | |||
1 | From d60ecdd94f4054aa0ec615824d5efdb4cebc7db9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Ting Liu <ting.liu@nxp.com> | ||
3 | Date: Thu, 19 Apr 2018 11:47:16 +0800 | ||
4 | Subject: [PATCH] memfd | ||
5 | |||
6 | --- | ||
7 | configure | 2 +- | ||
8 | util/memfd.c | 4 +--- | ||
9 | 2 files changed, 2 insertions(+), 4 deletions(-) | ||
10 | |||
11 | diff --git a/configure b/configure | ||
12 | index be4d326..cb5197c 100755 | ||
13 | --- a/configure | ||
14 | +++ b/configure | ||
15 | @@ -3735,7 +3735,7 @@ fi | ||
16 | # check if memfd is supported | ||
17 | memfd=no | ||
18 | cat > $TMPC << EOF | ||
19 | -#include <sys/memfd.h> | ||
20 | +#include <sys/mman.h> | ||
21 | |||
22 | int main(void) | ||
23 | { | ||
24 | diff --git a/util/memfd.c b/util/memfd.c | ||
25 | index 4571d1a..412e94a 100644 | ||
26 | --- a/util/memfd.c | ||
27 | +++ b/util/memfd.c | ||
28 | @@ -31,9 +31,7 @@ | ||
29 | |||
30 | #include "qemu/memfd.h" | ||
31 | |||
32 | -#ifdef CONFIG_MEMFD | ||
33 | -#include <sys/memfd.h> | ||
34 | -#elif defined CONFIG_LINUX | ||
35 | +#if defined CONFIG_LINUX && !defined CONFIG_MEMFD | ||
36 | #include <sys/syscall.h> | ||
37 | #include <asm/unistd.h> | ||
38 | |||
39 | -- | ||
40 | 2.7.4 | ||
41 | |||
diff --git a/recipes-devtools/qemu/qemu-qoriq/run-ptest b/recipes-devtools/qemu/qemu-qoriq/run-ptest index 2206b319..b25a792d 100644 --- a/recipes-devtools/qemu/qemu-qoriq/run-ptest +++ b/recipes-devtools/qemu/qemu-qoriq/run-ptest | |||
@@ -7,4 +7,4 @@ ptestdir=$(dirname "$(readlink -f "$0")") | |||
7 | export SRC_PATH=$ptestdir | 7 | export SRC_PATH=$ptestdir |
8 | 8 | ||
9 | cd $ptestdir/tests | 9 | cd $ptestdir/tests |
10 | make -f Makefile.include -k runtest-TESTS | sed '/: OK/ s/^/PASS: /g' | 10 | make -f Makefile.include -k runtest-TESTS | sed '/^ok /s/ok /PASS: /g' |