From: Thomas Gleixner <tglx@linutronix.de>
To: Yann Sionneau <ysionneau@kalray.eu>
Cc: Yann Sionneau <ysionneau@kalray.eu>,
Christian Brauner <brauner@kernel.org>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org,
Clement Leger <clement.leger@bootlin.com>,
Guillaume Thouvenin <gthouvenin@kalray.eu>,
Julian Vetter <jvetter@kalray.eu>,
Julien Villette <jvillette@kalray.eu>,
Marius Gligor <mgligor@kalray.eu>
Subject: Re: [RFC PATCH 12/25] kvx: Add system call support
Date: Mon, 09 Jan 2023 21:55:08 +0100 [thread overview]
Message-ID: <87pmbnjumr.ffs@tglx> (raw)
In-Reply-To: <20230103164359.24347-13-ysionneau@kalray.eu>
On Tue, Jan 03 2023 at 17:43, Yann Sionneau wrote:
> +/***********************************************************************
> +* Common exception return path
> +***********************************************************************/
> +/**
> + * Restore registers after exception
> + * When entering this macro, $sp must be located right before regs
> + * storage.
> + */
> +EXCEPTION_ENTRY(return_from_exception)
> +#ifdef CONFIG_DEBUG_EXCEPTION_STACK
> + ld $r1 = 0[$sp]
> + ;;
> + sbfd $r1 = $r1, $sp
> + ;;
> + cb.deqz $r1, _check_ok
> + ;;
> + make $r2 = panic
> + make $r0 = stack_error_panic_str_label
> + ;;
> + icall $r2
> + ;;
> +_check_ok:
> + addd $sp = $sp, STACK_REG_SIZE
> + ;;
> +#endif
> + get $r11 = $sr
> + /* Load sps value from saved registers */
> + ld $r6 = PT_SPS[$sp]
> + ;;
> + /* Disable interrupt to check task flags atomically */
> + disable_interrupt $r60
> + ;;
> + /* Check PL bit of sps, if set, then it means we are returning
> + * to a lower privilege level (ie to user), if so, we need to
> + * check work pending. If coming from kernel, directly go to
> + * register restoration */
> + cb.even $r6? _restore_regs
> + ld $r1 = TASK_TI_FLAGS[$r11]
> + ;;
> + /* Do we have work pending ? */
> + andd $r5 = $r1, _TIF_WORK_MASK
Please use the generic entry code to handle pending work, tracing etc.
All over the place....
Thanks,
tglx
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2023-01-09 20:57 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-03 16:43 [RFC PATCH 00/25] Upstream kvx Linux port Yann Sionneau
2023-01-03 16:43 ` [RFC PATCH 10/25] kvx: Add process management Yann Sionneau
2023-01-03 16:43 ` [RFC PATCH 11/25] kvx: Add memory management Yann Sionneau
2023-01-04 11:37 ` Mike Rapoport
2023-01-03 16:43 ` [RFC PATCH 12/25] kvx: Add system call support Yann Sionneau
2023-01-04 15:07 ` Arnd Bergmann
2023-01-09 20:55 ` Thomas Gleixner [this message]
2023-01-03 20:52 ` [RFC PATCH 00/25] Upstream kvx Linux port Rob Herring
2023-01-04 15:58 ` Arnd Bergmann
2023-01-05 10:40 ` Jules Maselbas
2023-01-05 12:05 ` Arnd Bergmann
2023-01-05 14:12 ` Steven Rostedt
2023-01-07 6:25 ` Jeff Xie
2023-01-09 13:21 ` Yann Sionneau
2023-01-09 15:11 ` Jeff Xie
2023-01-09 15:30 ` Yann Sionneau
2023-01-09 15:53 ` Jeff Xie
2023-01-16 7:31 ` Jeff Xie
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=87pmbnjumr.ffs@tglx \
--to=tglx@linutronix.de \
--cc=aou@eecs.berkeley.edu \
--cc=brauner@kernel.org \
--cc=clement.leger@bootlin.com \
--cc=gthouvenin@kalray.eu \
--cc=jvetter@kalray.eu \
--cc=jvillette@kalray.eu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=mgligor@kalray.eu \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=ysionneau@kalray.eu \
/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