From nobody Mon Feb 9 00:02:35 2026 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 --- 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