All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Ard Biesheuvel <ardb@kernel.org>,
	linux-arm-kernel@lists.infradead.org, linux@armlinux.org.uk
Cc: Frederic Weisbecker <frederic@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH v3 0/4] ARM: vfp: Switch to C API to en/disable softirqs
Date: Thu, 16 Mar 2023 17:24:26 -0700	[thread overview]
Message-ID: <5c061e54-0164-18a9-c1ca-32a78706d1e4@roeck-us.net> (raw)
In-Reply-To: <ee8a7b96-313f-ee94-f5aa-ab9c9088066b@roeck-us.net>

On 3/16/23 17:23, Guenter Roeck wrote:
> On 3/16/23 01:20, Ard Biesheuvel wrote:
>> As it turns out, enabling or disabling softirqs from asm code is more
>> tricky than it looks. Simply bumping the associated bit in preempt_count
>> does the trick for uninstrumented kernels, but with lockdep or preempt
>> debug enabled, we really need to call the C versions, as replicating
>> their behavior in asm fully is intractible.
>>
>> So let's rework the existing code a little bit so we can interpose a
>> little C helper 'vfp_entry()' that disables softirqs before calling the
>> existing vfpstate handling code in asm. Re-enabling softirqs from asm
>> code is more straight-forward, as we can simply perform a tail call via
>> a C routine that is guaranteed to be callable as a function.
>>
>> However, since calling these APIs from asm code is still not ideal,
>> let's reimplement the whole thing in C (patch #4)
>>
>>
>> Changes since v2:
>> - add Rbs and Tbs from Linus and Guenter (thanks!)
>> - correct reference to local_bh_enable() vs __local_bh_enable_ip() in
>>    commit log of patch #3
>> - add patch that reworks the asm VFP exception handling entirely so the
>>    bulk of it is implemented in C. This could be taken into v6.4, while
>>    the  preceding patches are fixes for v6.3-rc
>>
>> Cc: Frederic Weisbecker <frederic@kernel.org>
>> Cc: Guenter Roeck <linux@roeck-us.net>
>> Cc: Peter Zijlstra <peterz@infradead.org>
>> Cc: Linus Walleij <linus.walleij@linaro.org>
>> Cc: Arnd Bergmann <arnd@arndb.de>
>> Link: https://lore.kernel.org/all/ZBBYCSZUJOWBg1s8@localhost.localdomain/
>>
>> Ard Biesheuvel (4):
>>    ARM: vfp: Pass thread_info pointer to vfp_support_entry
>>    ARM: vfp: Pass successful return address via register R3
>>    ARM: vfp: Fix broken softirq handling with instrumentation enabled
>>    ARM: vfp: Reimplement VFP exception entry in C code
>>
>>   arch/arm/include/asm/assembler.h |  13 --
>>   arch/arm/kernel/entry-armv.S     |  12 ++
>>   arch/arm/vfp/Makefile            |   2 +-
>>   arch/arm/vfp/entry.S             |  39 ----
>>   arch/arm/vfp/vfp.h               |   1 +
>>   arch/arm/vfp/vfphw.S             | 198 ++------------------
>>   arch/arm/vfp/vfpmodule.c         | 125 +++++++++++-
>>   7 files changed, 142 insertions(+), 248 deletions(-)
>>   delete mode 100644 arch/arm/vfp/entry.S
>>
> 
> After applying this series, imx_v4_v5_defconfig and aspeed_g4_defconfig
> (and maybe others) fail to build:
> 
> arm-linux-gnueabi-ld: arch/arm/kernel/entry-armv.o: in function `do_vfp':
> (.entry.text+0x5a4): undefined reference to `vfp_entry'
> make[1]: *** [scripts/Makefile.vmlinux:35: vmlinux] Error 1
> make: *** [Makefile:1250: vmlinux] Error 2
> 

... and reverting the last patch of the series fixes the problem.

Guenter


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-03-17  0:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-16  8:20 [PATCH v3 0/4] ARM: vfp: Switch to C API to en/disable softirqs Ard Biesheuvel
2023-03-16  8:20 ` [PATCH v3 1/4] ARM: vfp: Pass thread_info pointer to vfp_support_entry Ard Biesheuvel
2023-03-16  8:20 ` [PATCH v3 2/4] ARM: vfp: Pass successful return address via register R3 Ard Biesheuvel
2023-03-16  8:20 ` [PATCH v3 3/4] ARM: vfp: Fix broken softirq handling with instrumentation enabled Ard Biesheuvel
2023-03-16  8:20 ` [PATCH v3 4/4] ARM: vfp: Reimplement VFP exception entry in C code Ard Biesheuvel
2023-03-16  8:59   ` Linus Walleij
2023-03-18 16:20     ` Ard Biesheuvel
2023-03-17  0:23 ` [PATCH v3 0/4] ARM: vfp: Switch to C API to en/disable softirqs Guenter Roeck
2023-03-17  0:24   ` Guenter Roeck [this message]
2023-03-17  8:55     ` Ard Biesheuvel

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=5c061e54-0164-18a9-c1ca-32a78706d1e4@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=ardb@kernel.org \
    --cc=arnd@arndb.de \
    --cc=frederic@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=peterz@infradead.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.