Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp766247imi; Thu, 21 Jul 2022 10:29:21 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t7RlbYFPC8lPqm4BnMkI3uLXWrGMo6UxlLUEcMQUKbOZJgXPDPEOJ9Q6LxLaF1WnUT6bSq X-Received: by 2002:a63:5fcf:0:b0:412:a708:d660 with SMTP id t198-20020a635fcf000000b00412a708d660mr38503859pgb.622.1658424560329; Thu, 21 Jul 2022 10:29:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658424560; cv=none; d=google.com; s=arc-20160816; b=MEaF9ua2rGareq1hjkJVwgIhcHy/R72gSmY21CLF8rfLhP6BB2tZMzQjB5wtQLchi0 CHjVJCj4dscEIHz6EifkJR+gROHmudWJvifMa0tuwRCHFRwcw70PATHGTNgW/hl+pCo2 w/Qpot4mT3XHKbINKEVwr3Gm0yqHenNDNRfJ414rMvCJC71DTsBlWXY5DXZ4R6iYDZh4 NexGCjWSPJKv7Z96BfMt+nSTaGR+4Z0kzikpNu+nKyn+jHBYJNBQJ5/kwFcpNL4LQKge NNEkaTwBBYD4o0hlYUZlWp9D0UZj8jzPsGxLMs3Zoppq8mWjxDBCE8vRVfHLg0R9XEbb 8ziQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=dyn7QFfu4+WpS955DVwQKooMgPSWdxDoIm+E8mQaXsA=; b=ftRlxuAUoK+FfdyEwipJRpzpUzDMTBcyAXKLuP3590wuzP3lq54d+qN73cdyopskmg yuh0RZsWtVHNoankRVULzG/olSO8kOhyRqARY35daJtmH8YzlZ24b45AQMxwcup7+oLB S9V3p1y2xcf1dVZukHsDgnJWHuWgITSOtCDg00//s2vJ2iorgA5oSiV5rZXrIcT1ibvH 62ZNDYl3bwUpaVSuDgarzavy7mOGICL+cRwdGmVQYsg7v39AsVJZ4JGlQ7L62+3TIoFD fwBEeKbvWyTHh2shkmOuncYu93hxCPE2sVp2dirUoQ/e4Syi+l7HCCDTRcxqjzBMQVIw f8oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ajhbbdZv; 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r22-20020a632056000000b00415f76d10efsi2791763pgm.585.2022.07.21.10.29.04; Thu, 21 Jul 2022 10:29:20 -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=@intel.com header.s=Intel header.b=ajhbbdZv; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229579AbiGURZG (ORCPT + 99 others); Thu, 21 Jul 2022 13:25:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229461AbiGURZF (ORCPT ); Thu, 21 Jul 2022 13:25:05 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C378354642 for ; Thu, 21 Jul 2022 10:25:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658424303; x=1689960303; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=iFVJ2PD2NWlvU7WTBpY338s4u7DT0v69UFMKVGkspzM=; b=ajhbbdZvMexuapU/gKVtVdHnXu+fI0GjDfqMQAIXYkPjccw2ISsluy6d gNx7LvTgb4tdQuomimBnN7NnAdae2Qf0aITssA5J1+S5zggKTBstDzbZz kneOoieM5mHRvGutqk6MhOP5xS68KZd2mYBpy5H8DwpRtBaBvWP9wGeP5 Pke16Vef7+c/X1bITX4jPSIRvV0CsK01VOF+bZutHBymU8LwbjEAFQ1Ia KIbSoTicxLv40r5VbWjB1MytlRX5Wi+WCXPkWkUDMYbaL4J65bmiC72E9 sH7jHRt6HIl0K71DE8IecQ91SuuExUp1SL8i6MaPmKcrejE0xHuNJaFEn Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10415"; a="287872386" X-IronPort-AV: E=Sophos;i="5.93,183,1654585200"; d="scan'208";a="287872386" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jul 2022 10:16:50 -0700 X-IronPort-AV: E=Sophos;i="5.93,183,1654585200"; d="scan'208";a="598542459" Received: from sattaran-mobl1.amr.corp.intel.com (HELO [10.212.246.186]) ([10.212.246.186]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jul 2022 10:16:38 -0700 Message-ID: Date: Thu, 21 Jul 2022 10:16:37 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.11.0 Subject: Re: [PATCH v8 5/5] x86/tdx: Add Quote generation support Content-Language: en-US To: Dave Hansen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org Cc: "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 References: <20220609025220.2615197-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20220609025220.2615197-6-sathyanarayanan.kuppuswamy@linux.intel.com> <214e24f0-5236-be8d-024a-da48737d854a@intel.com> From: Sathyanarayanan Kuppuswamy In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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 Hi Dave, On 7/21/22 10:02 AM, Dave Hansen wrote: > On 7/21/22 09:54, Sathyanarayanan Kuppuswamy wrote: >> >> On 7/21/22 9:49 AM, Dave Hansen wrote: >>> On 7/21/22 09:42, Sathyanarayanan Kuppuswamy wrote: >>>> On 7/21/22 9:08 AM, Dave Hansen wrote: >>>>> On 6/8/22 19:52, Kuppuswamy Sathyanarayanan wrote: >>>>>> For shared buffer allocation, alternatives like using the DMA API is >>>>>> also considered. Although it simpler to use, it is not preferred because >>>>>> dma_alloc_*() APIs require a valid bus device as argument, which would >>>>>> need converting the attestation driver into a platform device driver. >>>>>> This is unnecessary, and since the attestation driver does not do real >>>>>> DMA, there is no need to use real DMA APIs. >>>>> Let's actually try to walk through the requirements for the memory >>>>> allocation here. >>>>> >>>>> 1. The guest kernel needs to allocate some guest physical memory >>>>> for the attestation data buffer >>>> Physically contiguous memory. >>> Remind me how large the quote structures are. >> It depends on the attestation service. In addition to TDREPORT (1K size), >> during quote generation, additional data can be included in the signed >> quote. So the spec allows variable length. User agent will communicate with >> attestation service to identify the appropriate buffer length. Our test >> uses 8K buffers > > 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. > > -- Sathyanarayanan Kuppuswamy Linux Kernel Developer