Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp660065pxb; Wed, 6 Oct 2021 12:37:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfP7vDIEcepXfQ099bwzQy8ovjtuPU5NFKlHd8hg+XHQFPr3QPfJPiPmpglO5ZwdofUkTD X-Received: by 2002:a17:90a:1a43:: with SMTP id 3mr653774pjl.242.1633549057633; Wed, 06 Oct 2021 12:37:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633549057; cv=none; d=google.com; s=arc-20160816; b=IygB6QDbOKWm1UbQgzrfPvgT0Z6D258XBG1WUsyQ7z1A+OuxbI1XsImKONR9go4EHq y65tFxiM7/zdzBerfh6AiZuJ1A65h8jlxDp0To3J+y4l7w/g3ybevXcZ530YVQJMXsch taqUoL8triTanLX5lnzGUPOVxQFFNIOS8JlHORK+N3GLnHytvfNVukPQE+ySCzDbN1Pj y6sR1jfi7Ee61g/B5MfOYEuwdNARhnEF/AxaZ3ucg8qXrTCDsRG6Q+iQpBcGGT8wtH8U /KfNMNRwfwPcBytWN3Lh2xu8NEX1flyMBdiMOQOirPCkLSaOHnmYr95GJ0G0AmoP+B3F zCoA== 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:dkim-signature; bh=x7PJpkoqOXRnnq6BuAxUmUUioNSk1/jMjBh6/To47EU=; b=Cf3lKXmovXK3RQuMefgv8ocudXSerJvCjgEzei8vse351OaXbNPc7mNSrReAe/3zVB fD7wxIzKUvkDSB8jp2D9Oa0Tsrc/U7l0mCFXjTWOvwYWnerQg4eyfBx327g3MsIjf8VY SUily2LtxBA+76J1PZv1Cv3eW5bGkQTClQWbXU4GGAjj3AOMkKLGFUxMw+2tJ90VbOb7 HhoTA52tQ9Dgyeq2JB1xHzqO87RftJez9DozGdx74m1AklwxrmntEyMHioF+FqcJkPFZ cD9D76snriu/IXO57MSKN+ACh5PFg2oP8zwwKhkfz59VawL+/rEbRq+EJ+oCvlAt+/9Q 0Cpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="S2Ngx6/R"; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u7si28110051plq.301.2021.10.06.12.37.24; Wed, 06 Oct 2021 12:37:37 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="S2Ngx6/R"; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239370AbhJFTgk (ORCPT + 99 others); Wed, 6 Oct 2021 15:36:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:28571 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239377AbhJFTgj (ORCPT ); Wed, 6 Oct 2021 15:36:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633548886; 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: in-reply-to:in-reply-to:references:references; bh=x7PJpkoqOXRnnq6BuAxUmUUioNSk1/jMjBh6/To47EU=; b=S2Ngx6/Rf8ITbnAk3naIEyE+SDhl6H+jLUKVHa92WrLJ/mcclHkajU5BK8bAMgBq4tfE9T wOQNe+KNnKAl0mQaAutuxiirkNMZwoqgf7PfqZmSSmIeGppLYRMRrnSGda/49JDhyOOZx8 Pw2LrvMTweLFfFdLqXAKc5XKTjXLhcI= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-388-_NwhPMePPd2wS2NsI9_LDQ-1; Wed, 06 Oct 2021 15:34:46 -0400 X-MC-Unique: _NwhPMePPd2wS2NsI9_LDQ-1 Received: by mail-qt1-f200.google.com with SMTP id s10-20020ac80d8a000000b002a753776238so3063410qti.15 for ; Wed, 06 Oct 2021 12:34:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=x7PJpkoqOXRnnq6BuAxUmUUioNSk1/jMjBh6/To47EU=; b=hhNuaCCAFSER1SVHQoDYG5bK+JTuENvGod8hT1Avf0rqAeuZg2GJMrMj3UP1SgegXu u76UgUWyruUdpSqAv8nXEThYh7vQekXilAiL+km/kfu5NH7aFfFAf5m4Wi26gZ4Zo0G1 LPVWwDXP/5U6Eyfg1VKcouf4ehErVrCkSNZ8gqR/OJnEa1+G937U25QcbZ0VEHW4pCNZ cNnYH6/dFJNCWccavEmhb7J7Sk9tgcebdBHbYt3eCb0eRfWDeodNl6ft8AaxBQuvA8zX NjyEs+dicC8+o+N0ja/5kRYtFxJGdyMAwy7QCIPgKAsjv8t2ZAilX+uOyRthjMKC1qAp pSfQ== X-Gm-Message-State: AOAM531tDkQ8kzrzJNIaU0+IJCca1z3tLCyJpoc1dJRVrtkECtxhJ3gF 9e8jlL5ZiJVgszsPi80NZfB12iJKEJreMOPmKpaWTeEjFBtraFbuCT+0Ot+lPdUN4HmPKfsztVn OS96Tc8U3JyzevXFeBq3Cl75H X-Received: by 2002:a37:668d:: with SMTP id a135mr489290qkc.288.1633548885402; Wed, 06 Oct 2021 12:34:45 -0700 (PDT) X-Received: by 2002:a37:668d:: with SMTP id a135mr489254qkc.288.1633548885110; Wed, 06 Oct 2021 12:34:45 -0700 (PDT) Received: from treble ([2600:1700:6e32:6c00::49]) by smtp.gmail.com with ESMTPSA id c6sm14253619qtc.77.2021.10.06.12.34.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Oct 2021 12:34:44 -0700 (PDT) Date: Wed, 6 Oct 2021 12:34:40 -0700 From: Josh Poimboeuf To: Kuppuswamy Sathyanarayanan Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, Paolo Bonzini , David Hildenbrand , Andrea Arcangeli , Juergen Gross , Deep Shah , VMware Inc , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , 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 v8 08/11] x86/tdx: Wire up KVM hypercalls Message-ID: <20211006193440.jgmagja3vynqnnis@treble> References: <20211005025205.1784480-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20211005025205.1784480-9-sathyanarayanan.kuppuswamy@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20211005025205.1784480-9-sathyanarayanan.kuppuswamy@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 04, 2021 at 07:52:02PM -0700, Kuppuswamy Sathyanarayanan wrote: > static inline long kvm_hypercall0(unsigned int nr) > { > long ret; > + > + if (cc_platform_has(CC_ATTR_GUEST_TDX)) > + return tdx_kvm_hypercall(nr, 0, 0, 0, 0); Hm, I'm still thinking that figuring out a way to convert all the cc_platform_has() stuff to normal cpu features -- or at least inline wrappers around them -- would be really nice here. Then this could just be a nice fast static_cpu_has(). -- Josh