From nobody Tue Dec 2 02:29:43 2025 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 54EF126A1B9 for ; Wed, 19 Nov 2025 12:45:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763556333; cv=none; b=rew86vcTwZ/yGpE4jeG/c2883KjOsfJTMmuV/Wk8sATXiPo+PvMP0hRS0PXJ+6Dm7GIoP/OlEt+2eWPtFanIcuB8XuYNaZkCMtQN7gCRU498qLtk69egf8JZBTZw5z2IkANLzcfQ+J9DPz2i4LLp2i1fZpmDvBkhCLJCe5ZTHhg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763556333; c=relaxed/simple; bh=Ly/3ShfsF40dDJDuiiyr1kPzfEiDiH4vBFLWkTyHsyM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DglQ+K0+662TlYS8u0mTGCEPcBMKgV3XhAWPn59Ee1djyyi8fEBIS12H2+b7VLTkODITUlbWLNNCIEdX+pBdbjSkiy7xVVaXPFpBC5fprx/lrOxUA+MyxQ6rxoyMQK+/7qacnTP1kGZIiuq4TmQNxX7+AzxvNzNDizZER7Mu59k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=YSluk9rF; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="YSluk9rF" Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5AJ9wdM8019708; Wed, 19 Nov 2025 12:45:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=SsxUtQuljbB31H4Vb 1A8/PH/i69O3OULsuRsxx0vaAs=; b=YSluk9rFqcOa+A1A7G273GtHp4Q5SiAkG shKm+DwU3EoPtQisnrTywQ5V6PgYU2LEYvVGVYwYvUXp9y7APzCZDRLObUWhnWQ+ PHy1tb7X9MIKjRdq2UksHiUAkuVwouAS6gcjNBIx6L0ygju5hcMOwj6+l3OBOetR bCKc8XZtzqomcrYIJxRIsgILktlpUj/xJXWxAoig3ci3mYf97J379qNcXU1t0hP6 q9tHw0EcvFP++lc0HQ+cdtWeGDFKZOxDpbjcAqe+qLitcXnOznrkzlMoIdLF83Gc x0lCwvuhKzKp5BEjYpmrDtjxDpHbyDIw5XGVeVQdefMSNoD7ghPyQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4aejgwym99-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 19 Nov 2025 12:45:12 +0000 (GMT) Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.18.1.12/8.18.0.8) with ESMTP id 5AJCjC1v032011; Wed, 19 Nov 2025 12:45:12 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4aejgwym96-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 19 Nov 2025 12:45:12 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 5AJBiPhr022311; Wed, 19 Nov 2025 12:45:11 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4af4un0n15-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 19 Nov 2025 12:45:11 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 5AJCj7d156951046 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 19 Nov 2025 12:45:07 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7DF1F20043; Wed, 19 Nov 2025 12:45:07 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8DA7F20040; Wed, 19 Nov 2025 12:45:03 +0000 (GMT) Received: from li-7bb28a4c-2dab-11b2-a85c-887b5c60d769.ibm.com.com (unknown [9.39.25.220]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 19 Nov 2025 12:45:03 +0000 (GMT) From: Shrikanth Hegde To: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Cc: sshegde@linux.ibm.com, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, tglx@linutronix.de, yury.norov@gmail.com, maddy@linux.ibm.com, srikar@linux.ibm.com, gregkh@linuxfoundation.org, pbonzini@redhat.com, seanjc@google.com, kprateek.nayak@amd.com, vschneid@redhat.com, iii@linux.ibm.com, huschle@linux.ibm.com, rostedt@goodmis.org, dietmar.eggemann@arm.com, christophe.leroy@csgroup.eu Subject: [PATCH 02/17] cpumask: Introduce cpu_paravirt_mask Date: Wed, 19 Nov 2025 18:14:34 +0530 Message-ID: <20251119124449.1149616-3-sshegde@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119124449.1149616-1-sshegde@linux.ibm.com> References: <20251119124449.1149616-1-sshegde@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: MtzTJCe4lQpT_P7m9pyhjr-5a8YqBN_W X-Authority-Analysis: v=2.4 cv=YqwChoYX c=1 sm=1 tr=0 ts=691dbbd9 cx=c_pps a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17 a=6UeiqGixMTsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VnNF1IyMAAAA:8 a=PotXWsJoChvkt9Z01ZEA:9 X-Proofpoint-ORIG-GUID: lZnDUJjFBBriO7zlrR7s22hKBPnaPJag X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTE1MDAzMiBTYWx0ZWRfX7fDfPyhBOSJU iR7amjyJmckyUrUwRe20L3rkj+I3sDPhy1ipz+v8wyQOG53PhiPf5cM7WPY1jHXip0c9eGWicB2 RyOEnOcSqJ19ourib02haMBg+MYsKsqhcOCssD2G++h4ohRDqo7i+0HoWTVHV8cSfas66/n3W2/ m+tckKMvQCGccbaufnpBcBjwPp44u3EGYvFdPpJ44DrE70di1K19Hd45br6tF6BMDSb4Y4gQ8+U UfYOU2xjqCWOuORN1btWyLVw8t+9p3smxnZs5JYQM7auLYv3OsC0BcIqs5dR6AlnYPQlWgOsbCC e/fF/2VOYs6MCvqKdf/7/7Cly3/Vj/LUj5afeqmoiwogNF6Ze948/lX9LxnukMSosCglVUDynkR HNx3Q2YIAhXR79A9V6K6qsS0Sxru2w== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-19_03,2025-11-18_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 malwarescore=0 clxscore=1015 adultscore=0 bulkscore=0 phishscore=0 spamscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2510240000 definitions=main-2511150032 Content-Type: text/plain; charset="utf-8" This patch does - Declare and Define cpu_paravirt_mask. - Get/Set helpers for it. Values are set by arch code and consumed by the scheduler. Signed-off-by: Shrikanth Hegde --- include/linux/cpumask.h | 20 ++++++++++++++++++++ kernel/sched/core.c | 5 +++++ 2 files changed, 25 insertions(+) diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index ff8f41ab7ce6..079903851341 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h @@ -1270,6 +1270,26 @@ static __always_inline bool cpu_dying(unsigned int c= pu) =20 #endif /* NR_CPUS > 1 */ =20 +/* + * All related wrappers kept together to avoid too many ifdefs + * See Documentation/scheduler/sched-arch.rst for details + */ +#ifdef CONFIG_PARAVIRT +extern struct cpumask __cpu_paravirt_mask; +#define cpu_paravirt_mask ((const struct cpumask *)&__cpu_paravirt_mask) +#define set_cpu_paravirt(cpu, paravirt) assign_cpu((cpu), &__cpu_paravirt_= mask, (paravirt)) + +static __always_inline bool cpu_paravirt(unsigned int cpu) +{ + return cpumask_test_cpu(cpu, cpu_paravirt_mask); +} +#else +static __always_inline bool cpu_paravirt(unsigned int cpu) +{ + return false; +} +#endif + #define cpu_is_offline(cpu) unlikely(!cpu_online(cpu)) =20 #if NR_CPUS <=3D BITS_PER_LONG diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 9f10cfbdc228..40db5e659994 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -10852,3 +10852,8 @@ void sched_change_end(struct sched_change_ctx *ctx) p->sched_class->prio_changed(rq, p, ctx->prio); } } + +#ifdef CONFIG_PARAVIRT +struct cpumask __cpu_paravirt_mask __read_mostly; +EXPORT_SYMBOL(__cpu_paravirt_mask); +#endif --=20 2.47.3