From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C7BDB3DAC13 for ; Mon, 13 Apr 2026 14:21:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776090094; cv=none; b=F34iXmZ6q03pYI9+/CvscFkEBWox0HT8TiI2U2OM9LJUjSczRM3sXWMceSn0HSqq/UB+Oz0KBYxkFftd8qC6AnLUgDvporH5GHhT15IGe7AUvdIREm7gcZlOUdIHE+3kXynSlAMQeUVqFAkyztnrgKpTBJpnvSB4s052sJqyr3g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776090094; c=relaxed/simple; bh=pJYp7tduv0Us7J51R5lqtt1hDHs7oxiTVUE87lURY10=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=T7Q+6nSkRYS0fMJsyl7S7GH+3b0V3M4as2zXEKywrTwK26zX3F1FbqKHKl1dV+omz8RGxY5XpAHCLOKSTy5XOLCoG+F9J4wwjHh9S+f7ORO313zEDECwveHe3raSFPuvhErQewn7aXgCGsapDYwLOG6AzajZAhFpin59yuanNX8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org; spf=none smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=WcAvGrZb; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="WcAvGrZb" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=iuFTzBLVaL2rvVXXMqFGhsifPXC/G+Jzy88oQmdpy00=; b=WcAvGrZbwZBDDld5jt8S8p6fq7 p5qjV1PAPiMl6ZnSNiaVDhVgHYR56CzIMGA26N2HVDL2w6nHatvagmGqeKlVstl8ryVfUaWMmq5it v1GYBujxniBPsAu1OH/oTr1fY+G3IVkr1w9ZRyoD1ijiPYm9C6UOHyNn81aMRLtftXvU4HgVH6Ta/ 6HmtibjTg0fn9Hr1G/W5oWGMrg2ef2Fptq4lcuSPsttAXDr0ZQVGc0ClhC89BazxMswirrmi5CMTa wx8Lba/a2xYJLeQVarD9FrHWJ/qm0Ee7gjVVDC+pklbtRaMfg8BbDwVgqP9s8M+nujeISypCmaEwL gV86ZS4Q==; Received: from authenticated user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1wCIAA-00CM8w-13; Mon, 13 Apr 2026 14:21:18 +0000 Date: Mon, 13 Apr 2026 07:21:14 -0700 From: Breno Leitao To: Tejun Heo Cc: Lai Jiangshan , linux-kernel@vger.kernel.org, kernel-team@meta.com, kernel test robot Subject: Re: [PATCH] workqueue: validate cpumask_first() result in llc_populate_cpu_shard_id() Message-ID: References: <20260410-workqueue_fix_nios-v1-1-abbb26575b1b@debian.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Debian-User: leitao On Fri, Apr 10, 2026 at 07:36:10AM -1000, Tejun Heo wrote: > Hello, > > On Fri, Apr 10, 2026 at 03:42:00AM -0700, Breno Leitao wrote: > > @@ -8318,7 +8319,17 @@ static void __init llc_populate_cpu_shard_id(const struct cpumask *pod_cpus, > > * The siblings' shard MUST be the same as the leader. > > * never split threads in the same core. > > */ > > - cpu_shard_id[c] = cpu_shard_id[cpumask_first(sibling_cpus)]; > > + leader = cpumask_first(sibling_cpus); > > + > > + /* > > + * sibling_cpus cannot be empty here since 'c' > > + * is always set in it. This check silences a > > + * compiler warning about using the unchecked > > + * cpumask_first() result as an array index. > > + */ > > Can you add more details on the warning and update the patch desc > accordingly? Ack! > This only triggers on UP configs, right? yes, this only triggers on UP configs (like nios2) because on SMP NR_CPUS > 1 and the compiler can't prove the index is out of bounds.