From nobody Tue May 7 20:10:11 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 ARC-Seal: i=1; a=rsa-sha256; t=1565071099; cv=none; d=zoho.com; s=zohoarc; b=nFENsfeSHZuZaswIdkmWBqD3TplHIYwBFTXoxqfeHn+jXb10+Z3oH/eZfd4S/6hQT2WkBY79x/HDc+QWLsgk33vzZf9kMIQfdVO1c0fxN6mbMH/5zevknM3WyPw4K+FGrFPaCNZJd0NHvPMpvn7rN2drIZNHE5Hfez0ihc+zyqw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565071099; h=Content-Type:Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=NhqsF8fYA09CuDX2lc1dbjBuFr34GF79H94gQH07siM=; b=jIlMsi0ylO9lALt0iPOQv2zOb8WvSVsKeR/dUlGNET07fW5ttRDsYldnASSIVEEEabvlTe7zDR/i2T3QARa7Gume2RB8vtcs+tZJ5PKXuxDNf8g3sL4PxffKUPMFh7uSE4i6/0RfeFiRfQl89MZNU8GqdJutWsARPtdQQJJjZyk= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1565071099318327.25269601108755; Mon, 5 Aug 2019 22:58:19 -0700 (PDT) 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 1D3537FDFC; Tue, 6 Aug 2019 05:58:18 +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 EB27557AA; Tue, 6 Aug 2019 05:58: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 B5BCF1800204; Tue, 6 Aug 2019 05:58:17 +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 x765qj2E028135 for ; Tue, 6 Aug 2019 01:52:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 54BE960610; Tue, 6 Aug 2019 05:52:45 +0000 (UTC) Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4EBEE60605 for ; Tue, 6 Aug 2019 05:52:43 +0000 (UTC) Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D0FD83C92D for ; Tue, 6 Aug 2019 05:52:42 +0000 (UTC) Received: by mail-wm1-f72.google.com with SMTP id f189so19759875wme.5 for ; Mon, 05 Aug 2019 22:52:42 -0700 (PDT) Received: from vitty.brq.redhat.com (ip-89-176-127-93.net.upcbroadband.cz. [89.176.127.93]) by smtp.gmail.com with ESMTPSA id i66sm156446020wmi.11.2019.08.05.22.52.39 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 05 Aug 2019 22:52:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qOJBVqC8myFWjZkW0M4Rhj8XETnWM9XawTIJ7WtIO0g=; b=uSy0N1/lLgBoUJg5EPJy3XmRg997o//J0qYBXxi2wbuYP3eXReJtRBnIdwoTSDVIcY hrJeEIZDNqscMLJANmPrY9MRI6hU2SQHz8XZH2LdG0wyAL5swS4gJYgbKerhQNCnStwF d/0oxmfxL8V7zTmcEbk2p6m2+sXCakQKh13akR94yfRI6lv++HPBCgjVF+VNsL+pLMJB SKoxy/VAAqcNwHXSL+SIyv9/rlpH/veNddbl/L2u36lWFr+/BDheRhKXi/JXt8i342yV b80lGsKSAW1JbbBzO18RBW0o1O1htqI8GvMdQWEC7OD4qLfdmowkrJy6La+i9suhG03b n4sg== X-Gm-Message-State: APjAAAURQbQ2WcPMgDLCH4HNAdWQy+0RveqL89tZtqFEGFSRqV008N9W LDJKtiMSYnfXL7+9wIZuVTduRxtjQwBd1CnqpWdPoiCfakbLPOJLSV4fcedDTb+8JwnaKqcvaCn 6e1rw2ljGCfk22N3TclQ= X-Received: by 2002:adf:fdcc:: with SMTP id i12mr2291368wrs.88.1565070761251; Mon, 05 Aug 2019 22:52:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqyaDeWNqOlItaJwp01ZigzzVzQSBUBnYgGf48o4US5Z0UrmjXTmhHhBnciN101SagUJVYqMCw== X-Received: by 2002:adf:fdcc:: with SMTP id i12mr2291342wrs.88.1565070761021; Mon, 05 Aug 2019 22:52:41 -0700 (PDT) From: Vitaly Kuznetsov To: libvir-list@redhat.com Date: Tue, 6 Aug 2019 07:52:32 +0200 Message-Id: <20190806055236.31837-2-vkuznets@redhat.com> In-Reply-To: <20190806055236.31837-1-vkuznets@redhat.com> References: <20190806055236.31837-1-vkuznets@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?J=C3=A1n=20Tomko?= , Nikolay Shirokovskiy Subject: [libvirt] [PATCH v3 1/5] cpu_x86: add Edx to KVM_FEATURE_DEF() 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: , 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.27]); Tue, 06 Aug 2019 05:58:18 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Some Hyper-V features (like the upcoming Direct Synthetic timers) are announced by feature bits in Edx but KVM_FEATURE_DEF() supports only Eax. Signed-off-by: Vitaly Kuznetsov Reviewed-by: J=C3=A1n Tomko --- src/cpu/cpu_x86.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index b58eb2c9d8..d2d9537c32 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -59,9 +59,9 @@ struct _virCPUx86Feature { { .type =3D VIR_CPU_X86_DATA_CPUID, \ .data =3D { .cpuid =3D {__VA_ARGS__} } } =20 -#define KVM_FEATURE_DEF(Name, Eax_in, Eax) \ +#define KVM_FEATURE_DEF(Name, Eax_in, Eax, Edx) \ static virCPUx86DataItem Name ## _data[] =3D { \ - CPUID(.eax_in =3D Eax_in, .eax =3D Eax), \ + CPUID(.eax_in =3D Eax_in, .eax =3D Eax, .edx =3D Edx), \ } =20 #define KVM_FEATURE(Name) \ @@ -74,32 +74,32 @@ struct _virCPUx86Feature { } =20 KVM_FEATURE_DEF(VIR_CPU_x86_KVM_PV_UNHALT, - 0x40000001, 0x00000080); + 0x40000001, 0x00000080, 0x0); =20 KVM_FEATURE_DEF(VIR_CPU_x86_HV_RUNTIME, - 0x40000003, 0x00000001); + 0x40000003, 0x00000001, 0x0); KVM_FEATURE_DEF(VIR_CPU_x86_HV_SYNIC, - 0x40000003, 0x00000004); + 0x40000003, 0x00000004, 0x0); KVM_FEATURE_DEF(VIR_CPU_x86_HV_STIMER, - 0x40000003, 0x00000008); + 0x40000003, 0x00000008, 0x0); KVM_FEATURE_DEF(VIR_CPU_x86_HV_RELAXED, - 0x40000003, 0x00000020); + 0x40000003, 0x00000020, 0x0); KVM_FEATURE_DEF(VIR_CPU_x86_HV_VAPIC, - 0x40000003, 0x00000030); + 0x40000003, 0x00000030, 0x0); KVM_FEATURE_DEF(VIR_CPU_x86_HV_VPINDEX, - 0x40000003, 0x00000040); + 0x40000003, 0x00000040, 0x0); KVM_FEATURE_DEF(VIR_CPU_x86_HV_RESET, - 0x40000003, 0x00000080); + 0x40000003, 0x00000080, 0x0); KVM_FEATURE_DEF(VIR_CPU_x86_HV_FREQUENCIES, - 0x40000003, 0x00000800); + 0x40000003, 0x00000800, 0x0); KVM_FEATURE_DEF(VIR_CPU_x86_HV_REENLIGHTENMENT, - 0x40000003, 0x00002000); + 0x40000003, 0x00002000, 0x0); KVM_FEATURE_DEF(VIR_CPU_x86_HV_TLBFLUSH, - 0x40000004, 0x00000004); + 0x40000004, 0x00000004, 0x0); KVM_FEATURE_DEF(VIR_CPU_x86_HV_IPI, - 0x40000004, 0x00000400); + 0x40000004, 0x00000400, 0x0); KVM_FEATURE_DEF(VIR_CPU_x86_HV_EVMCS, - 0x40000004, 0x00004000); + 0x40000004, 0x00004000, 0x0); =20 static virCPUx86Feature x86_kvm_features[] =3D { --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue May 7 20:10:11 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 ARC-Seal: i=1; a=rsa-sha256; t=1565070978; cv=none; d=zoho.com; s=zohoarc; b=PQFR+RTARWqvVIA76MKD5mh6aMWDyxMAID4ncC+dTxXKgH58imUdmMB9IPr0IYBlCSjwsdAmmoTHYuvt76kkjs2Kl6jjYNzExiTnNsGhaB8bvddKKDCsnq5sX/mFgXRy0qaqpgVo1C2ms3SMbBDOOT5mtu5gaWD2HtiXJ+lMPgU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565070978; h=Content-Type:Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=lxwtRE09Du/UC0Mb3tF8x7ZwHeFHpJXj4LJMHekLUK8=; b=lD8HjslxEt9A7XMpLUna/paMPUDruIeNvABO8VnrM0btePhY0nMIoNvRx9xoNS2dBzz5UXtGn/FB0yiB3qnFBODHL1UgI/ikc5i5OoxL2/8olWRVTsvkfh9vrOcmKDabtx4Bbelwb49M839zuJi7/XkLPlL7LimTHMRyKABQrF8= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1565070978561943.9854074082358; Mon, 5 Aug 2019 22:56:18 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 20A1E300B912; Tue, 6 Aug 2019 05:56: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 D6F8C60C47; Tue, 6 Aug 2019 05:56:16 +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 7821E1800204; Tue, 6 Aug 2019 05:56:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x765qiAZ028127 for ; Tue, 6 Aug 2019 01:52:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8FF8D5C1D4; Tue, 6 Aug 2019 05:52:44 +0000 (UTC) Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 89E705C890 for ; Tue, 6 Aug 2019 05:52:44 +0000 (UTC) Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5B2DE806D1 for ; Tue, 6 Aug 2019 05:52:44 +0000 (UTC) Received: by mail-wr1-f70.google.com with SMTP id x2so41657018wru.22 for ; Mon, 05 Aug 2019 22:52:44 -0700 (PDT) Received: from vitty.brq.redhat.com (ip-89-176-127-93.net.upcbroadband.cz. [89.176.127.93]) by smtp.gmail.com with ESMTPSA id i66sm156446020wmi.11.2019.08.05.22.52.41 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 05 Aug 2019 22:52:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Db/9RVAsd2avvlAFuAfVK2PaqcXgViC/R3owU2YUUmw=; b=eJE8uBH6iSfQT9lHexo/ykxIBbbva+QPxb3W4em31rsfqH+rBTzIIbJUHQylIL03R0 adKWp7/QVeg2oigDGjqrC6VgQPKlutc3iH+jJ30YyuMCBhfEiqHhuh24lVtYdRYEK54y 4XNr/TM7J5zqpWE17RcU66eFjXaQLVf3QWFf94NjQGD1p/KJk3116ECxq3fHhEcDc8iO C0hEL7Z5TGHkozQonSOc8OYbdMx2cIju4EkilMch4Ym4b/xRqQCaOHYjSskt/OrT3vJ/ vvWhKxmA7boDcRyFDUfwwN/2KzN/rwMVRAH5ybYTN2+rW6ez043B2Wg7oBZTfmoG32rs 4EEg== X-Gm-Message-State: APjAAAXFkXcuklJJjZI6sVSeIlPw+qT8+GpF90CWL3IWuSJqnlma5RG8 dhKnROxwiHCDGyA6XZDMIB3ieqGO6Mkp3tKY830DjoucJX8pUn9wnQ51dNgO/XPNxxUscURaxSw skIWt4VtkKiQ6mfRsDXU= X-Received: by 2002:adf:f088:: with SMTP id n8mr2226096wro.58.1565070762637; Mon, 05 Aug 2019 22:52:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqwBb2i17j1aPnHbIjEoIdZdr00I5qJyK7un+nS+K57C5dDK+2B080dgXpKvDdP3DUPU7++/Bg== X-Received: by 2002:adf:f088:: with SMTP id n8mr2226070wro.58.1565070762410; Mon, 05 Aug 2019 22:52:42 -0700 (PDT) From: Vitaly Kuznetsov To: libvir-list@redhat.com Date: Tue, 6 Aug 2019 07:52:33 +0200 Message-Id: <20190806055236.31837-3-vkuznets@redhat.com> In-Reply-To: <20190806055236.31837-1-vkuznets@redhat.com> References: <20190806055236.31837-1-vkuznets@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?J=C3=A1n=20Tomko?= , Nikolay Shirokovskiy Subject: [libvirt] [PATCH v3 2/5] conf: change the way how Hyper-V features are printed out 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Tue, 06 Aug 2019 05:56:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Current code doesn't allow us to add sub-features as we always print the closing '/>'. As a preparatory change to implementing 'direct' sub-feature for 'stimer' feature switch to printing closing tag individually. No functional change. Signed-off-by: Vitaly Kuznetsov Reviewed-by: J=C3=A1n Tomko --- src/conf/domain_conf.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5cd9939031..f75ee03e9b 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -28078,19 +28078,24 @@ virDomainDefFormatFeatures(virBufferPtr buf, case VIR_DOMAIN_HYPERV_TLBFLUSH: case VIR_DOMAIN_HYPERV_IPI: case VIR_DOMAIN_HYPERV_EVMCS: + virBufferAddLit(&childBuf, "/>\n"); break; =20 case VIR_DOMAIN_HYPERV_SPINLOCKS: - if (def->hyperv_features[j] !=3D VIR_TRISTATE_SWITCH_O= N) + if (def->hyperv_features[j] !=3D VIR_TRISTATE_SWITCH_O= N) { + virBufferAddLit(&childBuf, "/>\n"); break; - virBufferAsprintf(&childBuf, " retries=3D'%d'", + } + virBufferAsprintf(&childBuf, " retries=3D'%d'/>\n", def->hyperv_spinlocks); break; =20 case VIR_DOMAIN_HYPERV_VENDOR_ID: - if (def->hyperv_features[j] !=3D VIR_TRISTATE_SWITCH_O= N) + if (def->hyperv_features[j] !=3D VIR_TRISTATE_SWITCH_O= N) { + virBufferAddLit(&childBuf, "/>\n"); break; - virBufferEscapeString(&childBuf, " value=3D'%s'", + } + virBufferEscapeString(&childBuf, " value=3D'%s'/>\n", def->hyperv_vendor_id); break; =20 @@ -28098,8 +28103,6 @@ virDomainDefFormatFeatures(virBufferPtr buf, case VIR_DOMAIN_HYPERV_LAST: break; } - - virBufferAddLit(&childBuf, "/>\n"); } virBufferAdjustIndent(&childBuf, -2); virBufferAddLit(&childBuf, "\n"); --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue May 7 20:10:11 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 ARC-Seal: i=1; a=rsa-sha256; t=1565070991; cv=none; d=zoho.com; s=zohoarc; b=KfJSG408NrD+27y16JoNjKE8sczbLCUE/BpLjb2+RnTb4HTTYFtT3f3JFJU6YkLTup4cyQ/P7foW1VyodDS2s5fD/tgkkRs7xNJrB8G3yAhLS5MilZADD0WTmAWZzxfdsdI9BTPCWScXf7LqijztSzXPstDua31AMFiYNKyJWdY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565070991; h=Content-Type:Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=OcsVp5q2mdTAFb2JMXirL0TKW1gubvdJlwCfPA00yMA=; b=NRNnCJhVnabU+YAwPbXGptTSFi5ArI9je4hIQdda1Fomw2TkMvR6zvMQsiBtsvhsd9SZXE2TLh1OQ4RkwSweIYfk+crRdYhcM0uhvxwvNXsXuz99XJUl1esYVcWzePC1aJ/MDl5nqLe3PE2MazZ6XT7VaD6OyUju0+1J60dQfnM= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1565070991613721.5622696100938; Mon, 5 Aug 2019 22:56:31 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C79F1A707; Tue, 6 Aug 2019 05:56:29 +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 9401260167; Tue, 6 Aug 2019 05:56:29 +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 4F60224F33; Tue, 6 Aug 2019 05:56:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x765qmSD028158 for ; Tue, 6 Aug 2019 01:52:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4C5331000329; Tue, 6 Aug 2019 05:52:48 +0000 (UTC) Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 46E3E1000323 for ; Tue, 6 Aug 2019 05:52:45 +0000 (UTC) Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A24A5EEF0A for ; Tue, 6 Aug 2019 05:52:45 +0000 (UTC) Received: by mail-wr1-f71.google.com with SMTP id e8so41566541wrw.15 for ; Mon, 05 Aug 2019 22:52:45 -0700 (PDT) Received: from vitty.brq.redhat.com (ip-89-176-127-93.net.upcbroadband.cz. [89.176.127.93]) by smtp.gmail.com with ESMTPSA id i66sm156446020wmi.11.2019.08.05.22.52.42 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 05 Aug 2019 22:52:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Gj/LIvqw5J0wOulmI12qJLbIjfs4+ioZ067mpr0TC2c=; b=CES4znvZ0lOPO0lGKV++UT4Rprr6OznOeAxG0MsobtTJitqBoNBvqa6S9TvdSKRQ45 OFfrRmp5hAXR5OnzU6x1cDmL7C+4dTNVZIhyjhyxsMmUh5a4rnV3AUzSvTIgnW+uYL1T 1jjssHVfdFUzkm5odIqvWVfveuNYYTEWYppaKZ0gKkC86YEz3n803Bz9Yqqy7v3d9jQ/ IUGfHNC0vF672qoLBg486rHtavJtyflq+wuOjs0ML+hTlxUGRXL5rm1JvrCQyjLV/cT+ ZtCEMRaiAVfDJzt8qH5l1E5NzfmX5bnAgT24BgwiU57pT5E7vrOjI3J/Evb88xI5jGK4 ZOJw== X-Gm-Message-State: APjAAAUbOlfYEiwS6qRqBEUbezH6Nn5zclaP7f2dsZs7HqLVFVzRUHUg icy5JISgDuLovMXpijX78iLXTk5UGUL0Z3BoduJPlYyar/Dz1Gk6fRyV0rfGje5TfzpryhPv4J4 H6pgoB2wAmSXK/Xxk+f0= X-Received: by 2002:a1c:a7c6:: with SMTP id q189mr2368059wme.146.1565070764106; Mon, 05 Aug 2019 22:52:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqonOVOYhRG9QAkYxzH9xoGz+iGvPbvRVaOyBN4/R+7jVXxIMSxsJVZwGaqblT4EJB8bnQ5Q== X-Received: by 2002:a1c:a7c6:: with SMTP id q189mr2368030wme.146.1565070763752; Mon, 05 Aug 2019 22:52:43 -0700 (PDT) From: Vitaly Kuznetsov To: libvir-list@redhat.com Date: Tue, 6 Aug 2019 07:52:34 +0200 Message-Id: <20190806055236.31837-4-vkuznets@redhat.com> In-Reply-To: <20190806055236.31837-1-vkuznets@redhat.com> References: <20190806055236.31837-1-vkuznets@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?J=C3=A1n=20Tomko?= , Nikolay Shirokovskiy Subject: [libvirt] [PATCH v3 3/5] conf: add support for Direct Mode for Hyper-V Synthetic timers 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 06 Aug 2019 05:56:30 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Support 'Direct Mode' for Hyper-V Synthetic Timers in domain config. Make it 'stimer' enlightenment option as it is not a separate thing. Signed-off-by: Vitaly Kuznetsov Reviewed-by: J=C3=A1n Tomko --- docs/formatdomain.html.in | 10 +++--- docs/schemas/domaincommon.rng | 16 ++++++++- src/conf/domain_conf.c | 62 ++++++++++++++++++++++++++++++++++- src/conf/domain_conf.h | 1 + src/cpu/cpu_x86.c | 3 ++ src/cpu/cpu_x86_data.h | 2 ++ 6 files changed, 88 insertions(+), 6 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index f5c882141a..de577e5755 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2033,7 +2033,9 @@ <vpindex state=3D'on'/> <runtime state=3D'on'/> <synic state=3D'on'/> - <stimer state=3D'on'/> + <stimer state=3D'on'> + <direct state=3D'on'/> + </stimer> <reset state=3D'on'/> <vendor_id state=3D'on' value=3D'KVM Hv'/> <frequencies state=3D'on'/> @@ -2148,9 +2150,9 @@ stimer - Enable SynIC timers - on, off - 1.3.3 (QEMU 2.6) + Enable SynIC timers, optionally with Direct Mode support + on, off; direct - on,off + 1.3.3 (QEMU 2.6), direct mode 5.7.0 (Q= EMU 4.1) reset diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index a0771da45b..6707dcc634 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -5907,7 +5907,7 @@ - + @@ -5956,6 +5956,20 @@ =20 + + + + + + + + + + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index f75ee03e9b..4d95be8c08 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -20388,6 +20388,39 @@ virDomainDefParseXML(xmlDocPtr xml, ctxt->node =3D node; } =20 + if (def->features[VIR_DOMAIN_HYPERV_STIMER] =3D=3D VIR_TRISTATE_SWITCH= _ON) { + int value; + if ((n =3D virXPathNodeSet("./features/hyperv/stimer/*", ctxt, &no= des)) < 0) + goto error; + + for (i =3D 0; i < n; i++) { + if (STRNEQ((const char *)nodes[i]->name, "direct")) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unsupported Hyper-V stimer feature: %s"), + nodes[i]->name); + goto error; + } + + if (!(tmp =3D virXMLPropString(nodes[i], "state"))) { + virReportError(VIR_ERR_XML_ERROR, + _("missing 'state' attribute for " + "Hyper-V stimer '%s' feature"), "direct"); + goto error; + } + + if ((value =3D virTristateSwitchTypeFromString(tmp)) < 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("invalid value of state argument " + "for Hyper-V stimer '%s' feature"), "dire= ct"); + goto error; + } + + VIR_FREE(tmp); + def->hyperv_stimer_direct =3D value; + } + VIR_FREE(nodes); + } + if (def->features[VIR_DOMAIN_FEATURE_KVM] =3D=3D VIR_TRISTATE_SWITCH_O= N) { int feature; int value; @@ -22612,6 +22645,17 @@ virDomainDefFeaturesCheckABIStability(virDomainDef= Ptr src, } } =20 + if (src->hyperv_features[VIR_DOMAIN_HYPERV_STIMER] =3D=3D VIR_TRISTATE= _SWITCH_ON) { + if (src->hyperv_stimer_direct !=3D dst->hyperv_stimer_direct) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("State of HyperV stimer direct feature differ= s: " + "source: '%s', destination: '%s'"), + virTristateSwitchTypeToString(src->hyperv_stime= r_direct), + virTristateSwitchTypeToString(dst->hyperv_stime= r_direct)); + return false; + } + } + /* kvm */ if (src->features[VIR_DOMAIN_FEATURE_KVM] =3D=3D VIR_TRISTATE_SWITCH_O= N) { for (i =3D 0; i < VIR_DOMAIN_KVM_LAST; i++) { @@ -28071,7 +28115,6 @@ virDomainDefFormatFeatures(virBufferPtr buf, case VIR_DOMAIN_HYPERV_VPINDEX: case VIR_DOMAIN_HYPERV_RUNTIME: case VIR_DOMAIN_HYPERV_SYNIC: - case VIR_DOMAIN_HYPERV_STIMER: case VIR_DOMAIN_HYPERV_RESET: case VIR_DOMAIN_HYPERV_FREQUENCIES: case VIR_DOMAIN_HYPERV_REENLIGHTENMENT: @@ -28090,6 +28133,23 @@ virDomainDefFormatFeatures(virBufferPtr buf, def->hyperv_spinlocks); break; =20 + case VIR_DOMAIN_HYPERV_STIMER: + if (def->hyperv_features[j] !=3D VIR_TRISTATE_SWITCH_O= N) { + virBufferAddLit(&childBuf, "/>\n"); + break; + } + if (def->hyperv_stimer_direct =3D=3D VIR_TRISTATE_SWIT= CH_ON) { + virBufferAddLit(&childBuf, ">\n"); + virBufferAdjustIndent(&childBuf, 2); + virBufferAddLit(&childBuf, "= \n"); + virBufferAdjustIndent(&childBuf, -2); + virBufferAddLit(&childBuf, "\n"); + } else { + virBufferAddLit(&childBuf, "/>\n"); + } + + break; + case VIR_DOMAIN_HYPERV_VENDOR_ID: if (def->hyperv_features[j] !=3D VIR_TRISTATE_SWITCH_O= N) { virBufferAddLit(&childBuf, "/>\n"); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 8a4425df64..7a2a9e16c0 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2400,6 +2400,7 @@ struct _virDomainDef { int kvm_features[VIR_DOMAIN_KVM_LAST]; int msrs_features[VIR_DOMAIN_MSRS_LAST]; unsigned int hyperv_spinlocks; + int hyperv_stimer_direct; virGICVersion gic_version; virDomainHPTResizing hpt_resizing; unsigned long long hpt_maxpagesize; /* Stored in KiB */ diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index d2d9537c32..32b9836dd5 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -100,6 +100,8 @@ KVM_FEATURE_DEF(VIR_CPU_x86_HV_IPI, 0x40000004, 0x00000400, 0x0); KVM_FEATURE_DEF(VIR_CPU_x86_HV_EVMCS, 0x40000004, 0x00004000, 0x0); +KVM_FEATURE_DEF(VIR_CPU_x86_HV_STIMER_DIRECT, + 0x40000003, 0x0, 0x00080000); =20 static virCPUx86Feature x86_kvm_features[] =3D { @@ -116,6 +118,7 @@ static virCPUx86Feature x86_kvm_features[] =3D KVM_FEATURE(VIR_CPU_x86_HV_TLBFLUSH), KVM_FEATURE(VIR_CPU_x86_HV_IPI), KVM_FEATURE(VIR_CPU_x86_HV_EVMCS), + KVM_FEATURE(VIR_CPU_x86_HV_STIMER_DIRECT), }; =20 typedef struct _virCPUx86Model virCPUx86Model; diff --git a/src/cpu/cpu_x86_data.h b/src/cpu/cpu_x86_data.h index cc0c93dff0..cebf3b6669 100644 --- a/src/cpu/cpu_x86_data.h +++ b/src/cpu/cpu_x86_data.h @@ -64,6 +64,8 @@ struct _virCPUx86MSR { #define VIR_CPU_x86_HV_IPI "hv-ipi" #define VIR_CPU_x86_HV_EVMCS "hv-evmcs" =20 +/* Hyper-V Synthetic Timer option */ +#define VIR_CPU_x86_HV_STIMER_DIRECT "hv-stimer-direct" =20 #define VIR_CPU_X86_DATA_INIT { 0 } =20 --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue May 7 20:10:11 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 ARC-Seal: i=1; a=rsa-sha256; t=1565071103; cv=none; d=zoho.com; s=zohoarc; b=R8e4N2HFfOHBdwyf/tpAOlD4Oww7aLjjczjOZFrGURbCANOH4XU3+HEEIsMN1BZx5q1UiivVK49YGN2qor0spAZ1QAYLZ7qtNqaA5gJe+Cx0tB1vraS4Y8+7lVuMzqIgJFEMEKcpJDPNKSBEIqROwEmEWK7e/avY/Vc+a/kEhDE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565071103; h=Content-Type:Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=hpIjYnhvzcPO+rxZ3o+G+H7XUCPfIBKeXgveY+rRI5E=; b=eSKl2AX8j4kfjMbQpG+u0aCU+4sO8GhJaTZoAPqETdDFD778kp2zIi/rATenwRsMc7vi+kYTNhnmeauWQEMMqGWgPE8Tz/fD+fdLhvJrn9wfUfh97ixjtE4T7OCzey8lqdr5puvh2be28PKNSHBn4t4aN0Tg0qdilvRhpNil0O4= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1565071103317433.42664279354574; Mon, 5 Aug 2019 22:58:23 -0700 (PDT) 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 1A6F130BCB95; Tue, 6 Aug 2019 05:58:22 +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 E91ADA22F; Tue, 6 Aug 2019 05:58:21 +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 B05C7180B536; Tue, 6 Aug 2019 05:58:21 +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 x765qnih028164 for ; Tue, 6 Aug 2019 01:52:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 13E706012D; Tue, 6 Aug 2019 05:52:49 +0000 (UTC) Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0C52F60127 for ; Tue, 6 Aug 2019 05:52:46 +0000 (UTC) Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 78748793D1 for ; Tue, 6 Aug 2019 05:52:46 +0000 (UTC) Received: by mail-wr1-f69.google.com with SMTP id f9so41722172wrq.14 for ; Mon, 05 Aug 2019 22:52:46 -0700 (PDT) Received: from vitty.brq.redhat.com (ip-89-176-127-93.net.upcbroadband.cz. [89.176.127.93]) by smtp.gmail.com with ESMTPSA id i66sm156446020wmi.11.2019.08.05.22.52.43 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 05 Aug 2019 22:52:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GcE69isUJL5RkdBCSPXEj+E3AGaMo9EQT2oDkINXtec=; b=O0aNawHHBExeZZ/sxN/tSFBcnf1fgbi68CgjsHBaMwgFOXq7ehtb3T8B5gh/XnuQvQ vyxvjCQfzZ2X2VHNiSiGB6jelGIDaCODUks7r2eA6vbO3LoD6Xp3yNbhDuC7fwM5Oz3s oyAFaWzJ1Mkv9lPfR/eMe8jIst2KM3W/taN6TS+LX609qoDr7A3YPnuXkAW/MF8i1vuo uv4h1fl/Qm7fVWGE+sY54B9Fd0DFwFXHXYMDxKgoZu5eodBdGBV5X7bPfLyqIEQjyo7x I01Gk0h+MYpIUNfzfi1uvtjpFtBvivUn9gqf8lmvs6Xcz6xgZTV1WZePC3SmDzG/gqwV TSZw== X-Gm-Message-State: APjAAAWdUsvxz1O57MQYjQ4DoNoO0BXVMSXAUSh45trAVg5PyTQOGFUK 1fEiWLJcHdCiPmpYL0Y/Y5jgtOP9tCRZfnfamy790mOd2N8wfixXlmYEVCCOiCJAQHL8vfDcnsq pY/qLrSunTUvs1zs40kg= X-Received: by 2002:a7b:ce18:: with SMTP id m24mr2259862wmc.126.1565070764951; Mon, 05 Aug 2019 22:52:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqwDXpzKoB+B6Ur1rz+2jsDse9CoKbTSRi5cK0bnTbbvCHFT4W2ED47HFs0z0NPyI/OZyDReNg== X-Received: by 2002:a7b:ce18:: with SMTP id m24mr2259833wmc.126.1565070764641; Mon, 05 Aug 2019 22:52:44 -0700 (PDT) From: Vitaly Kuznetsov To: libvir-list@redhat.com Date: Tue, 6 Aug 2019 07:52:35 +0200 Message-Id: <20190806055236.31837-5-vkuznets@redhat.com> In-Reply-To: <20190806055236.31837-1-vkuznets@redhat.com> References: <20190806055236.31837-1-vkuznets@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?J=C3=A1n=20Tomko?= , Nikolay Shirokovskiy Subject: [libvirt] [PATCH v3 4/5] qemu: add support for Direct Mode for Hyper-V Synthetic timers 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: , 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.49]); Tue, 06 Aug 2019 05:58:22 +0000 (UTC) Content-Type: text/plain; charset="utf-8" QEMU-4.1 supports 'Direct Mode' for Hyper-V synthetic timers (hv-stimer-direct CPU flag): Windows guests can request that timer expiration notifications are delivered as normal interrupts (and not VMBus messages). This is used by Hyper-V on KVM. Signed-off-by: Vitaly Kuznetsov Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 12 ++++++++---- src/qemu/qemu_process.c | 20 ++++++++++++++++++-- tests/qemuxml2argvdata/hyperv.args | 4 ++-- tests/qemuxml2argvdata/hyperv.xml | 4 +++- tests/qemuxml2xmloutdata/hyperv.xml | 4 +++- 5 files changed, 34 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index c8494de785..af913dba34 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7152,10 +7152,10 @@ qemuBuildCpuCommandLine(virCommandPtr cmd, } =20 if (def->features[VIR_DOMAIN_FEATURE_HYPERV] =3D=3D VIR_TRISTATE_SWITC= H_ON) { - const char *hvPrefix =3D "hv-"; + const char *hvDelimiter =3D "-"; =20 if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_CANONICAL_CPU_FEATURES)) - hvPrefix =3D "hv_"; + hvDelimiter =3D "_"; =20 for (i =3D 0; i < VIR_DOMAIN_HYPERV_LAST; i++) { switch ((virDomainHyperv) i) { @@ -7172,9 +7172,13 @@ qemuBuildCpuCommandLine(virCommandPtr cmd, case VIR_DOMAIN_HYPERV_IPI: case VIR_DOMAIN_HYPERV_EVMCS: if (def->hyperv_features[i] =3D=3D VIR_TRISTATE_SWITCH_ON) - virBufferAsprintf(&buf, ",%s%s", - hvPrefix, + virBufferAsprintf(&buf, ",hv%s%s", + hvDelimiter, virDomainHypervTypeToString(i)); + if ((i =3D=3D VIR_DOMAIN_HYPERV_STIMER) && + (def->hyperv_stimer_direct =3D=3D VIR_TRISTATE_SWITCH_= ON)) + virBufferAsprintf(&buf, ",hv%sstimer%sdirect", hvDelim= iter, + hvDelimiter); break; =20 case VIR_DOMAIN_HYPERV_SPINLOCKS: diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 1ed56457b1..792fa33327 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4112,10 +4112,26 @@ qemuProcessVerifyHypervFeatures(virDomainDefPtr def, rc =3D virCPUDataCheckFeature(cpu, cpuFeature); VIR_FREE(cpuFeature); =20 - if (rc < 0) + if (rc < 0) { return -1; - else if (rc =3D=3D 1) + } else if (rc =3D=3D 1) { + if (i =3D=3D VIR_DOMAIN_HYPERV_STIMER) { + if (def->hyperv_stimer_direct !=3D VIR_TRISTATE_SWITCH_ON) + continue; + + rc =3D virCPUDataCheckFeature(cpu, "hv-stimer-direct"); + if (rc < 0) + return -1; + else if (rc =3D=3D 1) + continue; + + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("host doesn't support hyperv stimer '%s' = feature"), + "direct"); + return -1; + } continue; + } =20 switch ((virDomainHyperv) i) { case VIR_DOMAIN_HYPERV_RELAXED: diff --git a/tests/qemuxml2argvdata/hyperv.args b/tests/qemuxml2argvdata/hy= perv.args index 086adaa349..8040da9caa 100644 --- a/tests/qemuxml2argvdata/hyperv.args +++ b/tests/qemuxml2argvdata/hyperv.args @@ -12,8 +12,8 @@ QEMU_AUDIO_DRV=3Dnone \ -S \ -machine pc,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ -cpu 'qemu32,hv_relaxed,hv_vapic,hv-spinlocks=3D0x2fff,hv_vpindex,hv_runti= me,\ -hv_synic,hv_stimer,hv_reset,hv-vendor-id=3DKVM Hv,hv_frequencies,\ -hv_reenlightenment,hv_tlbflush,hv_ipi,hv_evmcs' \ +hv_synic,hv_stimer,hv_stimer_direct,hv_reset,hv-vendor-id=3DKVM Hv,\ +hv_frequencies,hv_reenlightenment,hv_tlbflush,hv_ipi,hv_evmcs' \ -m 214 \ -realtime mlock=3Doff \ -smp 6,sockets=3D6,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/hyperv.xml b/tests/qemuxml2argvdata/hyp= erv.xml index c6feaed528..ae0f934f76 100644 --- a/tests/qemuxml2argvdata/hyperv.xml +++ b/tests/qemuxml2argvdata/hyperv.xml @@ -17,7 +17,9 @@ - + + + diff --git a/tests/qemuxml2xmloutdata/hyperv.xml b/tests/qemuxml2xmloutdata= /hyperv.xml index 5510d3dfad..2e4b43d4c6 100644 --- a/tests/qemuxml2xmloutdata/hyperv.xml +++ b/tests/qemuxml2xmloutdata/hyperv.xml @@ -17,7 +17,9 @@ - + + + --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue May 7 20:10:11 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 ARC-Seal: i=1; a=rsa-sha256; t=1565070974; cv=none; d=zoho.com; s=zohoarc; b=VE3hhBXSt7NSPIIM2tgDsFRNtLIcxJNqK6485HzWuO8x0kcc81yFLeH5ayIfLRsfZk5/Tnp32GuoEdhjR75P/5hg6HRH+DXQA8jnlLPjgpw8kuh0gEGUaAjfZrwRCxDW51XcWYj9JP88kHQAkqjJtG8vzsGVwZds2QBocFGVZHc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565070974; h=Content-Type:Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=HR5DgWiZ3HY89vNlda5ebw/JWMiGXl9JvQ7vD3wVWzg=; b=O/bMsBeKlpg78/LYaqwMFvzNBK1dCFzapMK+jarZiDA/Co+I2Z2yqLiZAN+49vi1aCidCgBMuScnvTLge6uqOUfeFXz+suokTalZJKu9hwitPd2O5+zeldZwx3mAPtsk4VaIkBGabnEOxntMQgMZuKVMJlFO5LgHkGBFVcBoe74= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1565070974270669.4895335883364; Mon, 5 Aug 2019 22:56:14 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8B19E3B46C; Tue, 6 Aug 2019 05:56:10 +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 0B01860C47; Tue, 6 Aug 2019 05:56:09 +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 0169524F30; Tue, 6 Aug 2019 05:56:03 +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 x765qo2G028182 for ; Tue, 6 Aug 2019 01:52:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id BAF3E60CC0; Tue, 6 Aug 2019 05:52:50 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B614560C47 for ; Tue, 6 Aug 2019 05:52:48 +0000 (UTC) Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 662A73D969 for ; Tue, 6 Aug 2019 05:52:48 +0000 (UTC) Received: by mail-wm1-f69.google.com with SMTP id t76so19747111wmt.9 for ; Mon, 05 Aug 2019 22:52:48 -0700 (PDT) Received: from vitty.brq.redhat.com (ip-89-176-127-93.net.upcbroadband.cz. [89.176.127.93]) by smtp.gmail.com with ESMTPSA id i66sm156446020wmi.11.2019.08.05.22.52.44 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 05 Aug 2019 22:52:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8QF4DVKB7su2IJD5GcjHUVaKtR4mspr/DAHw9ejbUaU=; b=jhtVmksCBvEUct4xqBb2KSO85duQXyviEuxMtFA8wdk+AunCxa9jXezle7Mwcgc1Y4 R46SZ1m6l9JObTOUIWXd6z4LyrUOLI6mNfeSV0LzAcrEG9o+ARHyOvbCdhZd9yZcbGuQ TdsVllpJLEZj4clu6hvzAAeXvjRIeo2/4S+uU6BhLB/w+qnA8aXle9whKaOfKy5fecsQ 3+LfwElpJir54gWPLHp/L01lzars+1B+CCn/LCrH2CNJiI53szfEwvpSfOCNDIeuecCy SH/Q2Kgx6fQHn4S4GeAI8uRE9QNis38OmLBwTlq/qujyz/Tko8HRe/IgS7pYeIJ9GY5f STSQ== X-Gm-Message-State: APjAAAUKb4VWVm5qadUJPwqMxShUyiXvVyPyPFBwlQml3xZ7pRY1yAq8 X8l2ChIylowR0zUxcV4KzRtIIvNghku9NbNNQ+GyOe+8agYYgx4VqhEsug7fm+XW4gKmdLP8jEI MzI0pbPO4i15dptFcAxc= X-Received: by 2002:a5d:6911:: with SMTP id t17mr2139897wru.268.1565070766914; Mon, 05 Aug 2019 22:52:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqyllcILEvgyos6z1Pw0Z5RsV2KEau+Dp9X5qsxG5oJd6HrQ2fo3WT2mEwRtn+NCtAsFLS739w== X-Received: by 2002:a5d:6911:: with SMTP id t17mr2139811wru.268.1565070766170; Mon, 05 Aug 2019 22:52:46 -0700 (PDT) From: Vitaly Kuznetsov To: libvir-list@redhat.com Date: Tue, 6 Aug 2019 07:52:36 +0200 Message-Id: <20190806055236.31837-6-vkuznets@redhat.com> In-Reply-To: <20190806055236.31837-1-vkuznets@redhat.com> References: <20190806055236.31837-1-vkuznets@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?J=C3=A1n=20Tomko?= , Nikolay Shirokovskiy Subject: [libvirt] [PATCH v3 5/5] news: mention Direct Mode for Hyper-V Synthetic timers support 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 06 Aug 2019 05:56:12 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The QEMU driver now supports Direct Mode for Hyper-V Synthetic timers for Hyper-V guests. Signed-off-by: Vitaly Kuznetsov Reviewed-by: J=C3=A1n Tomko --- docs/news.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index a4d727b9c5..d63fca3b48 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -41,6 +41,15 @@
+ + + qemu: Support Direct Mode for Hyper-V Synthetic timers + + + The QEMU driver now supports Direct Mode for Hyper-V Synthetic t= imers + for Hyper-V guests. + +
--=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list