From patchwork Thu Jan 24 17:15:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vitaly Kuznetsov X-Patchwork-Id: 10779661 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A5545746 for ; Thu, 24 Jan 2019 17:15:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 86B1F324EE for ; Thu, 24 Jan 2019 17:15:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 846C3315D8; Thu, 24 Jan 2019 17:15:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1626E324D6 for ; Thu, 24 Jan 2019 17:15:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728880AbfAXRPV (ORCPT ); Thu, 24 Jan 2019 12:15:21 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:45519 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727983AbfAXRPV (ORCPT ); Thu, 24 Jan 2019 12:15:21 -0500 Received: by mail-wr1-f65.google.com with SMTP id t6so7295915wrr.12 for ; Thu, 24 Jan 2019 09:15:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jGO4yYK/mHcYbbZOA4voGTiVjt6/xAHjeCPNmXeieEc=; b=lfroTHVpme3iKH7Airq2jsMH+G8sqX9lQsGMxdDwGM7/SPw+0h1ghQz9e/T+E2DuJL GZM5kiNUtIfv9wMHC7DgcCsoDx1giEFJqXin1O+7UvyLlA0PAiopS8+4/RnFb2KOSo+Q 80v60+d6SarVjx6X6ZUIlD8PvwWF2U8ULAsBoKovYnwdrepkX4JY/JuEdXk8y/5QITS1 zXUp0vliSM344TJLtGI6umhI220KesZYjOao3RBUrO1WKVx2OXIkf/21TDcewA0A1S5W tiapPVZUM2ZcEl0I1TuSnqHsbTMcwMbs3tMQc1Sg7FTEZJGa4/Hewzr8sFOht4ia5N0o iAlA== X-Gm-Message-State: AJcUukeMyThXV85ZF9KfuuyTwnXbD0rcC9GV1bNTr8q04CzJEc+w10uE mtuyv+1lp05XuFBYfhalq/dymPwyD52nGg== X-Google-Smtp-Source: ALg8bN6usWgducjOpMhEHTPH58zjC82k9lqDEMTn07J/NZCrbBvf56bO7/UI0iZ+AVbvbPmWKD0VGw== X-Received: by 2002:adf:ba8e:: with SMTP id p14mr7867861wrg.230.1548350118986; Thu, 24 Jan 2019 09:15:18 -0800 (PST) Received: from vitty.brq.redhat.com (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id n9sm83624972wrx.80.2019.01.24.09.15.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Jan 2019 09:15:17 -0800 (PST) From: Vitaly Kuznetsov To: kvm@vger.kernel.org Cc: Paolo Bonzini , =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= , Roman Kagan , linux-kernel@vger.kernel.org Subject: [PATCH] x86/kvm/hyper-v: tweak HYPERV_CPUID_ENLIGHTMENT_INFO Date: Thu, 24 Jan 2019 18:15:16 +0100 Message-Id: <20190124171516.23626-1-vkuznets@redhat.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We shouldn't probably be suggesting using Enlightened VMCS when it's not enabled (not supported from guest's point of view). System reset through synthetic MSR is not recommended neither by genuine Hyper-V nor my QEMU. Windows seems to be fine either way but let's be consistent. Fixes: 2bc39970e932 ("x86/kvm/hyper-v: Introduce KVM_GET_SUPPORTED_HV_CPUID") Signed-off-by: Vitaly Kuznetsov --- arch/x86/kvm/hyperv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c index ac44a681f065..4730fcaa70cf 100644 --- a/arch/x86/kvm/hyperv.c +++ b/arch/x86/kvm/hyperv.c @@ -1847,11 +1847,11 @@ int kvm_vcpu_ioctl_get_hv_cpuid(struct kvm_vcpu *vcpu, struct kvm_cpuid2 *cpuid, case HYPERV_CPUID_ENLIGHTMENT_INFO: ent->eax |= HV_X64_REMOTE_TLB_FLUSH_RECOMMENDED; ent->eax |= HV_X64_APIC_ACCESS_RECOMMENDED; - ent->eax |= HV_X64_SYSTEM_RESET_RECOMMENDED; ent->eax |= HV_X64_RELAXED_TIMING_RECOMMENDED; ent->eax |= HV_X64_CLUSTER_IPI_RECOMMENDED; ent->eax |= HV_X64_EX_PROCESSOR_MASKS_RECOMMENDED; - ent->eax |= HV_X64_ENLIGHTENED_VMCS_RECOMMENDED; + if (evmcs_ver) + ent->eax |= HV_X64_ENLIGHTENED_VMCS_RECOMMENDED; /* * Default number of spinlock retry attempts, matches