From nobody Mon May 6 14:13:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1584019535; cv=none; d=zohomail.com; s=zohoarc; b=d/ghD0pciUmDc44MrlaVFWQcYmg12q/W/YWCxqb8tqBGNJiSscaoX0TdFeo3BNYMg0SAHtPgmzrblw+6gbc4PJvrz4DGSqNzYwrTt4G+lh2Vr5r97mraGjdQcjaHH+NXnYkCrOgqVzWy8EvA7AB87htNZNh7vP+KOcpigGgTqKw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584019535; 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=Aj5oowg2Ans375sO5P4FZs47HSwjAM5D7oboCLXQSZE=; b=C8/5vuOQSv6cZPXMw3noHAQxriF2aa9unFL6i77d3ySMO/K+jwvSuhO9Pz336ritJxuFaqKJJ1szqBagZE393rcxn6V1RZAVDT83b2cfwsRmTO31qDC0HZWzb0Ud4RRU+57vPmTx3uYeYUyohQ6JJEWNc/ynnRn13DHgZrIn7RY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1584019535467440.385059513075; Thu, 12 Mar 2020 06:25:35 -0700 (PDT) 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-231-EUXGKCKqPhOsfjcTj3XrCw-1; Thu, 12 Mar 2020 09:25:32 -0400 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 75EF48010F6; Thu, 12 Mar 2020 13:25:25 +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 34D1273874; Thu, 12 Mar 2020 13:25:25 +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 8AFC218089CF; Thu, 12 Mar 2020 13:25:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 02CDPDVC022362 for ; Thu, 12 Mar 2020 09:25:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0CB839CA3; Thu, 12 Mar 2020 13:25:13 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D2B1D90801 for ; Thu, 12 Mar 2020 13:25:10 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id E1BA11003B0; Thu, 12 Mar 2020 14:25:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584019534; 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=Aj5oowg2Ans375sO5P4FZs47HSwjAM5D7oboCLXQSZE=; b=QEIqwZ0fWUWMpj4ESRJxofL30QChi/OuOjhjjXPFBhwGYi9BqTosdyGIaPHNapwTA94Nfb R8GhUhFNRRnTYZP+h5AfhmQ5H+4jWfl9uW8vhoz3T4bT2gdWfa23ANk4xxSOrL92/Tv3uT L5sMkG9jLE5wriXOsleZhSiCLkkSUW8= X-MC-Unique: EUXGKCKqPhOsfjcTj3XrCw-1 From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH 1/3] cpu: Change control flow in virCPUUpdateLive Date: Thu, 12 Mar 2020 14:25:05 +0100 Message-Id: <08fb7990fc18b05f3dcabfd29d06a25bc1d8863f.1584019301.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com 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-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The updateLive CPU sub-driver function is supposed to be called only for a subset of CPU definitions. Let's make it more obvious by turning a negative test and return into a positive check. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- src/cpu/cpu.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index 6d6191fe4e..c461c4839d 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -647,13 +647,14 @@ virCPUUpdateLive(virArch arch, if (!driver->updateLive) return 1; =20 - if (cpu->mode !=3D VIR_CPU_MODE_CUSTOM) - return 1; + if (cpu->mode =3D=3D VIR_CPU_MODE_CUSTOM) { + if (driver->updateLive(cpu, dataEnabled, dataDisabled) < 0) + return -1; =20 - if (driver->updateLive(cpu, dataEnabled, dataDisabled) < 0) - return -1; + return 0; + } =20 - return 0; + return 1; } =20 =20 --=20 2.25.1 From nobody Mon May 6 14:13:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1584019545; cv=none; d=zohomail.com; s=zohoarc; b=gGhKt/z3Vjf8tyn/TrL4D6+manpQmJoECN4z/rfps3QYk4o2jtGgHGd0+F61vM1nwSTSpkSi9Ywq5qOU3j9lkXZSW+9GLld/gfhJm5IXi+ktdmzAqJ+DP00oWgboF9xza2jQxYVbZC2P4CVW/vMRO2ztkCuH4jj3RaFOz/cx1Ic= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584019545; 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=PZdUYzaOTR50eExaM08CLqEfh89e01Bs09yc8WEXlAk=; b=TlThORkCkbft7S/hkMXjV1ksA5fN/2BRrHn3PfGQpyZQdkQJ465N17AHhZLLC7yPmJ6/3Pz8R431KovIVyjH1q5MgFTKkYFMzEkHEIJEEUACD1vMEoGLPAwPRYN9xnKfJGDg8EpUxgXWsrmcq7iYGHqYMOxjvaTczAxfU7vcbLg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1584019545318569.6738519996262; Thu, 12 Mar 2020 06:25:45 -0700 (PDT) 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-272-DM6L92vjPECC6ZtJ2HDXkQ-1; Thu, 12 Mar 2020 09:25:41 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5E67E1051EAB; Thu, 12 Mar 2020 13:25:31 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2EEE25DDA5; Thu, 12 Mar 2020 13:25:31 +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 C175085EC8; Thu, 12 Mar 2020 13:25:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 02CDPFWu022384 for ; Thu, 12 Mar 2020 09:25:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5468860BF1; Thu, 12 Mar 2020 13:25:15 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 270DC619DB for ; Thu, 12 Mar 2020 13:25:10 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id E8FB4101053; Thu, 12 Mar 2020 14:25:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584019543; 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=PZdUYzaOTR50eExaM08CLqEfh89e01Bs09yc8WEXlAk=; b=dV/X5CSOQKjI0YTcxhBUixRRw8yK2OkGhpZBuqqlkW0dtDo8U7IIa19zazQqqbfQCJeViZ a4UVkO4Y6apppj1t5AxAd4FDvqPTZgQ/WCM5V5r2/7teeHMrl2t5oS0yyb+OJDEZOXFbzd cNfs1SMD3zavN27x8tx90cfx4PaBUrU= X-MC-Unique: DM6L92vjPECC6ZtJ2HDXkQ-1 From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH 2/3] cpu_x86: Prepare virCPUx86UpdateLive for easier extension Date: Thu, 12 Mar 2020 14:25:06 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Adding more checks into the existing if statements would turn them into an unreadable mess. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- src/cpu/cpu_x86.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index dca9ed2979..5a6b7bb1d8 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -3036,9 +3036,15 @@ virCPUx86UpdateLive(virCPUDefPtr cpu, =20 for (i =3D 0; i < map->nfeatures; i++) { virCPUx86FeaturePtr feature =3D map->features[i]; + virCPUFeaturePolicy expected =3D VIR_CPU_FEATURE_LAST; =20 - if (x86DataIsSubset(&enabled, &feature->data) && - !x86DataIsSubset(&model->data, &feature->data)) { + if (x86DataIsSubset(&model->data, &feature->data)) + expected =3D VIR_CPU_FEATURE_REQUIRE; + else + expected =3D VIR_CPU_FEATURE_DISABLE; + + if (expected =3D=3D VIR_CPU_FEATURE_DISABLE && + x86DataIsSubset(&enabled, &feature->data)) { VIR_DEBUG("Feature '%s' enabled by the hypervisor", feature->n= ame); if (cpu->check =3D=3D VIR_CPU_CHECK_FULL) virBufferAsprintf(&bufAdded, "%s,", feature->name); @@ -3048,7 +3054,7 @@ virCPUx86UpdateLive(virCPUDefPtr cpu, } =20 if (x86DataIsSubset(&disabled, &feature->data) || - (x86DataIsSubset(&model->data, &feature->data) && + (expected =3D=3D VIR_CPU_FEATURE_REQUIRE && !x86DataIsSubset(&enabled, &feature->data))) { VIR_DEBUG("Feature '%s' disabled by the hypervisor", feature->= name); if (cpu->check =3D=3D VIR_CPU_CHECK_FULL) --=20 2.25.1 From nobody Mon May 6 14:13:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.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 (zohomail.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=1584019531; cv=none; d=zohomail.com; s=zohoarc; b=CouLFrxAUHMDbIVmYppGecu9B/7TQucsNz6UXUx5jqpUXXa/XEvv3g+NuBHLeBnFTHH862ZNXznBGWzMa+XfkE5vjoaltyn5SM0TlxojsrZqPN6fXDsoZylIIlhcPgPcBSDU8aVzQOxMS0u0MZ7lerWoCLvF6ahz8nBoak7htSs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584019531; 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=99q6t/lQIfHtDIdOGjI+r8p3iKTasiTRntSAArVK7Ew=; b=MDEGAU0fgdPsHCCmMmU//3A5QHKfnHtgoSvbQOF3nHuj0EbCvhXti3TXYcYJnEHjtl51rHA/GEZNQma77R/i5juiROUTYosGjDiP7PciOeaouK1gDSe/YMUepcxRh9UViFYTQcxfE5lXZtsa7+82N8soEczxkHbG42Rmdl28xE8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.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-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 158401953194664.88704734926307; Thu, 12 Mar 2020 06:25:31 -0700 (PDT) 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-316-SRAz4BgQM--hlz2n6Dd_oQ-1; Thu, 12 Mar 2020 09:25:28 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8599E2F2F; Thu, 12 Mar 2020 13:25:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 174E55C1C3; Thu, 12 Mar 2020 13:25:22 +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 E3B1E85EC4; Thu, 12 Mar 2020 13:25:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 02CDPDHN022369 for ; Thu, 12 Mar 2020 09:25:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 63C5F5DA60; Thu, 12 Mar 2020 13:25:13 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 24E195ED21 for ; Thu, 12 Mar 2020 13:25:10 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id EE7B210130D; Thu, 12 Mar 2020 14:25:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584019530; 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=99q6t/lQIfHtDIdOGjI+r8p3iKTasiTRntSAArVK7Ew=; b=DtiTuUh912Ejk3jNW7B2SR8/h6kfF538bMoIBb2sqEBLN7XX5HlfDQCI5NnSGIIlZ2jJps 5Fr6NVNev2Iv7uMt1tiz6vLLkkhGevsHB0gnNVuOsTT/9HArIIcte/JpVncxx+RLhZLj+K hb0aRjRazEcD50IJdbTykykEY+J2seA= X-MC-Unique: SRAz4BgQM--hlz2n6Dd_oQ-1 From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH 3/3] cpu: Honor check='full' for host-passthrough CPUs Date: Thu, 12 Mar 2020 14:25:07 +0100 Message-Id: <9394161d22ef0cf339ceb355cc2399cc40c4c4c6.1584019301.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com 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.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The check attribute was completely ignored for host-passthrough CPUs even if they explicitly requested some features to be enabled. For example, a domain with the following CPU definition would happily start even when 'svm' cannot be enabled. Let's call virCPUArchUpdateLive for host-passthrough CPUs with VIR_CPU_CHECK_FULL to make sure the architecture specific code can validate the provided virtual CPU against the desired definition. https://bugzilla.redhat.com/show_bug.cgi?id=3D1515677 Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- src/cpu/cpu.c | 3 ++- src/cpu/cpu_x86.c | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index c461c4839d..631c755391 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -647,7 +647,8 @@ virCPUUpdateLive(virArch arch, if (!driver->updateLive) return 1; =20 - if (cpu->mode =3D=3D VIR_CPU_MODE_CUSTOM) { + if (cpu->mode =3D=3D VIR_CPU_MODE_CUSTOM || + cpu->check =3D=3D VIR_CPU_CHECK_FULL) { if (driver->updateLive(cpu, dataEnabled, dataDisabled) < 0) return -1; =20 diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 5a6b7bb1d8..7a8a2e3f3b 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -3009,8 +3009,10 @@ virCPUx86UpdateLive(virCPUDefPtr cpu, virCPUDataPtr dataEnabled, virCPUDataPtr dataDisabled) { + bool hostPassthrough =3D cpu->mode =3D=3D VIR_CPU_MODE_HOST_PASSTHROUG= H; virCPUx86MapPtr map; virCPUx86ModelPtr model =3D NULL; + virCPUx86ModelPtr modelDisabled =3D NULL; virCPUx86Data enabled =3D VIR_CPU_X86_DATA_INIT; virCPUx86Data disabled =3D VIR_CPU_X86_DATA_INIT; virBuffer bufAdded =3D VIR_BUFFER_INITIALIZER; @@ -3026,6 +3028,10 @@ virCPUx86UpdateLive(virCPUDefPtr cpu, if (!(model =3D x86ModelFromCPU(cpu, map, -1))) goto cleanup; =20 + if (hostPassthrough && + !(modelDisabled =3D x86ModelFromCPU(cpu, map, VIR_CPU_FEATURE_DISA= BLE))) + goto cleanup; + if (dataEnabled && x86DataCopy(&enabled, &dataEnabled->data.x86) < 0) goto cleanup; @@ -3040,7 +3046,8 @@ virCPUx86UpdateLive(virCPUDefPtr cpu, =20 if (x86DataIsSubset(&model->data, &feature->data)) expected =3D VIR_CPU_FEATURE_REQUIRE; - else + else if (!hostPassthrough || + x86DataIsSubset(&modelDisabled->data, &feature->data)) expected =3D VIR_CPU_FEATURE_DISABLE; =20 if (expected =3D=3D VIR_CPU_FEATURE_DISABLE && @@ -3101,6 +3108,7 @@ virCPUx86UpdateLive(virCPUDefPtr cpu, =20 cleanup: x86ModelFree(model); + x86ModelFree(modelDisabled); virCPUx86DataClear(&enabled); virCPUx86DataClear(&disabled); VIR_FREE(added); --=20 2.25.1