From nobody Sat Apr 27 11:55:50 2024 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=fail; 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 ARC-Seal: i=1; a=rsa-sha256; t=1588244490; cv=none; d=zohomail.com; s=zohoarc; b=VEabs893ErkDwhqrt9ehaWjIUJuW6nFOBwqjQx3blMYn9o2hyr8eAkLjjp9oebHrwCRga0hFF7n0f8acDG3RYcqR3sD2FdrdAurSeamj8hjx9hho4D8g23Eogzcim3ai3FUNYXNQq4cw/pWXzqGtZj4SEpKD3J7/8Au9bbLWs3s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588244490; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=/JuMaoQK3/yKKWTgd5NYymon2SfOLFfbIdK1YvAE+to=; b=bnn6rO5XqCzkwWmS/Q80eOA+aVVN66/rPAhjDz/O7owI/LKxBVLEeudKUV6d9MD8f3MRWb+Sv5Fw1Uk+hzt7yzNCOy6hyqK+8Th/B4k0AyCB8/TQXyIk/8L9ZmPmets2739+Sg9cqyjZWf8J267QY13ciAbwCF5bkPPci93Sqbw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1588244490166489.3442430913259; Thu, 30 Apr 2020 04:01:30 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jU6w6-0001SY-MJ; Thu, 30 Apr 2020 11:00:58 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jU6w4-0001ST-OK for xen-devel@lists.xenproject.org; Thu, 30 Apr 2020 11:00:56 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id dd608c24-8ad1-11ea-9a22-12813bfff9fa; Thu, 30 Apr 2020 11:00:55 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jU6w3-0000ut-4c; Thu, 30 Apr 2020 11:00:55 +0000 Received: from 54-240-197-235.amazon.com ([54.240.197.235] helo=ufe34d9ed68d054.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jU6w2-0002r0-On; Thu, 30 Apr 2020 11:00:54 +0000 X-Inumbo-ID: dd608c24-8ad1-11ea-9a22-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=/JuMaoQK3/yKKWTgd5NYymon2SfOLFfbIdK1YvAE+to=; b=eSbXiFiq9/lU7eQee3VMboUyF1 KH5BVzNaUwdCRQglwrjq3AsZ9XXhO8BW6CEwcE7lriPfoS3HrGwtu+5AQulIEtD0cChP7tJ8yvuGs qoS3tEc+v8dV7aSeLGDsxbCNXBS3R2qb0Hp1lReCvAbpkZlx9jBorvvGeEA4FKQceMHk=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [PATCH] tools/xl: vcpu-pin: Skip global affinity when the hard affinity is not changed Date: Thu, 30 Apr 2020 12:00:51 +0100 Message-Id: <20200430110051.8965-1-julien@xen.org> X-Mailer: git-send-email 2.17.1 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: julien@xen.org, Wei Liu , Julien Grall , Ian Jackson , Pawel Wieczorkiewicz , Anthony PERARD Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Julien Grall After XSA-273, it is not possible to modify the vCPU soft affinity using xl vcpu-pin without modifying the hard affinity. Instead the command will crash. 42sh> gdb /usr/local/sbin/xl (gdb) r vcpu-pin 0 0 - 10 [...] Program received signal SIGSEGV, Segmentation fault. [...] (gdb) bt This is happening because 'xl' will use NULL when an affinity doesn't need to be modified. However, we will still try to apply the global affinity in the this case. As the hard affinity is not changed, then we don't need to apply the global affinity. So skip it when hard is NULL. Backport: 4.6+ # Any release with XSA-273 Fixes: aa67b97ed342 ("xl.conf: Add global affinity masks") Reported-by: Pawel Wieczorkiewicz Signed-off-by: Julien Grall Acked-by: Wei Liu --- tools/xl/xl_vcpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/xl/xl_vcpu.c b/tools/xl/xl_vcpu.c index 9ff5354f749b..66877a57dee4 100644 --- a/tools/xl/xl_vcpu.c +++ b/tools/xl/xl_vcpu.c @@ -283,7 +283,7 @@ int main_vcpupin(int argc, char **argv) } =20 /* Only hard affinity matters here */ - if (!ignore_masks) { + if (!ignore_masks && hard) { libxl_dominfo dominfo; =20 if (libxl_domain_info(ctx, &dominfo, domid)) { --=20 2.17.1