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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,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 0C649C43600 for ; Wed, 7 Apr 2021 16:09:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BA121611BE for ; Wed, 7 Apr 2021 16:09:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234147AbhDGQJy (ORCPT ); Wed, 7 Apr 2021 12:09:54 -0400 Received: from mail.skyhub.de ([5.9.137.197]:57512 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354320AbhDGQJk (ORCPT ); Wed, 7 Apr 2021 12:09:40 -0400 Received: from zn.tnic (p200300ec2f08fb00aad493ab6ea3c721.dip0.t-ipconnect.de [IPv6:2003:ec:2f08:fb00:aad4:93ab:6ea3:c721]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 3D4571EC0246; Wed, 7 Apr 2021 18:09:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1617811769; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=sxVXkcApyvWgRpvz11rKwU3ny4asbFyeyFcDJmEYY4Y=; b=Jti5HoimSVXTmsMwJCv2kI1KP+LX5MCLeIhCghkd+qTJfK6oP6MWmTijWFbADr1GjW+28H axA+m1b0eTCX47GNLKGOpxI+iNKoNXudwQB350WlEEUfcziZXhyp388N+7voUeP62ijsS9 GW0RyxaI6h6HNHeX1PqQNTufuzpL4XQ= Date: Wed, 7 Apr 2021 18:09:33 +0200 From: Borislav Petkov To: Vineeth Pillai Cc: Lan Tianyu , Michael Kelley , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Wei Liu , Stephen Hemminger , Haiyang Zhang , "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , "K. Y. Srinivasan" , x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org Subject: Re: [PATCH 1/7] hyperv: Detect Nested virtualization support for SVM Message-ID: <20210407160933.GI25319@zn.tnic> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Wed, Apr 07, 2021 at 02:41:22PM +0000, Vineeth Pillai wrote: > Detect nested features exposed by Hyper-V if SVM is enabled. > > Signed-off-by: Vineeth Pillai > --- > arch/x86/kernel/cpu/mshyperv.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c > index 3546d3e21787..4d364acfe95d 100644 > --- a/arch/x86/kernel/cpu/mshyperv.c > +++ b/arch/x86/kernel/cpu/mshyperv.c > @@ -325,9 +325,17 @@ static void __init ms_hyperv_init_platform(void) > ms_hyperv.isolation_config_a, ms_hyperv.isolation_config_b); > } > > - if (ms_hyperv.hints & HV_X64_ENLIGHTENED_VMCS_RECOMMENDED) { > + /* > + * AMD does not need enlightened VMCS as VMCB is already a > + * datastructure in memory. We need to get the nested > + * features if SVM is enabled. > + */ > + if (boot_cpu_has(X86_FEATURE_SVM) || Pls use: cpu_feature_enabled here. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette