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=-6.1 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,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 B9BBBC433EF for ; Fri, 3 Sep 2021 23:54:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8FF7360F9C for ; Fri, 3 Sep 2021 23:54:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350565AbhICXzH (ORCPT ); Fri, 3 Sep 2021 19:55:07 -0400 Received: from mga01.intel.com ([192.55.52.88]:27142 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233868AbhICXzG (ORCPT ); Fri, 3 Sep 2021 19:55:06 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10096"; a="241829209" X-IronPort-AV: E=Sophos;i="5.85,266,1624345200"; d="scan'208";a="241829209" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Sep 2021 16:54:05 -0700 X-IronPort-AV: E=Sophos;i="5.85,266,1624345200"; d="scan'208";a="447788053" Received: from akleen-mobl1.amr.corp.intel.com (HELO [10.212.143.21]) ([10.212.143.21]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Sep 2021 16:54:05 -0700 Subject: Re: [PATCH v6 11/11] x86/tdx: Handle CPUID via #VE To: Sean Christopherson , "Kuppuswamy, Sathyanarayanan" Cc: Dave Hansen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, Paolo Bonzini , Juergen Gross , Deep Shah , VMware Inc , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Peter H Anvin , Tony Luck , Dan Williams , Kirill Shutemov , Kuppuswamy Sathyanarayanan , linux-kernel@vger.kernel.org References: <20210903172812.1097643-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20210903172812.1097643-12-sathyanarayanan.kuppuswamy@linux.intel.com> <24d0fe72-78b4-6550-e5d8-dd511dcbfef3@intel.com> <26e79e8f-ba96-9087-04dd-283eadd8c693@linux.intel.com> From: Andi Kleen Message-ID: Date: Fri, 3 Sep 2021 16:54:04 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/3/2021 4:43 PM, Sean Christopherson wrote: > On Fri, Sep 03, 2021, Kuppuswamy, Sathyanarayanan wrote: >> >> On 9/3/21 11:35 AM, Dave Hansen wrote: >>> On 9/3/21 10:28 AM, Kuppuswamy Sathyanarayanan wrote: >>>> From: "Kirill A. Shutemov" >>>> >>>> TDX has three classes of CPUID leaves: some CPUID leaves are always >>>> handled by the CPU, others are handled by the TDX module, and some >>>> others are handled by the VMM. Since the VMM cannot directly intercept >>>> the instruction these are reflected with a #VE exception to the guest, >>>> which then converts it into a hypercall to the VMM, or handled >>>> directly. >>> Does this patch do any of the "handled directly" leaves? If not, why >>> mention it? >> It was added to give more information about CPUID leaves handling. Since >> it has nothing to do with this patch, I can remove it. > What leaves are "always handled by the CPU"? VTx doesn't allow disabling > CPUID exiting, let alone conditionally exiting on a specific CPUID leaf. I don't > see anything in the TDX specs that suggests that's any different in SEAM non-root > mode. It means they are handled by the TDX module, but always have the same contents as a native CPU would. As opposed to leaves that are modified by the TDX module. -Andi