From nobody Wed Nov 27 19:48:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1542214100600804.897530056021; Wed, 14 Nov 2018 08:48:20 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8A33E4E93F; Wed, 14 Nov 2018 16:48:17 +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 54B7A194AA; Wed, 14 Nov 2018 16:48:17 +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 03FFC181A86C; Wed, 14 Nov 2018 16:48:17 +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 wAEGS0rK001204 for ; Wed, 14 Nov 2018 11:28:00 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2BB7F5DD64; Wed, 14 Nov 2018 16:28:00 +0000 (UTC) Received: from vitty.brq.redhat.com (unknown [10.43.2.155]) by smtp.corp.redhat.com (Postfix) with ESMTP id 051255D9CC; Wed, 14 Nov 2018 16:27:58 +0000 (UTC) From: Vitaly Kuznetsov To: libvir-list@redhat.com Date: Wed, 14 Nov 2018 17:27:50 +0100 Message-Id: <20181114162751.25223-5-vkuznets@redhat.com> In-Reply-To: <20181114162751.25223-1-vkuznets@redhat.com> References: <20181114162751.25223-1-vkuznets@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Andrea Bolognani , Nikolay Shirokovskiy Subject: [libvirt] [PATCH v2 4/5] conf: add support for Hyper-V Enlightened VMCS 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 14 Nov 2018 16:48:18 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Support Hyper-V Enlightened VMCS in domain config. Qemu support will be implemented in the next patch, adding interim VIR_DOMAIN_HYPERV_EVMCS cases to src/qemu/* for now. Signed-off-by: Vitaly Kuznetsov --- docs/formatdomain.html.in | 7 +++++++ docs/schemas/domaincommon.rng | 5 +++++ src/conf/domain_conf.c | 4 ++++ src/conf/domain_conf.h | 1 + src/cpu/cpu_x86.c | 3 +++ src/cpu/cpu_x86_data.h | 1 + src/qemu/qemu_command.c | 1 + src/qemu/qemu_parse_command.c | 1 + src/qemu/qemu_process.c | 1 + 9 files changed, 24 insertions(+) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 7592f13a84..1b1518f465 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1982,6 +1982,7 @@ <reenlightenment state=3D'on'/> <tlbflush state=3D'on'/> <ipi state=3D'on'/> + <evmcs state=3D'on'/> </hyperv> <kvm> <hidden state=3D'on'/> @@ -2128,6 +2129,12 @@ on, off 4.10.0 (QEMU 3.1) + + evmcs + Enable Enlightened VMCS + on, off + 4.10.0 (QEMU 3.1) +
pvspinlock
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 26019b3279..ff57ce1015 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -5774,6 +5774,11 @@ + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 24876994c5..18d235872f 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -174,6 +174,7 @@ VIR_ENUM_IMPL(virDomainHyperv, VIR_DOMAIN_HYPERV_LAST, "reenlightenment", "tlbflush", "ipi", + "evmcs", ); =20 VIR_ENUM_IMPL(virDomainKVM, VIR_DOMAIN_KVM_LAST, @@ -19993,6 +19994,7 @@ virDomainDefParseXML(xmlDocPtr xml, case VIR_DOMAIN_HYPERV_REENLIGHTENMENT: case VIR_DOMAIN_HYPERV_TLBFLUSH: case VIR_DOMAIN_HYPERV_IPI: + case VIR_DOMAIN_HYPERV_EVMCS: break; =20 case VIR_DOMAIN_HYPERV_SPINLOCKS: @@ -22188,6 +22190,7 @@ virDomainDefFeaturesCheckABIStability(virDomainDefP= tr src, case VIR_DOMAIN_HYPERV_REENLIGHTENMENT: case VIR_DOMAIN_HYPERV_TLBFLUSH: case VIR_DOMAIN_HYPERV_IPI: + case VIR_DOMAIN_HYPERV_EVMCS: if (src->hyperv_features[i] !=3D dst->hyperv_features[i]) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("State of HyperV enlightenment " @@ -27953,6 +27956,7 @@ virDomainDefFormatInternal(virDomainDefPtr def, case VIR_DOMAIN_HYPERV_REENLIGHTENMENT: case VIR_DOMAIN_HYPERV_TLBFLUSH: case VIR_DOMAIN_HYPERV_IPI: + case VIR_DOMAIN_HYPERV_EVMCS: break; =20 case VIR_DOMAIN_HYPERV_SPINLOCKS: diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 9eea75548d..061185e779 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1796,6 +1796,7 @@ typedef enum { VIR_DOMAIN_HYPERV_REENLIGHTENMENT, VIR_DOMAIN_HYPERV_TLBFLUSH, VIR_DOMAIN_HYPERV_IPI, + VIR_DOMAIN_HYPERV_EVMCS, =20 VIR_DOMAIN_HYPERV_LAST } virDomainHyperv; diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 33252e927e..ebfa74fccd 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -116,6 +116,8 @@ KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_TLBFLUSH, 0x40000004, 0x00000004); KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_IPI, 0x40000004, 0x00000400); +KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_EVMCS, + 0x40000004, 0x00004000); =20 static virCPUx86Feature x86_kvm_features[] =3D { @@ -140,6 +142,7 @@ static virCPUx86Feature x86_kvm_features[] =3D KVM_FEATURE(VIR_CPU_x86_KVM_HV_REENLIGHTENMENT), KVM_FEATURE(VIR_CPU_x86_KVM_HV_TLBFLUSH), KVM_FEATURE(VIR_CPU_x86_KVM_HV_IPI), + KVM_FEATURE(VIR_CPU_x86_KVM_HV_EVMCS), }; =20 typedef struct _virCPUx86Model virCPUx86Model; diff --git a/src/cpu/cpu_x86_data.h b/src/cpu/cpu_x86_data.h index 8c51d88e1a..f52bba821f 100644 --- a/src/cpu/cpu_x86_data.h +++ b/src/cpu/cpu_x86_data.h @@ -66,6 +66,7 @@ struct _virCPUx86CPUID { # define VIR_CPU_x86_KVM_HV_REENLIGHTENMENT "__kvm_hv_reenlightenment" # define VIR_CPU_x86_KVM_HV_TLBFLUSH "__kvm_hv_tlbflush" # define VIR_CPU_x86_KVM_HV_IPI "__kvm_hv_ipi" +# define VIR_CPU_x86_KVM_HV_EVMCS "__kvm_hv_evmcs" =20 =20 # define VIR_CPU_X86_DATA_INIT { 0 } diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 6fc8deff00..27e77f7d66 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6900,6 +6900,7 @@ qemuBuildCpuCommandLine(virCommandPtr cmd, def->hyperv_vendor_id); break; =20 + case VIR_DOMAIN_HYPERV_EVMCS: /* coverity[dead_error_begin] */ case VIR_DOMAIN_HYPERV_LAST: break; diff --git a/src/qemu/qemu_parse_command.c b/src/qemu/qemu_parse_command.c index a15f4d1121..a1f8369919 100644 --- a/src/qemu/qemu_parse_command.c +++ b/src/qemu/qemu_parse_command.c @@ -1580,6 +1580,7 @@ qemuParseCommandLineCPU(virDomainDefPtr dom, =20 break; =20 + case VIR_DOMAIN_HYPERV_EVMCS: case VIR_DOMAIN_HYPERV_LAST: break; } diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 85e2f7046b..ed8bcf7f76 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -3959,6 +3959,7 @@ qemuProcessVerifyHypervFeatures(virDomainDefPtr def, virDomainHypervTypeToString(i)); return -1; =20 + case VIR_DOMAIN_HYPERV_EVMCS: /* coverity[dead_error_begin] */ case VIR_DOMAIN_HYPERV_VENDOR_ID: case VIR_DOMAIN_HYPERV_LAST: --=20 2.17.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list