From patchwork Fri Aug 12 18:14:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 658754 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3s9tNX4QJnz9sxR for ; Sat, 13 Aug 2016 04:15:40 +1000 (AEST) Received: from localhost ([::1]:54240 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYGzZ-0001yv-5U for incoming@patchwork.ozlabs.org; Fri, 12 Aug 2016 14:15:37 -0400 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) Received: from localhost (ovpn-116-211.phx2.redhat.com [10.3.116.211]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u7CIEj9W022107; Fri, 12 Aug 2016 14:14:46 -0400 From: Eduardo Habkost To: qemu-devel@nongnu.org, Paolo Bonzini Date: Fri, 12 Aug 2016 15:14:32 -0300 Message-Id: <1471025672-12541-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 12 Aug 2016 18:14:46 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] target-i386: kvm: Report kvm_pv_unhalt as unsupported w/o kernel_irqchip X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jones , Peter Xu , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Andrew Jones Tested-by: Peter Xu --- 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 */