qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: Serge Belyshev <belyshev@depni.sinp.msu.ru>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org
Subject: Re: [PATCH] linux-user/alpha: Fix target rlimits for alpha and rearrange for clarity
Date: Thu, 27 Jan 2022 14:49:30 +0100	[thread overview]
Message-ID: <4e110850-a303-d0a4-158b-6186367aa739@vivier.eu> (raw)
In-Reply-To: <87y236lpwb.fsf@depni.sinp.msu.ru>

Le 15/01/2022 à 12:32, Serge Belyshev a écrit :
> 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 <belyshev@depni.sinp.msu.ru>
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/577
> ---
>   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
>   
> -#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
>   
>   struct target_pollfd {
>       int fd;           /* file descriptor */

Reviewed-by: Laurent Vivier <laurent@vivier.eu>

perhaps you could also add RLIMIT_RTTIME (15) and update target_to_host_resource()?

The next step would be to move the generic definitions to a new file in 
linux-user/generic/target_resource.h and the specific ones to linux-user/alpha, linux-user/mips and 
linux-user/sparc.

Thanks,
Laurent


  reply	other threads:[~2022-01-27 13:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-15 11:32 [PATCH] linux-user/alpha: Fix target rlimits for alpha and rearrange for clarity Serge Belyshev
2022-01-27 13:49 ` Laurent Vivier [this message]
2022-01-29 19:41   ` Serge Belyshev
2022-01-29 19:46     ` [PATCH] linux-user: Move generic TARGET_RLIMIT* definitions to generic/target_resource.h Serge Belyshev
2022-01-29 19:48       ` [PATCH] linux-user/syscall: Translate TARGET_RLIMIT_RTTIME Serge Belyshev
2022-01-31  9:26         ` Laurent Vivier
2022-01-31  9:39         ` Laurent Vivier
2022-02-01  7:02         ` Laurent Vivier
2022-02-01  7:02       ` [PATCH] linux-user: Move generic TARGET_RLIMIT* definitions to generic/target_resource.h Laurent Vivier
2022-01-27 14:09 ` [PATCH] linux-user/alpha: Fix target rlimits for alpha and rearrange for clarity Laurent Vivier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4e110850-a303-d0a4-158b-6186367aa739@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=belyshev@depni.sinp.msu.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).