From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3081AC43458 for ; Wed, 1 Jul 2026 11:16:28 +0000 (UTC) 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 X-Outflank-Mailman: Message body and most headers restored to incoming version 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-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: 8bit X-Rspamd-Action: no action 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-purgate-ID: tlsNG-d25034/1782904574-A8AA8D51-0726AD08/0/0 X-purgate-type: clean X-purgate-size: 1341 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, uint32_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 = 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); -- 2.54.0