lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c3e97fe5-f058-4958-8660-a661f6a662a3@amd.com>
Date: Fri, 4 Jul 2025 17:16:44 +0530
From: K Prateek Nayak <kprateek.nayak@....com>
To: Borislav Petkov <bp@...en8.de>
Cc: linux-kernel@...r.kernel.org, linux-tip-commits@...r.kernel.org,
 Leon Romanovsky <leon@...nel.org>, Valentin Schneider <vschneid@...hat.com>,
 "Peter Zijlstra (Intel)" <peterz@...radead.org>,
 Steve Wahl <steve.wahl@....com>, x86@...nel.org
Subject: Re: [tip: sched/urgent] sched/fair: Use sched_domain_span() for
 topology_span_sane()

Hello Boris,

On 7/4/2025 3:51 PM, Borislav Petkov wrote:
> On Fri, Jul 04, 2025 at 09:13:16AM -0000, tip-bot2 for K Prateek Nayak wrote:
>> The following commit has been merged into the sched/urgent branch of tip:
>>
>> Commit-ID:     02bb4259ca525efa39a2531cb630329fb87fc968
>> Gitweb:        https://git.kernel.org/tip/02bb4259ca525efa39a2531cb630329fb87fc968
>> Author:        K Prateek Nayak <kprateek.nayak@....com>
>> AuthorDate:    Mon, 30 Jun 2025 06:10:59
>> Committer:     Peter Zijlstra <peterz@...radead.org>
>> CommitterDate: Fri, 04 Jul 2025 10:35:56 +02:00
>>
>> sched/fair: Use sched_domain_span() for topology_span_sane()
> 
> My guest doesn't like this one and reverting it ontop of the whole tip lineup
> fixes it.
> 
> Holler for more data if needed.

In an attempt to solve a complicated case, I think I overlooked the
simplest one. In your case, the PKG and NODE domain should have same
span (and covers all the CPUs in the system) and the
build_sched_domain() loop skips building the NODE domain altogether
since PKG has all the online CPUs.

Can you try the below incremental diff on top of this patch and
let me know if you still hit the error:

(Lightly tested on QEMU)

diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index 0e46068acb0a..cce540fe36c6 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -2423,6 +2423,14 @@ static bool topology_span_sane(const struct cpumask *cpu_map)
  			struct cpumask *sd_span = sched_domain_span(sd);
  			int id;
  
+			/*
+			 * If the child already covers the cpumap, sd
+			 * remains un-initialized. Use sd->private to
+			 * detect uninitialized domains.
+			 */
+			if (!sd->private)
+				continue;
+
  			/* lowest bit set in this mask is used as a unique id */
  			id = cpumask_first(sd_span);
  
---

Thank you for the report and sorry for the oversight. Hope I have not
disrupted your Feierabend.

P.S. I'm used the below cmdline to reproduce this:

   sudo ~/dev/qemu/build/qemu-system-x86_64 -enable-kvm -cpu host -m 20G \
   -smp cpus=10,socket=1,thread=10 -machine q35 \
   -object memory-backend-ram,size=20G,id=m0 \
   -numa node,cpus=0-9,memdev=m0,nodeid=0 \
   ...

> 
> [    0.280062] Timer migration: 2 hierarchy levels; 8 children per group; 2 crossnode level
> [    0.282922] NMI watchdog: Enabled. Permanently consumes one hw-PMU counter.
> [    0.287572] smp: Bringing up secondary CPUs ...
> [    0.288623] smpboot: x86: Booting SMP configuration:
> [    0.289085] .... node  #0, CPUs:        #1  #2  #3  #4  #5  #6  #7  #8  #9 #10 #11 #12 #13 #14 #15
> [    0.302358] smp: Brought up 1 node, 16 CPUs
> [    0.304445] smpboot: Total of 16 processors activated (118401.12 BogoMIPS)
> [    0.307884] BUG: unable to handle page fault for address: 0000000089c402fb
> [    0.307884] #PF: supervisor read access in kernel mode
> [    0.307884] #PF: error_code(0x0000) - not-present page
> [    0.307884] PGD 0 P4D 0
> [    0.307950] Oops: Oops: 0000 [#1] SMP NOPTI
> [    0.308344] CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.16.0-rc4+ #1 PREEMPT(full)
> [    0.309115] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 2023.11-8 02/21/2024
> [    0.309934] RIP: 0010:build_sched_domains+0x627/0x1550
> [    0.310086] Code: 84 75 06 00 00 f3 48 0f bc c0 48 63 f8 89 c0 48 0f a3 05 c4 cf 95 08 0f 83 6c 06 00 00 48 8b 3c fd c0 db 29 82 49 8b 44 24 18 <48> 8b 04 07 48 8b 80 90 00 00 00 48 33 86 90 00 00 00 66 85 c0 0f
> [    0.310086] RSP: 0018:ffffc9000001fe60 EFLAGS: 00010247
> [    0.310086] RAX: ffffffff89c402f8 RBX: ffff88800cea8e40 RCX: 0000000000000001
> [    0.310086] RDX: ffffffffffffffff RSI: ffff88800ceaacc0 RDI: 0000000100000003
> [    0.310086] RBP: ffff88800cc4e3e0 R08: 0000000000000000 R09: 0000000000000000
> [    0.310086] R10: 00000000fffedb1d R11: 00000000fffedb1d R12: ffff88800ceda4c0
> [    0.310086] R13: ffff88800cea9500 R14: 0000000000000010 R15: 000000000000000f
> [    0.310086] FS:  0000000000000000(0000) GS:ffff8880f39f2000(0000) knlGS:0000000000000000
> [    0.310086] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [    0.310086] CR2: 0000000089c402fb CR3: 0000000002c1a000 CR4: 00000000003506f0
> [    0.310086] Call Trace:
> [    0.310086]  <TASK>
> [    0.310086]  ? sched_init_domains+0x58/0xa0
> [    0.310086]  sched_init_smp+0x29/0x90
> [    0.310086]  kernel_init_freeable+0xa3/0x290
> [    0.310086]  ? __pfx_kernel_init+0x10/0x10
> [    0.310086]  kernel_init+0x1a/0x1c0
> [    0.310086]  ret_from_fork+0x85/0xf0
> [    0.310086]  ? __pfx_kernel_init+0x10/0x10
> [    0.310086]  ret_from_fork_asm+0x1a/0x30
> [    0.310086]  </TASK>
> [    0.310086] Modules linked in:
> [    0.310086] CR2: 0000000089c402fb
> [    0.310086] ---[ end trace 0000000000000000 ]---
> [    0.310086] RIP: 0010:build_sched_domains+0x627/0x1550
> [    0.310086] Code: 84 75 06 00 00 f3 48 0f bc c0 48 63 f8 89 c0 48 0f a3 05 c4 cf 95 08 0f 83 6c 06 00 00 48 8b 3c fd c0 db 29 82 49 8b 44 24 18 <48> 8b 04 07 48 8b 80 90 00 00 00 48 33 86 90 00 00 00 66 85 c0 0f
> [    0.310086] RSP: 0018:ffffc9000001fe60 EFLAGS: 00010247
> [    0.310086] RAX: ffffffff89c402f8 RBX: ffff88800cea8e40 RCX: 0000000000000001
> [    0.310086] RDX: ffffffffffffffff RSI: ffff88800ceaacc0 RDI: 0000000100000003
> [    0.310086] RBP: ffff88800cc4e3e0 R08: 0000000000000000 R09: 0000000000000000
> [    0.310086] R10: 00000000fffedb1d R11: 00000000fffedb1d R12: ffff88800ceda4c0
> [    0.310086] R13: ffff88800cea9500 R14: 0000000000000010 R15: 000000000000000f
> [    0.310086] FS:  0000000000000000(0000) GS:ffff8880f39f2000(0000) knlGS:0000000000000000
> [    0.310086] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [    0.310086] CR2: 0000000089c402fb CR3: 0000000002c1a000 CR4: 00000000003506f0
> [    0.310086] note: swapper/0[1] exited with irqs disabled
> [    0.310091] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009
> [    0.311130] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009 ]---
> 

-- 
Thanks and Regards,
Prateek


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ