From nobody Fri May 3 20:00:05 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=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=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1601660027; cv=none; d=zohomail.com; s=zohoarc; b=dDEJmYIiTu7CCkN1rZf6bruOU5v+Jn32T3f2KfV5E3I1SnZ5i1VRXJYYrzK4HfLAh5q7+S4bWv1O+qDEhZtrTepqWCdEbN2AqiB7XOvX/YJ9Ii3PRBlnbQ/PtHqvHYUohr3v2BDSPDceqk9j2VElLXzEWn7y6lgTglhoA+z7dj0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601660027; h=Content-Type:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=bU6rtqruOzKv7kga7Rc3gGwmVWiPjKjoOj3ejQ2irNE=; b=T9CoiA08SD7LFK6xNK1jpmNEQizxP2cS1cv42C14ZK6aK8IRdSXD778fq6SEzgQschfDrpks6e55HRCyfRuAGVqlff9vIcbUscyxtVMCvl9m703e2CswIfWbI5lr7GNEcm+77oHWeIJx1LvKOHosgA08MaM/xexq7TvmtIMUeWY= 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=reject dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1601660027062293.82732103548346; Fri, 2 Oct 2020 10:33:47 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.2284.6812 (Exim 4.92) (envelope-from ) id 1kOOvu-0001ml-FA; Fri, 02 Oct 2020 17:33:26 +0000 Received: by outflank-mailman (output) from mailman id 2284.6812; Fri, 02 Oct 2020 17:33:26 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kOOvu-0001me-Be; Fri, 02 Oct 2020 17:33:26 +0000 Received: by outflank-mailman (input) for mailman id 2284; Fri, 02 Oct 2020 17:33:25 +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 1kOOvt-0001mY-KR for xen-devel@lists.xenproject.org; Fri, 02 Oct 2020 17:33:25 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id fd031275-61be-42a9-a50c-9373a991b7fc; Fri, 02 Oct 2020 17:33:24 +0000 (UTC) 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 1kOOvt-0001mY-KR for xen-devel@lists.xenproject.org; Fri, 02 Oct 2020 17:33:25 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id fd031275-61be-42a9-a50c-9373a991b7fc; Fri, 02 Oct 2020 17:33:24 +0000 (UTC) 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" X-Inumbo-ID: fd031275-61be-42a9-a50c-9373a991b7fc DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1601660004; h=from:to:cc:subject:date:message-id:mime-version; bh=5ijSWnf0ZluClQuPI9UzrQI0WNYZ7aTO7Rm1qkH0l7g=; b=QAcJKzMxsbPE7YscW9TiVgPBFCyrSiiEjyakN06KX9Z4hSp1JcIgIJ7x p8HZYqjXT/bmaX/r085zgCqJOo14pkfMhzyeag6NFRS7jPN+1OnMt7Rgi DR/WVoZDaUjqmtgwlU04VWyd5pjp+qiD27FjWEirHPJf5fUzJeX6nq7zY c=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: iSvM/BbexMhPgj/TdHXXgsohZGzUu3Yb9HHZJr8+Lavk26K0iouKVKdTETpvQTe3RG8+B1gho5 toQH15h7EEi+/+3xIvCOXltWI5+7cerioS5JgIW90++y1OsA7Ervp4z7brfjzEtkhimels+61i EHLKPF9tnRX6QdLiKKoN+yAs7le2gULZ3CTKX7NxQBvwHwHnxkU3afJM1Nt4sxmMt6rwZxKn5F h2V61e6XWR5RK2gKHYjSCV6FmvXca6+reCXvjORk5U51F9VLP9sBoTd9EYpPiMXebx2CtV6UQg gIk= X-SBRS: None X-MesageID: 28183010 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.77,328,1596513600"; d="scan'208";a="28183010" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Ian Jackson , Wei Liu , Anthony PERARD Subject: [PATCH] tools/libxl: Work around libvirt breakage in libxl__cpuid_legacy() Date: Fri, 2 Oct 2020 18:32:59 +0100 Message-ID: <20201002173259.19702-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 X-ZohoMail-DKIM: pass (identity @citrix.com) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" OSSTest reports that libvirt is reliably regressed. The only possible option is a side effect of using libxl_defbool_val(), whi= ch can only be the assert() within. Unfortunately, libvirt actually crashes in __vfscanf_internal() while presuambly trying to render some form of error. Opencode the check without the assert() to unblock staging, while we investigate what is going on with libvirt. This will want reverting at some point in the future. Not-really-fixes: bfcc97c08c ("tools/cpuid: Plumb nested_virt down into xc_= cpuid_apply_policy()" reliably breaks libvirt.) Signed-off-by: Andrew Cooper --- CC: Ian Jackson CC: Wei Liu CC: Anthony PERARD --- tools/libs/light/libxl_cpuid.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c index 08e85dcffb..16c077cceb 100644 --- a/tools/libs/light/libxl_cpuid.c +++ b/tools/libs/light/libxl_cpuid.c @@ -422,7 +422,15 @@ void libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domi= d, bool restore, { bool pae =3D true; bool itsc; - bool nested_virt =3D libxl_defbool_val(info->nested_hvm); + + /* + * Gross hack. Using libxl_defbool_val() here causes libvirt to crash= in + * __vfscanf_internal(), which is probably collateral damage from a si= de + * effect of the assert(). + * + * Unblock things for now by opencoding without the assert. + */ + bool nested_virt =3D info->nested_hvm.val > 0; =20 /* * For PV guests, PAE is Xen-controlled (it is the 'p' that differenti= ates --=20 2.11.0