From nobody Tue Nov 18 15:26:05 2025 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 ARC-Seal: i=1; a=rsa-sha256; t=1611080480; cv=none; d=zohomail.com; s=zohoarc; b=g87tiW2Xvv3DUOBpLBO15//LiPbmOfzNIje5eosbCZStnOx3/eJeLkxbc+YOG9iVFp7tDbvFPzkMjgdF9/JQpD8VXitPagYtySXIxCKCSKOLg40rTnwW24Uhgz/n2klRMGqtg1eCWnKCvn0LoO3wK6BGJlfS/k3R5qmusx5F9Gw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611080480; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bW+HKz7CnzX/7SdlcWi4oZL/Paa5htUBO641c0k3lZw=; b=SyuDZLvAXe58m3OS+9yMZGnXz379HKW5eMCBWlmkbnyWnHg2YpIYtPd+wKc9Fkny2eG9kh/HZMJH9TNhCT/Wkcq1wvtB0URVXA1rIjPIenvkKgUNlmVlofUM1lDuTzpdiFVjeOK3VKMyXDpzDnPk3L0SaXo9EZfqtRqvIUZNkOA= ARC-Authentication-Results: i=1; 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 1611080480306255.29029195376654; Tue, 19 Jan 2021 10:21:20 -0800 (PST) Received: from localhost ([::1]:34128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1vd1-0006nm-7Q for importer@patchew.org; Tue, 19 Jan 2021 13:21:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39216) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1vDB-00027o-E4 for qemu-devel@nongnu.org; Tue, 19 Jan 2021 12:54:37 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:38943) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1vD9-00041F-Er for qemu-devel@nongnu.org; Tue, 19 Jan 2021 12:54:37 -0500 Received: from localhost.localdomain ([82.252.149.54]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N5FtF-1m0Nb00Ghx-0117LD; Tue, 19 Jan 2021 18:54:31 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 1/5] linux-user: Support F_ADD_SEALS and F_GET_SEALS fcntls Date: Tue, 19 Jan 2021 18:54:23 +0100 Message-Id: <20210119175427.2050737-2-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210119175427.2050737-1-laurent@vivier.eu> References: <20210119175427.2050737-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:nQ/XkIVQ63nTCKEJsoyjKiUs+ljebC9TvOoOECIp9QgejxINY42 R47V20pXbuRgE2QMrL/GeEancwtyFc1zKGeOZIF2X6xKwfkKnxGo4HSHESkGvgO7M2eWdRS iuxwQd646f2IQ6vIRR9eu9smIKSND0w4r4eZv+uzwfFOAGDlwa9SuksBbmd4rBTbZNTTsPN tFKEyAKzzqAJqenLDCt9g== X-UI-Out-Filterresults: notjunk:1;V03:K0:toZv0CJ7gL4=:DCkOoqPJiC5vBh5tKFXkaC +lqF/8ZnAc6eb5Ne19yBiSV4HCh9bZpgeHBsfu05SpYzJ8I5t073j4efSP6XSCEc5gtBMBF0Z QSDUyixPRq9mNp/hem3budWDl2MihI3ljjiz2BoZxwW8JFgNXKZNBsqigh0SEE+oIjSxyRAeh umLPIsDWf0Qi2sNBjeCrM6sPgFBf/1hp/bPQ3yxlALSC7yli0Q4TkccXC0iCWRKuj5pT1efmY LeaH4HHtk4mSk//ER8smLDYUkRqDp+V8koHWG/ZUYm+coRiycT9H6kQiSfUv17TQpP7Al+Rp8 bWbL+cm4iyvyiYwgBSmpRBkvsuOZ5K1BxWDQ3ozI56v8HwDxVJl1Q2fa7XE8g0IzA6t850Vii ZVFHWOL54MgSN5QsGbxLis18GLwgjkRb4qKNPefMuLfnPeKY8Boa2PRZA355C 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: none client-ip=212.227.126.187; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de 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_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Shu-Chun Weng Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Shu-Chun Weng Also reorder blocks so that they are all in the same order everywhere. Signed-off-by: Shu-Chun Weng Reviewed-by: Laurent Vivier Message-Id: <20201218193213.3566856-2-scw@google.com> Signed-off-by: Laurent Vivier --- linux-user/strace.c | 39 ++++++++++++++++++++++++++++++++------- linux-user/syscall.c | 10 ++++++++++ linux-user/syscall_defs.h | 14 ++++++++------ 3 files changed, 50 insertions(+), 13 deletions(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index e00275fcb51b..227812c07e63 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -2066,11 +2066,34 @@ print_fcntl(void *cpu_env, const struct syscallname= *name, break; case TARGET_F_SETLEASE: qemu_log("F_SETLEASE,"); - print_raw_param(TARGET_ABI_FMT_ld, arg2, 0); + print_raw_param(TARGET_ABI_FMT_ld, arg2, 1); break; case TARGET_F_GETLEASE: qemu_log("F_GETLEASE"); break; +#ifdef F_DUPFD_CLOEXEC + case TARGET_F_DUPFD_CLOEXEC: + qemu_log("F_DUPFD_CLOEXEC,"); + print_raw_param(TARGET_ABI_FMT_ld, arg2, 1); + break; +#endif + case TARGET_F_NOTIFY: + qemu_log("F_NOTIFY,"); + print_raw_param(TARGET_ABI_FMT_ld, arg2, 1); + break; +#ifdef F_GETOWN_EX + case TARGET_F_GETOWN_EX: + qemu_log("F_GETOWN_EX,"); + print_pointer(arg2, 1); + break; +#endif +#ifdef F_SETOWN_EX + case TARGET_F_SETOWN_EX: + qemu_log("F_SETOWN_EX,"); + print_pointer(arg2, 1); + break; +#endif +#ifdef F_SETPIPE_SZ case TARGET_F_SETPIPE_SZ: qemu_log("F_SETPIPE_SZ,"); print_raw_param(TARGET_ABI_FMT_ld, arg2, 1); @@ -2078,14 +2101,16 @@ print_fcntl(void *cpu_env, const struct syscallname= *name, case TARGET_F_GETPIPE_SZ: qemu_log("F_GETPIPE_SZ"); break; - case TARGET_F_DUPFD_CLOEXEC: - qemu_log("F_DUPFD_CLOEXEC,"); - print_raw_param(TARGET_ABI_FMT_ld, arg2, 1); +#endif +#ifdef F_ADD_SEALS + case TARGET_F_ADD_SEALS: + qemu_log("F_ADD_SEALS,"); + print_raw_param("0x"TARGET_ABI_FMT_lx, arg2, 1); break; - case TARGET_F_NOTIFY: - qemu_log("F_NOTIFY,"); - print_raw_param(TARGET_ABI_FMT_ld, arg2, 0); + case TARGET_F_GET_SEALS: + qemu_log("F_GET_SEALS"); break; +#endif default: print_raw_param(TARGET_ABI_FMT_ld, arg1, 0); print_pointer(arg2, 1); diff --git a/linux-user/syscall.c b/linux-user/syscall.c index d182890ff04a..98aaca01872f 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6639,6 +6639,14 @@ static int target_to_host_fcntl_cmd(int cmd) case TARGET_F_GETPIPE_SZ: ret =3D F_GETPIPE_SZ; break; +#endif +#ifdef F_ADD_SEALS + case TARGET_F_ADD_SEALS: + ret =3D F_ADD_SEALS; + break; + case TARGET_F_GET_SEALS: + ret =3D F_GET_SEALS; + break; #endif default: ret =3D -TARGET_EINVAL; @@ -6931,6 +6939,8 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong a= rg) case TARGET_F_GETLEASE: case TARGET_F_SETPIPE_SZ: case TARGET_F_GETPIPE_SZ: + case TARGET_F_ADD_SEALS: + case TARGET_F_GET_SEALS: ret =3D get_errno(safe_fcntl(fd, host_cmd, arg)); break; =20 diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index a00bfc2647c7..f98c1c1c8de4 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -2408,12 +2408,14 @@ struct target_statfs64 { #endif =20 #define TARGET_F_LINUX_SPECIFIC_BASE 1024 -#define TARGET_F_SETLEASE (TARGET_F_LINUX_SPECIFIC_BASE + 0) -#define TARGET_F_GETLEASE (TARGET_F_LINUX_SPECIFIC_BASE + 1) -#define TARGET_F_DUPFD_CLOEXEC (TARGET_F_LINUX_SPECIFIC_BASE + 6) -#define TARGET_F_SETPIPE_SZ (TARGET_F_LINUX_SPECIFIC_BASE + 7) -#define TARGET_F_GETPIPE_SZ (TARGET_F_LINUX_SPECIFIC_BASE + 8) -#define TARGET_F_NOTIFY (TARGET_F_LINUX_SPECIFIC_BASE+2) +#define TARGET_F_SETLEASE (TARGET_F_LINUX_SPECIFIC_BASE + 0) +#define TARGET_F_GETLEASE (TARGET_F_LINUX_SPECIFIC_BASE + 1) +#define TARGET_F_DUPFD_CLOEXEC (TARGET_F_LINUX_SPECIFIC_BASE + 6) +#define TARGET_F_NOTIFY (TARGET_F_LINUX_SPECIFIC_BASE + 2) +#define TARGET_F_SETPIPE_SZ (TARGET_F_LINUX_SPECIFIC_BASE + 7) +#define TARGET_F_GETPIPE_SZ (TARGET_F_LINUX_SPECIFIC_BASE + 8) +#define TARGET_F_ADD_SEALS (TARGET_F_LINUX_SPECIFIC_BASE + 9) +#define TARGET_F_GET_SEALS (TARGET_F_LINUX_SPECIFIC_BASE + 10) =20 #include "target_fcntl.h" =20 --=20 2.29.2