From nobody Mon Feb 9 19:09:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1768309260273801.8943327614967; Tue, 13 Jan 2026 05:01:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vfe0S-0006I7-8w; Tue, 13 Jan 2026 08:00:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vfe0O-0006BS-Nj; Tue, 13 Jan 2026 08:00:16 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vfe0N-00011Z-0E; Tue, 13 Jan 2026 08:00:16 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 59BDB17D9DD; Tue, 13 Jan 2026 16:00:05 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 526B634C414; Tue, 13 Jan 2026 16:00:10 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Michael Tokarev Subject: [PATCH 1/3] linux-user/syscall.c: statfs: f_flags is always present Date: Tue, 13 Jan 2026 16:00:00 +0300 Message-ID: <20260113130008.910240-3-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260113130008.910240-1-mjt@tls.msk.ru> References: <20260113130008.910240-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1768309262200158500 Content-Type: text/plain; charset="utf-8" statfs.f_flags is present since linux 2.6. There's no need to check for its existance anymore. Signed-off-by: Michael Tokarev --- linux-user/syscall.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 2060e561a2..d32299dddb 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -11000,11 +11000,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env,= int num, abi_long arg1, __put_user(stfs.f_fsid.__val[1], &target_stfs->f_fsid.val[1]); __put_user(stfs.f_namelen, &target_stfs->f_namelen); __put_user(stfs.f_frsize, &target_stfs->f_frsize); -#ifdef _STATFS_F_FLAGS __put_user(stfs.f_flags, &target_stfs->f_flags); -#else - __put_user(0, &target_stfs->f_flags); -#endif memset(target_stfs->f_spare, 0, sizeof(target_stfs->f_spare)); unlock_user_struct(target_stfs, arg2, 1); } @@ -11039,11 +11035,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env,= int num, abi_long arg1, __put_user(stfs.f_fsid.__val[1], &target_stfs->f_fsid.val[1]); __put_user(stfs.f_namelen, &target_stfs->f_namelen); __put_user(stfs.f_frsize, &target_stfs->f_frsize); -#ifdef _STATFS_F_FLAGS __put_user(stfs.f_flags, &target_stfs->f_flags); -#else - __put_user(0, &target_stfs->f_flags); -#endif memset(target_stfs->f_spare, 0, sizeof(target_stfs->f_spare)); unlock_user_struct(target_stfs, arg3, 1); } --=20 2.47.3 From nobody Mon Feb 9 19:09:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1768309245373359.7607174902663; Tue, 13 Jan 2026 05:00:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vfe0R-0006G5-QJ; Tue, 13 Jan 2026 08:00:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vfe0M-00062J-Ki; Tue, 13 Jan 2026 08:00:14 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vfe0K-00010V-0c; Tue, 13 Jan 2026 08:00:14 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 4B9F317D9DC; Tue, 13 Jan 2026 16:00:05 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 45E1034C413; Tue, 13 Jan 2026 16:00:10 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Michael Tokarev Subject: [PATCH trivial 1/7] linux-user/syscall.c: assume splice is always present Date: Tue, 13 Jan 2026 15:59:59 +0300 Message-ID: <20260113130008.910240-2-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260113130008.910240-1-mjt@tls.msk.ru> References: <20260113130008.910240-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1768309250285158501 Content-Type: text/plain; charset="utf-8" splice() &Co are defined since linux 2.6.17. Assume it is always present. Signed-off-by: Michael Tokarev Reviewed-by: Peter Maydell Reviewed-by: Richard Henderson --- linux-user/syscall.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 67ad681098..9cc9ed2fbc 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -13450,15 +13450,9 @@ static abi_long do_syscall1(CPUArchState *cpu_env,= int num, abi_long arg1, return ret; #endif =20 -#ifdef CONFIG_SPLICE -#ifdef TARGET_NR_tee case TARGET_NR_tee: - { - ret =3D get_errno(tee(arg1,arg2,arg3,arg4)); - } + ret =3D get_errno(tee(arg1, arg2, arg3, arg4)); return ret; -#endif -#ifdef TARGET_NR_splice case TARGET_NR_splice: { loff_t loff_in, loff_out; @@ -13488,9 +13482,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, = int num, abi_long arg1, } } return ret; -#endif -#ifdef TARGET_NR_vmsplice - case TARGET_NR_vmsplice: + case TARGET_NR_vmsplice: { struct iovec *vec =3D lock_iovec(VERIFY_READ, arg2, arg3, 1); if (vec !=3D NULL) { @@ -13501,8 +13493,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, = int num, abi_long arg1, } } return ret; -#endif -#endif /* CONFIG_SPLICE */ + #ifdef CONFIG_EVENTFD #if defined(TARGET_NR_eventfd) case TARGET_NR_eventfd: --=20 2.47.3 From nobody Mon Feb 9 19:09:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1768309343123170.37288716129467; Tue, 13 Jan 2026 05:02:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vfe0U-0006Nw-8M; Tue, 13 Jan 2026 08:00:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vfe0S-0006Iv-1E; Tue, 13 Jan 2026 08:00:20 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vfe0Q-00012X-8E; Tue, 13 Jan 2026 08:00:19 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 7D4C517D9DF; Tue, 13 Jan 2026 16:00:05 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 6C5E234C416; Tue, 13 Jan 2026 16:00:10 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Michael Tokarev Subject: [PATCH trivial 2/7] meson.build: stop checking for splice() Date: Tue, 13 Jan 2026 16:00:02 +0300 Message-ID: <20260113130008.910240-5-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260113130008.910240-1-mjt@tls.msk.ru> References: <20260113130008.910240-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1768309344954158500 Content-Type: text/plain; charset="utf-8" CONFIG_SPLICE was only needed for linux-user/, where it is not used anymore (assuming splice &Co is always present) Signed-off-by: Michael Tokarev Reviewed-by: Richard Henderson --- meson.build | 8 -------- 1 file changed, 8 deletions(-) diff --git a/meson.build b/meson.build index c58007291a..9b5f1540ff 100644 --- a/meson.build +++ b/meson.build @@ -2913,14 +2913,6 @@ config_host_data.set('CONFIG_PTHREAD_AFFINITY_NP', c= c.links(osdep_prefix + ''' config_host_data.set('CONFIG_SIGNALFD', cc.links(osdep_prefix + ''' #include int main(void) { return signalfd(-1, NULL, SFD_CLOEXEC); }''')) -config_host_data.set('CONFIG_SPLICE', cc.links(osdep_prefix + ''' - int main(void) - { - int len, fd =3D 0; - len =3D tee(STDIN_FILENO, STDOUT_FILENO, INT_MAX, SPLICE_F_NONBLOCK); - splice(STDIN_FILENO, NULL, fd, NULL, len, SPLICE_F_MOVE); - return 0; - }''')) =20 config_host_data.set('HAVE_MLOCKALL', cc.links(osdep_prefix + ''' #include --=20 2.47.3 From nobody Mon Feb 9 19:09:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1768309359330724.0992919460614; Tue, 13 Jan 2026 05:02:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vfe0V-0006P8-Ct; Tue, 13 Jan 2026 08:00:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vfe0Q-0006FC-3A; Tue, 13 Jan 2026 08:00:18 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vfe0O-00011u-Al; Tue, 13 Jan 2026 08:00:17 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 65DF517D9DE; Tue, 13 Jan 2026 16:00:05 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 604F034C415; Tue, 13 Jan 2026 16:00:10 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Michael Tokarev Subject: [PATCH 2/3] linux-user/syscall.c: consolidate statfs calls Date: Tue, 13 Jan 2026 16:00:01 +0300 Message-ID: <20260113130008.910240-4-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260113130008.910240-1-mjt@tls.msk.ru> References: <20260113130008.910240-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1768309361101158500 Content-Type: text/plain; charset="utf-8" group statfs&fstatfs together, eliminate goto into a different case label, eliminate struct statfs global to all syscalls. Ditto for statfs64. This makes code more readable and less scattered. While at it, drop `#ifdef TARGET_NR_fstatfs` -- assume fstatfs() is present together with statfs() - just like for fstatfs64. Signed-off-by: Michael Tokarev --- linux-user/syscall.c | 62 +++++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index d32299dddb..1f84c296d5 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -9457,10 +9457,6 @@ static abi_long do_syscall1(CPUArchState *cpu_env, i= nt num, abi_long arg1, || defined(TARGET_NR_fstat) || defined(TARGET_NR_fstat64) \ || defined(TARGET_NR_statx) struct stat st; -#endif -#if defined(TARGET_NR_statfs) || defined(TARGET_NR_statfs64) \ - || defined(TARGET_NR_fstatfs) - struct statfs stfs; #endif void *p; =20 @@ -10978,15 +10974,22 @@ static abi_long do_syscall1(CPUArchState *cpu_env= , int num, abi_long arg1, return get_errno(setpriority(arg1, arg2, arg3)); #ifdef TARGET_NR_statfs case TARGET_NR_statfs: - if (!(p =3D lock_user_string(arg1))) { - return -TARGET_EFAULT; - } - ret =3D get_errno(statfs(path(p), &stfs)); - unlock_user(p, arg1, 0); - convert_statfs: - if (!is_error(ret)) { + case TARGET_NR_fstatfs: + { + struct statf stfs; struct target_statfs *target_stfs; - + if (num =3D=3D TARGET_NR_statfs) { + if (!(p =3D lock_user_string(arg1))) { + return -TARGET_EFAULT; + } + ret =3D get_errno(statfs(path(p), &stfs)); + unlock_user(p, arg1, 0); + } else /* if (num =3D=3D TARGET_NR_fstatfs) */ { + ret =3D get_errno(fstatfs(arg1, &stfs)); + } + if (is_error(ret)) { + return ret; + } if (!lock_user_struct(VERIFY_WRITE, target_stfs, arg2, 0)) return -TARGET_EFAULT; __put_user(stfs.f_type, &target_stfs->f_type); @@ -11003,25 +11006,27 @@ static abi_long do_syscall1(CPUArchState *cpu_env= , int num, abi_long arg1, __put_user(stfs.f_flags, &target_stfs->f_flags); memset(target_stfs->f_spare, 0, sizeof(target_stfs->f_spare)); unlock_user_struct(target_stfs, arg2, 1); + return ret; } - return ret; -#endif -#ifdef TARGET_NR_fstatfs - case TARGET_NR_fstatfs: - ret =3D get_errno(fstatfs(arg1, &stfs)); - goto convert_statfs; #endif #ifdef TARGET_NR_statfs64 case TARGET_NR_statfs64: - if (!(p =3D lock_user_string(arg1))) { - return -TARGET_EFAULT; - } - ret =3D get_errno(statfs(path(p), &stfs)); - unlock_user(p, arg1, 0); - convert_statfs64: - if (!is_error(ret)) { + case TARGET_NR_fstatfs64: + { + struct statfs stfs; struct target_statfs64 *target_stfs; - + if (num =3D=3D TARGET_NR_statfs64) { + if (!(p =3D lock_user_string(arg1))) { + return -TARGET_EFAULT; + } + ret =3D get_errno(statfs(path(p), &stfs)); + unlock_user(p, arg1, 0); + } else /* if (num =3D=3D TARGET_NR_fstatfs64) */ { + ret =3D get_errno(fstatfs(arg1, &stfs)); + } + if (is_error(ret)) { + return ret; + } if (!lock_user_struct(VERIFY_WRITE, target_stfs, arg3, 0)) return -TARGET_EFAULT; __put_user(stfs.f_type, &target_stfs->f_type); @@ -11038,11 +11043,8 @@ static abi_long do_syscall1(CPUArchState *cpu_env,= int num, abi_long arg1, __put_user(stfs.f_flags, &target_stfs->f_flags); memset(target_stfs->f_spare, 0, sizeof(target_stfs->f_spare)); unlock_user_struct(target_stfs, arg3, 1); + return ret; } - return ret; - case TARGET_NR_fstatfs64: - ret =3D get_errno(fstatfs(arg1, &stfs)); - goto convert_statfs64; #endif #ifdef TARGET_NR_socketcall case TARGET_NR_socketcall: --=20 2.47.3 From nobody Mon Feb 9 19:09:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1768309258931547.1479361689857; Tue, 13 Jan 2026 05:00:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vfe0Y-0006Zm-Ez; Tue, 13 Jan 2026 08:00:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vfe0V-0006PC-8y; Tue, 13 Jan 2026 08:00:23 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vfe0T-00013k-GY; Tue, 13 Jan 2026 08:00:23 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 96FFF17D9E1; Tue, 13 Jan 2026 16:00:05 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 90EDE34C418; Tue, 13 Jan 2026 16:00:10 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Michael Tokarev Subject: [PATCH RFC 3/3] linux-user/syscall.c: consolidate statfs calls further Date: Tue, 13 Jan 2026 16:00:04 +0300 Message-ID: <20260113130008.910240-7-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260113130008.910240-1-mjt@tls.msk.ru> References: <20260113130008.910240-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1768309262292158500 Content-Type: text/plain; charset="utf-8" Since statfs & statfs64 implementations are exactly the same, differs only in "64" suffix, merge them into one using a common macro. Signed-off-by: Michael Tokarev --- linux-user/syscall.c | 110 ++++++++++++++++--------------------------- 1 file changed, 40 insertions(+), 70 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 1f84c296d5..1b888bccfc 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -10972,80 +10972,50 @@ static abi_long do_syscall1(CPUArchState *cpu_env= , int num, abi_long arg1, return ret; case TARGET_NR_setpriority: return get_errno(setpriority(arg1, arg2, arg3)); -#ifdef TARGET_NR_statfs - case TARGET_NR_statfs: - case TARGET_NR_fstatfs: - { - struct statf stfs; - struct target_statfs *target_stfs; - if (num =3D=3D TARGET_NR_statfs) { - if (!(p =3D lock_user_string(arg1))) { - return -TARGET_EFAULT; - } - ret =3D get_errno(statfs(path(p), &stfs)); - unlock_user(p, arg1, 0); - } else /* if (num =3D=3D TARGET_NR_fstatfs) */ { - ret =3D get_errno(fstatfs(arg1, &stfs)); - } - if (is_error(ret)) { - return ret; - } - if (!lock_user_struct(VERIFY_WRITE, target_stfs, arg2, 0)) - return -TARGET_EFAULT; - __put_user(stfs.f_type, &target_stfs->f_type); - __put_user(stfs.f_bsize, &target_stfs->f_bsize); - __put_user(stfs.f_blocks, &target_stfs->f_blocks); - __put_user(stfs.f_bfree, &target_stfs->f_bfree); - __put_user(stfs.f_bavail, &target_stfs->f_bavail); - __put_user(stfs.f_files, &target_stfs->f_files); - __put_user(stfs.f_ffree, &target_stfs->f_ffree); - __put_user(stfs.f_fsid.__val[0], &target_stfs->f_fsid.val[0]); - __put_user(stfs.f_fsid.__val[1], &target_stfs->f_fsid.val[1]); - __put_user(stfs.f_namelen, &target_stfs->f_namelen); - __put_user(stfs.f_frsize, &target_stfs->f_frsize); - __put_user(stfs.f_flags, &target_stfs->f_flags); - memset(target_stfs->f_spare, 0, sizeof(target_stfs->f_spare)); - unlock_user_struct(target_stfs, arg2, 1); - return ret; + +#define statfs_fstatfs_impl(variant) /* variant is statfs or statfs64 */ \ + case TARGET_NR_##variant: \ + case TARGET_NR_f##variant: \ + { \ + struct statfs stfs; \ + struct target_##variant *target_stfs; \ + if (num =3D=3D TARGET_NR_##variant) { \ + if (!(p =3D lock_user_string(arg1))) { \ + return -TARGET_EFAULT; \ + } \ + ret =3D get_errno(statfs(path(p), &stfs)); \ + unlock_user(p, arg1, 0); \ + } else /* if (num =3D=3D TARGET_NR_f##variant) */ { \ + ret =3D get_errno(fstatfs(arg1, &stfs)); \ + } \ + if (is_error(ret)) { \ + return ret; \ + } \ + if (!lock_user_struct(VERIFY_WRITE, target_stfs, arg2, 0)) \ + return -TARGET_EFAULT; \ + __put_user(stfs.f_type, &target_stfs->f_type); \ + __put_user(stfs.f_bsize, &target_stfs->f_bsize); \ + __put_user(stfs.f_blocks, &target_stfs->f_blocks); \ + __put_user(stfs.f_bfree, &target_stfs->f_bfree); \ + __put_user(stfs.f_bavail, &target_stfs->f_bavail); \ + __put_user(stfs.f_files, &target_stfs->f_files); \ + __put_user(stfs.f_ffree, &target_stfs->f_ffree); \ + __put_user(stfs.f_fsid.__val[0], &target_stfs->f_fsid.val[0]);= \ + __put_user(stfs.f_fsid.__val[1], &target_stfs->f_fsid.val[1]);= \ + __put_user(stfs.f_namelen, &target_stfs->f_namelen); \ + __put_user(stfs.f_frsize, &target_stfs->f_frsize); \ + __put_user(stfs.f_flags, &target_stfs->f_flags); \ + memset(target_stfs->f_spare, 0, sizeof(target_stfs->f_spare));= \ + unlock_user_struct(target_stfs, arg2, 1); \ + return ret; \ } +#ifdef TARGET_NR_statfs + statfs_fstatfs_impl(statfs); #endif #ifdef TARGET_NR_statfs64 - case TARGET_NR_statfs64: - case TARGET_NR_fstatfs64: - { - struct statfs stfs; - struct target_statfs64 *target_stfs; - if (num =3D=3D TARGET_NR_statfs64) { - if (!(p =3D lock_user_string(arg1))) { - return -TARGET_EFAULT; - } - ret =3D get_errno(statfs(path(p), &stfs)); - unlock_user(p, arg1, 0); - } else /* if (num =3D=3D TARGET_NR_fstatfs64) */ { - ret =3D get_errno(fstatfs(arg1, &stfs)); - } - if (is_error(ret)) { - return ret; - } - if (!lock_user_struct(VERIFY_WRITE, target_stfs, arg3, 0)) - return -TARGET_EFAULT; - __put_user(stfs.f_type, &target_stfs->f_type); - __put_user(stfs.f_bsize, &target_stfs->f_bsize); - __put_user(stfs.f_blocks, &target_stfs->f_blocks); - __put_user(stfs.f_bfree, &target_stfs->f_bfree); - __put_user(stfs.f_bavail, &target_stfs->f_bavail); - __put_user(stfs.f_files, &target_stfs->f_files); - __put_user(stfs.f_ffree, &target_stfs->f_ffree); - __put_user(stfs.f_fsid.__val[0], &target_stfs->f_fsid.val[0]); - __put_user(stfs.f_fsid.__val[1], &target_stfs->f_fsid.val[1]); - __put_user(stfs.f_namelen, &target_stfs->f_namelen); - __put_user(stfs.f_frsize, &target_stfs->f_frsize); - __put_user(stfs.f_flags, &target_stfs->f_flags); - memset(target_stfs->f_spare, 0, sizeof(target_stfs->f_spare)); - unlock_user_struct(target_stfs, arg3, 1); - return ret; - } + statfs_fstatfs_impl(statfs64); #endif + #ifdef TARGET_NR_socketcall case TARGET_NR_socketcall: return do_socketcall(arg1, arg2); --=20 2.47.3 From nobody Mon Feb 9 19:09:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 176830931525550.85137161622197; Tue, 13 Jan 2026 05:01:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vfe0X-0006W3-0W; Tue, 13 Jan 2026 08:00:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vfe0T-0006NF-Dr; Tue, 13 Jan 2026 08:00:21 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vfe0R-00013H-Kn; Tue, 13 Jan 2026 08:00:21 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 8A37117D9E0; Tue, 13 Jan 2026 16:00:05 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 83EA634C417; Tue, 13 Jan 2026 16:00:10 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Michael Tokarev Subject: [PATCH trivial 3/7] linux-user: assume inotify sycalls are always present Date: Tue, 13 Jan 2026 16:00:03 +0300 Message-ID: <20260113130008.910240-6-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260113130008.910240-1-mjt@tls.msk.ru> References: <20260113130008.910240-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1768309319176158500 Content-Type: text/plain; charset="utf-8" inotify_init() and other syscalls appeared in linux 2.6.13, inotify_init1() - in linux 2.6.27. There's no need to check their presence on linux anymore. Keep condition on TARGET_NR_inotify_init because modern architectures have only more generic inotify_init1(). Other, not linux-specific, places of the code checks for inotify_init1() syscall only. Signed-off-by: Michael Tokarev Reviewed-by: Richard Henderson --- linux-user/fd-trans.c | 5 ----- linux-user/fd-trans.h | 4 ---- linux-user/syscall.c | 19 ++----------------- 3 files changed, 2 insertions(+), 26 deletions(-) diff --git a/linux-user/fd-trans.c b/linux-user/fd-trans.c index f83d1f79d5..64dd0745d2 100644 --- a/linux-user/fd-trans.c +++ b/linux-user/fd-trans.c @@ -18,9 +18,7 @@ #include #include #include -#ifdef CONFIG_INOTIFY #include -#endif #include #ifdef CONFIG_RTNETLINK #include @@ -1861,8 +1859,6 @@ TargetFdTrans target_timerfd_trans =3D { .host_to_target_data =3D swap_data_u64, }; =20 -#if defined(CONFIG_INOTIFY) && (defined(TARGET_NR_inotify_init) || \ - defined(TARGET_NR_inotify_init1)) static abi_long host_to_target_data_inotify(void *buf, size_t len) { struct inotify_event *ev; @@ -1885,4 +1881,3 @@ static abi_long host_to_target_data_inotify(void *buf= , size_t len) TargetFdTrans target_inotify_trans =3D { .host_to_target_data =3D host_to_target_data_inotify, }; -#endif diff --git a/linux-user/fd-trans.h b/linux-user/fd-trans.h index e14f96059c..3bbc15fa1f 100644 --- a/linux-user/fd-trans.h +++ b/linux-user/fd-trans.h @@ -141,9 +141,5 @@ extern TargetFdTrans target_netlink_audit_trans; extern TargetFdTrans target_signalfd_trans; extern TargetFdTrans target_eventfd_trans; extern TargetFdTrans target_timerfd_trans; -#if (defined(TARGET_NR_inotify_init) && defined(__NR_inotify_init)) || \ - (defined(CONFIG_INOTIFY1) && defined(TARGET_NR_inotify_init1) && \ - defined(__NR_inotify_init1)) extern TargetFdTrans target_inotify_trans; #endif -#endif diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 9cc9ed2fbc..fad2bf3632 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -497,15 +497,7 @@ static int sys_renameat2(int oldfd, const char *old, #endif #endif /* TARGET_NR_renameat2 */ =20 -#ifdef CONFIG_INOTIFY #include -#else -/* Userspace can usually survive runtime without inotify */ -#undef TARGET_NR_inotify_init -#undef TARGET_NR_inotify_init1 -#undef TARGET_NR_inotify_add_watch -#undef TARGET_NR_inotify_rm_watch -#endif /* CONFIG_INOTIFY */ =20 #if defined(TARGET_NR_prlimit64) #ifndef __NR_prlimit64 @@ -13267,8 +13259,8 @@ static abi_long do_syscall1(CPUArchState *cpu_env, = int num, abi_long arg1, case TARGET_NR_futex_time64: return do_futex(cpu, true, arg1, arg2, arg3, arg4, arg5, arg6); #endif -#ifdef CONFIG_INOTIFY -#if defined(TARGET_NR_inotify_init) + +#ifdef TARGET_NR_inotify_init case TARGET_NR_inotify_init: ret =3D get_errno(inotify_init()); if (ret >=3D 0) { @@ -13276,7 +13268,6 @@ static abi_long do_syscall1(CPUArchState *cpu_env, = int num, abi_long arg1, } return ret; #endif -#if defined(TARGET_NR_inotify_init1) && defined(CONFIG_INOTIFY1) case TARGET_NR_inotify_init1: ret =3D get_errno(inotify_init1(target_to_host_bitmask(arg1, fcntl_flags_tbl))); @@ -13284,19 +13275,13 @@ static abi_long do_syscall1(CPUArchState *cpu_env= , int num, abi_long arg1, fd_trans_register(ret, &target_inotify_trans); } return ret; -#endif -#if defined(TARGET_NR_inotify_add_watch) case TARGET_NR_inotify_add_watch: p =3D lock_user_string(arg2); ret =3D get_errno(inotify_add_watch(arg1, path(p), arg3)); unlock_user(p, arg2, 0); return ret; -#endif -#if defined(TARGET_NR_inotify_rm_watch) case TARGET_NR_inotify_rm_watch: return get_errno(inotify_rm_watch(arg1, arg2)); -#endif -#endif =20 #if defined(TARGET_NR_mq_open) && defined(__NR_mq_open) case TARGET_NR_mq_open: --=20 2.47.3 From nobody Mon Feb 9 19:09:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1768309371164361.54833777805834; Tue, 13 Jan 2026 05:02:51 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vfe1w-0000nJ-Fw; Tue, 13 Jan 2026 08:01:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vfe0q-00071c-Dc; Tue, 13 Jan 2026 08:00:51 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vfe0o-00014E-Uz; Tue, 13 Jan 2026 08:00:44 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id AD52E17D9E2; Tue, 13 Jan 2026 16:00:05 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 9D6DF34C419; Tue, 13 Jan 2026 16:00:10 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Michael Tokarev Subject: [PATCH trivial 4/7] meson.build: stop checking for inotify_init() Date: Tue, 13 Jan 2026 16:00:05 +0300 Message-ID: <20260113130008.910240-8-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260113130008.910240-1-mjt@tls.msk.ru> References: <20260113130008.910240-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1768309372986158500 Content-Type: text/plain; charset="utf-8" the only place in qemu which used the check for inotify_init() was linux-user, which now assumes inotify_init() is always present. There's no need to check for this function anymore. Signed-off-by: Michael Tokarev --- meson.build | 1 - 1 file changed, 1 deletion(-) diff --git a/meson.build b/meson.build index 9b5f1540ff..6ea49c6fc0 100644 --- a/meson.build +++ b/meson.build @@ -2709,7 +2709,6 @@ if (have_inotify_init or have_inotify_init1) and host= _os =3D=3D 'freebsd' have_inotify_init1 =3D inotify.found() endif endif -config_host_data.set('CONFIG_INOTIFY', have_inotify_init) config_host_data.set('CONFIG_INOTIFY1', have_inotify_init1) =20 # has_header_symbol --=20 2.47.3 From nobody Mon Feb 9 19:09:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1768309318620201.3648740321123; Tue, 13 Jan 2026 05:01:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vfe1j-0008J3-Sn; Tue, 13 Jan 2026 08:01:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vfe0u-00072T-K7; Tue, 13 Jan 2026 08:00:51 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vfe0r-00014j-4z; Tue, 13 Jan 2026 08:00:47 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id B980017D9E3; Tue, 13 Jan 2026 16:00:05 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id B378334C41A; Tue, 13 Jan 2026 16:00:10 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Michael Tokarev Subject: [PATCH trivial 5/7] linux-user: assume epoll is always present Date: Tue, 13 Jan 2026 16:00:06 +0300 Message-ID: <20260113130008.910240-9-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260113130008.910240-1-mjt@tls.msk.ru> References: <20260113130008.910240-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1768309322844158501 Content-Type: text/plain; charset="utf-8" epoll is in linux since 2.6. epoll_init1 has been added in 2.6.27. There's no need to check for its presence, including all other epoll-related syscalls. Modern architectures don't have epoll_create(), only epoll_create1(), so keep conditional around the former. Signed-off-by: Michael Tokarev Reviewed-by: Richard Henderson --- linux-user/syscall.c | 10 ++-------- linux-user/syscall_defs.h | 3 --- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index fad2bf3632..207c54db02 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -72,9 +72,7 @@ #ifdef CONFIG_EVENTFD #include #endif -#ifdef CONFIG_EPOLL #include -#endif #ifdef CONFIG_ATTR #include "qemu/xattr.h" #endif @@ -13558,16 +13556,13 @@ static abi_long do_syscall1(CPUArchState *cpu_env= , int num, abi_long arg1, case TARGET_NR_signalfd: return do_signalfd4(arg1, arg2, 0); #endif -#if defined(CONFIG_EPOLL) + #if defined(TARGET_NR_epoll_create) case TARGET_NR_epoll_create: return get_errno(epoll_create(arg1)); #endif -#if defined(TARGET_NR_epoll_create1) && defined(CONFIG_EPOLL_CREATE1) case TARGET_NR_epoll_create1: return get_errno(epoll_create1(target_to_host_bitmask(arg1, fcntl_= flags_tbl))); -#endif -#if defined(TARGET_NR_epoll_ctl) case TARGET_NR_epoll_ctl: { struct epoll_event ep; @@ -13596,7 +13591,6 @@ static abi_long do_syscall1(CPUArchState *cpu_env, = int num, abi_long arg1, } return get_errno(epoll_ctl(arg1, arg2, arg3, epp)); } -#endif =20 #if defined(TARGET_NR_epoll_wait) case TARGET_NR_epoll_wait: @@ -13682,7 +13676,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, = int num, abi_long arg1, g_free(ep); return ret; } -#endif /* CONFIG_EPOLL */ + #ifdef TARGET_NR_prlimit64 case TARGET_NR_prlimit64: { diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index cd9ff709b8..20e2e7deac 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -2595,7 +2595,6 @@ struct target_drm_i915_getparam { #define FUTEX_CLOCK_REALTIME 256 #define FUTEX_CMD_MASK ~(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIM= E) =20 -#ifdef CONFIG_EPOLL #if defined(TARGET_X86_64) #define TARGET_EPOLL_PACKED QEMU_PACKED #else @@ -2616,8 +2615,6 @@ struct target_epoll_event { =20 #define TARGET_EP_MAX_EVENTS (INT_MAX / sizeof(struct target_epoll_event)) =20 -#endif - struct target_ucred { abi_uint pid; abi_uint uid; --=20 2.47.3 From nobody Mon Feb 9 19:09:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1768309374455476.4463647924316; Tue, 13 Jan 2026 05:02:54 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vfe1z-0001Lk-Da; Tue, 13 Jan 2026 08:01:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vfe0w-00073D-Eo; Tue, 13 Jan 2026 08:00:56 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vfe0s-00017E-O5; Tue, 13 Jan 2026 08:00:48 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id D02B117D9E4; Tue, 13 Jan 2026 16:00:05 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id BFE6634C41B; Tue, 13 Jan 2026 16:00:10 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Michael Tokarev Subject: [PATCH trivial 6/7] meson.build: do not check for epoll.h (CONFIG_EPOLL) Date: Tue, 13 Jan 2026 16:00:07 +0300 Message-ID: <20260113130008.910240-10-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260113130008.910240-1-mjt@tls.msk.ru> References: <20260113130008.910240-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1768309375028158500 Content-Type: text/plain; charset="utf-8" The only place where we used CONFIG_EPOLL was linux-user, which now enables it unconditionally. Signed-off-by: Michael Tokarev Reviewed-by: Richard Henderson --- meson.build | 1 - 1 file changed, 1 deletion(-) diff --git a/meson.build b/meson.build index 6ea49c6fc0..f8b4f06049 100644 --- a/meson.build +++ b/meson.build @@ -2617,7 +2617,6 @@ config_host_data.set('CONFIG_FSFREEZE', qga_fsfreeze) config_host_data.set('CONFIG_FSTRIM', qga_fstrim) =20 # has_header -config_host_data.set('CONFIG_EPOLL', cc.has_header('sys/epoll.h')) config_host_data.set('CONFIG_LINUX_MAGIC_H', cc.has_header('linux/magic.h'= )) valgrind =3D false if get_option('valgrind').allowed() --=20 2.47.3 From nobody Mon Feb 9 19:09:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17683093758571015.0639304352965; Tue, 13 Jan 2026 05:02:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vfe2l-00027k-2o; Tue, 13 Jan 2026 08:02:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vfe0y-00075U-0X; Tue, 13 Jan 2026 08:00:56 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vfe0w-00018R-IV; Tue, 13 Jan 2026 08:00:51 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id DAFE617D9E5; Tue, 13 Jan 2026 16:00:05 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id D5BFA34C41C; Tue, 13 Jan 2026 16:00:10 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Michael Tokarev Subject: [PATCH trivial 7/7] rename CONFIG_EPOLL_CREATE1 to CONFIG_EPOLL Date: Tue, 13 Jan 2026 16:00:08 +0300 Message-ID: <20260113130008.910240-11-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260113130008.910240-1-mjt@tls.msk.ru> References: <20260113130008.910240-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1768309376952158500 Content-Type: text/plain; charset="utf-8" Since CONFIG_EPOLL is now unused, it's okay to perform this rename, to make it less ugly. Since epoll is linux-specific and is always present, we might as well make CONFIG_EPOLL equal to CONFIG_LINUX. Signed-off-by: Michael Tokarev --- meson.build | 2 +- util/aio-posix.h | 4 ++-- util/meson.build | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index f8b4f06049..552b34f34e 100644 --- a/meson.build +++ b/meson.build @@ -2713,7 +2713,7 @@ config_host_data.set('CONFIG_INOTIFY1', have_inotify_= init1) # has_header_symbol config_host_data.set('CONFIG_BLKZONED', cc.has_header_symbol('linux/blkzoned.h', 'BLKOPENZONE= ')) -config_host_data.set('CONFIG_EPOLL_CREATE1', +config_host_data.set('CONFIG_EPOLL', cc.has_header_symbol('sys/epoll.h', 'epoll_create1')) config_host_data.set('CONFIG_FALLOCATE_PUNCH_HOLE', cc.has_header_symbol('linux/falloc.h', 'FALLOC_FL_PUN= CH_HOLE') and diff --git a/util/aio-posix.h b/util/aio-posix.h index 0cedb8d189..ab894a3c0f 100644 --- a/util/aio-posix.h +++ b/util/aio-posix.h @@ -52,7 +52,7 @@ extern const FDMonOps fdmon_poll_ops; /* Switch back to poll(2). list_lock must be held. */ void fdmon_poll_downgrade(AioContext *ctx); =20 -#ifdef CONFIG_EPOLL_CREATE1 +#ifdef CONFIG_EPOLL bool fdmon_epoll_try_upgrade(AioContext *ctx, unsigned npfd); void fdmon_epoll_setup(AioContext *ctx); =20 @@ -71,7 +71,7 @@ static inline void fdmon_epoll_setup(AioContext *ctx) static inline void fdmon_epoll_disable(AioContext *ctx) { } -#endif /* !CONFIG_EPOLL_CREATE1 */ +#endif /* !CONFIG_EPOLL */ =20 #ifdef CONFIG_LINUX_IO_URING bool fdmon_io_uring_setup(AioContext *ctx, Error **errp); diff --git a/util/meson.build b/util/meson.build index 35029380a3..44f0312e8c 100644 --- a/util/meson.build +++ b/util/meson.build @@ -6,7 +6,7 @@ endif if host_os !=3D 'windows' util_ss.add(files('aio-posix.c')) util_ss.add(files('fdmon-poll.c')) - if config_host_data.get('CONFIG_EPOLL_CREATE1') + if config_host_data.get('CONFIG_EPOLL') util_ss.add(files('fdmon-epoll.c')) endif util_ss.add(files('compatfd.c')) --=20 2.47.3