From patchwork Wed Feb 5 11:24:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Durrant X-Patchwork-Id: 11366149 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0981614D5 for ; Wed, 5 Feb 2020 11:25:47 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id DA68E2072B for ; Wed, 5 Feb 2020 11:25:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="MxS66uDv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA68E2072B Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amazon.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1izIn7-00030X-Oz; Wed, 05 Feb 2020 11:24:21 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1izIn6-00030F-2I for xen-devel@lists.xenproject.org; Wed, 05 Feb 2020 11:24:20 +0000 X-Inumbo-ID: 0d241602-480a-11ea-b211-bc764e2007e4 Received: from smtp-fw-6002.amazon.com (unknown [52.95.49.90]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 0d241602-480a-11ea-b211-bc764e2007e4; Wed, 05 Feb 2020 11:24:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1580901859; x=1612437859; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=aUVhM3JACGS8Mtd4sIpfFaFQhcNQCUVDkHagyeiC2pA=; b=MxS66uDvW/Qv25UZXzwIX9WXaFJaOW+7hg3JtQO4m8urxeCgD1WsYT4T 95vZ3IRIk9VtIAK4JcidB736QZbUmZoJI4KkY2FDzc4yFt8y4JTs2wGR6 HJItJ9B7NIdLOA3mhUTzJgaXNMGX2CoBqRGw1/0iA802NVWAe/0q6pXN2 U=; IronPort-SDR: OUFv4zXygIY0WK5js32znPl/xSDWo8rTQmjY+N9vLyVNmT7LN6uLCiVcupk+IczeRqOa4EG/kH PcnqzlnPpaCg== X-IronPort-AV: E=Sophos;i="5.70,405,1574121600"; d="scan'208";a="14881112" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2b-4ff6265a.us-west-2.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-6002.iad6.amazon.com with ESMTP; 05 Feb 2020 11:24:17 +0000 Received: from EX13MTAUEA002.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan3.pdx.amazon.com [10.170.41.166]) by email-inbound-relay-2b-4ff6265a.us-west-2.amazon.com (Postfix) with ESMTPS id 9AE71A2698; Wed, 5 Feb 2020 11:24:16 +0000 (UTC) Received: from EX13D32EUC001.ant.amazon.com (10.43.164.159) by EX13MTAUEA002.ant.amazon.com (10.43.61.77) with Microsoft SMTP Server (TLS) id 15.0.1236.3; Wed, 5 Feb 2020 11:24:16 +0000 Received: from EX13MTAUEA001.ant.amazon.com (10.43.61.82) by EX13D32EUC001.ant.amazon.com (10.43.164.159) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 5 Feb 2020 11:24:15 +0000 Received: from u2f063a87eabd5f.cbg10.amazon.com (10.125.106.135) by mail-relay.amazon.com (10.43.61.243) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Wed, 5 Feb 2020 11:24:13 +0000 From: Paul Durrant To: Date: Wed, 5 Feb 2020 11:24:12 +0000 Message-ID: <20200205112412.19414-1-pdurrant@amazon.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Precedence: Bulk Subject: [Xen-devel] [PATCH v2] libxl: fix assertion failure in stub domain creation X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Julien Grall , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Paul Durrant , Ian Jackson , Jan Beulich , Anthony PERARD , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" An assertion in libxl__domain_make(): 'soft_reset || *domid == INVALID_DOMID' does not hold true for stub domain creation, where soft_reset is false but the passed in domid == 0. This is easily fixed by changing the initializer in libxl__spawn_stub_dm(). NOTE: The comment for XEN_DOMCTL_createdomain in domctl.h is changed to reflect reality. Fixes: 75259239d85d ("libxl_create: make 'soft reset' explicit") Signed-off-by: Paul Durrant Acked-by: Wei Liu Acked-by: Jan Beulich --- Cc: Ian Jackson Cc: Wei Liu Cc: Anthony PERARD Cc: Roger Pau Monné Cc: Andrew Cooper Cc: George Dunlap Cc: Jan Beulich Cc: Julien Grall Cc: Konrad Rzeszutek Wilk Cc: Stefano Stabellini An example of the assertion failure can be seen at: http://logs.test-lab.xenproject.org/osstest/logs/146726/test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm/10.ts-debian-hvm-install.log --- tools/libxl/libxl_dm.c | 2 +- xen/include/public/domctl.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index f758daf3b6..3b1da90167 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -2127,7 +2127,7 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stub_dm_spawn_state *sdss) goto out; } - sdss->pvqemu.guest_domid = 0; + sdss->pvqemu.guest_domid = INVALID_DOMID; libxl_domain_create_info_init(&dm_config->c_info); dm_config->c_info.type = LIBXL_DOMAIN_TYPE_PV; diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index 2bb7397923..fec6f6fdd1 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -42,7 +42,8 @@ /* * NB. xen_domctl.domain is an IN/OUT parameter for this operation. - * If it is specified as zero, an id is auto-allocated and returned. + * If it is specified as an invalid value (0 or >= DOMID_FIRST_RESERVED), + * an id is auto-allocated and returned. */ /* XEN_DOMCTL_createdomain */ struct xen_domctl_createdomain {