Re: [patch 17/17] x86/fpu: Move FPU initialization into arch_cpu_finalize_init()

2023-06-13 Thread Chang S. Bae
On 6/13/2023 4:39 PM, Thomas Gleixner wrote: @@ -2396,6 +2393,13 @@ void __init arch_cpu_finalize_init(void) '0' + (boot_cpu_data.x86 > 6 ? 6 : boot_cpu_data.x86); } + /* +* Must be before alternatives because it might set or clear +*

[PATCH v3] uml: Replace strlcpy with strscpy

2023-06-13 Thread Azeem Shaikh
strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No

[patch 17/17] x86/fpu: Move FPU initialization into arch_cpu_finalize_init()

2023-06-13 Thread Thomas Gleixner
Initializing the FPU during the early boot process is a pointless exercise. Early boot is convoluted and fragile enough. Nothing requires that the FPU is set up early. It has to be initialized before fork_init() because the task_struct size depends on the FPU register buffer size. Move the

[patch 13/17] init, x86: Move mem_encrypt_init() into arch_cpu_finalize_init()

2023-06-13 Thread Thomas Gleixner
Invoke the X86ism mem_encrypt_init() from X86 arch_cpu_finalize_init() and remove the weak fallback from the core code. No functional change. Signed-off-by: Thomas Gleixner Cc: Tom Lendacky --- arch/x86/include/asm/mem_encrypt.h |7 --- arch/x86/kernel/cpu/common.c | 11

[patch 16/17] x86/fpu: Mark init functions __init

2023-06-13 Thread Thomas Gleixner
No point in keeping them around. Signed-off-by: Thomas Gleixner --- arch/x86/kernel/fpu/init.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/arch/x86/kernel/fpu/init.c +++ b/arch/x86/kernel/fpu/init.c @@ -53,7 +53,7 @@ void fpu__init_cpu(void)

[patch 12/17] init: Invoke arch_cpu_finalize_init() earlier

2023-06-13 Thread Thomas Gleixner
X86 is reworking the boot process so that initializations which are not required during early boot can be moved into the late boot process and out of the fragile and restricted initial boot phase. arch_cpu_finalize_init() is the obvious place to do such initializations, but

[patch 10/17] um/cpu: Switch to arch_cpu_finalize_init()

2023-06-13 Thread Thomas Gleixner
check_bugs() is about to be phased out. Switch over to the new arch_cpu_finalize_init() implementation. No functional change. Signed-off-by: Thomas Gleixner Cc: Richard Weinberger Cc: Anton Ivanov Cc: Johannes Berg Cc: linux-um@lists.infradead.org --- arch/um/Kconfig|1 +

[patch 15/17] x86/fpu: Remove cpuinfo argument from init functions

2023-06-13 Thread Thomas Gleixner
Nothing in the call chain requires it Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/fpu/api.h |2 +- arch/x86/kernel/cpu/common.c |2 +- arch/x86/kernel/fpu/init.c |6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) --- a/arch/x86/include/asm/fpu/api.h +++

[patch 14/17] x86/init: Initialize signal frame size late

2023-06-13 Thread Thomas Gleixner
No point in doing this during really early boot. Move it to an early initcall so that it is set up before possible user mode helpers are started during device initialization. Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/sigframe.h |2 -- arch/x86/kernel/cpu/common.c|3 ---

[patch 11/17] init: Remove check_bugs() leftovers

2023-06-13 Thread Thomas Gleixner
Everything is converted over to arch_cpu_finalize_init(). Remove the check_bugs() leftovers including the empty stubs in asm-generic, alpha, parisc, powerpc and xtensa. Signed-off-by: Thomas Gleixner Cc: Richard Henderson Cc: "James E.J. Bottomley" Cc: Michael Ellerman Cc: Chris Zankel ---

[patch 08/17] sh/cpu: Switch to arch_cpu_finalize_init()

2023-06-13 Thread Thomas Gleixner
check_bugs() is about to be phased out. Switch over to the new arch_cpu_finalize_init() implementation. No functional change. Signed-off-by: Thomas Gleixner Cc: Yoshinori Sato Cc: Rich Felker Cc: John Paul Adrian Glaubitz Cc: linux...@vger.kernel.org --- arch/sh/Kconfig |

[patch 07/17] mips/cpu: Switch to arch_cpu_finalize_init()

2023-06-13 Thread Thomas Gleixner
check_bugs() is about to be phased out. Switch over to the new arch_cpu_finalize_init() implementation. No functional change. Signed-off-by: Thomas Gleixner Cc: Thomas Bogendoerfer Cc: linux-m...@vger.kernel.org --- arch/mips/Kconfig|1 + arch/mips/include/asm/bugs.h | 17

[patch 09/17] sparc/cpu: Switch to arch_cpu_finalize_init()

2023-06-13 Thread Thomas Gleixner
check_bugs() is about to be phased out. Switch over to the new arch_cpu_finalize_init() implementation. No functional change. Signed-off-by: Thomas Gleixner Cc: "David S. Miller" Cc: sparcli...@vger.kernel.org --- arch/sparc/Kconfig|1 + arch/sparc/include/asm/bugs.h | 18

[patch 06/17] m68k/cpu: Switch to arch_cpu_finalize_init()

2023-06-13 Thread Thomas Gleixner
check_bugs() is about to be phased out. Switch over to the new arch_cpu_finalize_init() implementation. No functional change. Signed-off-by: Thomas Gleixner Cc: Geert Uytterhoeven Cc: linux-m...@lists.linux-m68k.org --- arch/m68k/Kconfig|1 + arch/m68k/include/asm/bugs.h |

[patch 05/17] loongarch/cpu: Switch to arch_cpu_finalize_init()

2023-06-13 Thread Thomas Gleixner
check_bugs() is about to be phased out. Switch over to the new arch_cpu_finalize_init() implementation. No functional change. Signed-off-by: Thomas Gleixner Cc: Huacai Chen Cc: WANG Xuerui Cc: loonga...@lists.linux.dev --- arch/loongarch/Kconfig|1 +

[patch 04/17] ia64/cpu: Switch to arch_cpu_finalize_init()

2023-06-13 Thread Thomas Gleixner
check_bugs() is about to be phased out. Switch over to the new arch_cpu_finalize_init() implementation. No functional change. Signed-off-by: Thomas Gleixner Cc: linux-i...@vger.kernel.org --- arch/ia64/Kconfig|1 + arch/ia64/include/asm/bugs.h | 20

[patch 02/17] x86/cpu: Switch to arch_cpu_finalize_init()

2023-06-13 Thread Thomas Gleixner
check_bugs() is a dump ground for finalizing the CPU bringup. Only parts of it has to do with actual CPU bugs. Split it apart into arch_cpu_finalize_init() and cpu_select_mitigations(). Fixup the bogus 32bit comments while at it. No functional change. Signed-off-by: Thomas Gleixner ---

[patch 00/17] init, treewide, x86: Cleanup check_bugs() and start sanitizing the x86 boot process

2023-06-13 Thread Thomas Gleixner
Hi! My team and myself are working on sanitizing the x86 boot process, especially the complete horror show of CPUID evaluation, which is constructed with hay-wire circuits, duct tape and superglue. A related goal is to move the initialization of infrastructure which is not required during early

[patch 01/17] init: Provide arch_cpu_finalize_init()

2023-06-13 Thread Thomas Gleixner
check_bugs() has become a dump ground for all sorts of activities to finalize the CPU initialization before running the rest of the init code. Most are empty, a few do actual bug checks, some do alternative patching and some cobble a CPU advertisment string together Aside of that the current

[patch 03/17] ARM: cpu: Switch to arch_cpu_finalize_init()

2023-06-13 Thread Thomas Gleixner
check_bugs() is about to be phased out. Switch over to the new arch_cpu_finalize_init() implementation. No functional change. Signed-off-by: Thomas Gleixner Cc: Russell King Cc: Arnd Bergmann Cc: linux-arm-ker...@lists.infradead.org --- arch/arm/Kconfig|1 +

Re: [PATCH v4 27/34] nios2: Convert __pte_free_tlb() to use ptdescs

2023-06-13 Thread Dinh Nguyen
On 6/12/23 16:04, Vishal Moola (Oracle) wrote: Part of the conversions to replace pgtable constructor/destructors with ptdesc equivalents. Signed-off-by: Vishal Moola (Oracle) --- arch/nios2/include/asm/pgalloc.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

Re: [PATCH v9 01/42] mm: Rename arch pte_mkwrite()'s to pte_mkwrite_novma()

2023-06-13 Thread Edgecombe, Rick P
On Tue, 2023-06-13 at 09:19 +0200, Geert Uytterhoeven wrote: > Acked-by: Geert Uytterhoeven Thanks! ___ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um

Re: [PATCH v9 01/42] mm: Rename arch pte_mkwrite()'s to pte_mkwrite_novma()

2023-06-13 Thread Edgecombe, Rick P
On Tue, 2023-06-13 at 10:43 +0300, Mike Rapoport wrote: > On Mon, Jun 12, 2023 at 05:10:27PM -0700, Rick Edgecombe wrote: > > The x86 Shadow stack feature includes a new type of memory called > > shadow > > stack. This shadow stack memory has some unusual properties, which > > requires > > some

Re: [PATCH v9 01/42] mm: Rename arch pte_mkwrite()'s to pte_mkwrite_novma()

2023-06-13 Thread Edgecombe, Rick P
On Tue, 2023-06-13 at 14:26 +0200, David Hildenbrand wrote: > > Acked-by: David Hildenbrand Thanks! ___ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um

Re: [PATCH v9 01/42] mm: Rename arch pte_mkwrite()'s to pte_mkwrite_novma()

2023-06-13 Thread David Hildenbrand
On 13.06.23 02:10, Rick Edgecombe wrote: The x86 Shadow stack feature includes a new type of memory called shadow stack. This shadow stack memory has some unusual properties, which requires some core mm changes to function properly. One of these unusual properties is that shadow stack memory is

Re: [PATCH v9 01/42] mm: Rename arch pte_mkwrite()'s to pte_mkwrite_novma()

2023-06-13 Thread Mike Rapoport
On Mon, Jun 12, 2023 at 05:10:27PM -0700, Rick Edgecombe wrote: > The x86 Shadow stack feature includes a new type of memory called shadow > stack. This shadow stack memory has some unusual properties, which requires > some core mm changes to function properly. > > One of these unusual properties

Re: [PATCH v4 25/34] m68k: Convert various functions to use ptdescs

2023-06-13 Thread Geert Uytterhoeven
On Mon, Jun 12, 2023 at 11:05 PM Vishal Moola (Oracle) wrote: > As part of the conversions to replace pgtable constructor/destructors with > ptdesc equivalents, convert various page table functions to use ptdescs. > > Some of the functions use the *get*page*() helper functions. Convert > these to

Re: [PATCH v9 01/42] mm: Rename arch pte_mkwrite()'s to pte_mkwrite_novma()

2023-06-13 Thread Geert Uytterhoeven
On Tue, Jun 13, 2023 at 2:13 AM Rick Edgecombe wrote: > The x86 Shadow stack feature includes a new type of memory called shadow > stack. This shadow stack memory has some unusual properties, which requires > some core mm changes to function properly. > > One of these unusual properties is that