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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 1963BC2D0C9 for ; Thu, 12 Dec 2019 18:34:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 00D0B22527 for ; Thu, 12 Dec 2019 18:34:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730411AbfLLSem (ORCPT ); Thu, 12 Dec 2019 13:34:42 -0500 Received: from mga14.intel.com ([192.55.52.115]:13397 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730291AbfLLSel (ORCPT ); Thu, 12 Dec 2019 13:34:41 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Dec 2019 10:27:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,306,1571727600"; d="scan'208";a="239043222" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.202]) by fmsmga004.fm.intel.com with ESMTP; 12 Dec 2019 10:27:21 -0800 Date: Thu, 12 Dec 2019 10:27:21 -0800 From: Sean Christopherson To: Liran Alon Cc: Jim Mattson , Paolo Bonzini , Borislav Petkov , Thomas Gleixner , Ingo Molnar , the arch/x86 maintainers , "H. Peter Anvin" , Peter Zijlstra , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Radim =?utf-8?B?S3LEjW3DocWZ?= , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , Tony Luck , Tony W Wang-oc , Len Brown , Shuah Khan , LKML , kvm list , linux-edac@vger.kernel.org, Linux PM list , "open list:KERNEL SELFTEST FRAMEWORK" , Jarkko Sakkinen Subject: Re: [PATCH v4 11/19] x86/cpu: Print VMX flags in /proc/cpuinfo using VMX_FEATURES_* Message-ID: <20191212182721.GI3163@linux.intel.com> References: <20191128014016.4389-12-sean.j.christopherson@intel.com> <20191212122646.GE4991@zn.tnic> <4A24DE75-4E68-4EC6-B3F3-4ACB0EE82BF0@oracle.com> <17c6569e-d0af-539c-6d63-f4c07367d8d1@redhat.com> <20191212174357.GE3163@linux.intel.com> <52dd758d-a590-52a6-4248-22d6852b75cd@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On Thu, Dec 12, 2019 at 08:04:19PM +0200, Liran Alon wrote: > > > > On 12 Dec 2019, at 19:57, Jim Mattson wrote: > > > > On Thu, Dec 12, 2019 at 9:53 AM Liran Alon wrote: > > > >> Why should CPU VMX features be treated differently than standard CPUID deduced features? > > > > Do we have the right Intel people on the recipient list to answer this > > question? Presumably, Intel felt that this information should be > > available in supervisor mode only. > > > > Sean? > > Good question. Probably because it just makes sense that Ring3 will never need to use > this info as all VMX instructions are privileged. i.e. Can only be executed in Ring0. I highly doubt ring0 vs. ring3 was a motivating factor. I suspect the MSR interface is primarily driven by VMX's allowed-0 vs. allowed-1 behavior, which would be awkward to encode in CPUID. Reporting via MSR also likely provided more flexibility for updating/fixing CPU behavior, e.g. patching the RDMSR hook is likely far easier than patching CPUID. Even if the architects intended the information to be supervisor-only, that's just their opinion, no? > De-facto in KVM we have discovered this assumption to be problematic BTW, > as KVM created an interface to query VMX MSRs values to properly define the requested > vCPU model. :P (See kvm_get_msr_feature())