From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B9FAC4727E for ; Thu, 24 Sep 2020 14:59:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CE4AB206C3 for ; Thu, 24 Sep 2020 14:59:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="BCvfbItv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728336AbgIXO6T (ORCPT ); Thu, 24 Sep 2020 10:58:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:45242 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728199AbgIXO6R (ORCPT ); Thu, 24 Sep 2020 10:58:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600959495; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=B3cKmN/G4JQx8JIZf3k/gZZAWceOigmYqUGv0Iykr/I=; b=BCvfbItvZ8l+7e1NW9xQrLgrb6NLZi7LGQ4EergEbOx3+t/bszfEPelJzk0Dq1JVw6syJu 1uxJxEWhS66IfIxVqBJZsf10vCzbewakiHAiUa9ic6SFo7/788W6vMOk4ZKTbQNl82DfYQ uc7+HfuuxqekKyzYSYByZ2fzo2Y3t88= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-477-rNoR_jS8NmeKiOhPetHW1g-1; Thu, 24 Sep 2020 10:58:14 -0400 X-MC-Unique: rNoR_jS8NmeKiOhPetHW1g-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 33A7881CBF1; Thu, 24 Sep 2020 14:58:12 +0000 (UTC) Received: from vitty.brq.redhat.com (unknown [10.40.192.160]) by smtp.corp.redhat.com (Postfix) with ESMTP id E995B5578D; Thu, 24 Sep 2020 14:58:09 +0000 (UTC) From: Vitaly Kuznetsov To: kvm@vger.kernel.org, Paolo Bonzini Cc: Sean Christopherson , Wanpeng Li , Jim Mattson , Eduardo Habkost , Jon Doron , linux-kernel@vger.kernel.org Subject: [PATCH v2 4/7] KVM: x86: hyper-v: always advertise HV_STIMER_DIRECT_MODE_AVAILABLE Date: Thu, 24 Sep 2020 16:57:54 +0200 Message-Id: <20200924145757.1035782-5-vkuznets@redhat.com> In-Reply-To: <20200924145757.1035782-1-vkuznets@redhat.com> References: <20200924145757.1035782-1-vkuznets@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org HV_STIMER_DIRECT_MODE_AVAILABLE is the last conditionally set feature bit in KVM_GET_SUPPORTED_HV_CPUID but it doesn't have to be conditional: first, this bit is only an indication to userspace VMM that direct mode stimers are supported, it still requires manual enablement (enabling SynIC) to work so no VMM should just blindly copy it to guest CPUIDs. Second, lapic_in_kernel() is a must for SynIC. Expose the bit unconditionally. Signed-off-by: Vitaly Kuznetsov --- arch/x86/kvm/hyperv.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c index 6da20f91cd59..503829f71270 100644 --- a/arch/x86/kvm/hyperv.c +++ b/arch/x86/kvm/hyperv.c @@ -2028,13 +2028,7 @@ int kvm_vcpu_ioctl_get_hv_cpuid(struct kvm_vcpu *vcpu, struct kvm_cpuid2 *cpuid, ent->ebx |= HV_DEBUGGING; ent->edx |= HV_X64_GUEST_DEBUGGING_AVAILABLE; ent->edx |= HV_FEATURE_DEBUG_MSRS_AVAILABLE; - - /* - * Direct Synthetic timers only make sense with in-kernel - * LAPIC - */ - if (lapic_in_kernel(vcpu)) - ent->edx |= HV_STIMER_DIRECT_MODE_AVAILABLE; + ent->edx |= HV_STIMER_DIRECT_MODE_AVAILABLE; break; -- 2.25.4