From nobody Tue Nov 26 14:45:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1573504596; cv=none; d=zoho.com; s=zohoarc; b=eZg2AHvkaBUORXlWRvQSNBr1gmn7VKpohRcEH5oicYLBAj6xuJoT8hM0oErb3Hv/LwwnEyU4oebeXMG97RDuJjNPG3X10fmbjvQE5qqUMRTQl3oJ7I8oU0uFZ1KoGrIGi74aiwSwuHhMvLRBedJHJ/g8CoXGsdmjEokjCKYMebY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573504596; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=K4CcTf/sVPNFR43W3onco+KSBktWPa67bqYY/ArVXik=; b=kCpaBeZ+FKJzoTc6UXDigkVRFr2F1ACF9DKh2oklFX4OTDzK47JO2kmkgcYDwFaDNngFUeXEcbcrAV05gciwDZJeJMr/ulPMaahf9MSWF0eSIBqBHHhQr8sVWIBDhIgboSgthdmwiIMdzDB4ymKgrnrV8UIG8tRlOR/eOWgiwio= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 15735045961214.442112478304239; Mon, 11 Nov 2019 12:36:36 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-290-HgVnzv_nNp-74xVQYVDpDQ-1; Mon, 11 Nov 2019 15:36:33 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B7CE4801FD2; Mon, 11 Nov 2019 20:36:27 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 902EF5D6A3; Mon, 11 Nov 2019 20:36:27 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 49769180202F; Mon, 11 Nov 2019 20:36:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xABKZlwB011667 for ; Mon, 11 Nov 2019 15:35:47 -0500 Received: by smtp.corp.redhat.com (Postfix) id D501460905; Mon, 11 Nov 2019 20:35:47 +0000 (UTC) Received: from orkuz.int.mamuti.net (ovpn-204-85.brq.redhat.com [10.40.204.85]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7F02F60902 for ; Mon, 11 Nov 2019 20:35:44 +0000 (UTC) Received: by orkuz.int.mamuti.net (Postfix, from userid 500) id 77DE52A9ED0; Mon, 11 Nov 2019 21:35:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573504595; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=K4CcTf/sVPNFR43W3onco+KSBktWPa67bqYY/ArVXik=; b=NLJI8+DCrNEw4gl1yDqRrmTkrLUpNfxOfJiF2e24g8CPOvnjcqAG5ECmmGBz8ByQgxL33o QglUG/+bifs1WzpLANKFO6OUFH59cdfiWb5OS1iibsGfU8TZIx4TlzKbHmvnW9BIospgQl AfS1z6xIxqRStpliMgjQeE/JOy4N/Ps= From: Jiri Denemark To: libvir-list@redhat.com Date: Mon, 11 Nov 2019 21:35:37 +0100 Message-Id: <847d29addca4b98ec2fd206c3302e7d3e2df67e7.1573504055.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 6/6] cpu_map: Drop pconfig from Icelake-Server CPU model X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: HgVnzv_nNp-74xVQYVDpDQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The pconfig feature was enabled in QEMU by accident in 3.1.0. All other newer versions do not support it and it was removed from the Icelake-Server CPU model in QEMU. We don't normally change our CPU models even when QEMU does so to avoid breaking migrations between different versions of libvirt. But we can safely do so in this specific case. QEMU never supported enabling pconfig so any domain which was able to start has pconfig disabled. With a small compatibility hack which explicitly disables pconfig when CPU model equals Icelake-Server in migratable domain definition, only one migration scenario stays broken (and there's nothing we can do about it): from any host to a host with libvirt < 5.10.0 and QEMU > 3.1.0. https://bugzilla.redhat.com/show_bug.cgi?id=3D1749672 Signed-off-by: Jiri Denemark --- src/cpu_map/x86_Icelake-Server.xml | 1 - src/qemu/qemu_domain.c | 23 +++++++++++++++++++ src/qemu/qemu_domain.h | 3 +++ src/qemu/qemu_migration_cookie.c | 3 +++ .../x86_64-cpuid-Ice-Lake-Server-guest.xml | 1 - .../x86_64-cpuid-Ice-Lake-Server-host.xml | 11 +-------- .../x86_64-cpuid-Ice-Lake-Server-json.xml | 1 - 7 files changed, 30 insertions(+), 13 deletions(-) diff --git a/src/cpu_map/x86_Icelake-Server.xml b/src/cpu_map/x86_Icelake-S= erver.xml index ecd21cf5c7..a565371977 100644 --- a/src/cpu_map/x86_Icelake-Server.xml +++ b/src/cpu_map/x86_Icelake-Server.xml @@ -54,7 +54,6 @@ - diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 58a82fbd60..4a641019be 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -8921,6 +8921,26 @@ qemuDomainDefCopy(virQEMUDriverPtr driver, } =20 =20 +int +qemuDomainMakeCPUMigratable(virCPUDefPtr cpu) +{ + if (cpu->mode =3D=3D VIR_CPU_MODE_CUSTOM && + STREQ_NULLABLE(cpu->model, "Icelake-Server")) { + /* Originally Icelake-Server CPU model contained pconfig CPU featu= re. + * It was never actually enabled and thus it was removed. To enable + * migration to QEMU 3.1.0 (with both new and old libvirt), we + * explicitly disable pconfig in migration XML (otherwise old libv= irt + * would think it was implicitly enabled on the source). New libvi= rt + * will drop it from the XML before starting the domain on new QEM= U. + */ + if (virCPUDefUpdateFeature(cpu, "pconfig", VIR_CPU_FEATURE_DISABLE= ) < 0) + return -1; + } + + return 0; +} + + static int qemuDomainDefFormatBufInternal(virQEMUDriverPtr driver, virQEMUCapsPtr qemuCaps, @@ -9103,6 +9123,9 @@ qemuDomainDefFormatBufInternal(virQEMUDriverPtr drive= r, if (!(def->cpu =3D virCPUDefCopy(origCPU))) goto cleanup; } + + if (qemuDomainMakeCPUMigratable(def->cpu) < 0) + goto cleanup; } =20 format: diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index b23912ee98..a458af79f7 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -1225,3 +1225,6 @@ qemuDomainValidateActualNetDef(const virDomainNetDef = *net, int qemuDomainSupportsCheckpointsBlockjobs(virDomainObjPtr vm) G_GNUC_WARN_UNUSED_RESULT; + +int +qemuDomainMakeCPUMigratable(virCPUDefPtr cpu); diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_coo= kie.c index 27e6bde601..5f64800aec 100644 --- a/src/qemu/qemu_migration_cookie.c +++ b/src/qemu/qemu_migration_cookie.c @@ -536,6 +536,9 @@ qemuMigrationCookieAddCPU(qemuMigrationCookiePtr mig, if (!(mig->cpu =3D virCPUDefCopy(vm->def->cpu))) return -1; =20 + if (qemuDomainMakeCPUMigratable(mig->cpu) < 0) + return -1; + mig->flags |=3D QEMU_MIGRATION_COOKIE_CPU; =20 return 0; diff --git a/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-guest.xml b/tes= ts/cputestdata/x86_64-cpuid-Ice-Lake-Server-guest.xml index 6ca2099b33..4676f3aa7d 100644 --- a/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-guest.xml @@ -32,5 +32,4 @@ - diff --git a/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-host.xml b/test= s/cputestdata/x86_64-cpuid-Ice-Lake-Server-host.xml index 31af20bc85..35b9e39629 100644 --- a/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-host.xml +++ b/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-host.xml @@ -1,6 +1,6 @@ x86_64 - Icelake-Client + Icelake-Server Intel @@ -21,23 +21,14 @@ - - - - - - - - - diff --git a/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-json.xml b/test= s/cputestdata/x86_64-cpuid-Ice-Lake-Server-json.xml index b043db58d7..ada11d2608 100644 --- a/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-json.xml +++ b/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-json.xml @@ -13,5 +13,4 @@ - --=20 2.24.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list