[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87pmtkav4q.fsf@keithp.com>
Date: Tue, 07 Sep 2021 15:17:09 -0700
From: Keith Packard <keithp@...thp.com>
To: Ard Biesheuvel <ardb@...nel.org>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Abbott Liu <liuwenliang@...wei.com>,
Alexander Sverdlin <alexander.sverdlin@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Anshuman Khandual <anshuman.khandual@....com>,
Arnd Bergmann <arnd@...db.de>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Florian Fainelli <f.fainelli@...il.com>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Hartley Sweeten <hsweeten@...ionengravers.com>,
Jens Axboe <axboe@...nel.dk>, Jian Cai <jiancai@...gle.com>,
Joe Perches <joe@...ches.com>,
Kees Cook <keescook@...omium.org>,
Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>,
Linus Walleij <linus.walleij@...aro.org>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
Manivannan Sadhasivam <mani@...nel.org>,
Marc Zyngier <maz@...nel.org>,
Masahiro Yamada <masahiroy@...nel.org>,
Miguel Ojeda <ojeda@...nel.org>,
Mike Rapoport <rppt@...nel.org>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Nicolas Pitre <nico@...xnic.net>,
Rob Herring <robh@...nel.org>,
Russell King <linux@...linux.org.uk>,
Thomas Gleixner <tglx@...utronix.de>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>,
Valentin Schneider <valentin.schneider@....com>,
Viresh Kumar <viresh.kumar@...aro.org>,
"Wolfram Sang (Renesas)" <wsa+renesas@...g-engineering.com>,
YiFei Zhu <yifeifz2@...inois.edu>
Subject: Re: [PATCH 2/3] ARM: Move thread_info into task_struct (v7 only)
Ard Biesheuvel <ardb@...nel.org> writes:
> That is still a bit tricky, given that you now have to swap out the
> per-CPU offset when you migrate a task, and the generic code is not
> really set up for that.
Yeah, I decided to just leverage as much generic code as possible and
re-purposed the TPIDRPRW register for 'current', leaving the
per_cpu_offset data in memory. That makes the patch series pretty
compact, with a bunch of restructuring changes followed by fairly short
functional changes.
> I had a stab at this myself today (long boring day with no Internet connection).
>
> https://android-kvm.googlesource.com/linux/+log/refs/heads/ardb/arm32-ti-in-task
>
> It resembles your code in some places - I suppose we went on the same
> journey in a sense :-) We'll fix up the credits before this gets
> resubmitted.
This does look great, and preserves the optimization of keeping the
per_cpu_offset value in a register.
With the series I posted, getting the per_cpu_offset value requires
fetching the cpu value from task_struct and then using that to index the
per_cpu_offset arrray. I don't have a good feeling of how important this
optimization is? We could stick the per_cpu_offset value into
thread_info to avoid one fetch?
> Fixing the per-task stack protector plugin on top of these changes
> should be trivial but I need a coffee first.
I haven't even looked at that step yet :-)
--
-keith
Download attachment "signature.asc" of type "application/pgp-signature" (833 bytes)
Powered by blists - more mailing lists