From nobody Sat Jul 4 21:04:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1782904598; cv=none; d=zohomail.com; s=zohoarc; b=nz6AiVMnuWmLkwU8EuadytJoQOG1MwkLHqa5M26TaT0sn+Al7C8SIi5Ka9uU0jdW8t676Y4ZXH7S3upS1GsaVpihazBbHQpSog77FwfFxP56amNG54wOTjDJY/jkZOolxRnVCd+4vS/a8+mC9wL1ikRegvrYi9dd4wlfBIaG7I0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782904598; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Zaxfdhd/2xyg/xgn5cvnR+sq5s7uLGSyRRwH/Mnptzo=; b=Otcw5lwFR5+hq/+xsLo0I1YZdTDGxAoCFYrz2HRX1c9jVP6Qc4gIWefCh/HLnQPnNHZu2B02HxGSf0W/1owGcyNUEfGSdk1fcPikXmiY0sXXIN7HM+vQk4BK7rf3CKghm+HDBNXgfKdQzbTBAIK4yWdYuRIWvtC7nHcOeDs6hUw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1782904598566280.2318379672364; Wed, 1 Jul 2026 04:16:38 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1349771.1607420 (Exim 4.92) (envelope-from ) id 1wesvQ-00011j-RT; Wed, 01 Jul 2026 11:16:16 +0000 Received: by outflank-mailman (output) from mailman id 1349771.1607420; Wed, 01 Jul 2026 11:16:16 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wesvQ-00011c-NC; Wed, 01 Jul 2026 11:16:16 +0000 Received: by outflank-mailman (input) for mailman id 1349771; Wed, 01 Jul 2026 11:16:15 +0000 Received: from mx.expurgate.net ([195.190.135.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wesvP-00010r-Ns for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 11:16:15 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wesvP-00AhOL-4G for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 13:16:15 +0200 Received: from [10.42.69.12] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a44f6f4-e002-0a2a0a5209dd-0a2a450c89fa-44 for ; Wed, 01 Jul 2026 13:16:15 +0200 Received: from [195.135.223.130] (helo=smtp-out1.suse.de) by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a44f6fe-f399-0a2a450c0019-c387df82dc56-3 for ; Wed, 01 Jul 2026 13:16:14 +0200 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 84EC273A63; Wed, 1 Jul 2026 11:16:14 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 62023779AA; Wed, 1 Jul 2026 11:16:14 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 8NijFv72RGrZAQAAD6G6ig (envelope-from ); Wed, 01 Jul 2026 11:16:14 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1782904574; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Zaxfdhd/2xyg/xgn5cvnR+sq5s7uLGSyRRwH/Mnptzo=; b=JhVt65x1JsQycqKDgFnCPOiZKlZvFyiIG+Yag8Eg2mF0F/RPNqYvuM3CoqLPktKDgc8RUh sWkv/C0Pu55RkUH+1tuE0R6syoBBdpE23T3/7GOrhi9yi6ugkKaOkudPF0ZQawwpR97Vw3 qQJrINcEdbhfiM8UIHMqIu6ZUgUaUjk= Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.com header.s=susede1 header.b=JhVt65x1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1782904574; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Zaxfdhd/2xyg/xgn5cvnR+sq5s7uLGSyRRwH/Mnptzo=; b=JhVt65x1JsQycqKDgFnCPOiZKlZvFyiIG+Yag8Eg2mF0F/RPNqYvuM3CoqLPktKDgc8RUh sWkv/C0Pu55RkUH+1tuE0R6syoBBdpE23T3/7GOrhi9yi6ugkKaOkudPF0ZQawwpR97Vw3 qQJrINcEdbhfiM8UIHMqIu6ZUgUaUjk= From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Anthony PERARD Subject: [PATCH 1/3] tools/libxl: don't rely on xc_vcpu_setaffinity() returned cpumaps Date: Wed, 1 Jul 2026 13:16:04 +0200 Message-ID: <20260701111606.4063972-2-jgross@suse.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260701111606.4063972-1-jgross@suse.com> References: <20260701111606.4063972-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Flag: NO X-Rspamd-Action: no action X-Spam-Level: X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.com:s=susede1]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.com:+]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCPT_COUNT_THREE(0.00)[3]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.com:email,suse.com:dkim,suse.com:mid] X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Queue-Id: 84EC273A63 X-Spam-Score: -3.01 X-purgate-ID: tlsNG-d25034/1782904574-A8AA8D51-0726AD08/0/0 X-purgate-type: clean X-purgate-size: 1341 X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1782904599392158500 Content-Type: text/plain; charset="utf-8" In order to prepare for XEN_DOMCTL_setvcpuaffinity no longer returning the effective affinity settings, use xc_vcpu_getaffinity() for getting the effective affinities after having set them. Signed-off-by: Juergen Gross --- tools/libs/light/libxl_sched.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/libs/light/libxl_sched.c b/tools/libs/light/libxl_sched.c index 2d6635dae7..2f6a70aef5 100644 --- a/tools/libs/light/libxl_sched.c +++ b/tools/libs/light/libxl_sched.c @@ -69,6 +69,15 @@ static int libxl__set_vcpuaffinity(libxl_ctx *ctx, uint3= 2_t domid, * is possible that Xen will use something different from what we asked * for various reasons. If that's the case, report it. */ + if ((cpumap_hard || cpumap_soft) && + xc_vcpu_getaffinity(ctx->xch, domid, vcpuid, + cpumap_hard ? hard.map : NULL, + cpumap_soft ? soft.map : NULL, + flags & ~XEN_VCPUAFFINITY_FORCE)) { + LOGED(ERROR, domid, "Checking vcpu affinity"); + rc =3D ERROR_FAIL; + goto out; + } if (cpumap_hard && !libxl_bitmap_equal(cpumap_hard, &hard, 0)) LOGD(DEBUG, domid, "New hard affinity for vcpu %d has unreachable = cpus", vcpuid); --=20 2.54.0 From nobody Sat Jul 4 21:04:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1782904595; cv=none; d=zohomail.com; s=zohoarc; b=DmV+v+Bop0ycGaRkX+0IHCGHM8jT/jJypylFfpwonX0IZFZW9PbsIfuzuwtVnbWWJ8VVapBmX5bo0eGnud+O64XP3YvBJrGYv4hvWLaUAJhm+9DVZKuKqXKRS5vdU/BMB3A6upEQr7elpfqpJTc2AmoW+oNLvZ2QkIkCvp7DL9s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782904595; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=eHLTBeGgYNLdb9o5EF92sUCLA1iLOlkHRzk4jz8IGiQ=; b=F/4c74ZkHwdOgcvSm5Roc2/vchE/GTOanmPwwFMWtgfeoMqGC0Qu/wpS+8EnjvlpaIZXQp/yVuVhJMvwtepVvY+7oKIjlXnsZjHOHGCFCKBLyox5SsWvc+wY/As7N91Ca0EYjhe3TbhrLe6DK0vlWpvnJ8Hr3ot0GBgw0b+hwHw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1782904595249542.5332883462477; Wed, 1 Jul 2026 04:16:35 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1349772.1607429 (Exim 4.92) (envelope-from ) id 1wesvX-0001KB-3E; Wed, 01 Jul 2026 11:16:23 +0000 Received: by outflank-mailman (output) from mailman id 1349772.1607429; Wed, 01 Jul 2026 11:16:23 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wesvW-0001Jx-U2; Wed, 01 Jul 2026 11:16:22 +0000 Received: by outflank-mailman (input) for mailman id 1349772; Wed, 01 Jul 2026 11:16:21 +0000 Received: from mx.expurgate.net ([194.145.224.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wesvV-0001IA-9O for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 11:16:21 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wesvU-008Ib4-MO for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 13:16:20 +0200 Received: from [10.42.69.3] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a44f6ff-bab6-0a2a0a5309dd-0a2a45038504-8 for ; Wed, 01 Jul 2026 13:16:20 +0200 Received: from [195.135.223.130] (helo=smtp-out1.suse.de) by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a44f704-ec1a-0a2a45030019-c387df82da78-3 for ; Wed, 01 Jul 2026 13:16:20 +0200 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 3062C73A63; Wed, 1 Jul 2026 11:16:20 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id D9B40779AA; Wed, 1 Jul 2026 11:16:19 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 8F7cMwP3RGrhAQAAD6G6ig (envelope-from ); Wed, 01 Jul 2026 11:16:19 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1782904580; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eHLTBeGgYNLdb9o5EF92sUCLA1iLOlkHRzk4jz8IGiQ=; b=WxgOEtUNI3sdwzFIUTtXShDsriBbBzUldTOXEQxT0sH5yfsbtNS151iYxQJw4wyTY5fSQW 5nqcg5yOupZe9vzqagQDrVOmRMU66WA1FVqoxEcdfGj5MYsadumODIwmR2FnxPWpkamYY1 bQbJW+2PFdIZgeg1XMS4ah3gNsOse8M= Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.com header.s=susede1 header.b=WxgOEtUN DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1782904580; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eHLTBeGgYNLdb9o5EF92sUCLA1iLOlkHRzk4jz8IGiQ=; b=WxgOEtUNI3sdwzFIUTtXShDsriBbBzUldTOXEQxT0sH5yfsbtNS151iYxQJw4wyTY5fSQW 5nqcg5yOupZe9vzqagQDrVOmRMU66WA1FVqoxEcdfGj5MYsadumODIwmR2FnxPWpkamYY1 bQbJW+2PFdIZgeg1XMS4ah3gNsOse8M= From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Dario Faggioli , George Dunlap , Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini Subject: [PATCH 2/3] xen: don't let XEN_DOMCTL_setvcpuaffinity return the new affinities Date: Wed, 1 Jul 2026 13:16:05 +0200 Message-ID: <20260701111606.4063972-3-jgross@suse.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260701111606.4063972-1-jgross@suse.com> References: <20260701111606.4063972-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Flag: NO X-Rspamd-Action: no action X-Spam-Level: X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.com:s=susede1]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.com:email,suse.com:dkim,suse.com:mid]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FUZZY_RATELIMITED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_SEVEN(0.00)[11]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; TO_DN_SOME(0.00)[]; DKIM_TRACE(0.00)[suse.com:+] X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Queue-Id: 3062C73A63 X-Spam-Score: -3.01 X-purgate-ID: tlsNG-33051d/1782904580-BDFBB5D1-DAD606B7/0/0 X-purgate-type: clean X-purgate-size: 5760 X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1782904597407158500 Content-Type: text/plain; charset="utf-8" There is no in-tree user of XEN_DOMCTL_setvcpuaffinity left relying on the returned effective affinity settings. Drop returning the new affinities, as any error occurring for that will be reported to the user, while the affinities won't be changed back to what they were. This would result in the caller believing that the affinity was not modified, while it might have been. Fix a comment typo while modifying vcpu_affinity_domctl(). Signed-off-by: Juergen Gross --- xen/common/sched/core.c | 40 +++++++++---------------------------- xen/include/public/domctl.h | 9 ++------- 2 files changed, 11 insertions(+), 38 deletions(-) diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c index 3609721426..1611e60020 100644 --- a/xen/common/sched/core.c +++ b/xen/common/sched/core.c @@ -1708,7 +1708,7 @@ int vcpu_affinity_domctl(struct domain *d, uint32_t c= md, { struct vcpu *v; const struct sched_unit *unit; - int ret =3D 0, hret =3D 0; + int ret =3D 0; =20 if ( vcpuaff->vcpu >=3D d->max_vcpus ) return -EINVAL; @@ -1724,12 +1724,11 @@ int vcpu_affinity_domctl(struct domain *d, uint32_t= cmd, if ( cmd =3D=3D XEN_DOMCTL_setvcpuaffinity ) { cpumask_var_t new_affinity, old_affinity; - cpumask_t *online =3D cpupool_domain_master_cpumask(v->domain); =20 /* * We want to be able to restore hard affinity if we are trying * setting both and changing soft affinity (which happens later, - * when hard affinity has been succesfully chaged already) fails. + * when hard affinity has been successfully changed already) fails. */ if ( !alloc_cpumask_var(&old_affinity) ) return -ENOMEM; @@ -1746,25 +1745,14 @@ int vcpu_affinity_domctl(struct domain *d, uint32_t= cmd, if ( vcpuaff->flags & XEN_VCPUAFFINITY_FORCE ) vcpu_temporary_affinity(v, NR_CPUS, VCPU_AFFINITY_OVERRIDE); =20 - /* - * We both set a new affinity and report back to the caller what - * the scheduler will be effectively using. - */ if ( vcpuaff->flags & XEN_VCPUAFFINITY_HARD ) { - hret =3D xenctl_bitmap_to_bitmap(cpumask_bits(new_affinity), + ret =3D xenctl_bitmap_to_bitmap(cpumask_bits(new_affinity), &vcpuaff->cpumap_hard, nr_cpu_i= ds); - if ( !hret ) - hret =3D vcpu_set_hard_affinity(v, new_affinity); - if ( hret ) + if ( !ret ) + ret =3D vcpu_set_hard_affinity(v, new_affinity); + if ( ret ) goto setvcpuaffinity_out; - - /* - * For hard affinity, what we return is the intersection of - * cpupool's online mask and the new hard affinity. - */ - cpumask_and(new_affinity, online, unit->cpu_hard_affinity); - hret =3D cpumask_to_xenctl_bitmap(&vcpuaff->cpumap_hard, new_a= ffinity); } if ( vcpuaff->flags & XEN_VCPUAFFINITY_SOFT ) { @@ -1782,17 +1770,7 @@ int vcpu_affinity_domctl(struct domain *d, uint32_t = cmd, */ if ( vcpuaff->flags & XEN_VCPUAFFINITY_HARD ) vcpu_set_hard_affinity(v, old_affinity); - goto setvcpuaffinity_out; } - - /* - * For soft affinity, we return the intersection between the - * new soft affinity, the cpupool's online map and the (new) - * hard affinity. - */ - cpumask_and(new_affinity, new_affinity, online); - cpumask_and(new_affinity, new_affinity, unit->cpu_hard_affinit= y); - ret =3D cpumask_to_xenctl_bitmap(&vcpuaff->cpumap_soft, new_af= finity); } =20 setvcpuaffinity_out: @@ -1802,14 +1780,14 @@ int vcpu_affinity_domctl(struct domain *d, uint32_t= cmd, else { if ( vcpuaff->flags & XEN_VCPUAFFINITY_HARD ) - hret =3D cpumask_to_xenctl_bitmap(&vcpuaff->cpumap_hard, + ret =3D cpumask_to_xenctl_bitmap(&vcpuaff->cpumap_hard, unit->cpu_hard_affinity); - if ( vcpuaff->flags & XEN_VCPUAFFINITY_SOFT ) + if ( !ret && vcpuaff->flags & XEN_VCPUAFFINITY_SOFT ) ret =3D cpumask_to_xenctl_bitmap(&vcpuaff->cpumap_soft, unit->cpu_soft_affinity); } =20 - return hret ?: ret; + return ret; } =20 bool alloc_affinity_masks(struct affinity_masks *affinity) diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index cdf350a290..906d2c59d0 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -357,13 +357,8 @@ struct xen_domctl_vcpuaffinity { /* * IN/OUT variables. * - * Both are IN/OUT for XEN_DOMCTL_setvcpuaffinity, in which case they - * contain effective hard or/and soft affinity. That is, upon successf= ul - * return, cpumap_soft, contains the intersection of the soft affinity, - * hard affinity and the cpupool's online CPUs for the domain (if - * XEN_VCPUAFFINITY_SOFT was set in flags). cpumap_hard contains the - * intersection between hard affinity and the cpupool's online CPUs (if - * XEN_VCPUAFFINITY_HARD was set in flags). + * Both are IN-only for XEN_DOMCTL_setvcpuaffinity, in which case they + * contain effective hard or/and soft affinity. * * Both are OUT-only for XEN_DOMCTL_getvcpuaffinity, in which case they * contain the plain hard and/or soft affinity masks that were set dur= ing --=20 2.54.0 From nobody Sat Jul 4 21:04:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1782904608; cv=none; d=zohomail.com; s=zohoarc; b=de7XSZ7kIMppHSkS+KyB9ZlNqjYbunk6vpvfEBky6BgwW9kFDBme57TGO0+rhZL7kh9NF1ars1KodqlMQMHVCBLiq1VnaXD6F/W2Ipm+1qVxOnQtK8NdrXINVQ4OtxjrKo4q2rqMQIljIO40tOykMkIecgImVkjXHH5G2qH59DM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782904608; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=2t/WHu9BiecxDO+oBqpdeXwPpVi0SCaRQ5V3xF2p+VU=; b=DkxUJ1pS66Ex1D229VmM74AQkOrCZHCcETYUZoMvZl+NgOR7jVSD9T4ad2pUIx7HFovn+UkUTJnVKwdC75ovT7TFcivu8xZ/F+ChZ09IJj/kravsmBh0ZNhf2XeTjgty4FubGqjywT5c7aS83M1eQQOn/kvE2pupNcH2Jt5pv5E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1782904608038509.5386371120105; Wed, 1 Jul 2026 04:16:48 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1349775.1607437 (Exim 4.92) (envelope-from ) id 1wesvc-0001eE-7N; Wed, 01 Jul 2026 11:16:28 +0000 Received: by outflank-mailman (output) from mailman id 1349775.1607437; Wed, 01 Jul 2026 11:16:28 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wesvc-0001e6-4W; Wed, 01 Jul 2026 11:16:28 +0000 Received: by outflank-mailman (input) for mailman id 1349775; Wed, 01 Jul 2026 11:16:26 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wesva-0001bA-Pd for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 11:16:26 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wesva-003663-65 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 13:16:26 +0200 Received: from [10.42.69.6] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a44f709-2eae-0a2a0a5409dd-0a2a4506d3e8-6 for ; Wed, 01 Jul 2026 13:16:26 +0200 Received: from [195.135.223.131] (helo=smtp-out2.suse.de) by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a44f709-08de-0a2a45060019-c387df83d738-3 for ; Wed, 01 Jul 2026 13:16:25 +0200 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id A685F75C3A; Wed, 1 Jul 2026 11:16:25 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 83C02779AA; Wed, 1 Jul 2026 11:16:25 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id PYjUHgn3RGoEAgAAD6G6ig (envelope-from ); Wed, 01 Jul 2026 11:16:25 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1782904585; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2t/WHu9BiecxDO+oBqpdeXwPpVi0SCaRQ5V3xF2p+VU=; b=hs6TvoaspCKSX7Q68ECL2s4YoFqNJJpwoirSRZaZJ8PDAIRTZ3cBdhlPSb2ONon782l5V7 wWPvKg1xpVYJR1aVKk3RmIVM9HYL3sk/eNhDR/UNJJB9QM2wo0badB11Xt8OU1xI7CiECa 0git7o0hLtQykU2ffHn+9qTPgBhsJ3o= Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.com header.s=susede1 header.b=hs6Tvoas DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1782904585; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2t/WHu9BiecxDO+oBqpdeXwPpVi0SCaRQ5V3xF2p+VU=; b=hs6TvoaspCKSX7Q68ECL2s4YoFqNJJpwoirSRZaZJ8PDAIRTZ3cBdhlPSb2ONon782l5V7 wWPvKg1xpVYJR1aVKk3RmIVM9HYL3sk/eNhDR/UNJJB9QM2wo0badB11Xt8OU1xI7CiECa 0git7o0hLtQykU2ffHn+9qTPgBhsJ3o= From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Anthony PERARD Subject: [PATCH 3/3] tools/libxenctrl: rename parameters of xc_vcpu_setaffinity() Date: Wed, 1 Jul 2026 13:16:06 +0200 Message-ID: <20260701111606.4063972-4-jgross@suse.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260701111606.4063972-1-jgross@suse.com> References: <20260701111606.4063972-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Action: no action X-Rspamd-Queue-Id: A685F75C3A X-Spam-Flag: NO X-Spam-Score: -4.01 X-Spam-Level: X-Spamd-Result: default: False [-4.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; DWL_DNSWL_LOW(-1.00)[suse.com:dkim]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.com:s=susede1]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; ARC_NA(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim,suse.com:email,suse.com:mid,imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[suse.com:+] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-purgate-ID: tlsNG-16d1c6/1782904585-C5B3A68D-500FB331/0/0 X-purgate-type: clean X-purgate-size: 5707 X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1782904609341158500 Content-Type: text/plain; charset="utf-8" The cpumaps passed to xc_vcpu_setaffinity() are input-only now, so drop the "_inout" suffix from their names and make them const. Signed-off-by: Juergen Gross --- tools/include/xenctrl.h | 26 ++++++-------------------- tools/libs/ctrl/xc_domain.c | 26 ++++++++++++-------------- 2 files changed, 18 insertions(+), 34 deletions(-) diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h index d5dbf69c89..96fb0cc81f 100644 --- a/tools/include/xenctrl.h +++ b/tools/include/xenctrl.h @@ -590,37 +590,23 @@ int xc_domain_node_getaffinity(xc_interface *xch, * There are two kinds of affinity. Soft affinity is on what CPUs a vcpu * prefers to run. Hard affinity is on what CPUs a vcpu is allowed to run. * If flags contains XEN_VCPUAFFINITY_SOFT, the soft affinity it is set to - * what cpumap_soft_inout contains. If flags contains XEN_VCPUAFFINITY_HAR= D, - * the hard affinity is set to what cpumap_hard_inout contains. Both flags + * what cpumap_soft contains. If flags contains XEN_VCPUAFFINITY_HARD, + * the hard affinity is set to what cpumap_hard contains. Both flags * can be set at the same time, in which case both soft and hard affinity = are * set to what the respective parameter contains. * - * The function also returns the effective hard or/and soft affinity, still - * via the cpumap_soft_inout and cpumap_hard_inout parameters. Effective - * affinity is, in case of soft affinity, the intersection of soft affinit= y, - * hard affinity and the cpupool's online CPUs for the domain, and is retu= rned - * in cpumap_soft_inout, if XEN_VCPUAFFINITY_SOFT is set in flags. In case= of - * hard affinity, it is the intersection between hard affinity and the - * cpupool's online CPUs, and is returned in cpumap_hard_inout, if - * XEN_VCPUAFFINITY_HARD is set in flags. If both flags are set, both soft - * and hard affinity are returned in the respective parameter. - * - * We do report it back as effective affinity is what the Xen scheduler wi= ll - * actually use, and we thus allow checking whether or not that matches wi= th, - * or at least is good enough for, the caller's purposes. - * * @param xch a handle to an open hypervisor interface. * @param domid the id of the domain to which the vcpu belongs * @param vcpu the vcpu id wihin the domain - * @param cpumap_hard_inout specifies(/returns) the (effective) hard affin= ity - * @param cpumap_soft_inout specifies(/returns) the (effective) soft affin= ity + * @param cpumap_hard specifies the hard affinity + * @param cpumap_soft specifies the soft affinity * @param flags what we want to set */ int xc_vcpu_setaffinity(xc_interface *xch, uint32_t domid, int vcpu, - xc_cpumap_t cpumap_hard_inout, - xc_cpumap_t cpumap_soft_inout, + const xc_cpumap_t cpumap_hard, + const xc_cpumap_t cpumap_soft, uint32_t flags); =20 /** diff --git a/tools/libs/ctrl/xc_domain.c b/tools/libs/ctrl/xc_domain.c index 01c0669c88..3ee0e43ea5 100644 --- a/tools/libs/ctrl/xc_domain.c +++ b/tools/libs/ctrl/xc_domain.c @@ -199,15 +199,13 @@ int xc_domain_node_getaffinity(xc_interface *xch, int xc_vcpu_setaffinity(xc_interface *xch, uint32_t domid, int vcpu, - xc_cpumap_t cpumap_hard_inout, - xc_cpumap_t cpumap_soft_inout, + const xc_cpumap_t cpumap_hard, + const xc_cpumap_t cpumap_soft, uint32_t flags) { struct xen_domctl domctl =3D {}; - DECLARE_HYPERCALL_BOUNCE(cpumap_hard_inout, 0, - XC_HYPERCALL_BUFFER_BOUNCE_BOTH); - DECLARE_HYPERCALL_BOUNCE(cpumap_soft_inout, 0, - XC_HYPERCALL_BUFFER_BOUNCE_BOTH); + DECLARE_HYPERCALL_BOUNCE(cpumap_hard, 0, XC_HYPERCALL_BUFFER_BOUNCE_IN= ); + DECLARE_HYPERCALL_BOUNCE(cpumap_soft, 0, XC_HYPERCALL_BUFFER_BOUNCE_IN= ); int ret =3D -1; int cpusize; =20 @@ -218,11 +216,11 @@ int xc_vcpu_setaffinity(xc_interface *xch, return -1; } =20 - HYPERCALL_BOUNCE_SET_SIZE(cpumap_hard_inout, cpusize); - HYPERCALL_BOUNCE_SET_SIZE(cpumap_soft_inout, cpusize); + HYPERCALL_BOUNCE_SET_SIZE(cpumap_hard, cpusize); + HYPERCALL_BOUNCE_SET_SIZE(cpumap_soft, cpusize); =20 - if ( xc_hypercall_bounce_pre(xch, cpumap_hard_inout) || - xc_hypercall_bounce_pre(xch, cpumap_soft_inout) ) + if ( xc_hypercall_bounce_pre(xch, cpumap_hard) || + xc_hypercall_bounce_pre(xch, cpumap_soft) ) { PERROR("Could not allocate hcall buffers for DOMCTL_setvcpuaffinit= y"); goto out; @@ -234,17 +232,17 @@ int xc_vcpu_setaffinity(xc_interface *xch, domctl.u.vcpuaffinity.flags =3D flags; =20 set_xen_guest_handle(domctl.u.vcpuaffinity.cpumap_hard.bitmap, - cpumap_hard_inout); + cpumap_hard); domctl.u.vcpuaffinity.cpumap_hard.nr_bits =3D cpusize * 8; set_xen_guest_handle(domctl.u.vcpuaffinity.cpumap_soft.bitmap, - cpumap_soft_inout); + cpumap_soft); domctl.u.vcpuaffinity.cpumap_soft.nr_bits =3D cpusize * 8; =20 ret =3D do_domctl(xch, &domctl); =20 out: - xc_hypercall_bounce_post(xch, cpumap_hard_inout); - xc_hypercall_bounce_post(xch, cpumap_soft_inout); + xc_hypercall_bounce_post(xch, cpumap_hard); + xc_hypercall_bounce_post(xch, cpumap_soft); =20 return ret; } --=20 2.54.0