mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Prakash Sangappa <prakash.sangappa@oracle.com>,
	linux-kernel@vger.kernel.org
Cc: peterz@infradead.org, rostedt@goodmis.org, tglx@linutronix.de,
	bigeasy@linutronix.de, kprateek.nayak@amd.com
Subject: Re: [PATCH V4 6/6] Add API to query supported rseq cs flags
Date: Fri, 23 May 2025 15:57:10 -0400	[thread overview]
Message-ID: <df3840a6-36ae-4429-80f2-b1f089917e2c@efficios.com> (raw)
In-Reply-To: <20250513214554.4160454-7-prakash.sangappa@oracle.com>

On 2025-05-13 17:45, Prakash Sangappa wrote:
> For the API, add a new flag to sys_rseq 'flags' argument called
> RSEQ_FLAG_QUERY_CS_FLAGS.
> 
> When this flag is passed it returns a bit mask of all the supported
> rseq cs flags in the user provided rseq struct's 'flags' member.
> 
> Suggested-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> Signed-off-by: Prakash Sangappa <prakash.sangappa@oracle.com>
> ---
>   include/uapi/linux/rseq.h |  1 +
>   kernel/rseq.c             | 17 +++++++++++++++++
>   2 files changed, 18 insertions(+)
> 
> diff --git a/include/uapi/linux/rseq.h b/include/uapi/linux/rseq.h
> index 015534f064af..44baea9dd10a 100644
> --- a/include/uapi/linux/rseq.h
> +++ b/include/uapi/linux/rseq.h
> @@ -20,6 +20,7 @@ enum rseq_cpu_id_state {
>   
>   enum rseq_flags {
>   	RSEQ_FLAG_UNREGISTER = (1 << 0),
> +	RSEQ_FLAG_QUERY_CS_FLAGS = (1 << 1),
>   };
>   
>   enum rseq_cs_flags_bit {
> diff --git a/kernel/rseq.c b/kernel/rseq.c
> index c4bc52f8ba9c..997f7ca722ca 100644
> --- a/kernel/rseq.c
> +++ b/kernel/rseq.c
> @@ -576,6 +576,23 @@ SYSCALL_DEFINE4(rseq, struct rseq __user *, rseq, u32, rseq_len,
>   		return 0;
>   	}
>   
> +	/*
> +	 * return supported rseq_cs flags
> +	 * It is an or of all the rseq_cs_flags;
> +	 */
> +	if (flags & RSEQ_FLAG_QUERY_CS_FLAGS) {
> +		u32 rseq_csflags = RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT |
> +				   RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL  |
> +				   RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE |

Those 3 flags (above) are already or'd by RSEQ_CS_NO_RESTART_FLAGS,
and they are all deprecated. See rseq_warn_flags().

So I would not return them within the set of supported
rseq flags.

Thanks,

Mathieu



> +				   RSEQ_CS_FLAG_DELAY_RESCHED |
> +				   RSEQ_CS_FLAG_RESCHEDULED;
> +		if (!rseq)
> +			return -EINVAL;
> +		if (copy_to_user(&rseq->flags, &rseq_csflags, sizeof(u32)))
> +			return -EFAULT;
> +		return 0;
> +	}
> +
>   	if (unlikely(flags))
>   		return -EINVAL;
>   


-- 
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com

  reply	other threads:[~2025-05-23 19:57 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-13 21:45 [PATCH V4 0/6] Scheduler time slice extension Prakash Sangappa
2025-05-13 21:45 ` [PATCH V4 1/6] Sched: " Prakash Sangappa
2025-05-14 10:58   ` Madadi Vineeth Reddy
2025-05-14 23:12     ` Prakash Sangappa
2025-05-15  9:01       ` Steven Rostedt
2025-05-20 16:52         ` Prakash Sangappa
2025-05-20 20:20           ` Steven Rostedt
2025-05-23 20:06   ` Mathieu Desnoyers
2025-05-23 20:34     ` Prakash Sangappa
2025-05-13 21:45 ` [PATCH V4 2/6] Sched: Indicate if thread got rescheduled Prakash Sangappa
2025-05-13 21:45 ` [PATCH V4 3/6] Sched: Tunable to specify duration of time slice extension Prakash Sangappa
2025-05-14 11:21   ` kernel test robot
2025-05-13 21:45 ` [PATCH V4 4/6] Sched: Add scheduler stat for cpu " Prakash Sangappa
2025-05-14 12:37   ` Madadi Vineeth Reddy
2025-05-14 23:01     ` Prakash Sangappa
2025-05-13 21:45 ` [PATCH V4 5/6] Sched: Add tracepoint for sched " Prakash Sangappa
2025-05-13 21:45 ` [PATCH V4 6/6] Add API to query supported rseq cs flags Prakash Sangappa
2025-05-23 19:57   ` Mathieu Desnoyers [this message]
2025-05-23 20:03     ` Prakash Sangappa
2025-05-20 21:01 ` [PATCH V4 0/6] Scheduler time slice extension Prakash Sangappa

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=df3840a6-36ae-4429-80f2-b1f089917e2c@efficios.com \
    --to=mathieu.desnoyers@efficios.com \
    --cc=bigeasy@linutronix.de \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=prakash.sangappa@oracle.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®