Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp618708pxy; Wed, 28 Apr 2021 10:35:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDT+cWt2l828KcSfOAA0/qr/5O3iVWaYvhs8xzPZm14j1BDf/0hdVuu4l8kKtNNX3JcsAU X-Received: by 2002:a17:906:d145:: with SMTP id br5mr5309933ejb.452.1619631315706; Wed, 28 Apr 2021 10:35:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619631315; cv=none; d=google.com; s=arc-20160816; b=eyyX0SVFnlnKCurMrQQVUPdu6xAPkdt/HcvoNVYDUw1smYOySYxww92XfdnfRyYS+l OM2AQCfeqftzvnz9/5VC0ShBOuaHNiPYpBSBGVWyVCP1MARImnn8dGlSD/nyr5lN4ja0 iZAVZWybH/cfnqPRFezLgXvuUbi+AzFlyHiithqLcepgr1EPx4ZbO2o29L75uplUwkxO IOExpgZ1GGVlY0NpdkZLX4P8s03KBAUtMwogc5Pupo3CxrhlDtSftqEOK4xmDP8Wfxrz gzy/OHFQ0P8Mdpimfw9drZK7TzuATZ8kHTjP6BJSQqMxA1QZ9C3DrMHswnJ7cgl/CkPt rXBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Uheu8s26iW3ko1XKinftj7CiwtVhVkhr//K4W010x+g=; b=yOCXF7SQGPGiOzPBNUm3Mvbl85s3UDUvcPgYBnTLns5flpSXtQBRAwRbncajJqnGNW ZF4NrH/QsxK8aBznfumXH6KlBmg9iX7Qk987iht+vpwtr01FxBOmmCYb729tMRYC5TzT u142zvn72hsDOYNyiyjc1osqmLblE8S3HI5VSxJi3+bzjD1gintB8kYDThrFWlaB18eI kqoIb8nH836pZ9GZ5aqPP9XOvmCwC1qwUzhgyHMlz6aMYnQQDKbvj8SymEdWjSoElh/U 3e0KBHlJ0VFDj7newZvC7x0qmbeVWQOc69IA4O2cbsHL0VaGlH/mH1gxm1KIuPpojzql hlhw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qk30si669400ejb.152.2021.04.28.10.34.51; Wed, 28 Apr 2021 10:35:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240108AbhD1ODH (ORCPT + 99 others); Wed, 28 Apr 2021 10:03:07 -0400 Received: from mail-wr1-f47.google.com ([209.85.221.47]:43624 "EHLO mail-wr1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238380AbhD1OCo (ORCPT ); Wed, 28 Apr 2021 10:02:44 -0400 Received: by mail-wr1-f47.google.com with SMTP id x7so63152674wrw.10; Wed, 28 Apr 2021 07:01:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Uheu8s26iW3ko1XKinftj7CiwtVhVkhr//K4W010x+g=; b=MKy3Kq2BVhQG9g3ncrRkK2jYiFZKB8NepwFyhtZ7wcio0uUUosnue5H8Sqvo9DqKAQ LO6tS9Bf0q3jgPz2OjQzEJ56c0TSBU8uAo867FfLjBidj0yw7SjVDyFxgATIL03w3MqL ZxZMndHxq2wNHmx5N9hFn6ITqCJWV3uWcbXfaR0KssqdtHpw1BSn6FHYb52hr9Q0lwtp kCzWCsIGfkfT5ismQ+1Mf7sJBC3ifXjJqAhq5+cadYtHMdi8cHrSzen3H+5UxPWlQdWD TJRklLWs1IRvoomxjx1uh5AYyV8hh8804md2jfL2Pg3tTxpaHp4ilO1S2rqEs/YTWY7f ownw== X-Gm-Message-State: AOAM532VtWf+/A6zEemLZZWpM4pnJhnHluB1XlcbOAlqIKW0yvPdv+KR duBT9oeq4VB9ZBli7jl7zfA= X-Received: by 2002:a5d:638f:: with SMTP id p15mr23588927wru.255.1619618518894; Wed, 28 Apr 2021 07:01:58 -0700 (PDT) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id n12sm3882943wmq.29.2021.04.28.07.01.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Apr 2021 07:01:58 -0700 (PDT) Date: Wed, 28 Apr 2021 14:01:56 +0000 From: Wei Liu To: Vineeth Pillai Cc: Lan Tianyu , Michael Kelley , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Tom Lendacky , Wanpeng Li , Jim Mattson , Joerg Roedel , Wei Liu , Stephen Hemminger , Haiyang Zhang , "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "K. Y. Srinivasan" , x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org Subject: Re: [PATCH v4 1/7] hyperv: Detect Nested virtualization support for SVM Message-ID: <20210428140156.flf5ie6r2j7os5ch@liuwe-devbox-debian-v2> References: <8ffa88e6ceb55d283c76b4c5fd9ad0fb1a2cf667.1619556430.git.viremana@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8ffa88e6ceb55d283c76b4c5fd9ad0fb1a2cf667.1619556430.git.viremana@linux.microsoft.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 27, 2021 at 08:54:50PM +0000, Vineeth Pillai wrote: > Previously, to detect nested virtualization enlightenment support, > we were using HV_X64_ENLIGHTENED_VMCS_RECOMMENDED feature bit of > HYPERV_CPUID_ENLIGHTMENT_INFO.EAX CPUID as docuemented in TLFS: > "Bit 14: Recommend a nested hypervisor using the enlightened VMCS > interface. Also indicates that additional nested enlightenments > may be available (see leaf 0x4000000A)". > > Enlightened VMCS, however, is an Intel only feature so the above > detection method doesn't work for AMD. So, use the > HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS.EAX CPUID information ("The > maximum input value for hypervisor CPUID information.") and this > works for both AMD and Intel. > > Signed-off-by: Vineeth Pillai Acked-by: Wei Liu