Skip to content
This repository was archived by the owner on Nov 22, 2025. It is now read-only.

Commit 900b0c7

Browse files
committed
bump qemu-9.0.0 alpine-3.20.0
- regeneratde old patches - add patch from alpine pkgs to remove various `64` suffixes for lfs
1 parent 7c1d6ce commit 900b0c7

File tree

6 files changed

+237
-14
lines changed

6 files changed

+237
-14
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM alpine:3.18.6
1+
FROM alpine:3.20.0
22

33
RUN apk update
44
RUN apk upgrade

command/base

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ HOST_OS=${HOST_OS_RAW,,}
77
HOST_ARCH=${HOST_ARCH_RAW,,}
88

99
QEMU_NAME="qemu"
10-
QEMU_REV="8.2.1"
10+
QEMU_REV="9.0.0"
1111

1212
# when not empty use `git clone` instead of downloading source tarball
1313
QEMU_GIT_COMMIT=""

command/patch

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ set -e
55
. $(dirname $0)/base
66

77
WORKDIR "/work/src/${QEMU_SRC_BASENAME}"
8-
RUN patch -p1 -i "${WORK_ROOT}/patch/linux-user__signal.c.diff"
9-
RUN patch -p1 -i "${WORK_ROOT}/patch/linux-user__syscall.c.diff"
8+
RUN patch -p1 -i "${WORK_ROOT}/patch/linux-user__sigrt.diff"
9+
RUN patch -p1 -i "${WORK_ROOT}/patch/linux-user__syscall.diff"
10+
RUN patch -p1 -i "${WORK_ROOT}/patch/linux-user__syscall-lfs.diff"

patch/linux-user__signal.c.diff renamed to patch/linux-user__sigrt.diff

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1+
commit f73d26228e00c7a768755d72f6a01e2fa80c5252
2+
Author: Michael Dusan <[email protected]>
3+
Date: Wed Jun 5 11:08:51 2024 -0400
4+
5+
signal.c
6+
17
diff --git a/linux-user/signal.c b/linux-user/signal.c
2-
index a8faea6f0..71e8473ad 100644
8+
index 05dc4afb52..c07727dff0 100644
39
--- a/linux-user/signal.c
410
+++ b/linux-user/signal.c
5-
@@ -25,6 +25,13 @@
6-
#include "trace.h"
7-
#include "signal-common.h"
11+
@@ -37,6 +37,13 @@
12+
/* target_siginfo_t must fit in gdbstub's siginfo save area. */
13+
QEMU_BUILD_BUG_ON(sizeof(target_siginfo_t) > MAX_SIGINFO_LENGTH);
814

915
+#ifndef __SIGRTMIN
1016
+#define __SIGRTMIN 32

patch/linux-user__syscall-lfs.diff

Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
commit a868cc88bde245a274923be481408c6660587b72
2+
Author: Michael Dusan <[email protected]>
3+
Date: Wed Jun 5 11:09:44 2024 -0400
4+
5+
syscall.c
6+
7+
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
8+
index 29420959bf..cdb0aadf6e 100644
9+
--- a/linux-user/syscall.c
10+
+++ b/linux-user/syscall.c
11+
@@ -6744,13 +6744,13 @@ static int target_to_host_fcntl_cmd(int cmd)
12+
ret = cmd;
13+
break;
14+
case TARGET_F_GETLK:
15+
- ret = F_GETLK64;
16+
+ ret = F_GETLK;
17+
break;
18+
case TARGET_F_SETLK:
19+
- ret = F_SETLK64;
20+
+ ret = F_SETLK;
21+
break;
22+
case TARGET_F_SETLKW:
23+
- ret = F_SETLKW64;
24+
+ ret = F_SETLKW;
25+
break;
26+
case TARGET_F_GETOWN:
27+
ret = F_GETOWN;
28+
@@ -6766,13 +6766,13 @@ static int target_to_host_fcntl_cmd(int cmd)
29+
break;
30+
#if TARGET_ABI_BITS == 32
31+
case TARGET_F_GETLK64:
32+
- ret = F_GETLK64;
33+
+ ret = F_GETLK;
34+
break;
35+
case TARGET_F_SETLK64:
36+
- ret = F_SETLK64;
37+
+ ret = F_SETLK;
38+
break;
39+
case TARGET_F_SETLKW64:
40+
- ret = F_SETLKW64;
41+
+ ret = F_SETLKW;
42+
break;
43+
#endif
44+
case TARGET_F_SETLEASE:
45+
@@ -6826,8 +6826,8 @@ static int target_to_host_fcntl_cmd(int cmd)
46+
* them to 5, 6 and 7 before making the syscall(). Since we make the
47+
* syscall directly, adjust to what is supported by the kernel.
48+
*/
49+
- if (ret >= F_GETLK64 && ret <= F_SETLKW64) {
50+
- ret -= F_GETLK64 - 5;
51+
+ if (ret >= F_GETLK && ret <= F_SETLKW) {
52+
+ ret -= F_GETLK - 5;
53+
}
54+
#endif
55+
56+
@@ -6860,7 +6860,7 @@ static int host_to_target_flock(int type)
57+
return type;
58+
}
59+
60+
-static inline abi_long copy_from_user_flock(struct flock64 *fl,
61+
+static inline abi_long copy_from_user_flock(struct flock *fl,
62+
abi_ulong target_flock_addr)
63+
{
64+
struct target_flock *target_fl;
65+
@@ -6885,7 +6885,7 @@ static inline abi_long copy_from_user_flock(struct flock64 *fl,
66+
}
67+
68+
static inline abi_long copy_to_user_flock(abi_ulong target_flock_addr,
69+
- const struct flock64 *fl)
70+
+ const struct flock *fl)
71+
{
72+
struct target_flock *target_fl;
73+
short l_type;
74+
@@ -6904,8 +6904,8 @@ static inline abi_long copy_to_user_flock(abi_ulong target_flock_addr,
75+
return 0;
76+
}
77+
78+
-typedef abi_long from_flock64_fn(struct flock64 *fl, abi_ulong target_addr);
79+
-typedef abi_long to_flock64_fn(abi_ulong target_addr, const struct flock64 *fl);
80+
+typedef abi_long from_flock64_fn(struct flock *fl, abi_ulong target_addr);
81+
+typedef abi_long to_flock64_fn(abi_ulong target_addr, const struct flock *fl);
82+
83+
#if defined(TARGET_ARM) && TARGET_ABI_BITS == 32
84+
struct target_oabi_flock64 {
85+
@@ -6916,7 +6916,7 @@ struct target_oabi_flock64 {
86+
abi_int l_pid;
87+
} QEMU_PACKED;
88+
89+
-static inline abi_long copy_from_user_oabi_flock64(struct flock64 *fl,
90+
+static inline abi_long copy_from_user_oabi_flock64(struct flock *fl,
91+
abi_ulong target_flock_addr)
92+
{
93+
struct target_oabi_flock64 *target_fl;
94+
@@ -6941,7 +6941,7 @@ static inline abi_long copy_from_user_oabi_flock64(struct flock64 *fl,
95+
}
96+
97+
static inline abi_long copy_to_user_oabi_flock64(abi_ulong target_flock_addr,
98+
- const struct flock64 *fl)
99+
+ const struct flock *fl)
100+
{
101+
struct target_oabi_flock64 *target_fl;
102+
short l_type;
103+
@@ -6961,7 +6961,7 @@ static inline abi_long copy_to_user_oabi_flock64(abi_ulong target_flock_addr,
104+
}
105+
#endif
106+
107+
-static inline abi_long copy_from_user_flock64(struct flock64 *fl,
108+
+static inline abi_long copy_from_user_flock64(struct flock *fl,
109+
abi_ulong target_flock_addr)
110+
{
111+
struct target_flock64 *target_fl;
112+
@@ -6986,7 +6986,7 @@ static inline abi_long copy_from_user_flock64(struct flock64 *fl,
113+
}
114+
115+
static inline abi_long copy_to_user_flock64(abi_ulong target_flock_addr,
116+
- const struct flock64 *fl)
117+
+ const struct flock *fl)
118+
{
119+
struct target_flock64 *target_fl;
120+
short l_type;
121+
@@ -7007,7 +7007,7 @@ static inline abi_long copy_to_user_flock64(abi_ulong target_flock_addr,
122+
123+
static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)
124+
{
125+
- struct flock64 fl64;
126+
+ struct flock fl64;
127+
#ifdef F_GETOWN_EX
128+
struct f_owner_ex fox;
129+
struct target_f_owner_ex *target_fox;
130+
@@ -7283,7 +7283,7 @@ static inline abi_long target_truncate64(CPUArchState *cpu_env, const char *arg1
131+
arg2 = arg3;
132+
arg3 = arg4;
133+
}
134+
- return get_errno(truncate64(arg1, target_offset64(arg2, arg3)));
135+
+ return get_errno(truncate(arg1, target_offset64(arg2, arg3)));
136+
}
137+
#endif
138+
139+
@@ -7297,7 +7297,7 @@ static inline abi_long target_ftruncate64(CPUArchState *cpu_env, abi_long arg1,
140+
arg2 = arg3;
141+
arg3 = arg4;
142+
}
143+
- return get_errno(ftruncate64(arg1, target_offset64(arg2, arg3)));
144+
+ return get_errno(ftruncate(arg1, target_offset64(arg2, arg3)));
145+
}
146+
#endif
147+
148+
@@ -8683,7 +8683,7 @@ static int do_getdents(abi_long dirfd, abi_long arg2, abi_long count)
149+
void *tdirp;
150+
int hlen, hoff, toff;
151+
int hreclen, treclen;
152+
- off64_t prev_diroff = 0;
153+
+ off_t prev_diroff = 0;
154+
155+
hdirp = g_try_malloc(count);
156+
if (!hdirp) {
157+
@@ -8736,7 +8736,7 @@ static int do_getdents(abi_long dirfd, abi_long arg2, abi_long count)
158+
* Return what we have, resetting the file pointer to the
159+
* location of the first record not returned.
160+
*/
161+
- lseek64(dirfd, prev_diroff, SEEK_SET);
162+
+ lseek(dirfd, prev_diroff, SEEK_SET);
163+
break;
164+
}
165+
166+
@@ -8770,7 +8770,7 @@ static int do_getdents64(abi_long dirfd, abi_long arg2, abi_long count)
167+
void *tdirp;
168+
int hlen, hoff, toff;
169+
int hreclen, treclen;
170+
- off64_t prev_diroff = 0;
171+
+ off_t prev_diroff = 0;
172+
173+
hdirp = g_try_malloc(count);
174+
if (!hdirp) {
175+
@@ -8812,7 +8812,7 @@ static int do_getdents64(abi_long dirfd, abi_long arg2, abi_long count)
176+
* Return what we have, resetting the file pointer to the
177+
* location of the first record not returned.
178+
*/
179+
- lseek64(dirfd, prev_diroff, SEEK_SET);
180+
+ lseek(dirfd, prev_diroff, SEEK_SET);
181+
break;
182+
}
183+
184+
@@ -11543,7 +11543,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
185+
return -TARGET_EFAULT;
186+
}
187+
}
188+
- ret = get_errno(pread64(arg1, p, arg3, target_offset64(arg4, arg5)));
189+
+ ret = get_errno(pread(arg1, p, arg3, target_offset64(arg4, arg5)));
190+
unlock_user(p, arg2, ret);
191+
return ret;
192+
case TARGET_NR_pwrite64:
193+
@@ -11560,7 +11560,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
194+
return -TARGET_EFAULT;
195+
}
196+
}
197+
- ret = get_errno(pwrite64(arg1, p, arg3, target_offset64(arg4, arg5)));
198+
+ ret = get_errno(pwrite(arg1, p, arg3, target_offset64(arg4, arg5)));
199+
unlock_user(p, arg2, 0);
200+
return ret;
201+
#endif
202+
@@ -12420,7 +12420,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
203+
case TARGET_NR_fcntl64:
204+
{
205+
int cmd;
206+
- struct flock64 fl;
207+
+ struct flock fl;
208+
from_flock64_fn *copyfrom = copy_from_user_flock64;
209+
to_flock64_fn *copyto = copy_to_user_flock64;
210+

patch/linux-user__syscall.c.diff renamed to patch/linux-user__syscall.diff

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1+
commit 60406bafb9f2ed39c8187058900dfefaf43ef9e6
2+
Author: Michael Dusan <[email protected]>
3+
Date: Wed Jun 5 11:09:23 2024 -0400
4+
5+
syscall.c
6+
17
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
2-
index ccd3892b2..eb1a9dc5e 100644
8+
index 3df2b94d9a..29420959bf 100644
39
--- a/linux-user/syscall.c
410
+++ b/linux-user/syscall.c
5-
@@ -134,6 +134,13 @@
11+
@@ -144,6 +144,13 @@
612
#include "fd-trans.h"
7-
#include "tcg/tcg.h"
13+
#include "cpu_loop-common.h"
814

915
+#ifndef F_SHLCK
1016
+#define F_SHLCK 8
@@ -16,7 +22,7 @@ index ccd3892b2..eb1a9dc5e 100644
1622
#ifndef CLONE_IO
1723
#define CLONE_IO 0x80000000 /* Clone io context */
1824
#endif
19-
@@ -3208,7 +3215,7 @@ static abi_long do_sendrecvmsg_locked(int fd, struct target_msghdr *msgp,
25+
@@ -3223,7 +3230,7 @@ static abi_long do_sendrecvmsg_locked(int fd, struct target_msghdr *msgp,
2026
int flags, int send)
2127
{
2228
abi_long ret, len;
@@ -25,7 +31,7 @@ index ccd3892b2..eb1a9dc5e 100644
2531
abi_ulong count;
2632
struct iovec *vec;
2733
abi_ulong target_vec;
28-
@@ -7273,9 +7280,20 @@ static inline abi_long host_to_target_timex64(abi_long target_addr,
34+
@@ -7526,9 +7533,20 @@ static inline abi_long host_to_target_timex64(abi_long target_addr,
2935
#define sigev_notify_thread_id _sigev_un._tid
3036
#endif
3137

@@ -47,7 +53,7 @@ index ccd3892b2..eb1a9dc5e 100644
4753
struct target_sigevent *target_sevp;
4854

4955
if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {
50-
@@ -7293,7 +7311,7 @@ static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
56+
@@ -7546,7 +7564,7 @@ static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
5157
host_sevp->sigev_signo =
5258
target_to_host_signal(tswap32(target_sevp->sigev_signo));
5359
host_sevp->sigev_notify = tswap32(target_sevp->sigev_notify);

0 commit comments

Comments
 (0)