From patchwork Wed Feb 3 20:07:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Druzhinin X-Patchwork-Id: 12065281 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26284C433E0 for ; Wed, 3 Feb 2021 20:07:41 +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 B593064F68 for ; Wed, 3 Feb 2021 20:07:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B593064F68 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.81049.149018 (Exim 4.92) (envelope-from ) id 1l7OQy-00007W-1w; Wed, 03 Feb 2021 20:07:28 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 81049.149018; Wed, 03 Feb 2021 20:07: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 1l7OQx-00007O-V0; Wed, 03 Feb 2021 20:07:27 +0000 Received: by outflank-mailman (input) for mailman id 81049; Wed, 03 Feb 2021 20:07:27 +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 1l7OQx-000079-5k for xen-devel@lists.xenproject.org; Wed, 03 Feb 2021 20:07:27 +0000 Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 4e528a65-e106-4e81-ad5f-82f4218a94de; Wed, 03 Feb 2021 20:07:25 +0000 (UTC) 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: 4e528a65-e106-4e81-ad5f-82f4218a94de DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1612382845; h=from:to:cc:subject:date:message-id:mime-version; bh=MITj/cWLh6YxfT29z0NOD+rmVZ8NCm5//wvOqP2KyUk=; b=IdnH1eTYWRSY+3VigfL5vEeidgy37RQz4URBXPlmdon6t3HNXZLz7pjJ pSw1u74ccz9TeLCuvcKrRwtou6h5rjJqyJT5ntTRg6k92RETZpcvCog6q AftfuNP1+RR86oQgd4wu6jJ/CJ2bwIvEeTYASxa727D1LAHskZHqjusB8 A=; Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: hIP17ujBP+/tAu1gzbWzgP6zqDXD9V+CusUUyPvVzqJnLeOYF27W9t7XN/Ms/LrgPU7AqAoOw/ okQCZmc7FoD0+0GAgq+8cqZ+lmzxvW/+qds4atbYWZQJyCyAjttAtKEIn/Je96nLiEqHeM+HUZ Blx/pTFLi+uWNkwSmdSmnm97XQLUhzwyH1d6hCfG9MG0yQqkS7oJTkrR+t/klFbCOO9by7bFIy gNPJXPtpceFWChJMSP1dgdYDPpJNy2w3Kcujl8bMWcAutJDdnTqty7Mt9NvMmUJwzdWpXeHdYh lRI= X-SBRS: 4.0 X-MesageID: 37834476 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.79,399,1602561600"; d="scan'208";a="37834476" From: Igor Druzhinin To: CC: , , , , Igor Druzhinin Subject: [PATCH v2 1/2] tools/libxl: pass libxl__domain_build_state to libxl__arch_domain_create Date: Wed, 3 Feb 2021 20:07:03 +0000 Message-ID: <1612382824-20232-1-git-send-email-igor.druzhinin@citrix.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 No functional change. Signed-off-by: Igor Druzhinin Reviewed-by: Ian Jackson --- New patch in v2 as requested. --- tools/libs/light/libxl_arch.h | 6 ++++-- tools/libs/light/libxl_arm.c | 4 +++- tools/libs/light/libxl_dom.c | 2 +- tools/libs/light/libxl_x86.c | 6 ++++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/tools/libs/light/libxl_arch.h b/tools/libs/light/libxl_arch.h index 6a91775..c305d70 100644 --- a/tools/libs/light/libxl_arch.h +++ b/tools/libs/light/libxl_arch.h @@ -30,8 +30,10 @@ int libxl__arch_domain_save_config(libxl__gc *gc, /* arch specific internal domain creation function */ _hidden -int libxl__arch_domain_create(libxl__gc *gc, libxl_domain_config *d_config, - uint32_t domid); +int libxl__arch_domain_create(libxl__gc *gc, + libxl_domain_config *d_config, + libxl__domain_build_state *state, + uint32_t domid); /* setup arch specific hardware description, i.e. DTB on ARM */ _hidden diff --git a/tools/libs/light/libxl_arm.c b/tools/libs/light/libxl_arm.c index 66e8a06..8c4eda3 100644 --- a/tools/libs/light/libxl_arm.c +++ b/tools/libs/light/libxl_arm.c @@ -126,7 +126,9 @@ int libxl__arch_domain_save_config(libxl__gc *gc, return 0; } -int libxl__arch_domain_create(libxl__gc *gc, libxl_domain_config *d_config, +int libxl__arch_domain_create(libxl__gc *gc, + libxl_domain_config *d_config, + ibxl__domain_build_state *state, uint32_t domid) { return 0; diff --git a/tools/libs/light/libxl_dom.c b/tools/libs/light/libxl_dom.c index 1916857..842a51c 100644 --- a/tools/libs/light/libxl_dom.c +++ b/tools/libs/light/libxl_dom.c @@ -378,7 +378,7 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid, state->store_port = xc_evtchn_alloc_unbound(ctx->xch, domid, state->store_domid); state->console_port = xc_evtchn_alloc_unbound(ctx->xch, domid, state->console_domid); - rc = libxl__arch_domain_create(gc, d_config, domid); + rc = libxl__arch_domain_create(gc, d_config, state, domid); /* Construct a CPUID policy, but only for brand new domains. Domains * being migrated-in/restored have CPUID handled during the diff --git a/tools/libs/light/libxl_x86.c b/tools/libs/light/libxl_x86.c index 91a9fc7..91169d1 100644 --- a/tools/libs/light/libxl_x86.c +++ b/tools/libs/light/libxl_x86.c @@ -453,8 +453,10 @@ static int hvm_set_conf_params(libxl__gc *gc, uint32_t domid, return ret; } -int libxl__arch_domain_create(libxl__gc *gc, libxl_domain_config *d_config, - uint32_t domid) +int libxl__arch_domain_create(libxl__gc *gc, + libxl_domain_config *d_config, + libxl__domain_build_state *state, + uint32_t domid) { const libxl_domain_build_info *info = &d_config->b_info; int ret = 0; From patchwork Wed Feb 3 20:07:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Druzhinin X-Patchwork-Id: 12065283 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2106AC433E0 for ; Wed, 3 Feb 2021 20:07:46 +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 B542964F74 for ; Wed, 3 Feb 2021 20:07:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B542964F74 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.81050.149031 (Exim 4.92) (envelope-from ) id 1l7OR8-0000CC-BP; Wed, 03 Feb 2021 20:07:38 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 81050.149031; Wed, 03 Feb 2021 20:07:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l7OR8-0000C0-7R; Wed, 03 Feb 2021 20:07:38 +0000 Received: by outflank-mailman (input) for mailman id 81050; Wed, 03 Feb 2021 20:07:37 +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 1l7OR7-0000Bi-Hb for xen-devel@lists.xenproject.org; Wed, 03 Feb 2021 20:07:37 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 19246fc6-9e83-44af-808f-9044396c1725; Wed, 03 Feb 2021 20:07:35 +0000 (UTC) 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: 19246fc6-9e83-44af-808f-9044396c1725 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1612382855; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=EyvH51Bn6pq0zdCFJ+K3Cfpfi1Q7rbnOK1TQDTsUE8M=; b=RcdmPx3C9CDwLmZehsq8nZ38IlW6cED3EFsqsXuKhml/3dsScbMePHhy U5RUAie/6d6IRBzaQpaB1or8OJpd59xAVDJ+xoqDuAGHVdn+S0Nm1QK28 zOdeZxHaPqGVL8AixbE+JZFB+SPasblD//BU358MBDDd/jDynOhhY6AXC E=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: y0vrFMvfz/3F9VBGEL2ptjYDNwIkFipgqd+cfKDaRytnjYsPTCef31rc5xJ/HbNAXLEchisjiv 3gyu/5xpUt9m1QotYqw6k1SELRN2HXkYxPIVXamaUo3AzBYn1ddhDP53UaDR36MH+gsYsslNGU 5Ol65laLUoWwMf1LTp+ENVwtN0buuh8qixcHI0qu/6xQdvVvmZNwxZmKgBha5em6yrm1Hvg6bA 7SjrpfMoYkW3mU/KJ1XRI3IRRjihdfCMFL3IZyIKlZJ1tmx+fyZYw2l3070rEaHaQQhEOXBbEr Aeg= X-SBRS: 4.0 X-MesageID: 36694182 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.79,399,1602561600"; d="scan'208";a="36694182" From: Igor Druzhinin To: CC: , , , , Igor Druzhinin Subject: [PATCH v2 2/2] tools/libxl: only set viridian flags on new domains Date: Wed, 3 Feb 2021 20:07:04 +0000 Message-ID: <1612382824-20232-2-git-send-email-igor.druzhinin@citrix.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1612382824-20232-1-git-send-email-igor.druzhinin@citrix.com> References: <1612382824-20232-1-git-send-email-igor.druzhinin@citrix.com> MIME-Version: 1.0 Domains migrating or restoring should have viridian HVM param key in the migration stream already and setting that twice results in Xen returing -EEXIST on the second attempt later (during migration stream parsing) in case the values don't match. That causes migration/restore operation to fail at destination side. That issue is now resurfaced by the latest commits (983524671 and 7e5cffcd1e) extending default viridian feature set making the values from the previous migration streams and those set at domain construction different. Suggested-by: Andrew Cooper Signed-off-by: Igor Druzhinin Reviewed-by: Andrew Cooper --- tools/libs/light/libxl_x86.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/libs/light/libxl_x86.c b/tools/libs/light/libxl_x86.c index 91169d1..58187ed 100644 --- a/tools/libs/light/libxl_x86.c +++ b/tools/libs/light/libxl_x86.c @@ -468,7 +468,10 @@ int libxl__arch_domain_create(libxl__gc *gc, (ret = hvm_set_conf_params(gc, domid, info)) != 0) goto out; - if (info->type == LIBXL_DOMAIN_TYPE_HVM && + /* Viridian flags are already a part of the migration stream so set + * them here only for brand new domains. */ + if (!state->restore && + info->type == LIBXL_DOMAIN_TYPE_HVM && (ret = hvm_set_viridian_features(gc, domid, info)) != 0) goto out;