Skip to contentSkip to conversation

ARM: support THREAD_INFO_IN_TASK

GIT PULL Ard Biesheuvel 3 participants 5 messages Sep 27, 2021 – Oct 14, 2021

lore
Share & tools
lore
#0 lore raw

The following changes since commit 6880fa6c56601bb8ed59df6c30fd390cc5f6dd8f:

Linux 5.15-rc1 (2021-09-12 16:28:37 -0700)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git tags/pr-arm32-ti-in-task

for you to fetch changes up to 18ed1c01a7dd3d7c780b06a49124da237a4c1790:

ARM: smp: Enable THREAD_INFO_IN_TASK (2021-09-27 16:54:02 +0200)

----------------------------------------------------------------
ARM: support THREAD_INFO_IN_TASK

Move thread_info off the stack and into the task struct, as is done by many other architectures. This requires a method to find the task struct of the task currently running on the CPU, which is provided in this case by the user space TLS (Thread Local Storage) register. This implies that the feature is only supported on CPUs that implement this register, i.e., ARM v6k or later.

Kindly tested by Amit and reviewed by Linus. The first patch is against the GCC plugins subsystem, but was reviewed by the maintainer and can be taken through the ARM tree.

----------------------------------------------------------------

Cc Keith Packard <[email protected]>
Cc Kees Cook <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Amit Daniel Kachhap <[email protected]>
Cc Linus Walleij <[email protected]>

Ard Biesheuvel (4):
gcc-plugins: arm-ssp: Prepare for THREAD_INFO_IN_TASK support
ARM: smp: Free up the TLS register while running in the kernel
ARM: smp: Store current pointer in TPIDRURO register if available
ARM: smp: Enable THREAD_INFO_IN_TASK

Keith Packard (1):
ARM: smp: Pass task to secondary_start_kernel

 arch/arm/Kconfig                              |  8 ++++-
 arch/arm/Makefile                             |  9 ++---
 arch/arm/include/asm/assembler.h              | 29 ++++++++++++++++
 arch/arm/include/asm/current.h                | 50 +++++++++++++++++++++++++++
 arch/arm/include/asm/smp.h                    |  3 +-
 arch/arm/include/asm/stackprotector.h         |  2 --
 arch/arm/include/asm/switch_to.h              | 16 +++++++++
 arch/arm/include/asm/thread_info.h            | 15 +++++---
 arch/arm/include/asm/tls.h                    | 10 ++++--
 arch/arm/kernel/asm-offsets.c                 |  6 ++--
 arch/arm/kernel/entry-armv.S                  |  5 +++
 arch/arm/kernel/entry-common.S                |  1 +
 arch/arm/kernel/entry-header.S                |  8 +++++
 arch/arm/kernel/head-common.S                 |  5 +++
 arch/arm/kernel/head-nommu.S                  |  1 +
 arch/arm/kernel/head.S                        |  5 +--
 arch/arm/kernel/process.c                     |  8 ++---
 arch/arm/kernel/smp.c                         | 13 +++++--
 arch/arm/mm/proc-macros.S                     |  3 +-
 scripts/gcc-plugins/arm_ssp_per_task_plugin.c | 27 ++++-----------
 20 files changed, 174 insertions(+), 50 deletions(-)
 create mode 100644 arch/arm/include/asm/current.h

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#1 lore raw
Quoted 23 lines · Ard Biesheuvel

The following changes since commit 6880fa6c56601bb8ed59df6c30fd390cc5f6dd8f:

Linux 5.15-rc1 (2021-09-12 16:28:37 -0700)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git tags/pr-arm32-ti-in-task

for you to fetch changes up to 18ed1c01a7dd3d7c780b06a49124da237a4c1790:

ARM: smp: Enable THREAD_INFO_IN_TASK (2021-09-27 16:54:02 +0200)

----------------------------------------------------------------
ARM: support THREAD_INFO_IN_TASK

Move thread_info off the stack and into the task struct, as is done by many other architectures. This requires a method to find the task struct of the task currently running on the CPU, which is provided in this case by the user space TLS (Thread Local Storage) register. This implies that the feature is only supported on CPUs that implement this register, i.e., ARM v6k or later.

Quoted 6 lines

Kindly tested by Amit and reviewed by Linus. The first patch is against the GCC plugins subsystem, but was reviewed by the maintainer and can be taken through the ARM tree.

----------------------------------------------------------------

Ping?

Quoted 38 lines
Cc Keith Packard <[email protected]>
Cc Kees Cook <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Amit Daniel Kachhap <[email protected]>
Cc Linus Walleij <[email protected]>

Ard Biesheuvel (4):
gcc-plugins: arm-ssp: Prepare for THREAD_INFO_IN_TASK support
ARM: smp: Free up the TLS register while running in the kernel
ARM: smp: Store current pointer in TPIDRURO register if available
ARM: smp: Enable THREAD_INFO_IN_TASK

Keith Packard (1):
ARM: smp: Pass task to secondary_start_kernel

 arch/arm/Kconfig                              |  8 ++++-
 arch/arm/Makefile                             |  9 ++---
 arch/arm/include/asm/assembler.h              | 29 ++++++++++++++++
 arch/arm/include/asm/current.h                | 50 +++++++++++++++++++++++++++
 arch/arm/include/asm/smp.h                    |  3 +-
 arch/arm/include/asm/stackprotector.h         |  2 --
 arch/arm/include/asm/switch_to.h              | 16 +++++++++
 arch/arm/include/asm/thread_info.h            | 15 +++++---
 arch/arm/include/asm/tls.h                    | 10 ++++--
 arch/arm/kernel/asm-offsets.c                 |  6 ++--
 arch/arm/kernel/entry-armv.S                  |  5 +++
 arch/arm/kernel/entry-common.S                |  1 +
 arch/arm/kernel/entry-header.S                |  8 +++++
 arch/arm/kernel/head-common.S                 |  5 +++
 arch/arm/kernel/head-nommu.S                  |  1 +
 arch/arm/kernel/head.S                        |  5 +--
 arch/arm/kernel/process.c                     |  8 ++---
 arch/arm/kernel/smp.c                         | 13 +++++--
 arch/arm/mm/proc-macros.S                     |  3 +-
 scripts/gcc-plugins/arm_ssp_per_task_plugin.c | 27 ++++-----------
 20 files changed, 174 insertions(+), 50 deletions(-)
 create mode 100644 arch/arm/include/asm/current.h
Quoted 4 lines

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#2 lore raw
Quoted 24 lines · Ard Biesheuvel
Quoted 23 lines · Ard Biesheuvel

The following changes since commit 6880fa6c56601bb8ed59df6c30fd390cc5f6dd8f:

Linux 5.15-rc1 (2021-09-12 16:28:37 -0700)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git tags/pr-arm32-ti-in-task

for you to fetch changes up to 18ed1c01a7dd3d7c780b06a49124da237a4c1790:

ARM: smp: Enable THREAD_INFO_IN_TASK (2021-09-27 16:54:02 +0200)

----------------------------------------------------------------
ARM: support THREAD_INFO_IN_TASK

Move thread_info off the stack and into the task struct, as is done by many other architectures. This requires a method to find the task struct of the task currently running on the CPU, which is provided in this case by the user space TLS (Thread Local Storage) register. This implies that the feature is only supported on CPUs that implement this register, i.e., ARM v6k or later.

Quoted 8 lines
Quoted 6 lines

Kindly tested by Amit and reviewed by Linus. The first patch is against the GCC plugins subsystem, but was reviewed by the maintainer and can be taken through the ARM tree.

----------------------------------------------------------------

Ping?

As this is a prerequisite for the IRQ stack work and it's been Reviewed/Tested-by already, I could carry this series for -next. Maybe that would help?

-Kees

Quoted 43 lines
Quoted 43 lines
Cc Keith Packard <[email protected]>
Cc Kees Cook <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Amit Daniel Kachhap <[email protected]>
Cc Linus Walleij <[email protected]>

Ard Biesheuvel (4):
gcc-plugins: arm-ssp: Prepare for THREAD_INFO_IN_TASK support
ARM: smp: Free up the TLS register while running in the kernel
ARM: smp: Store current pointer in TPIDRURO register if available
ARM: smp: Enable THREAD_INFO_IN_TASK

Keith Packard (1):
ARM: smp: Pass task to secondary_start_kernel

 arch/arm/Kconfig                              |  8 ++++-
 arch/arm/Makefile                             |  9 ++---
 arch/arm/include/asm/assembler.h              | 29 ++++++++++++++++
 arch/arm/include/asm/current.h                | 50 +++++++++++++++++++++++++++
 arch/arm/include/asm/smp.h                    |  3 +-
 arch/arm/include/asm/stackprotector.h         |  2 --
 arch/arm/include/asm/switch_to.h              | 16 +++++++++
 arch/arm/include/asm/thread_info.h            | 15 +++++---
 arch/arm/include/asm/tls.h                    | 10 ++++--
 arch/arm/kernel/asm-offsets.c                 |  6 ++--
 arch/arm/kernel/entry-armv.S                  |  5 +++
 arch/arm/kernel/entry-common.S                |  1 +
 arch/arm/kernel/entry-header.S                |  8 +++++
 arch/arm/kernel/head-common.S                 |  5 +++
 arch/arm/kernel/head-nommu.S                  |  1 +
 arch/arm/kernel/head.S                        |  5 +--
 arch/arm/kernel/process.c                     |  8 ++---
 arch/arm/kernel/smp.c                         | 13 +++++--
 arch/arm/mm/proc-macros.S                     |  3 +-
 scripts/gcc-plugins/arm_ssp_per_task_plugin.c | 27 ++++-----------
 20 files changed, 174 insertions(+), 50 deletions(-)
 create mode 100644 arch/arm/include/asm/current.h

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Signature · 6 lines
Kees Cook

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#3 lore raw
In reply to Ard Biesheuvel
Quoted 24 lines · Ard Biesheuvel
Quoted 23 lines · Ard Biesheuvel

The following changes since commit 6880fa6c56601bb8ed59df6c30fd390cc5f6dd8f:

Linux 5.15-rc1 (2021-09-12 16:28:37 -0700)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git tags/pr-arm32-ti-in-task

for you to fetch changes up to 18ed1c01a7dd3d7c780b06a49124da237a4c1790:

ARM: smp: Enable THREAD_INFO_IN_TASK (2021-09-27 16:54:02 +0200)

----------------------------------------------------------------
ARM: support THREAD_INFO_IN_TASK

Move thread_info off the stack and into the task struct, as is done by many other architectures. This requires a method to find the task struct of the task currently running on the CPU, which is provided in this case by the user space TLS (Thread Local Storage) register. This implies that the feature is only supported on CPUs that implement this register, i.e., ARM v6k or later.

Quoted 8 lines
Quoted 6 lines

Kindly tested by Amit and reviewed by Linus. The first patch is against the GCC plugins subsystem, but was reviewed by the maintainer and can be taken through the ARM tree.

----------------------------------------------------------------

Ping?

I haven't forgotten about it, I just haven't really opened my tree for new material yet... which I need to do this week, if I have time after catching up.

Signature · 7 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#4 lore raw
Quoted 29 lines · Russell King (Oracle)
Quoted 28 lines · Ard Biesheuvel
Quoted 27 lines · Ard Biesheuvel

The following changes since commit 6880fa6c56601bb8ed59df6c30fd390cc5f6dd8f:

Linux 5.15-rc1 (2021-09-12 16:28:37 -0700)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git tags/pr-arm32-ti-in-task

for you to fetch changes up to 18ed1c01a7dd3d7c780b06a49124da237a4c1790:

ARM: smp: Enable THREAD_INFO_IN_TASK (2021-09-27 16:54:02 +0200)

----------------------------------------------------------------
ARM: support THREAD_INFO_IN_TASK

Move thread_info off the stack and into the task struct, as is done by many other architectures. This requires a method to find the task struct of the task currently running on the CPU, which is provided in this case by the user space TLS (Thread Local Storage) register. This implies that the feature is only supported on CPUs that implement this register, i.e., ARM v6k or later.

Kindly tested by Amit and reviewed by Linus. The first patch is against the GCC plugins subsystem, but was reviewed by the maintainer and can be taken through the ARM tree.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

----------------------------------------------------------------

Ping?

I haven't forgotten about it, I just haven't really opened my tree for new material yet... which I need to do this week, if I have time after catching up.

Thanks! Getting this into -next would help with the irq series and vmap stack series too.

Signature · 6 lines
Kees Cook

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel