Commit c65eacbe290b ("sched/core: Allow putting thread_info into
task_struct") mentions that, along with moving thread_info into
task_struct, the cpu field is moved out of the former into the latter,
but does not explain why.
While collaborating with Keith on adding THREAD_INFO_IN_TASK support to
ARM, we noticed that keeping CPU in task_struct is problematic for
architectures that define raw_smp_processor_id() in terms of this field,
as it requires linux/sched.h to be included, which causes a lot of pain
in terms of circular dependencies (or 'header soup', as the original
commit refers to it).
For examples of how existing architectures work around this, please
refer to patches #6 or #7. In the former case, it uses an awful
asm-offsets hack to index thread_info/current without using its type
definition. The latter approach simply keeps a copy of the task_struct
CPU field in thread_info, and keeps it in sync at context switch time.
Patch #8 reverts this latter approach for ARM, but this code is still
under review so it does not currently apply to mainline.
We also discussed introducing yet another Kconfig symbol to indicate
that the arch has THREAD_INFO_IN_TASK enabled but still prefers to keep
its CPU field in thread_info, but simply keeping it in thread_info in
all cases seems to be the cleanest approach here.
Cc: Keith Packard <redacted>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Christophe Leroy <redacted>
Cc: Paul Mackerras <redacted>
Cc: Paul Walmsley <redacted>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Christian Borntraeger <redacted>
Cc: Thomas Gleixner <redacted>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Kees Cook <redacted>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-riscv@lists.infradead.org
Cc: linux-s390@vger.kernel.org
Ard Biesheuvel (8):
arm64: add CPU field to struct thread_info
x86: add CPU field to struct thread_info
s390: add CPU field to struct thread_info
powerpc: add CPU field to struct thread_info
sched: move CPU field back into thread_info if THREAD_INFO_IN_TASK=y
powerpc: smp: remove hack to obtain offset of task_struct::cpu
riscv: rely on core code to keep thread_info::cpu updated
ARM: rely on core code to keep thread_info::cpu updated
arch/arm/include/asm/switch_to.h | 14 --------------
arch/arm/kernel/smp.c | 3 ---
arch/arm64/include/asm/thread_info.h | 1 +
arch/arm64/kernel/asm-offsets.c | 2 +-
arch/arm64/kernel/head.S | 2 +-
arch/powerpc/Makefile | 11 -----------
arch/powerpc/include/asm/smp.h | 17 +----------------
arch/powerpc/include/asm/thread_info.h | 3 +++
arch/powerpc/kernel/asm-offsets.c | 4 +---
arch/powerpc/kernel/smp.c | 2 +-
arch/riscv/kernel/asm-offsets.c | 1 -
arch/riscv/kernel/entry.S | 5 -----
arch/riscv/kernel/head.S | 1 -
arch/s390/include/asm/thread_info.h | 1 +
arch/x86/include/asm/thread_info.h | 3 +++
include/linux/sched.h | 6 +-----
kernel/sched/sched.h | 4 ----
17 files changed, 14 insertions(+), 66 deletions(-)
--
2.30.2
The CPU field will be moved back into thread_info even when
THREAD_INFO_IN_TASK is enabled, so add it back to arm64's definition of
struct thread_info.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
arch/arm64/include/asm/thread_info.h | 1 +
arch/arm64/kernel/asm-offsets.c | 1 +
2 files changed, 2 insertions(+)
The CPU field will be moved back into thread_info even when
THREAD_INFO_IN_TASK is enabled, so add it back to x86's definition of
struct thread_info.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
arch/x86/include/asm/thread_info.h | 3 +++
1 file changed, 3 insertions(+)
The CPU field will be moved back into thread_info even when
THREAD_INFO_IN_TASK is enabled, so add it back to s390's definition of
struct thread_info.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
arch/s390/include/asm/thread_info.h | 1 +
1 file changed, 1 insertion(+)
The CPU field will be moved back into thread_info even when
THREAD_INFO_IN_TASK is enabled, so add it back to powerpc's definition
of struct thread_info.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
arch/powerpc/include/asm/thread_info.h | 3 +++
1 file changed, 3 insertions(+)
THREAD_INFO_IN_TASK moved the CPU field out of thread_info, but this
causes some issues on architectures that define raw_smp_processor_id()
in terms of this field, due to the fact that #include'ing linux/sched.h
to get at struct task_struct is problematic in terms of circular
dependencies.
Given that thread_info and task_struct are the same data structure
anyway when THREAD_INFO_IN_TASK=y, let's move it back so that having
access to the type definition of struct thread_info is sufficient to
reference the CPU number of the current task.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
arch/arm64/kernel/asm-offsets.c | 1 -
arch/arm64/kernel/head.S | 2 +-
arch/powerpc/kernel/asm-offsets.c | 2 +-
arch/powerpc/kernel/smp.c | 2 +-
include/linux/sched.h | 6 +-----
kernel/sched/sched.h | 4 ----
6 files changed, 4 insertions(+), 13 deletions(-)
Instead of relying on awful hacks to obtain the offset of the cpu field
in struct task_struct, move it back into struct thread_info, which does
not create the same level of circular dependency hell when trying to
include the header file that defines it.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
arch/powerpc/Makefile | 11 -----------
arch/powerpc/include/asm/smp.h | 17 +----------------
arch/powerpc/kernel/asm-offsets.c | 2 --
3 files changed, 1 insertion(+), 29 deletions(-)
Now that the core code switched back to using thread_info::cpu to keep
a task's CPU number, we no longer need to keep it in sync explicitly. So
just drop the code that does this.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
arch/riscv/kernel/asm-offsets.c | 1 -
arch/riscv/kernel/entry.S | 5 -----
arch/riscv/kernel/head.S | 1 -
3 files changed, 7 deletions(-)
Now that the core code switched back to using thread_info::cpu to keep
a task's CPU number, we no longer need to keep it in sync explicitly. So
just drop the code that does this.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
This patch applies onto [0], which we hope to get merged for v5.16
[0] https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/log/?h=arm32-ti-in-task-v5
arch/arm/include/asm/switch_to.h | 14 --------------
arch/arm/kernel/smp.c | 3 ---
2 files changed, 17 deletions(-)
Commit c65eacbe290b ("sched/core: Allow putting thread_info into
task_struct") mentions that, along with moving thread_info into
task_struct, the cpu field is moved out of the former into the latter,
but does not explain why.
I think it does explain why (init/Kconfig): "an arch will need to remove
all thread_info fields except flags".
IIUC initially the intention with THREAD_INFO_IN_TASK was to remove
everything from thread_info, but at the end it didn't happen it seems.
While collaborating with Keith on adding THREAD_INFO_IN_TASK support to
ARM, we noticed that keeping CPU in task_struct is problematic for
architectures that define raw_smp_processor_id() in terms of this field,
as it requires linux/sched.h to be included, which causes a lot of pain
in terms of circular dependencies (or 'header soup', as the original
commit refers to it).
For examples of how existing architectures work around this, please
refer to patches #6 or #7. In the former case, it uses an awful
asm-offsets hack to index thread_info/current without using its type
definition. The latter approach simply keeps a copy of the task_struct
CPU field in thread_info, and keeps it in sync at context switch time.
It was a pain when implementing that on powerpc, so I really like your
idea, the series looks good to me.
Patch #8 reverts this latter approach for ARM, but this code is still
under review so it does not currently apply to mainline.
We also discussed introducing yet another Kconfig symbol to indicate
that the arch has THREAD_INFO_IN_TASK enabled but still prefers to keep
its CPU field in thread_info, but simply keeping it in thread_info in
all cases seems to be the cleanest approach here.
Yes, if we can avoid yet another config, that's better. We already have
so many configs that are supposed to be temporary and have lasted for
years if not decades.
Christophe
From: Mark Rutland <mark.rutland@arm.com> Date: 2021-09-14 13:55:46
On Tue, Sep 14, 2021 at 02:10:28PM +0200, Ard Biesheuvel wrote:
Commit c65eacbe290b ("sched/core: Allow putting thread_info into
task_struct") mentions that, along with moving thread_info into
task_struct, the cpu field is moved out of the former into the latter,
but does not explain why.
From what I recall of talking to Andy around that time, when converting
arm64 over, the theory was that over time we'd move more and more out of
thread_info and into task_struct or thread_struct, until task_struct
supplanted thread_info entirely, and that all became generic.
I think the key gain there was making things more *generic*, and there
are other ways we could do that in future without moving more into
task_struct (e.g. with a geenric thread_info and arch_thread_info inside
that).
With that in mind, and given the diffstat, I think this is worthwhile.
FWIW, for the series:
Acked-by: Mark Rutland <mark.rutland@arm.com>
Mark.
While collaborating with Keith on adding THREAD_INFO_IN_TASK support to
ARM, we noticed that keeping CPU in task_struct is problematic for
architectures that define raw_smp_processor_id() in terms of this field,
as it requires linux/sched.h to be included, which causes a lot of pain
in terms of circular dependencies (or 'header soup', as the original
commit refers to it).
For examples of how existing architectures work around this, please
refer to patches #6 or #7. In the former case, it uses an awful
asm-offsets hack to index thread_info/current without using its type
definition. The latter approach simply keeps a copy of the task_struct
CPU field in thread_info, and keeps it in sync at context switch time.
Patch #8 reverts this latter approach for ARM, but this code is still
under review so it does not currently apply to mainline.
We also discussed introducing yet another Kconfig symbol to indicate
that the arch has THREAD_INFO_IN_TASK enabled but still prefers to keep
its CPU field in thread_info, but simply keeping it in thread_info in
all cases seems to be the cleanest approach here.
Cc: Keith Packard <redacted>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Christophe Leroy <redacted>
Cc: Paul Mackerras <redacted>
Cc: Paul Walmsley <redacted>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Christian Borntraeger <redacted>
Cc: Thomas Gleixner <redacted>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Kees Cook <redacted>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-riscv@lists.infradead.org
Cc: linux-s390@vger.kernel.org
Ard Biesheuvel (8):
arm64: add CPU field to struct thread_info
x86: add CPU field to struct thread_info
s390: add CPU field to struct thread_info
powerpc: add CPU field to struct thread_info
sched: move CPU field back into thread_info if THREAD_INFO_IN_TASK=y
powerpc: smp: remove hack to obtain offset of task_struct::cpu
riscv: rely on core code to keep thread_info::cpu updated
ARM: rely on core code to keep thread_info::cpu updated
arch/arm/include/asm/switch_to.h | 14 --------------
arch/arm/kernel/smp.c | 3 ---
arch/arm64/include/asm/thread_info.h | 1 +
arch/arm64/kernel/asm-offsets.c | 2 +-
arch/arm64/kernel/head.S | 2 +-
arch/powerpc/Makefile | 11 -----------
arch/powerpc/include/asm/smp.h | 17 +----------------
arch/powerpc/include/asm/thread_info.h | 3 +++
arch/powerpc/kernel/asm-offsets.c | 4 +---
arch/powerpc/kernel/smp.c | 2 +-
arch/riscv/kernel/asm-offsets.c | 1 -
arch/riscv/kernel/entry.S | 5 -----
arch/riscv/kernel/head.S | 1 -
arch/s390/include/asm/thread_info.h | 1 +
arch/x86/include/asm/thread_info.h | 3 +++
include/linux/sched.h | 6 +-----
kernel/sched/sched.h | 4 ----
17 files changed, 14 insertions(+), 66 deletions(-)
--
2.30.2
On Tue, Sep 14, 2021 at 5:10 AM Ard Biesheuvel [off-list ref] wrote:
The CPU field will be moved back into thread_info even when
THREAD_INFO_IN_TASK is enabled, so add it back to arm64's definition of
struct thread_info.
The series looks sane to me, but it strikes me that it's inconsistent
- here for arm64, you make it unconditional, but for the other
architectures you end up putting it inside a #ifdef CONFIG_SMP.
Was there some reason for this odd behavior?
Linus
On Tue, 14 Sept 2021 at 17:41, Linus Torvalds
[off-list ref] wrote:
On Tue, Sep 14, 2021 at 5:10 AM Ard Biesheuvel [off-list ref] wrote:
quoted
The CPU field will be moved back into thread_info even when
THREAD_INFO_IN_TASK is enabled, so add it back to arm64's definition of
struct thread_info.
The series looks sane to me, but it strikes me that it's inconsistent
- here for arm64, you make it unconditional, but for the other
architectures you end up putting it inside a #ifdef CONFIG_SMP.
Was there some reason for this odd behavior?
Those two lines look different, but aren't.
Please just remove the CONFIG_THREAD_INFO_IN_TASK conditional, and use
return READ_ONCE(task_thread_info(p)->cpu);
unconditionally, which now does the right thing regardless.
Linus
Those two lines look different, but aren't.
Please just remove the CONFIG_THREAD_INFO_IN_TASK conditional, and use
return READ_ONCE(task_thread_info(p)->cpu);
unconditionally, which now does the right thing regardless.
Unfortunately not.
task_cpu() takes a 'const struct task_struct *', whereas
task_thread_info() takes a 'struct task_struct *'.
Since task_thread_info()-><foo> is widely used as an lvalue, I would
need to update task_cpu()'s prototype and fix up all the callers, some
of which take the const flavor themselves. Or introduce
'const_task_thread_info()' which takes the const flavor, and cannot be
used to instantiate lvalues.
Suggestions welcome, but this is the cleanest I could come up with.
On Tue, Sep 14, 2021 at 8:53 AM Ard Biesheuvel [off-list ref] wrote:
task_cpu() takes a 'const struct task_struct *', whereas
task_thread_info() takes a 'struct task_struct *'.
Oh, annoying, but that's easily fixed. Just make that
static inline struct thread_info *task_thread_info(struct
task_struct *task) ..
be a simple
#define task_thread_info(tsk) (&(tsk)->thread_info)
instead. That actually then matches the !THREAD_INFO_IN_TASK case anyway.
Make the commit comment be about how that fixes the type problem.
Because while in many cases inline functions are superior to macros,
it clearly isn't the case in this case.
Linus
On Tue, 14 Sept 2021 at 17:59, Linus Torvalds
[off-list ref] wrote:
On Tue, Sep 14, 2021 at 8:53 AM Ard Biesheuvel [off-list ref] wrote:
quoted
task_cpu() takes a 'const struct task_struct *', whereas
task_thread_info() takes a 'struct task_struct *'.
Oh, annoying, but that's easily fixed. Just make that
static inline struct thread_info *task_thread_info(struct
task_struct *task) ..
be a simple
#define task_thread_info(tsk) (&(tsk)->thread_info)
instead. That actually then matches the !THREAD_INFO_IN_TASK case anyway.
Make the commit comment be about how that fixes the type problem.
Because while in many cases inline functions are superior to macros,
it clearly isn't the case in this case.
On Tue, Sep 14, 2021 at 02:10:29PM +0200, Ard Biesheuvel wrote:
The CPU field will be moved back into thread_info even when
THREAD_INFO_IN_TASK is enabled, so add it back to arm64's definition of
struct thread_info.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
On Thu, 16 Sept 2021 at 16:41, Catalin Marinas [off-list ref] wrote:
On Tue, Sep 14, 2021 at 02:10:29PM +0200, Ard Biesheuvel wrote:
quoted
The CPU field will be moved back into thread_info even when
THREAD_INFO_IN_TASK is enabled, so add it back to arm64's definition of
struct thread_info.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
On Tue, 14 Sept 2021 at 15:55, Mark Rutland [off-list ref] wrote:
On Tue, Sep 14, 2021 at 02:10:28PM +0200, Ard Biesheuvel wrote:
quoted
Commit c65eacbe290b ("sched/core: Allow putting thread_info into
task_struct") mentions that, along with moving thread_info into
task_struct, the cpu field is moved out of the former into the latter,
but does not explain why.
From what I recall of talking to Andy around that time, when converting
arm64 over, the theory was that over time we'd move more and more out of
thread_info and into task_struct or thread_struct, until task_struct
supplanted thread_info entirely, and that all became generic.
I think the key gain there was making things more *generic*, and there
are other ways we could do that in future without moving more into
task_struct (e.g. with a geenric thread_info and arch_thread_info inside
that).
With that in mind, and given the diffstat, I think this is worthwhile.
FWIW, for the series:
Acked-by: Mark Rutland <mark.rutland@arm.com>
Thanks.
Any comments on this from the various arch maintainers? Especially
power, as Christophe seems happy with this but there are 3 different
patches affecting power that need a maintainer ack.
On Tue, Sep 14, 2021 at 02:10:30PM +0200, Ard Biesheuvel wrote:
quoted hunk
The CPU field will be moved back into thread_info even when
THREAD_INFO_IN_TASK is enabled, so add it back to x86's definition of
struct thread_info.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
arch/x86/include/asm/thread_info.h | 3 +++
1 file changed, 3 insertions(+)
On Tue, Sep 14, 2021 at 02:10:33PM +0200, Ard Biesheuvel wrote:
THREAD_INFO_IN_TASK moved the CPU field out of thread_info, but this
causes some issues on architectures that define raw_smp_processor_id()
in terms of this field, due to the fact that #include'ing linux/sched.h
to get at struct task_struct is problematic in terms of circular
dependencies.
Given that thread_info and task_struct are the same data structure
anyway when THREAD_INFO_IN_TASK=y, let's move it back so that having
access to the type definition of struct thread_info is sufficient to
reference the CPU number of the current task.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
On Tue, 14 Sept 2021 at 14:11, Ard Biesheuvel [off-list ref] wrote:
The CPU field will be moved back into thread_info even when
THREAD_INFO_IN_TASK is enabled, so add it back to powerpc's definition
of struct thread_info.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Michael,
Do you have any objections or issues with this patch or the subsequent
ones cleaning up the task CPU kludge for ppc32? Christophe indicated
that he was happy with it.
Thanks,
Ard.
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2021-09-27 23:13:32
Ard Biesheuvel [off-list ref] writes:
On Tue, 14 Sept 2021 at 14:11, Ard Biesheuvel [off-list ref] wrote:
quoted
The CPU field will be moved back into thread_info even when
THREAD_INFO_IN_TASK is enabled, so add it back to powerpc's definition
of struct thread_info.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Michael,
Do you have any objections or issues with this patch or the subsequent
ones cleaning up the task CPU kludge for ppc32? Christophe indicated
that he was happy with it.
No objections, it looks good to me, thanks for cleaning up that horror :)
It didn't apply cleanly to master so I haven't tested it at all, if you can point me at a
git tree with the dependencies I'd be happy to run some tests over it.
cheers
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2021-09-28 00:16:21
Michael Ellerman [off-list ref] writes:
Ard Biesheuvel [off-list ref] writes:
quoted
On Tue, 14 Sept 2021 at 14:11, Ard Biesheuvel [off-list ref] wrote:
quoted
The CPU field will be moved back into thread_info even when
THREAD_INFO_IN_TASK is enabled, so add it back to powerpc's definition
of struct thread_info.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Michael,
Do you have any objections or issues with this patch or the subsequent
ones cleaning up the task CPU kludge for ppc32? Christophe indicated
that he was happy with it.
No objections, it looks good to me, thanks for cleaning up that horror :)
It didn't apply cleanly to master so I haven't tested it at all, if you can point me at a
git tree with the dependencies I'd be happy to run some tests over it.
Actually I realised I can just drop the last patch.
So that looks fine, passes my standard quick build & boot on qemu tests,
and builds with/without stack protector enabled.
cheers
On Tue, 28 Sept 2021 at 02:16, Michael Ellerman [off-list ref] wrote:
Michael Ellerman [off-list ref] writes:
quoted
Ard Biesheuvel [off-list ref] writes:
quoted
On Tue, 14 Sept 2021 at 14:11, Ard Biesheuvel [off-list ref] wrote:
quoted
The CPU field will be moved back into thread_info even when
THREAD_INFO_IN_TASK is enabled, so add it back to powerpc's definition
of struct thread_info.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Michael,
Do you have any objections or issues with this patch or the subsequent
ones cleaning up the task CPU kludge for ppc32? Christophe indicated
that he was happy with it.
No objections, it looks good to me, thanks for cleaning up that horror :)
It didn't apply cleanly to master so I haven't tested it at all, if you can point me at a
git tree with the dependencies I'd be happy to run some tests over it.
Actually I realised I can just drop the last patch.
So that looks fine, passes my standard quick build & boot on qemu tests,
and builds with/without stack protector enabled.
Thanks.
Do you have any opinion on how this series should be merged? Kees Cook
is willing to take them via his cross-arch tree, or you could carry
them if you prefer. Taking it via multiple trees at the same time is
going to be tricky, or take two cycles, with I'd prefer to avoid.
--
Ard.
On Tue, 14 Sept 2021 at 14:11, Ard Biesheuvel [off-list ref] wrote:
The CPU field will be moved back into thread_info even when
THREAD_INFO_IN_TASK is enabled, so add it back to s390's definition of
struct thread_info.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
arch/s390/include/asm/thread_info.h | 1 +
1 file changed, 1 insertion(+)
Heiko, Christian, Vasily,
Do you have any objections to this change? If you don't, could you
please ack it so it can be taken through another tree (or if that is
problematic for you, could you please propose another way of merging
these changes?)
Thanks,
Ard.
On Tue, 14 Sep 2021 05:10:35 PDT (-0700), ardb@kernel.org wrote:
quoted hunk
Now that the core code switched back to using thread_info::cpu to keep
a task's CPU number, we no longer need to keep it in sync explicitly. So
just drop the code that does this.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
arch/riscv/kernel/asm-offsets.c | 1 -
arch/riscv/kernel/entry.S | 5 -----
arch/riscv/kernel/head.S | 1 -
3 files changed, 7 deletions(-)
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2021-09-29 22:46:19
Ard Biesheuvel [off-list ref] writes:
On Tue, 28 Sept 2021 at 02:16, Michael Ellerman [off-list ref] wrote:
quoted
Michael Ellerman [off-list ref] writes:
quoted
Ard Biesheuvel [off-list ref] writes:
quoted
On Tue, 14 Sept 2021 at 14:11, Ard Biesheuvel [off-list ref] wrote:
quoted
The CPU field will be moved back into thread_info even when
THREAD_INFO_IN_TASK is enabled, so add it back to powerpc's definition
of struct thread_info.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Michael,
Do you have any objections or issues with this patch or the subsequent
ones cleaning up the task CPU kludge for ppc32? Christophe indicated
that he was happy with it.
No objections, it looks good to me, thanks for cleaning up that horror :)
It didn't apply cleanly to master so I haven't tested it at all, if you can point me at a
git tree with the dependencies I'd be happy to run some tests over it.
Actually I realised I can just drop the last patch.
So that looks fine, passes my standard quick build & boot on qemu tests,
and builds with/without stack protector enabled.
Thanks.
Do you have any opinion on how this series should be merged? Kees Cook
is willing to take them via his cross-arch tree, or you could carry
them if you prefer. Taking it via multiple trees at the same time is
going to be tricky, or take two cycles, with I'd prefer to avoid.
I don't really mind. If Kees is happy to take it then that's OK by me.
If Kees put the series in a topic branch based off rc2 then I could
merge that, and avoid any conflicts.
cheers
On Thu, Sep 30, 2021 at 08:46:04AM +1000, Michael Ellerman wrote:
Ard Biesheuvel [off-list ref] writes:
quoted
On Tue, 28 Sept 2021 at 02:16, Michael Ellerman [off-list ref] wrote:
quoted
Michael Ellerman [off-list ref] writes:
quoted
Ard Biesheuvel [off-list ref] writes:
quoted
On Tue, 14 Sept 2021 at 14:11, Ard Biesheuvel [off-list ref] wrote:
quoted
The CPU field will be moved back into thread_info even when
THREAD_INFO_IN_TASK is enabled, so add it back to powerpc's definition
of struct thread_info.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Michael,
Do you have any objections or issues with this patch or the subsequent
ones cleaning up the task CPU kludge for ppc32? Christophe indicated
that he was happy with it.
No objections, it looks good to me, thanks for cleaning up that horror :)
It didn't apply cleanly to master so I haven't tested it at all, if you can point me at a
git tree with the dependencies I'd be happy to run some tests over it.
Actually I realised I can just drop the last patch.
So that looks fine, passes my standard quick build & boot on qemu tests,
and builds with/without stack protector enabled.
Thanks.
Do you have any opinion on how this series should be merged? Kees Cook
is willing to take them via his cross-arch tree, or you could carry
them if you prefer. Taking it via multiple trees at the same time is
going to be tricky, or take two cycles, with I'd prefer to avoid.
I don't really mind. If Kees is happy to take it then that's OK by me.
If Kees put the series in a topic branch based off rc2 then I could
merge that, and avoid any conflicts.
If that helps, yeah, I can make a separate stable branch. Thanks!
-Kees
--
Kees Cook
On Thu, Sep 30, 2021 at 08:46:04AM +1000, Michael Ellerman wrote:
Ard Biesheuvel [off-list ref] writes:
quoted
On Tue, 28 Sept 2021 at 02:16, Michael Ellerman [off-list ref] wrote:
quoted
Michael Ellerman [off-list ref] writes:
quoted
Ard Biesheuvel [off-list ref] writes:
quoted
On Tue, 14 Sept 2021 at 14:11, Ard Biesheuvel [off-list ref] wrote:
quoted
The CPU field will be moved back into thread_info even when
THREAD_INFO_IN_TASK is enabled, so add it back to powerpc's definition
of struct thread_info.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Michael,
Do you have any objections or issues with this patch or the subsequent
ones cleaning up the task CPU kludge for ppc32? Christophe indicated
that he was happy with it.
No objections, it looks good to me, thanks for cleaning up that horror :)
It didn't apply cleanly to master so I haven't tested it at all, if you can point me at a
git tree with the dependencies I'd be happy to run some tests over it.
Actually I realised I can just drop the last patch.
So that looks fine, passes my standard quick build & boot on qemu tests,
and builds with/without stack protector enabled.
Thanks.
Do you have any opinion on how this series should be merged? Kees Cook
is willing to take them via his cross-arch tree, or you could carry
them if you prefer. Taking it via multiple trees at the same time is
going to be tricky, or take two cycles, with I'd prefer to avoid.
I don't really mind. If Kees is happy to take it then that's OK by me.
If Kees put the series in a topic branch based off rc2 then I could
merge that, and avoid any conflicts.
I've created:
git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/thread_info/cpu
it includes a --no-ff merge commit, which I'm not sure is desirable? Let
me know if I should adjust this, or if Linus will yell about this if I
send him a PR containing a merge commit? I'm not sure what's right here.
Thanks!
--
Kees Cook
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2021-10-05 01:55:51
Kees Cook [off-list ref] writes:
On Thu, Sep 30, 2021 at 08:46:04AM +1000, Michael Ellerman wrote:
quoted
Ard Biesheuvel [off-list ref] writes:
quoted
On Tue, 28 Sept 2021 at 02:16, Michael Ellerman [off-list ref] wrote:
quoted
Michael Ellerman [off-list ref] writes:
quoted
Ard Biesheuvel [off-list ref] writes:
quoted
On Tue, 14 Sept 2021 at 14:11, Ard Biesheuvel [off-list ref] wrote:
quoted
The CPU field will be moved back into thread_info even when
THREAD_INFO_IN_TASK is enabled, so add it back to powerpc's definition
of struct thread_info.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Michael,
Do you have any objections or issues with this patch or the subsequent
ones cleaning up the task CPU kludge for ppc32? Christophe indicated
that he was happy with it.
No objections, it looks good to me, thanks for cleaning up that horror :)
It didn't apply cleanly to master so I haven't tested it at all, if you can point me at a
git tree with the dependencies I'd be happy to run some tests over it.
Actually I realised I can just drop the last patch.
So that looks fine, passes my standard quick build & boot on qemu tests,
and builds with/without stack protector enabled.
Thanks.
Do you have any opinion on how this series should be merged? Kees Cook
is willing to take them via his cross-arch tree, or you could carry
them if you prefer. Taking it via multiple trees at the same time is
going to be tricky, or take two cycles, with I'd prefer to avoid.
I don't really mind. If Kees is happy to take it then that's OK by me.
If Kees put the series in a topic branch based off rc2 then I could
merge that, and avoid any conflicts.
I've created:
git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/thread_info/cpu
it includes a --no-ff merge commit, which I'm not sure is desirable? Let
me know if I should adjust this, or if Linus will yell about this if I
send him a PR containing a merge commit? I'm not sure what's right here.
It looks good to me.
I don't think Linus will be bothered about that merge. It has useful
information, ie. explains why you're merging it and that arch
maintainers have acked it, and quotes Ard's cover letter.
cheers