All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Florian Bezdeka <florian.bezdeka@siemens.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>,  xenomai@xenomai.org
Subject: Re: [dovetail 6.1.y-cip][PATCH 1/3] arm64: fpsimd: dovetail: Hard-disable interrupts inside fpsimd_save_and_flush_cpu_state
Date: Sat, 27 Sep 2025 19:53:34 +0200	[thread overview]
Message-ID: <87qzvrkcip.fsf@xenomai.org> (raw)
In-Reply-To: <682e1128c6f0450f28db6234c032a3f25ec5d914.camel@siemens.com> (Florian Bezdeka's message of "Thu, 25 Sep 2025 14:57:02 +0200")

Florian Bezdeka <florian.bezdeka@siemens.com> writes:

> On Thu, 2025-09-25 at 14:49 +0200, Jan Kiszka wrote:
>> On 25.09.25 14:47, Florian Bezdeka wrote:
>> > On Thu, 2025-09-25 at 14:40 +0200, Jan Kiszka wrote:
>> > > On 23.09.25 20:51, Philippe Gerum wrote:
>> > > > Jan Kiszka <jan.kiszka@siemens.com> writes:
>> > > > 
>> > > > > From: Jan Kiszka <jan.kiszka@siemens.com>
>> > > > > 
>> > > > > Not all callers of this function do that themselves.
>> > > > > 
>> > > > 
>> > > > Are we 100% sure that kvm_arch_vcpu_load_fp() and kvm_arch_vcpu_put_fp()
>> > > > would not benefit from doing that themselves precisely, to create an
>> > > > atomic section around their internal state change _and_ the fpsimd flush
>> > > > op?
>> > > 
>> > > Is kvm on arm64 officially enabled for oob (-preemption), or are we
>> > > patching blindly here? If no one was looking at kvm yet, then you might
>> > > be right. If it was reviewed already, then this here is just cleaning up.
>> > 
>> > We have
>> > https://gitlab.com/Xenomai/linux-dovetail/-/commit/028ad3b2c19ca8a3655577fb34cac7996f166d2a
>> > 
>> > since 6.14 (AFAICT). At the time of writing this was the first kernel
>> > release that used in-kernel FPU. Maybe that changed (thanks to
>> > backports)? Btw: Which version are we talking about right now? 6.1?
>> > 6.12?
>> 
>> All of them.
>> 
>
> In case backporting is considered:
>

We already have 028ad3b2 in [rebase/]6.1.y-cip, I'll pick 97cb63af01de
as well.

> Please also take
>
> 97cb63af01de ("arm64: fpsimd: dovetail: Align with x86 implementation")
>
> into account. Just a "couple of weeks" old and brings some
> optimizations.
>
>

We also need to enable the oob preemption test in switchtest, which was
disabled so far due to lack of support. Now that 028ad3b2 enables safe
preemption of kernel_neon_begin/end sections by oob thread, we should
allow testing this feature in v3 as well with something along these
lines:

diff --git a/kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h b/kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h
index 0958d5e2a..b8c0c39c5 100644
--- a/kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h
+++ b/kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h
@@ -10,16 +10,20 @@
 #include <linux/errno.h>
 #include <asm/xenomai/uapi/fptest.h>
 #include <asm/hwcap.h>
+#include <asm/neon.h>
 
 #define have_fp (ELF_HWCAP & HWCAP_FP)
 
 static inline int fp_linux_begin(void)
 {
-	return -ENOSYS;
+	kernel_neon_begin();
+
+	return 0;
 }
 
 static inline void fp_linux_end(void)
 {
+	kernel_neon_end();
 }
 
 static inline int fp_detect(void)

This was just done in v4 by [1], no issue detected afterwards by the
'hectic' test (switchtest equivalent).

[1] https://gitlab.com/Xenomai/xenomai4/linux-evl/-/commit/0396a52a9b3dc352ef10e6a9d2ed096718ef5d80

-- 
Philippe.

  parent reply	other threads:[~2025-09-27 17:53 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-19  6:55 [dovetail 6.1.y-cip][PATCH 0/3] fpsimd fixes and cleanups Jan Kiszka
2025-09-19  6:55 ` [dovetail 6.1.y-cip][PATCH 1/3] arm64: fpsimd: dovetail: Hard-disable interrupts inside fpsimd_save_and_flush_cpu_state Jan Kiszka
2025-09-19  7:18   ` Jan Kiszka
2025-09-19  9:20     ` Jan Kiszka
2025-09-23 18:51   ` Philippe Gerum
2025-09-25 12:40     ` Jan Kiszka
2025-09-25 12:47       ` Florian Bezdeka
2025-09-25 12:49         ` Jan Kiszka
2025-09-25 12:57           ` Florian Bezdeka
2025-09-25 13:00             ` Jan Kiszka
2025-09-25 13:03               ` Florian Bezdeka
2025-09-25 13:05                 ` Jan Kiszka
2025-09-27 17:53             ` Philippe Gerum [this message]
2025-09-27 18:54               ` Florian Bezdeka
2025-10-08 13:35                 ` Bezdeka, Florian
2025-11-18 10:55                   ` Florian Bezdeka
2025-11-18 12:29                     ` Jan Kiszka
2025-09-19  6:55 ` [dovetail 6.1.y-cip][PATCH 2/3] arm64: fpsimd: dovetail: drop redundant hard irqs disabling Jan Kiszka
2025-10-27 16:01   ` Jan Kiszka
2025-10-27 16:07     ` Philippe Gerum
2025-09-19  6:55 ` [dovetail 6.1.y-cip][PATCH 3/3] arm64: fpsimd: dovetail: Drop extra condition from WARN_ON Jan Kiszka
2025-09-23 18:52   ` Philippe Gerum
2025-09-23 19:02     ` Philippe Gerum

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=87qzvrkcip.fsf@xenomai.org \
    --to=rpm@xenomai.org \
    --cc=florian.bezdeka@siemens.com \
    --cc=jan.kiszka@siemens.com \
    --cc=xenomai@xenomai.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.