Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp802394pxb; Fri, 22 Apr 2022 11:27:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDLOYEEN1tL5COPaL/NjtjANj6RwBHqkuUOADNMLYZz9jiBsFy975clcE1dCydfpgEbDlH X-Received: by 2002:a17:902:7798:b0:158:ee95:f45b with SMTP id o24-20020a170902779800b00158ee95f45bmr5667436pll.97.1650652026988; Fri, 22 Apr 2022 11:27:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650652026; cv=none; d=google.com; s=arc-20160816; b=y/zEaDq7cgxfZenrWQgiHwoLCtG1aPyJ5YZgTQR+iL8WT4nuK2qMxPONw/gswBL0nC YwTngR4DiAn89flaPHOA4S+OtOSUX9y47UxvLAzVOIFNSAzr8ORMCXUr8KUXbjTFqIgU 5mJADMTf820TcwYfut+rKiG1A2Hnv6IBP+yrupvl3XXfMhmPaDfcFTP/nW8Op7T8Kzim kDg3z4qVgX6ruFtY8X9PZoTC6rc0DQSrR8L8fM7TI4r8GtAX9H2wmfu5R1CQOjBwEO1O NuiQC8/5xXEX7VruPhtTTSjhP7eDZ1yzvSSIlVsh9PyMv5upM1NPD2YNQAiOCFqu+5jm z4OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=o/ozdBc2EnetQZby0Dq0arg/wM1fGuqmYXDc/fS+iKE=; b=BgXwCnUovbtusWyJNptsYA3LnD0I89YGSksvZHPTCVUVeMxQY8OSsS13L0UFM3E9Fe MnOuMlEapU6HwFZonpfIlnIjRWk92K20vUOxfL3ukhZU1BWaVceL02mHspT/cXPe9Ggr 95vhqpLsqXCIkt3L0m0dJwBMGitNl5eG2C5ac+aS174rcmAVa7s7FIZ3gI5Cxq921IdK EwVIs7kUjhGOtoBHcE+FGkgzd3tJubCAFBK1Ncvd2YH7LTpgSoQHyJrpEL+XLCRvrqAx RrEppXVwIrP6TyKddwb/sFiRhDvXKOxowtWnesMR9bvxndi05Qcx/IPoGoQh3xt1xC6m Uw8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kV3mEYMR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id z20-20020a63d014000000b00387429c6255si9686731pgf.178.2022.04.22.11.27.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 11:27:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kV3mEYMR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E01E7D3706; Fri, 22 Apr 2022 10:55:15 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1385485AbiDUHA2 (ORCPT + 99 others); Thu, 21 Apr 2022 03:00:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1385541AbiDUHAH (ORCPT ); Thu, 21 Apr 2022 03:00:07 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F55715A32; Wed, 20 Apr 2022 23:57:14 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id j17so4140112pfi.9; Wed, 20 Apr 2022 23:57:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=o/ozdBc2EnetQZby0Dq0arg/wM1fGuqmYXDc/fS+iKE=; b=kV3mEYMRZCjIuz1tsNE+1ob8/s/kL83lxOJG9DUy5xJj7JL8SVYhJlojfHvx7cFwgO Oecl0Og28SvzCiEO5O3tg+l140mcjhtOvaFlX5ejJAfASMTfOiZmkohDsST14SSqKTEy gI2GGj/oWKSKr5npPdFAZBnYpUTo9GLjj0PdDECjOCpVV68FfWTZu5C1oIR0hMWest8g 3dN6/AVkelgrY5keUOwkUfsipojB7+oqi0p/5Jm9DQpIIqaK5qhBIRhCHVv6ivg3N8Ir L3sZC8phJt62v36rKBc8nRqMxar5oOSE2ldBHTBOl7fPx7R6wb4gMXCQJXO/iHzH7bJV jsMA== 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:user-agent; bh=o/ozdBc2EnetQZby0Dq0arg/wM1fGuqmYXDc/fS+iKE=; b=NbTdxWec8lkvG29gxif/esdCZ+1kWnkZrBaXlDGiMu92fSrArC78JGpx9SGv7m7aFL 3p0WBpemBFlDUEgtyTMjAvrBc+8rtVwkeNbDAcMZzeRkSHjQOFtJAM2KEksbSdMun3ZI D976hL1rkltmRo7i0OnP3hQhvjDoTIDWYY7fzj8AaD3DfwoWJyA/ADjZ7S3AQg+NBfum EGHBPhWjM62fEJIZtVMywDIQ92AA689T0iSIpEQIUBgbSQ1iZARoLLa7gZ2pBvZlfDXd uzm4dqDUR3amZKW3faw+pYZSnqE//j8lxma+Vjpws3674livCAccVR6NV46N3NTtzjcx e1Kg== X-Gm-Message-State: AOAM53387yIckTrdB21EfmK2QonJRP2U/JCVfcaJvKmXlFlk++ItiHOs Jm1pQre8WK8ktAD2r+ayxYU= X-Received: by 2002:a05:6a00:2883:b0:509:322f:685f with SMTP id ch3-20020a056a00288300b00509322f685fmr27259825pfb.60.1650524233790; Wed, 20 Apr 2022 23:57:13 -0700 (PDT) Received: from localhost (c-107-3-154-88.hsd1.ca.comcast.net. [107.3.154.88]) by smtp.gmail.com with ESMTPSA id w7-20020aa79547000000b0050ad0e82e6dsm2847893pfq.215.2022.04.20.23.57.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Apr 2022 23:57:13 -0700 (PDT) Date: Wed, 20 Apr 2022 23:57:07 -0700 From: Isaku Yamahata To: Sathyanarayanan Kuppuswamy Cc: Kai Huang , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Hans de Goede , Mark Gross , "H . Peter Anvin" , "Kirill A . Shutemov" , Tony Luck , Andi Kleen , linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, isaku.yamahata@gmail.com Subject: Re: [PATCH v3 4/4] platform/x86: intel_tdx_attest: Add TDX Guest attestation interface driver Message-ID: <20220421065707.GA1423762@private.email.ne.jp> References: <20220415220109.282834-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20220415220109.282834-5-sathyanarayanan.kuppuswamy@linux.intel.com> <420a4d689f73f9f7dc1ef71c61da75b7c9777a3f.camel@intel.com> <1e184b44-8024-b8ae-98a8-cf2b6f78df61@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1e184b44-8024-b8ae-98a8-cf2b6f78df61@linux.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 20, 2022 at 07:42:06PM -0700, Sathyanarayanan Kuppuswamy wrote: > > > On 4/20/22 5:11 PM, Kai Huang wrote: > > On Wed, 2022-04-20 at 16:45 -0700, Sathyanarayanan Kuppuswamy wrote: > > > If we want to support multiple GetQuote requests in parallel, then we > > > need some way to uniquely identify the GetQuote requests. So that when > > > we get completion notification, we can understand which request is > > > completed. This part is not mentioned/discussed in ABI spec. So we want > > > to serialize the requests for now. > > > > > > > Yes it's unfortunate that this part (whether concurrent GetQuote requests are > > supported by TDX architecture) is not explicitly mentioned in GHCI spec. I am > > fine with only supporting GetQuote requests one by one. AFAICT there's no > > request to support concurrent GetQuote requests anyway. What concerns me is > > exactly how explain this. > > > > As I said, we have GET_QUOTE_IN_FLIGHT flag now. Theoretically, you can queue > > multiple GetQuote requests, and when you receive the interrupt, you check which > > buffer has GET_QUOTE_IN_FLIGHT cleared. That buffer is the one with Quote > > ready. However I am not 100% sure whether above will always work. Interrupt > > can get lost when there are multiple Quotes ready in multiple buffer in very > > short time period, etc? Perhaps Isaku can provide more input here. > > Either supported or not, it should be mentioned in the GHCI spec. Currently, > there are no details related to it. If it is supported, the specification > should include the protocol to use. > > I will check with Isaku about it. The spec says that TD can call multiple GetQuote requests in parallel. TDG.VP.VMCALL API allows one TD to issue multiple requests. It's implementation specific that how many concurrent requests are allowed. The TD should be able to handle TDG.VP.VMCALL_RETRY if it chooses to issue multiple requests simultaneously As Kai said, there is no requirement for multiple GetQuote in parallel, it's okay to support only single request at the same time. While the status is GET_QUOTE_IN_FLIGHT, VMM owns the shared GPA. The attestation driver should wait for GET_QUOTE_IN_FLIGHT to be cleared before sending next request. -- Isaku Yamahata