Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp837658imi; Thu, 21 Jul 2022 11:59:12 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sXJ4EC8Uagxg5Xe37M+ZOzRbTQ/pjb/VJ67kRJa/A07RyVU+mK6VYnBan6ww9zcb+YpaDV X-Received: by 2002:a05:6402:518b:b0:43a:dc65:35f8 with SMTP id q11-20020a056402518b00b0043adc6535f8mr59906610edd.185.1658429952728; Thu, 21 Jul 2022 11:59:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658429952; cv=none; d=google.com; s=arc-20160816; b=SWoGhLneegFoT9eKgQ7z6IGj8zVd8Q2ZSMHgDKj5vb99cSjDQC+cJfe9Kf+Txt7Q6M L6T7SaCp5XR0POb7ymJ98DuUPQY2wZ6EzBhYQcVu1X85xIUfcg9iQ6ewTAUIyqEAHGCk 7gVBvpz6ljPVHwxXUShBeNYobgyZEemXg9Kdc+X+BuUYZ7GCsZQSi/+1H4HuBHWlsqk/ 9LExVhy+XVExvI5rbmUECwiLn7fWS6kiSUY2G+8gnd5Bs2sGFFp6kJGwUx7+ClsltuTZ ecDqKO8dRVrZ4HHvvohaSXIMQaJTg2/HSoGn6ENyApWeHar8sDH5SGAGPilb8bSZLNei 6Yyw== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=6lO7pt6FihNk1tDfVmTHyIHkzM0Dj/vcrPMGPRBVjJs=; b=U+xKIaCQaXx1tpJmTQVTfpJ3ga50XGUzfu7wDOcqIOv/NWaELqVHlGi2DFKEK/rm0T ZJAHxkug74P+gbqDqCn06eCgv78TnKilhW9Htxq23L+l8+gKK0JtOuToxMxIJRWYS37N THH1nbncBeT08aot/dEku460GIxZyAmtuma1lYRrOED+zUE7wF+bkVMUqd4wgxNGkf2r p+POLTIVFOjyMwmWl52HhbIT6Gg2gRiKidP9Nv4METGmQyc+o5yp3PpWbx/PC1NWtpna UIauhGnlRpLE5VUeMvw7qUr05UuhYqICB+66Ss+Bnth5uoWVuAGF2ZHPVeBwkxmUbtIq BS2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hK47mpHA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jw13-20020a17090776ad00b0072b57c1f238si2814533ejc.291.2022.07.21.11.58.48; Thu, 21 Jul 2022 11:59:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hK47mpHA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232761AbiGUSm0 (ORCPT + 99 others); Thu, 21 Jul 2022 14:42:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232086AbiGUSmZ (ORCPT ); Thu, 21 Jul 2022 14:42:25 -0400 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 963928AB20 for ; Thu, 21 Jul 2022 11:42:24 -0700 (PDT) Received: by mail-pf1-x42a.google.com with SMTP id l124so2526931pfl.8 for ; Thu, 21 Jul 2022 11:42:24 -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:content-transfer-encoding:in-reply-to; bh=6lO7pt6FihNk1tDfVmTHyIHkzM0Dj/vcrPMGPRBVjJs=; b=hK47mpHA5I3SmZ2mt635TU1iVFJJrdQ9aKGPW6IdHXaVUoaqdYDLYHF5quDgD77irQ 7FdyXpNN51l6Bic6On8ZWcVQfyVZnk95BRD6fcbXC2flC6CcAAV4kyZEhaJ54oN4NFH1 tWfASpYc3bTCNxIFVwn5tDRkt2DRoHe3gd+bOYUPuRxWFNaJ0Ffkw6NWIwXMesoJefLC xofgDltyKQPkZhJpx5YSqfMNZ8jzi6LaPuun+bAUpoNhiJUQp0JPeJ51j7feT5p7vA1U snbPVJwUG7wnejwGIFczzzMQgt3Cl74UvM6xwCIyMBbSIsYehJKNed3E5gStaAlN4BZ+ wgOg== 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:content-transfer-encoding :in-reply-to; bh=6lO7pt6FihNk1tDfVmTHyIHkzM0Dj/vcrPMGPRBVjJs=; b=AujuJ/fB4+SySbkLCSDSzDvl520rJRFL8wITDFEDQ7zdQJ68fdZfD+a4Ege63M/BcP HgrtL26grb6EO7gxd0vbjHenIJNooYcNtPeMySxTRx0XYNulV3M+W2v9OoDylvEea7qj 4XbkLVXYZb9Z7Y0At+f0nO/Ly0p8yVGHKpVdGSAvzamF7tP0qljezZAbYkW6fkmACCOx x8SB9PYJ+XDlda+6Z6gxc9duKTa7IdrVAO+I2H2Be+9XxXjQAjmx6ds7y1JeLQauKF+4 jX1F2FwWlC7UEMts383HkW71/r2ZbUCF1175S8h0XMRILjCHwnSvN3BcAeE6H5ag1+HY ej6Q== X-Gm-Message-State: AJIora9aPqtXjEtaC0HcEiETfrk2vpRqff/xDCQXCAZgH2FMU64E5/fZ djCJhlGiAgSmRgupYj1Rf3Bj3VrTGFt1NQ== X-Received: by 2002:a63:de49:0:b0:41a:8b08:4754 with SMTP id y9-20020a63de49000000b0041a8b084754mr2336827pgi.162.1658428943795; Thu, 21 Jul 2022 11:42:23 -0700 (PDT) Received: from localhost ([192.55.54.49]) by smtp.gmail.com with ESMTPSA id f4-20020a170902860400b0016be0d5483asm2020217plo.252.2022.07.21.11.42.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jul 2022 11:42:23 -0700 (PDT) Date: Thu, 21 Jul 2022 11:42:21 -0700 From: Isaku Yamahata To: Dave Hansen Cc: Sathyanarayanan Kuppuswamy , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H . Peter Anvin" , "Kirill A . Shutemov" , Tony Luck , Andi Kleen , Kai Huang , Wander Lairson Costa , Isaku Yamahata , marcelo.cerri@canonical.com, tim.gardner@canonical.com, khalid.elmously@canonical.com, philip.cox@canonical.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v8 5/5] x86/tdx: Add Quote generation support Message-ID: <20220721184221.GA3288872@ls.amr.corp.intel.com> References: <20220609025220.2615197-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20220609025220.2615197-6-sathyanarayanan.kuppuswamy@linux.intel.com> <214e24f0-5236-be8d-024a-da48737d854a@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 Thu, Jul 21, 2022 at 10:19:30AM -0700, Dave Hansen wrote: > On 7/21/22 10:16, Sathyanarayanan Kuppuswamy wrote: > >> What is this "additional data"? Is that "REPORTDATA" from the TDX > >> module spec? > >> > >> "Additional REPORTDATA, a 64-byte value, is provided by the > >> guest TD to be included in the TDG.MR.REPORT." > > > > It is not the REPORTDATA. REPORTDATA is already included in the TDREPORT during > > REPORT generation process (using TDG.MR.REPORT). > > > > Spec does not clearly define the details about the additional data. I think it is > > related to certificates. > > > > Isaku, do you have more details about it? > > > > Current ABI allows attestation service and agent to decide the quote size. So > > we can't make assumptions on what that size will be. > > > > Following is copied from TDX Module specification, sec titled "Measurement > > and Attestation" > > > > An Intel SGX Quoting Enclave, written specifically to support quoting Intel TDX TDs, > > uses a new ENCLU instruction leaf, EVERIFYREPORT2, to help check the integrity of the > > TDG.MR.REPORT. If it passes, the Quoting Enclave can use a certified quote signing key > > to sign a quote containing the guest TD’s measurements and the additional data being > > quoted. > > We're off in the weeds again. > > How many bytes does the TDX module read from and write to the guest > physical address space? What are the absolute limits? What is the > minimum and the maximum that the kernel needs to handle? It's VMM (exactly, user space VMM like qemu in KVM case) that handles getquote request and reads/writes the shared pages. With KVM, there is no hard limit for user space VMM to access guest memory. Regarding to the size of quote, there is no hard limit because it's for future usage. But here is a rough idea about it. - 4KB(1 page) can accommodate TDREPORT that is defined right now. - 128KB is too small for foreseen use cases. - 1MB is too big. big enough for future. Thanks, -- Isaku Yamahata