From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36177) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYGyt-0001cS-I6 for qemu-devel@nongnu.org; Fri, 12 Aug 2016 14:15:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bYGym-0005GW-C2 for qemu-devel@nongnu.org; Fri, 12 Aug 2016 14:14:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35608) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYGym-0005Fv-6V for qemu-devel@nongnu.org; Fri, 12 Aug 2016 14:14:48 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AEF6EC04D292 for ; Fri, 12 Aug 2016 18:14:46 +0000 (UTC) From: Eduardo Habkost Date: Fri, 12 Aug 2016 15:14:32 -0300 Message-Id: <1471025672-12541-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [PATCH] target-i386: kvm: Report kvm_pv_unhalt as unsupported w/o kernel_irqchip List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Paolo Bonzini Cc: Andrew Jones , Peter Xu , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= The kvm_pv_unhalt feature doesn't work if kernel_irqchip is disabled, so we need to report it as unsupported. Signed-off-by: Eduardo Habkost --- target-i386/kvm.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 0b2016a..d1a25c5 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -329,6 +329,13 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint32_t function, */ cpuid_1_edx = kvm_arch_get_supported_cpuid(s, 1, 0, R_EDX); ret |= cpuid_1_edx & CPUID_EXT2_AMD_ALIASES; + } else if (function == KVM_CPUID_FEATURES && reg == R_EAX) { + /* kvm_pv_unhalt is reported by GET_SUPPORTED_CPUID, but it can't + * be enabled without the in-kernel irqchip + */ + if (!kvm_irqchip_in_kernel()) { + ret &= ~(1U << KVM_FEATURE_PV_UNHALT); + } } /* fallback for older kernels */ -- 2.7.4