From nobody Thu May 2 21:35:57 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=1564155074; cv=none; d=zoho.com; s=zohoarc; b=kzlUsWc3QHRJidfvGZgJ6Qa0arIpNTk2np5hzurD8vhWL6gm7KiTROiRCj8Wl7f1R5uYSS9h1sTGevL9FgPms7aBYYD5ttN4w5utqQ6o7Bfn/THqbTfDoV9/zW/QN6e9yl6rKvYJk0HrSBUI2bORYpneCYIpnQYgxYSpjaqFXHc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564155074; 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:ARC-Authentication-Results; bh=tINCtuONrXCZTGriZvn7OllAPOqcIOIjaC9OcL7FwYU=; b=i8iMs3NoALFGlJgeqW5FqhZhHds5r7Sssj6JjTw2jjCPv2wiaYH6cCBp6x2pbXUu4NytFKPPN4gnD/W7Aah3FZdqODv6zVS2py/SHGWx0NJ/MN/x5XKUJhjX5PJqWzNQhKvfyfo5P/fFaqzifEbucXAO4Mq55IU/uNymPOpzwYM= 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 1564155074150171.1143108450177; Fri, 26 Jul 2019 08:31:14 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D40923B71F; Fri, 26 Jul 2019 15:31:12 +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 A75D16061B; Fri, 26 Jul 2019 15:31:12 +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 5DAAD18045D0; Fri, 26 Jul 2019 15:31:12 +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 x6QFV3Hg004189 for ; Fri, 26 Jul 2019 11:31:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6508D5C6E0; Fri, 26 Jul 2019 15:31:03 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 14C97605C3 for ; Fri, 26 Jul 2019 15:31:00 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 8B796100112; Fri, 26 Jul 2019 17:30:59 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 26 Jul 2019 17:30:52 +0200 Message-Id: <3e4427ff1f0bb9a2aaf95225aa72cd87bd11c0f5.1564154901.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 Subject: [libvirt] [PATCH 1/5] qemu: Fix hyperv features with QEMU 4.1 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 26 Jul 2019 15:31:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Originally the names of the hyperv CPU features were only used internally for looking up their CPUID bits. So we used "__kvm_hv_" prefix for them to make sure the names do not collide with normal CPU features stored in our CPU map. But with QEMU 4.1 we check which features were enabled or disabled by a freshly started QEMU process using their names rather than their CPUID bits (mostly because of MSR features). Thus we need to change our made up internal names into the actual names used by QEMU. Most of the names are only used with QEMU 4.1 and newer and the reset was introduced with QEMU recently enough to already support spelling with "-". Thus we don't need to define them as "hv_*" with a translation to "hv-*" for new QEMU. Without this patch libvirt would mistakenly report all hyperv features as unavailable and refuse to start any domain using them with QEMU 4.1. Reported-by: Vitaly Kuznetsov Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko Tested-by: Vitaly Kuznetsov --- src/cpu/cpu_x86_data.h | 28 ++++++++++++++-------------- src/qemu/qemu_process.c | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/cpu/cpu_x86_data.h b/src/cpu/cpu_x86_data.h index f3f4d7ab9c..bb781707aa 100644 --- a/src/cpu/cpu_x86_data.h +++ b/src/cpu/cpu_x86_data.h @@ -56,21 +56,21 @@ struct _virCPUx86MSR { /* * The following HyperV feature names suffixes must exactly match correspo= nding * ones defined for virDomainHyperv in domain_conf.c. - * E.g "__kvm_runtime" -> "runtime", "__kvm_hv_spinlocks" -> "spinlocks" e= tc. + * E.g "hv-runtime" -> "runtime", "hv-spinlocks" -> "spinlocks" etc. */ -#define VIR_CPU_x86_KVM_HV_RUNTIME "__kvm_hv_runtime" -#define VIR_CPU_x86_KVM_HV_SYNIC "__kvm_hv_synic" -#define VIR_CPU_x86_KVM_HV_STIMER "__kvm_hv_stimer" -#define VIR_CPU_x86_KVM_HV_RELAXED "__kvm_hv_relaxed" -#define VIR_CPU_x86_KVM_HV_SPINLOCKS "__kvm_hv_spinlocks" -#define VIR_CPU_x86_KVM_HV_VAPIC "__kvm_hv_vapic" -#define VIR_CPU_x86_KVM_HV_VPINDEX "__kvm_hv_vpindex" -#define VIR_CPU_x86_KVM_HV_RESET "__kvm_hv_reset" -#define VIR_CPU_x86_KVM_HV_FREQUENCIES "__kvm_hv_frequencies" -#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" +#define VIR_CPU_x86_KVM_HV_RUNTIME "hv-runtime" +#define VIR_CPU_x86_KVM_HV_SYNIC "hv-synic" +#define VIR_CPU_x86_KVM_HV_STIMER "hv-stimer" +#define VIR_CPU_x86_KVM_HV_RELAXED "hv-relaxed" +#define VIR_CPU_x86_KVM_HV_SPINLOCKS "hv-spinlocks" +#define VIR_CPU_x86_KVM_HV_VAPIC "hv-vapic" +#define VIR_CPU_x86_KVM_HV_VPINDEX "hv-vpindex" +#define VIR_CPU_x86_KVM_HV_RESET "hv-reset" +#define VIR_CPU_x86_KVM_HV_FREQUENCIES "hv-frequencies" +#define VIR_CPU_x86_KVM_HV_REENLIGHTENMENT "hv-reenlightenment" +#define VIR_CPU_x86_KVM_HV_TLBFLUSH "hv-tlbflush" +#define VIR_CPU_x86_KVM_HV_IPI "hv-ipi" +#define VIR_CPU_x86_KVM_HV_EVMCS "hv-evmcs" =20 =20 #define VIR_CPU_X86_DATA_INIT { 0 } diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 75205bc121..7561781848 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4104,7 +4104,7 @@ qemuProcessVerifyHypervFeatures(virDomainDefPtr def, if (def->hyperv_features[i] !=3D VIR_TRISTATE_SWITCH_ON) continue; =20 - if (virAsprintf(&cpuFeature, "__kvm_hv_%s", + if (virAsprintf(&cpuFeature, "hv-%s", virDomainHypervTypeToString(i)) < 0) return -1; =20 --=20 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 21:35:57 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=1564155068; cv=none; d=zoho.com; s=zohoarc; b=Z83dvJM/lYvNsIxt9AhPXk4nCnLFS15idrP7KdzjTaC9WJ6SQKFx46xwbFwaMPNjQkgzXZdwLA333gepxYFa08HHW8Hf7VyG+EzFaw4MoKcs01QZydQoPhP0Y4iogJ2MBglrc8OjzZZ/QmimGyq/otiypIQx/tDb3R2KdPOjofM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564155068; 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:ARC-Authentication-Results; bh=TpcSLnDn3tPK5VYCPjI7+BFUCxw2pbU8pK/bYQxI1jU=; b=WQc3pNOInwxx3LjzuEy4SYLsUAeYcwvM9SK9yd8uHb2P6Up8Q6J9vdJKHiRSObsLHT+KWvEcmmuUlkYCOoyNUNoB4o9JtCfbSHW+tWfatJ3IGARA3U4GvsEeZcP4cs4YD6/r2c8EPT/yYbpixl8nWzU/9Kmt3G+HInQoDmNy2Yg= 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 1564155068067648.4033169584392; Fri, 26 Jul 2019 08:31:08 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 86B95330265; Fri, 26 Jul 2019 15:31:06 +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 5FF1F5C70A; Fri, 26 Jul 2019 15:31:06 +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 0C59641F63; Fri, 26 Jul 2019 15:31:06 +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 x6QFV3UZ004190 for ; Fri, 26 Jul 2019 11:31:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id 64F006012D; Fri, 26 Jul 2019 15:31:03 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 148E65C6F1 for ; Fri, 26 Jul 2019 15:31:00 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 8E5E3100113; Fri, 26 Jul 2019 17:30:59 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 26 Jul 2019 17:30:53 +0200 Message-Id: <107e504b5c95faf9811795de9a349f722ec9e01c.1564154901.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 Subject: [libvirt] [PATCH 2/5] qemu: Prefer dashes for hyperv features 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 26 Jul 2019 15:31:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Starting with QEMU 4.1, we're using the canonical feature names on the command line and avoid aliases to prepare for possible deprecation of all aliases in QEMU. But we do so only for features from our CPU map, hyperv features defined in the code were unchanged and this patch fixes it. Some features use "hv-" prefix unconditionally because they were introduced recently enough to always support spelling with a dash. Signed-off-by: Jiri Denemark Reported-by: Vitaly Kuznetsov Reviewed-by: J=C3=A1n Tomko Tested-by: Vitaly Kuznetsov --- src/qemu/qemu_command.c | 17 ++++++++++++----- .../clock-timer-hyperv-rtc.args | 2 +- tests/qemuxml2argvdata/hyperv-panic.args | 2 +- tests/qemuxml2argvdata/hyperv.args | 4 ++-- tests/qemuxml2argvdata/panic-double.args | 2 +- 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 476e710257..c2f99034c8 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7133,7 +7133,7 @@ qemuBuildCpuCommandLine(virCommandPtr cmd, !!timer->present); } else if (timer->name =3D=3D VIR_DOMAIN_TIMER_NAME_HYPERVCLOCK && timer->present =3D=3D 1) { - virBufferAddLit(&buf, ",hv_time"); + virBufferAddLit(&buf, ",hv-time"); } else if (timer->name =3D=3D VIR_DOMAIN_TIMER_NAME_TSC && timer->frequency > 0) { virBufferAsprintf(&buf, ",tsc-frequency=3D%lu", timer->frequen= cy); @@ -7151,6 +7151,11 @@ qemuBuildCpuCommandLine(virCommandPtr cmd, } =20 if (def->features[VIR_DOMAIN_FEATURE_HYPERV] =3D=3D VIR_TRISTATE_SWITC= H_ON) { + const char *hvPrefix =3D "hv-"; + + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_CANONICAL_CPU_FEATURES)) + hvPrefix =3D "hv_"; + for (i =3D 0; i < VIR_DOMAIN_HYPERV_LAST; i++) { switch ((virDomainHyperv) i) { case VIR_DOMAIN_HYPERV_RELAXED: @@ -7166,19 +7171,21 @@ 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, ",hv_%s", + virBufferAsprintf(&buf, ",%s%s", + hvPrefix, virDomainHypervTypeToString(i)); break; =20 case VIR_DOMAIN_HYPERV_SPINLOCKS: if (def->hyperv_features[i] =3D=3D VIR_TRISTATE_SWITCH_ON) - virBufferAsprintf(&buf, ",hv_spinlocks=3D0x%x", + virBufferAsprintf(&buf, ",%s=3D0x%x", + VIR_CPU_x86_KVM_HV_SPINLOCKS, def->hyperv_spinlocks); break; =20 case VIR_DOMAIN_HYPERV_VENDOR_ID: if (def->hyperv_features[i] =3D=3D VIR_TRISTATE_SWITCH_ON) - virBufferAsprintf(&buf, ",hv_vendor_id=3D%s", + virBufferAsprintf(&buf, ",hv-vendor-id=3D%s", def->hyperv_vendor_id); break; =20 @@ -7191,7 +7198,7 @@ qemuBuildCpuCommandLine(virCommandPtr cmd, =20 for (i =3D 0; i < def->npanics; i++) { if (def->panics[i]->model =3D=3D VIR_DOMAIN_PANIC_MODEL_HYPERV) { - virBufferAddLit(&buf, ",hv_crash"); + virBufferAddLit(&buf, ",hv-crash"); break; } } diff --git a/tests/qemuxml2argvdata/clock-timer-hyperv-rtc.args b/tests/qem= uxml2argvdata/clock-timer-hyperv-rtc.args index 98b7dcae1b..d75585bf0f 100644 --- a/tests/qemuxml2argvdata/clock-timer-hyperv-rtc.args +++ b/tests/qemuxml2argvdata/clock-timer-hyperv-rtc.args @@ -11,7 +11,7 @@ QEMU_AUDIO_DRV=3Dnone \ -name QEMUGuest1 \ -S \ -machine pc,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ --cpu qemu32,hv_time \ +-cpu qemu32,hv-time \ -m 214 \ -realtime mlock=3Doff \ -smp 6,sockets=3D6,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/hyperv-panic.args b/tests/qemuxml2argvd= ata/hyperv-panic.args index 3226837fbd..1ef5068aca 100644 --- a/tests/qemuxml2argvdata/hyperv-panic.args +++ b/tests/qemuxml2argvdata/hyperv-panic.args @@ -11,7 +11,7 @@ QEMU_AUDIO_DRV=3Dnone \ -name QEMUGuest1 \ -S \ -machine pc,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ --cpu qemu32,hv_crash \ +-cpu qemu32,hv-crash \ -m 214 \ -realtime mlock=3Doff \ -smp 6,sockets=3D6,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/hyperv.args b/tests/qemuxml2argvdata/hy= perv.args index c557b6d8fe..086adaa349 100644 --- a/tests/qemuxml2argvdata/hyperv.args +++ b/tests/qemuxml2argvdata/hyperv.args @@ -11,8 +11,8 @@ QEMU_AUDIO_DRV=3Dnone \ -name QEMUGuest1 \ -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,\ +-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' \ -m 214 \ -realtime mlock=3Doff \ diff --git a/tests/qemuxml2argvdata/panic-double.args b/tests/qemuxml2argvd= ata/panic-double.args index 8e75816e56..7f49d3482e 100644 --- a/tests/qemuxml2argvdata/panic-double.args +++ b/tests/qemuxml2argvdata/panic-double.args @@ -11,7 +11,7 @@ QEMU_AUDIO_DRV=3Dnone \ -name QEMUGuest1 \ -S \ -machine pc,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ --cpu qemu32,hv_crash \ +-cpu qemu32,hv-crash \ -m 214 \ -realtime mlock=3Doff \ -smp 6,sockets=3D6,cores=3D1,threads=3D1 \ --=20 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 21:35:57 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=1564155068; cv=none; d=zoho.com; s=zohoarc; b=oLH3UErnrUJZXCaRgcbAyAGu7dWkv+JWcQVUIp46HKYM16GfzOCgDDs5Ks3ZI55til0/NcIWArTdq9FbKSOXSF/77PSOavFvj2nbtxpm/a2wlp5DB6j7VuUhYXU52VRO65e9XS5LOWUVvG85WF3gh4mSht5mPFH5S0XmdFjPL4E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564155068; 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:ARC-Authentication-Results; bh=flDrFjKDg7LlrgNoIqXgfM63wfTw/flbEvbYdqYJ9Xs=; b=IxIEPMj3ePv+SfCv5603/LQ8GAkvGyX3poTcH5QohYEWtniLOIGbcoxzF4nrA4bvo6pCwGyEZXNkxr0CdqwqFJsrxnruobd/WCYNACss7YPVwrwmk/LEtti75YxFZXBBlIxJ+lOxqehd8I595oilZrWEzH+eEVRvpw3siGsckA8= 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 156415506826763.04353007047814; Fri, 26 Jul 2019 08:31:08 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0C0E4307D850; Fri, 26 Jul 2019 15:31:07 +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 6EA3310114A1; Fri, 26 Jul 2019 15:31:06 +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 18C7241F66; Fri, 26 Jul 2019 15:31:06 +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 x6QFV3SW004201 for ; Fri, 26 Jul 2019 11:31:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id A0B5A665FA; Fri, 26 Jul 2019 15:31:03 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 52113665FF for ; Fri, 26 Jul 2019 15:31:00 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 915B7100114; Fri, 26 Jul 2019 17:30:59 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 26 Jul 2019 17:30:54 +0200 Message-Id: <37957f5531462c9492279b1aa6097dc09293cbc5.1564154901.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/5] cpu: Drop KVM_ from hyperv feature macros 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.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Fri, 26 Jul 2019 15:31:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" All the features are hyperv features even though they are provided by KVM with QEMU. The "KVM" part in the macro names does not make a lot of sense. Signed-off-by: Jiri Denemark Reported-by: Vitaly Kuznetsov Reviewed-by: J=C3=A1n Tomko Tested-by: Vitaly Kuznetsov --- src/cpu/cpu_x86.c | 53 +++++++++++++++++++++-------------------- src/cpu/cpu_x86_data.h | 26 ++++++++++---------- src/qemu/qemu_command.c | 2 +- 3 files changed, 41 insertions(+), 40 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 55b55da784..f8a51dedf6 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -91,31 +91,32 @@ KVM_FEATURE_DEF(VIR_CPU_x86_KVM_PV_UNHALT, 0x40000001, 0x00000080); KVM_FEATURE_DEF(VIR_CPU_x86_KVM_CLOCKSOURCE_STABLE_BIT, 0x40000001, 0x01000000); -KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_RUNTIME, + +KVM_FEATURE_DEF(VIR_CPU_x86_HV_RUNTIME, 0x40000003, 0x00000001); -KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_SYNIC, +KVM_FEATURE_DEF(VIR_CPU_x86_HV_SYNIC, 0x40000003, 0x00000004); -KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_STIMER, +KVM_FEATURE_DEF(VIR_CPU_x86_HV_STIMER, 0x40000003, 0x00000008); -KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_RELAXED, +KVM_FEATURE_DEF(VIR_CPU_x86_HV_RELAXED, 0x40000003, 0x00000020); -KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_SPINLOCKS, +KVM_FEATURE_DEF(VIR_CPU_x86_HV_SPINLOCKS, 0x40000003, 0x00000022); -KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_VAPIC, +KVM_FEATURE_DEF(VIR_CPU_x86_HV_VAPIC, 0x40000003, 0x00000030); -KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_VPINDEX, +KVM_FEATURE_DEF(VIR_CPU_x86_HV_VPINDEX, 0x40000003, 0x00000040); -KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_RESET, +KVM_FEATURE_DEF(VIR_CPU_x86_HV_RESET, 0x40000003, 0x00000080); -KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_FREQUENCIES, +KVM_FEATURE_DEF(VIR_CPU_x86_HV_FREQUENCIES, 0x40000003, 0x00000800); -KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_REENLIGHTENMENT, +KVM_FEATURE_DEF(VIR_CPU_x86_HV_REENLIGHTENMENT, 0x40000003, 0x00002000); -KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_TLBFLUSH, +KVM_FEATURE_DEF(VIR_CPU_x86_HV_TLBFLUSH, 0x40000004, 0x00000004); -KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_IPI, +KVM_FEATURE_DEF(VIR_CPU_x86_HV_IPI, 0x40000004, 0x00000400); -KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_EVMCS, +KVM_FEATURE_DEF(VIR_CPU_x86_HV_EVMCS, 0x40000004, 0x00004000); =20 static virCPUx86Feature x86_kvm_features[] =3D @@ -129,19 +130,19 @@ static virCPUx86Feature x86_kvm_features[] =3D KVM_FEATURE(VIR_CPU_x86_KVM_PV_EOI), KVM_FEATURE(VIR_CPU_x86_KVM_PV_UNHALT), KVM_FEATURE(VIR_CPU_x86_KVM_CLOCKSOURCE_STABLE_BIT), - KVM_FEATURE(VIR_CPU_x86_KVM_HV_RUNTIME), - KVM_FEATURE(VIR_CPU_x86_KVM_HV_SYNIC), - KVM_FEATURE(VIR_CPU_x86_KVM_HV_STIMER), - KVM_FEATURE(VIR_CPU_x86_KVM_HV_RELAXED), - KVM_FEATURE(VIR_CPU_x86_KVM_HV_SPINLOCKS), - KVM_FEATURE(VIR_CPU_x86_KVM_HV_VAPIC), - KVM_FEATURE(VIR_CPU_x86_KVM_HV_VPINDEX), - KVM_FEATURE(VIR_CPU_x86_KVM_HV_RESET), - KVM_FEATURE(VIR_CPU_x86_KVM_HV_FREQUENCIES), - 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), + KVM_FEATURE(VIR_CPU_x86_HV_RUNTIME), + KVM_FEATURE(VIR_CPU_x86_HV_SYNIC), + KVM_FEATURE(VIR_CPU_x86_HV_STIMER), + KVM_FEATURE(VIR_CPU_x86_HV_RELAXED), + KVM_FEATURE(VIR_CPU_x86_HV_SPINLOCKS), + KVM_FEATURE(VIR_CPU_x86_HV_VAPIC), + KVM_FEATURE(VIR_CPU_x86_HV_VPINDEX), + KVM_FEATURE(VIR_CPU_x86_HV_RESET), + KVM_FEATURE(VIR_CPU_x86_HV_FREQUENCIES), + KVM_FEATURE(VIR_CPU_x86_HV_REENLIGHTENMENT), + KVM_FEATURE(VIR_CPU_x86_HV_TLBFLUSH), + KVM_FEATURE(VIR_CPU_x86_HV_IPI), + KVM_FEATURE(VIR_CPU_x86_HV_EVMCS), }; =20 typedef struct _virCPUx86Model virCPUx86Model; diff --git a/src/cpu/cpu_x86_data.h b/src/cpu/cpu_x86_data.h index bb781707aa..85aaab709c 100644 --- a/src/cpu/cpu_x86_data.h +++ b/src/cpu/cpu_x86_data.h @@ -58,19 +58,19 @@ struct _virCPUx86MSR { * ones defined for virDomainHyperv in domain_conf.c. * E.g "hv-runtime" -> "runtime", "hv-spinlocks" -> "spinlocks" etc. */ -#define VIR_CPU_x86_KVM_HV_RUNTIME "hv-runtime" -#define VIR_CPU_x86_KVM_HV_SYNIC "hv-synic" -#define VIR_CPU_x86_KVM_HV_STIMER "hv-stimer" -#define VIR_CPU_x86_KVM_HV_RELAXED "hv-relaxed" -#define VIR_CPU_x86_KVM_HV_SPINLOCKS "hv-spinlocks" -#define VIR_CPU_x86_KVM_HV_VAPIC "hv-vapic" -#define VIR_CPU_x86_KVM_HV_VPINDEX "hv-vpindex" -#define VIR_CPU_x86_KVM_HV_RESET "hv-reset" -#define VIR_CPU_x86_KVM_HV_FREQUENCIES "hv-frequencies" -#define VIR_CPU_x86_KVM_HV_REENLIGHTENMENT "hv-reenlightenment" -#define VIR_CPU_x86_KVM_HV_TLBFLUSH "hv-tlbflush" -#define VIR_CPU_x86_KVM_HV_IPI "hv-ipi" -#define VIR_CPU_x86_KVM_HV_EVMCS "hv-evmcs" +#define VIR_CPU_x86_HV_RUNTIME "hv-runtime" +#define VIR_CPU_x86_HV_SYNIC "hv-synic" +#define VIR_CPU_x86_HV_STIMER "hv-stimer" +#define VIR_CPU_x86_HV_RELAXED "hv-relaxed" +#define VIR_CPU_x86_HV_SPINLOCKS "hv-spinlocks" +#define VIR_CPU_x86_HV_VAPIC "hv-vapic" +#define VIR_CPU_x86_HV_VPINDEX "hv-vpindex" +#define VIR_CPU_x86_HV_RESET "hv-reset" +#define VIR_CPU_x86_HV_FREQUENCIES "hv-frequencies" +#define VIR_CPU_x86_HV_REENLIGHTENMENT "hv-reenlightenment" +#define VIR_CPU_x86_HV_TLBFLUSH "hv-tlbflush" +#define VIR_CPU_x86_HV_IPI "hv-ipi" +#define VIR_CPU_x86_HV_EVMCS "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 c2f99034c8..7b2cfa0683 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7179,7 +7179,7 @@ qemuBuildCpuCommandLine(virCommandPtr cmd, case VIR_DOMAIN_HYPERV_SPINLOCKS: if (def->hyperv_features[i] =3D=3D VIR_TRISTATE_SWITCH_ON) virBufferAsprintf(&buf, ",%s=3D0x%x", - VIR_CPU_x86_KVM_HV_SPINLOCKS, + VIR_CPU_x86_HV_SPINLOCKS, def->hyperv_spinlocks); break; =20 --=20 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 21:35:57 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=1564155077; cv=none; d=zoho.com; s=zohoarc; b=WivpyC6ZwDbzHNvZIrFkVgc/LEgAM6BMWFhmKovbA0DpB3Mhn/kKtN9jXQ+nJf/vKYc4uQfKZhsPviWEWoyeWyNn7xWRy9EEilT73x5RvwlAxRk8MsLxlw6tgkiYGu8DUH6b+NsHHuBN3c7lVhjPNz/0kV8YLFcH7mdJiwS/ubE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564155077; 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:ARC-Authentication-Results; bh=1aAQfGm6PLnBBrWMsl196Ou7XIjxr/tm+PEXwswUM+o=; b=a0ITLIN5z1tO1SGuTvbIKUCxSWoU1djsm9YoDuRscLYWRdcMyVSa47qQkmI9g63VlzV7ihMsjzfc6o2uQl2fFd96zr7uF9DVlgssGWMW8SmsT9nw6xp/rb8Gkii0vn3Y9b+LdKIBO0eWh1757MqWGJymLQ17qsrwMc0iC7Et1Zc= 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 1564155077488576.1840096248794; Fri, 26 Jul 2019 08:31:17 -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 4D1AF308FBB4; Fri, 26 Jul 2019 15:31:16 +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 1CC8A19729; Fri, 26 Jul 2019 15:31: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 D232E18045D3; Fri, 26 Jul 2019 15:31:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6QFV3sD004199 for ; Fri, 26 Jul 2019 11:31:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id 99739396B; Fri, 26 Jul 2019 15:31:03 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6F18B1C2 for ; Fri, 26 Jul 2019 15:31:00 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 93880100115; Fri, 26 Jul 2019 17:30:59 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 26 Jul 2019 17:30:55 +0200 Message-Id: <8963841b4fbb876dd158061670a7dd684bf8766a.1564154901.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/5] cpu: Drop unused KVM features 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.43]); Fri, 26 Jul 2019 15:31:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Most of the internally defined KVM CPUID features are not actually used by libvirt. The QEMU driver may enable or disable them on the command line, but we don't check for the associated CPU properties or CPUID bits. They would be useless with QEMU 4.1 anyway since their names were only remotely similar to the actual feature names. Signed-off-by: Jiri Denemark Reported-by: Vitaly Kuznetsov Reviewed-by: J=C3=A1n Tomko Tested-by: Vitaly Kuznetsov --- src/cpu/cpu_x86.c | 24 ------------------------ src/cpu/cpu_x86_data.h | 8 -------- 2 files changed, 32 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index f8a51dedf6..387c365512 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -73,24 +73,8 @@ struct _virCPUx86Feature { } \ } =20 -KVM_FEATURE_DEF(VIR_CPU_x86_KVM_CLOCKSOURCE, - 0x40000001, 0x00000001); -KVM_FEATURE_DEF(VIR_CPU_x86_KVM_NOP_IO_DELAY, - 0x40000001, 0x00000002); -KVM_FEATURE_DEF(VIR_CPU_x86_KVM_MMU_OP, - 0x40000001, 0x00000004); -KVM_FEATURE_DEF(VIR_CPU_x86_KVM_CLOCKSOURCE2, - 0x40000001, 0x00000008); -KVM_FEATURE_DEF(VIR_CPU_x86_KVM_ASYNC_PF, - 0x40000001, 0x00000010); -KVM_FEATURE_DEF(VIR_CPU_x86_KVM_STEAL_TIME, - 0x40000001, 0x00000020); -KVM_FEATURE_DEF(VIR_CPU_x86_KVM_PV_EOI, - 0x40000001, 0x00000040); KVM_FEATURE_DEF(VIR_CPU_x86_KVM_PV_UNHALT, 0x40000001, 0x00000080); -KVM_FEATURE_DEF(VIR_CPU_x86_KVM_CLOCKSOURCE_STABLE_BIT, - 0x40000001, 0x01000000); =20 KVM_FEATURE_DEF(VIR_CPU_x86_HV_RUNTIME, 0x40000003, 0x00000001); @@ -121,15 +105,7 @@ KVM_FEATURE_DEF(VIR_CPU_x86_HV_EVMCS, =20 static virCPUx86Feature x86_kvm_features[] =3D { - KVM_FEATURE(VIR_CPU_x86_KVM_CLOCKSOURCE), - KVM_FEATURE(VIR_CPU_x86_KVM_NOP_IO_DELAY), - KVM_FEATURE(VIR_CPU_x86_KVM_MMU_OP), - KVM_FEATURE(VIR_CPU_x86_KVM_CLOCKSOURCE2), - KVM_FEATURE(VIR_CPU_x86_KVM_ASYNC_PF), - KVM_FEATURE(VIR_CPU_x86_KVM_STEAL_TIME), - KVM_FEATURE(VIR_CPU_x86_KVM_PV_EOI), KVM_FEATURE(VIR_CPU_x86_KVM_PV_UNHALT), - KVM_FEATURE(VIR_CPU_x86_KVM_CLOCKSOURCE_STABLE_BIT), KVM_FEATURE(VIR_CPU_x86_HV_RUNTIME), KVM_FEATURE(VIR_CPU_x86_HV_SYNIC), KVM_FEATURE(VIR_CPU_x86_HV_STIMER), diff --git a/src/cpu/cpu_x86_data.h b/src/cpu/cpu_x86_data.h index 85aaab709c..2607dd96b1 100644 --- a/src/cpu/cpu_x86_data.h +++ b/src/cpu/cpu_x86_data.h @@ -43,15 +43,7 @@ struct _virCPUx86MSR { #define CPUX86_KVM 0x40000000 #define CPUX86_EXTENDED 0x80000000 =20 -#define VIR_CPU_x86_KVM_CLOCKSOURCE "__kvm_clocksource" -#define VIR_CPU_x86_KVM_NOP_IO_DELAY "__kvm_no_io_delay" -#define VIR_CPU_x86_KVM_MMU_OP "__kvm_mmu_op" -#define VIR_CPU_x86_KVM_CLOCKSOURCE2 "__kvm_clocksource2" -#define VIR_CPU_x86_KVM_ASYNC_PF "__kvm_async_pf" -#define VIR_CPU_x86_KVM_STEAL_TIME "__kvm_steal_time" -#define VIR_CPU_x86_KVM_PV_EOI "__kvm_pv_eoi" #define VIR_CPU_x86_KVM_PV_UNHALT "__kvm_pv_unhalt" -#define VIR_CPU_x86_KVM_CLOCKSOURCE_STABLE_BIT "__kvm_clocksource_stable" =20 /* * The following HyperV feature names suffixes must exactly match correspo= nding --=20 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 21:35:57 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=1564155074; cv=none; d=zoho.com; s=zohoarc; b=obYN+i2JPoxa5L2S9s4CdP+7TxgQo1xMxBC+F00v6O6jiLsjcYVaWxrblwWwcWvZInqI4A7DrWOaF7jLOH8X9tppD0rIZMISKIsUUt6hrsn/QizKvj8yEvpzTicGLT6H6jYxh/LNhI4wWD/wjheDgl3beZemgq+9aw/pezdT97Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564155074; 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:ARC-Authentication-Results; bh=AjZ3l1CRFGMFNVmygm3Yu+U+xSQ9+AQS1b3Z6uvvUC4=; b=P03FBR0AeqVo75gRiIxrzRpXgnIIlqPRl82TYpgWBq41r3KMh5k5O0WzXgcBUKLtAX2TtT0ek0iutcbKZnQyJduBKOD2JfNBOok8Q8lIPnS8/BdHSMPEw6ZTL2KUFGDjLsUTq+MK+w3M+T0rZkjENYYn+E37CS3cQsOn6KFoxp4= 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 1564155074491472.58409339765615; Fri, 26 Jul 2019 08:31:14 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id E443830C34D5; Fri, 26 Jul 2019 15:31:12 +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 B2D5251; Fri, 26 Jul 2019 15:31:12 +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 623AF264C9; Fri, 26 Jul 2019 15:31:12 +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 x6QFV3BK004212 for ; Fri, 26 Jul 2019 11:31:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id E2ECF5C46C; Fri, 26 Jul 2019 15:31:03 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B83406012D for ; Fri, 26 Jul 2019 15:31:03 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 95C06100116; Fri, 26 Jul 2019 17:30:59 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 26 Jul 2019 17:30:56 +0200 Message-Id: <7171cfb201a61d61e6ca2534fdfa90512c5d4cf9.1564154901.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 Subject: [libvirt] [PATCH 5/5] qemu: Fix KVM features with QEMU 4.1 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Fri, 26 Jul 2019 15:31:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Originally the names of the KVM CPU features were only used internally for looking up their CPUID bits. So we used "__kvm_" prefix for them to make sure the names do not collide with normal CPU features stored in our CPU map. But with QEMU 4.1 we check which features were enabled or disabled by a freshly started QEMU process using their names rather than their CPUID bits (mostly because of MSR features). Thus we need to change our made up internal names into the actual names used by QEMU. Signed-off-by: Jiri Denemark Reported-by: Vitaly Kuznetsov Reviewed-by: J=C3=A1n Tomko Tested-by: Vitaly Kuznetsov --- src/cpu/cpu_x86_data.h | 2 +- src/qemu/qemu_command.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cpu/cpu_x86_data.h b/src/cpu/cpu_x86_data.h index 2607dd96b1..cc0c93dff0 100644 --- a/src/cpu/cpu_x86_data.h +++ b/src/cpu/cpu_x86_data.h @@ -43,7 +43,7 @@ struct _virCPUx86MSR { #define CPUX86_KVM 0x40000000 #define CPUX86_EXTENDED 0x80000000 =20 -#define VIR_CPU_x86_KVM_PV_UNHALT "__kvm_pv_unhalt" +#define VIR_CPU_x86_KVM_PV_UNHALT "kvm_pv_unhalt" =20 /* * The following HyperV feature names suffixes must exactly match correspo= nding diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 7b2cfa0683..fee51158a9 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7146,7 +7146,7 @@ qemuBuildCpuCommandLine(virCommandPtr cmd, } =20 if (def->features[VIR_DOMAIN_FEATURE_PVSPINLOCK]) { - qemuBuildCpuFeature(qemuCaps, &buf, "kvm_pv_unhalt", + qemuBuildCpuFeature(qemuCaps, &buf, VIR_CPU_x86_KVM_PV_UNHALT, def->features[VIR_DOMAIN_FEATURE_PVSPINLOCK] = =3D=3D VIR_TRISTATE_SWITCH_ON); } =20 --=20 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list