From nobody Tue Apr 30 10:11:20 2024 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 1642948915524262.4494415922203; Sun, 23 Jan 2022 06:41:55 -0800 (PST) Received: from localhost ([::1]:58070 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nBe42-0002WX-Hr for importer@patchew.org; Sun, 23 Jan 2022 09:41:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44584) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nBZto-0002wG-4U; Sun, 23 Jan 2022 05:15:04 -0500 Received: from depni-mx.sinp.msu.ru ([213.131.7.21]:39483) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nBZtm-0003q9-9A; Sun, 23 Jan 2022 05:15:03 -0500 Received: from spider (unknown [176.195.59.180]) by depni-mx.sinp.msu.ru (Postfix) with ESMTPSA id 392321BF45A; Sun, 23 Jan 2022 13:15:14 +0300 (MSK) From: Serge Belyshev To: qemu-devel@nongnu.org Subject: [PATCH] linux-user/alpha: Fix target rlimits for alpha and rearrange for clarity Date: Sat, 15 Jan 2022 14:32:35 +0300 Message-ID: <87y236lpwb.fsf@depni.sinp.msu.ru> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 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=213.131.7.21; envelope-from=belyshev@depni.sinp.msu.ru; helo=depni-mx.sinp.msu.ru X-Spam_score_int: -7 X-Spam_score: -0.8 X-Spam_bar: / X-Spam_report: (-0.8 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_96_XX=3.405, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 23 Jan 2022 09:38:32 -0500 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1642948916503100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Alpha uses different values of some TARGET_RLIMIT_* constants, which were missing and caused bugs like #577, fixed thus. Also rearranged all three (alpha, mips and sparc) that differ from everyone else for clarity. Signed-off-by: Serge Belyshev Resolves: https://gitlab.com/qemu-project/qemu/-/issues/577 Reviewed-by: Laurent Vivier --- linux-user/syscall_defs.h | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index f23f0a2178..3fcabaeae3 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -730,44 +730,41 @@ struct target_rlimit { #define TARGET_RLIM_INFINITY ((abi_ulong)-1) #endif =20 -#if defined(TARGET_MIPS) #define TARGET_RLIMIT_CPU 0 #define TARGET_RLIMIT_FSIZE 1 #define TARGET_RLIMIT_DATA 2 #define TARGET_RLIMIT_STACK 3 #define TARGET_RLIMIT_CORE 4 +#if defined(TARGET_MIPS) +#define TARGET_RLIMIT_NOFILE 5 +#define TARGET_RLIMIT_AS 6 #define TARGET_RLIMIT_RSS 7 #define TARGET_RLIMIT_NPROC 8 -#define TARGET_RLIMIT_NOFILE 5 #define TARGET_RLIMIT_MEMLOCK 9 -#define TARGET_RLIMIT_AS 6 -#define TARGET_RLIMIT_LOCKS 10 -#define TARGET_RLIMIT_SIGPENDING 11 -#define TARGET_RLIMIT_MSGQUEUE 12 -#define TARGET_RLIMIT_NICE 13 -#define TARGET_RLIMIT_RTPRIO 14 -#else -#define TARGET_RLIMIT_CPU 0 -#define TARGET_RLIMIT_FSIZE 1 -#define TARGET_RLIMIT_DATA 2 -#define TARGET_RLIMIT_STACK 3 -#define TARGET_RLIMIT_CORE 4 +#elif defined(TARGET_ALPHA) +#define TARGET_RLIMIT_RSS 5 +#define TARGET_RLIMIT_NOFILE 6 +#define TARGET_RLIMIT_AS 7 +#define TARGET_RLIMIT_NPROC 8 +#define TARGET_RLIMIT_MEMLOCK 9 +#elif defined(TARGET_SPARC) #define TARGET_RLIMIT_RSS 5 -#if defined(TARGET_SPARC) #define TARGET_RLIMIT_NOFILE 6 #define TARGET_RLIMIT_NPROC 7 +#define TARGET_RLIMIT_MEMLOCK 8 +#define TARGET_RLIMIT_AS 9 #else +#define TARGET_RLIMIT_RSS 5 #define TARGET_RLIMIT_NPROC 6 #define TARGET_RLIMIT_NOFILE 7 -#endif #define TARGET_RLIMIT_MEMLOCK 8 #define TARGET_RLIMIT_AS 9 +#endif #define TARGET_RLIMIT_LOCKS 10 #define TARGET_RLIMIT_SIGPENDING 11 #define TARGET_RLIMIT_MSGQUEUE 12 #define TARGET_RLIMIT_NICE 13 #define TARGET_RLIMIT_RTPRIO 14 -#endif =20 struct target_pollfd { int fd; /* file descriptor */ --=20 2.34.1