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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9772C433EF for ; Tue, 28 Sep 2021 11:46:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AF17261139 for ; Tue, 28 Sep 2021 11:46:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240417AbhI1Lry (ORCPT ); Tue, 28 Sep 2021 07:47:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240377AbhI1Lru (ORCPT ); Tue, 28 Sep 2021 07:47:50 -0400 Received: from theia.8bytes.org (8bytes.org [IPv6:2a01:238:4383:600:38bc:a715:4b6d:a889]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E253C061575 for ; Tue, 28 Sep 2021 04:46:11 -0700 (PDT) Received: by theia.8bytes.org (Postfix, from userid 1000) id 4F0CC208; Tue, 28 Sep 2021 13:46:09 +0200 (CEST) Date: Tue, 28 Sep 2021 13:46:08 +0200 From: Joerg Roedel To: Kuppuswamy Sathyanarayanan Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, Paolo Bonzini , Juergen Gross , Deep Shah , VMware Inc , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Peter H Anvin , Dave Hansen , Tony Luck , Dan Williams , Andi Kleen , Kirill Shutemov , Sean Christopherson , Kuppuswamy Sathyanarayanan , linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 04/11] x86/tdx: Add protected guest support for TDX guest Message-ID: References: <20210903172812.1097643-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20210903172812.1097643-5-sathyanarayanan.kuppuswamy@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210903172812.1097643-5-sathyanarayanan.kuppuswamy@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 03, 2021 at 10:28:05AM -0700, Kuppuswamy Sathyanarayanan wrote: > static inline bool prot_guest_has(unsigned int attr) > { > if (sme_me_mask) > return amd_prot_guest_has(attr); > + else if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) > + return intel_prot_guest_has(attr); This causes a function call on every Intel machine this code runs. is there an easier to check whether TDX is enabled, like the sme_me_mask check on AMD?