<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/init/main.c, branch v6.12</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.12</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.12'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2024-08-20T18:05:33Z</updated>
<entry>
<title>init/main.c: Initialize early LSMs after arch code, static keys and calls.</title>
<updated>2024-08-20T18:05:33Z</updated>
<author>
<name>KP Singh</name>
<email>kpsingh@kernel.org</email>
</author>
<published>2024-08-16T15:43:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=77b644c39d6afc0b2985807c74d95335931f6403'/>
<id>urn:sha1:77b644c39d6afc0b2985807c74d95335931f6403</id>
<content type='text'>
With LSMs using static calls and static keys, early_lsm_init needs to
wait for setup_arch for architecture specific functionality which
includes jump tables and static calls to be initialized.

Since not all architectures call jump_table_init in setup_arch,
explicitly call both jump_table_init and static_call_init before
early_security_init.

This only affects "early LSMs" i.e. only lockdown when
CONFIG_SECURITY_LOCKDOWN_LSM_EARLY is set.

Tested-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: KP Singh &lt;kpsingh@kernel.org&gt;
Signed-off-by: Paul Moore &lt;paul@paul-moore.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'mm-nonmm-stable-2024-05-19-11-56' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm</title>
<updated>2024-05-19T21:02:03Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2024-05-19T21:02:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=eb6a9339efeb6f3d2b5c86fdf2382cdc293eca2c'/>
<id>urn:sha1:eb6a9339efeb6f3d2b5c86fdf2382cdc293eca2c</id>
<content type='text'>
Pull non-mm updates from Andrew Morton:
 "Mainly singleton patches, documented in their respective changelogs.
  Notable series include:

   - Some maintenance and performance work for ocfs2 in Heming Zhao's
     series "improve write IO performance when fragmentation is high".

   - Some ocfs2 bugfixes from Su Yue in the series "ocfs2 bugs fixes
     exposed by fstests".

   - kfifo header rework from Andy Shevchenko in the series "kfifo:
     Clean up kfifo.h".

   - GDB script fixes from Florian Rommel in the series "scripts/gdb:
     Fixes for $lx_current and $lx_per_cpu".

   - After much discussion, a coding-style update from Barry Song
     explaining one reason why inline functions are preferred over
     macros. The series is "codingstyle: avoid unused parameters for a
     function-like macro""

* tag 'mm-nonmm-stable-2024-05-19-11-56' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (62 commits)
  fs/proc: fix softlockup in __read_vmcore
  nilfs2: convert BUG_ON() in nilfs_finish_roll_forward() to WARN_ON()
  scripts: checkpatch: check unused parameters for function-like macro
  Documentation: coding-style: ask function-like macros to evaluate parameters
  nilfs2: use __field_struct() for a bitwise field
  selftests/kcmp: remove unused open mode
  nilfs2: remove calls to folio_set_error() and folio_clear_error()
  kernel/watchdog_perf.c: tidy up kerneldoc
  watchdog: allow nmi watchdog to use raw perf event
  watchdog: handle comma separated nmi_watchdog command line
  nilfs2: make superblock data array index computation sparse friendly
  squashfs: remove calls to set the folio error flag
  squashfs: convert squashfs_symlink_read_folio to use folio APIs
  scripts/gdb: fix detection of current CPU in KGDB
  scripts/gdb: make get_thread_info accept pointers
  scripts/gdb: fix parameter handling in $lx_per_cpu
  scripts/gdb: fix failing KGDB detection during probe
  kfifo: don't use "proxy" headers
  media: stih-cec: add missing io.h
  media: rc: add missing io.h
  ...
</content>
</entry>
<entry>
<title>Merge tag 'bootconfig-v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace</title>
<updated>2024-05-18T01:23:55Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2024-05-18T01:23:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e9d682518076b38ae76f9fe45ba4fa9e324274f7'/>
<id>urn:sha1:e9d682518076b38ae76f9fe45ba4fa9e324274f7</id>
<content type='text'>
Pull bootconfig updates from Masami Hiramatsu:

 - Do not put unneeded quotes on the extra command line items which was
   inserted from the bootconfig.

 - Remove redundant spaces from the extra command line.

* tag 'bootconfig-v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
  init/main.c: Minor cleanup for the setup_command_line() function
  init/main.c: Remove redundant space from saved_command_line
  bootconfig: do not put quotes on cmdline items unless necessary
</content>
</entry>
<entry>
<title>Merge tag 'locking-core-2024-05-13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2024-05-14T00:01:28Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2024-05-14T00:01:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=48fc82c40bc29a80361b1eab0e4a9494628a7144'/>
<id>urn:sha1:48fc82c40bc29a80361b1eab0e4a9494628a7144</id>
<content type='text'>
Pull locking updates from Ingo Molnar:

 - Over a dozen code generation micro-optimizations for the atomic
   and spinlock code

 - Add more __ro_after_init attributes

 - Robustify the lockdevent_*() macros

* tag 'locking-core-2024-05-13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  locking/pvqspinlock/x86: Use _Q_LOCKED_VAL in PV_UNLOCK_ASM macro
  locking/qspinlock/x86: Micro-optimize virt_spin_lock()
  locking/atomic/x86: Merge __arch{,_try}_cmpxchg64_emu_local() with __arch{,_try}_cmpxchg64_emu()
  locking/atomic/x86: Introduce arch_try_cmpxchg64_local()
  locking/pvqspinlock/x86: Remove redundant CMP after CMPXCHG in __raw_callee_save___pv_queued_spin_unlock()
  locking/pvqspinlock: Use try_cmpxchg() in qspinlock_paravirt.h
  locking/pvqspinlock: Use try_cmpxchg_acquire() in trylock_clear_pending()
  locking/qspinlock: Use atomic_try_cmpxchg_relaxed() in xchg_tail()
  locking/atomic/x86: Define arch_atomic_sub() family using arch_atomic_add() functions
  locking/atomic/x86: Rewrite x86_32 arch_atomic64_{,fetch}_{and,or,xor}() functions
  locking/atomic/x86: Introduce arch_atomic64_read_nonatomic() to x86_32
  locking/atomic/x86: Introduce arch_atomic64_try_cmpxchg() to x86_32
  locking/atomic/x86: Introduce arch_try_cmpxchg64() for !CONFIG_X86_CMPXCHG64
  locking/atomic/x86: Modernize x86_32 arch_{,try_}_cmpxchg64{,_local}()
  locking/atomic/x86: Correct the definition of __arch_try_cmpxchg128()
  x86/tsc: Make __use_tsc __ro_after_init
  x86/kvm: Make kvm_async_pf_enabled __ro_after_init
  context_tracking: Make context_tracking_key __ro_after_init
  jump_label,module: Don't alloc static_key_mod for __ro_after_init keys
  locking/qspinlock: Always evaluate lockevent* non-event parameter once
</content>
</entry>
<entry>
<title>NUMA: early use of cpu_to_node() returns 0 instead of the correct node id</title>
<updated>2024-04-26T04:07:03Z</updated>
<author>
<name>Huang Shijie</name>
<email>shijie@os.amperecomputing.com</email>
</author>
<published>2024-01-26T06:44:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f9899c028151468d8c4af0bcbb3d5e87619b0973'/>
<id>urn:sha1:f9899c028151468d8c4af0bcbb3d5e87619b0973</id>
<content type='text'>
During the kernel booting, the generic cpu_to_node() is called too early
in arm64, powerpc and riscv when CONFIG_NUMA is enabled.

There are at least four places in the common code where
the generic cpu_to_node() is called before it is initialized:
	   1.) early_trace_init()         in kernel/trace/trace.c
	   2.) sched_init()               in kernel/sched/core.c
	   3.) init_sched_fair_class()    in kernel/sched/fair.c
	   4.) workqueue_init_early()     in kernel/workqueue.c

This will harm performance since there is an increase in off node
accesses.

In order to fix the bug, the patch introduces early_numa_node_init() which
is called after smp_prepare_boot_cpu() in start_kernel. 
early_numa_node_init will initialize the "numa_node" as soon as the
early_cpu_to_node() is ready, before the cpu_to_node() is called at the
first time.

Link: https://lkml.kernel.org/r/20240126064451.5465-1-shijie@os.amperecomputing.com
Signed-off-by: Huang Shijie &lt;shijie@os.amperecomputing.com&gt;
Acked-by: Palmer Dabbelt &lt;palmer@rivosinc.com&gt;	[RISC-V]
Cc: Albert Ou &lt;aou@eecs.berkeley.edu&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Huacai Chen &lt;chenhuacai@kernel.org&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Jakub Kicinski &lt;kuba@kernel.org&gt;
Cc: Jiaxun Yang &lt;jiaxun.yang@flygoat.com&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
Cc: Mark Rutland &lt;mark.rutland@arm.com&gt;
Cc: Masami Hiramatsu &lt;mhiramat@kernel.org&gt;
Cc: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Cc: Michael Kelley (LINUX) &lt;mikelley@microsoft.com&gt;
Cc: "Mike Rapoport (IBM)" &lt;rppt@kernel.org&gt;
Cc: Nick Desaulniers &lt;ndesaulniers@google.com&gt;
Cc: Paul Walmsley &lt;paul.walmsley@sifive.com&gt;
Cc: Rafael J. Wysocki &lt;rafael@kernel.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Valentin Schneider &lt;vschneid@redhat.com&gt;
Cc: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Cc: Will Deacon &lt;will@kernel.org&gt;
Cc: Yury Norov &lt;yury.norov@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>bootconfig: do not put quotes on cmdline items unless necessary</title>
<updated>2024-04-26T04:07:01Z</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2024-03-20T10:19:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=212f863fa8811c780abacc1d0404c573fdc0a2de'/>
<id>urn:sha1:212f863fa8811c780abacc1d0404c573fdc0a2de</id>
<content type='text'>
When trying to migrate to using bootconfig to embed the kernel's and
PID1's command line with the kernel image itself, and so allowing changing
that without modifying the bootloader, I noticed that /proc/cmdline
changed from e.g.

  console=ttymxc0,115200n8 cma=128M quiet -- --log-level=notice

to

  console="ttymxc0,115200n8" cma="128M" quiet -- --log-level="notice"

The kernel parameters are parsed just fine, and the quotes are indeed
stripped from the actual argv[] given to PID1.  However, the quoting
doesn't really serve any purpose and looks excessive, and might confuse
some (naive) userspace tool trying to parse /proc/cmdline.  So do not
quote the value unless it contains whitespace.

Link: https://lkml.kernel.org/r/20240320101952.62135-1-linux@rasmusvillemoes.dk
Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Cc: Masami Hiramatsu &lt;mhiramat@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>init/main.c: Minor cleanup for the setup_command_line() function</title>
<updated>2024-04-12T16:03:13Z</updated>
<author>
<name>Yuntao Wang</name>
<email>ytcoode@gmail.com</email>
</author>
<published>2024-04-12T08:17:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ddd53363f875eb23b6754362ce0a43f2214f0a83'/>
<id>urn:sha1:ddd53363f875eb23b6754362ce0a43f2214f0a83</id>
<content type='text'>
This is just a minor cleanup to make the code look a bit cleaner.

Link: https://lore.kernel.org/all/20240412081733.35925-3-ytcoode@gmail.com/

Signed-off-by: Yuntao Wang &lt;ytcoode@gmail.com&gt;
Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;
</content>
</entry>
<entry>
<title>init/main.c: Remove redundant space from saved_command_line</title>
<updated>2024-04-12T16:02:08Z</updated>
<author>
<name>Yuntao Wang</name>
<email>ytcoode@gmail.com</email>
</author>
<published>2024-04-12T16:02:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cd24bdb06820d12dc84aeb0a47a10ad7ecf4b027'/>
<id>urn:sha1:cd24bdb06820d12dc84aeb0a47a10ad7ecf4b027</id>
<content type='text'>
There is a space at the end of extra_init_args. In the current logic,
copying extra_init_args to saved_command_line will cause extra spaces
in saved_command_line here or there. Remove the trailing space from
extra_init_args to make the string in saved_command_line look more perfect.

Link: https://lore.kernel.org/all/20240412032950.12687-1-ytcoode@gmail.com/

Signed-off-by: Yuntao Wang &lt;ytcoode@gmail.com&gt;
Acked-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;
Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;
</content>
</entry>
<entry>
<title>bootconfig: do not put quotes on cmdline items unless necessary</title>
<updated>2024-04-12T16:02:08Z</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2024-04-12T16:02:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=efee03a50c2844d78f6fb5e98be1ffd17605dc5b'/>
<id>urn:sha1:efee03a50c2844d78f6fb5e98be1ffd17605dc5b</id>
<content type='text'>
When trying to migrate to using bootconfig to embed the kernel's and
PID1's command line with the kernel image itself, and so allowing
changing that without modifying the bootloader, I noticed that
/proc/cmdline changed from e.g.

  console=ttymxc0,115200n8 cma=128M quiet -- --log-level=notice

to

  console="ttymxc0,115200n8" cma="128M" quiet -- --log-level="notice"

The kernel parameters are parsed just fine, and the quotes are indeed
stripped from the actual argv[] given to PID1. However, the quoting
doesn't really serve any purpose and looks excessive, and might
confuse some (naive) userspace tool trying to parse /proc/cmdline. So
do not quote the value unless it contains whitespace.

Link: https://lore.kernel.org/all/20240308124401.1702046-1-linux@rasmusvillemoes.dk/

Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Acked-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;
Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;
</content>
</entry>
<entry>
<title>init/main.c: Fix potential static_command_line memory overflow</title>
<updated>2024-04-12T15:59:36Z</updated>
<author>
<name>Yuntao Wang</name>
<email>ytcoode@gmail.com</email>
</author>
<published>2024-04-12T08:17:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=46dad3c1e57897ab9228332f03e1c14798d2d3b9'/>
<id>urn:sha1:46dad3c1e57897ab9228332f03e1c14798d2d3b9</id>
<content type='text'>
We allocate memory of size 'xlen + strlen(boot_command_line) + 1' for
static_command_line, but the strings copied into static_command_line are
extra_command_line and command_line, rather than extra_command_line and
boot_command_line.

When strlen(command_line) &gt; strlen(boot_command_line), static_command_line
will overflow.

This patch just recovers strlen(command_line) which was miss-consolidated
with strlen(boot_command_line) in the commit f5c7310ac73e ("init/main: add
checks for the return value of memblock_alloc*()")

Link: https://lore.kernel.org/all/20240412081733.35925-2-ytcoode@gmail.com/

Fixes: f5c7310ac73e ("init/main: add checks for the return value of memblock_alloc*()")
Cc: stable@vger.kernel.org
Signed-off-by: Yuntao Wang &lt;ytcoode@gmail.com&gt;
Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;
</content>
</entry>
</feed>
