Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp865228imi; Thu, 21 Jul 2022 12:30:54 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ugPb6POigN5nBAjttkUksh/VtEZSHMRyyAGtbenNf8R28tg8vKFUlsmbSe/BVeq2OctPZK X-Received: by 2002:a17:90a:49cb:b0:1f2:427e:6793 with SMTP id l11-20020a17090a49cb00b001f2427e6793mr24187pjm.120.1658431854564; Thu, 21 Jul 2022 12:30:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658431854; cv=none; d=google.com; s=arc-20160816; b=g3KD8MXKkhD9gAy8X02Krc4a6D0m5c+NGY8BNFywUwQyt/t/PhEhlbj5qRJhD901yr aUC/+sWr7FHTcCbdOKae6058Taf2YHwzu1mhvoB/0hEp/QVRfbPrfdqzAhACog8nt8PR Xh/evq9fHfRhFT0doc4rJO9CSbbUDvdce+lYKElI8c8CtSNFzeDFGl5iaRcDBe4ecz1N isHyB/H43scVsvuCNwbca6ReiXWKRra60MPfHIF73dteMtYfO59mYhx5EQlnl830MfTo 0u0eCm3D3nxF0RO8xVDfFyek+uyT5VKnGxX7F1zWg/mWgsvLI3KUymXDN4YVrVRYzKOz XepA== 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=Pky9+LBj2Y0LDoygJ8iHV8OGEHaaFeUFv6HiHRzDSEc=; b=iM03ZX3l3YBxo8Txy1yvdCiysSHpDBWPo4Zqw5K1ztcjjYu7eijBa3mNKp3JslhhBn BCvZYS7ZHQ4s6HzKWOepj/yVcdzAS3OwYzRcczk4tOXxXNMgFmEZZkliHQ5rmBsGYAQH Wz6HYWhvUsejlDsRJOa/2kHPt4v+D9nNKpEG4bFrUJCvaYzwLhQSi6dR/sKKV8lqgbQV PCFS7sNkGf5nQFpNXe0sB0Nm1s+FyAYKokTpjrFH/heUIlhgEzPs7F4daput9/Ostii1 eartoihXtU9Vls2GbGlwFbpAtdrOoDahePVmVCNTUB+diilw0m0xroJDIbykDOO+CDAC yu6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=L0wKG0AR; 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 b4-20020a170902d88400b0016d0a984cb9si2995138plz.73.2022.07.21.12.30.40; Thu, 21 Jul 2022 12:30:54 -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=L0wKG0AR; 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 S232805AbiGUS5c (ORCPT + 99 others); Thu, 21 Jul 2022 14:57:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231364AbiGUS5Y (ORCPT ); Thu, 21 Jul 2022 14:57:24 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0099988F2A for ; Thu, 21 Jul 2022 11:57:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658429844; x=1689965844; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=zaXk1/QSYHxGTZcLT61E2h91LFbSgj46agJuVRtVTLk=; b=L0wKG0ARGaS6SJj3GVczHm+EcxdVsjh+9r8EpauKLbIgt5S+pauP6LUh bTZkQOfYt8DXuoDe5W7hGp1Mh4TEewXiCDMw5pBNNJOcYcbjTgbF4nvyT lMq9SPquGyVoYqLlXRourrZxMGl5S8PU0fQbXfKhSY1ksd2ScxVQz0fOJ Duutlyi8Fwz39JDCEfoRBBK9lveGSrEKOU3tranzvzT/xG4Z5M1FEyd7+ XFZMF6/SxuaOH5Fx2GoGNuZjaN/t6HnGebLH1xQciF2ZirEjc4saMpl4e cniZYqRP2Gk2sL7AlWGDl/Eqzxz2eQ+LTllvsZwzPVYPA88ZlPc3ILq+5 g==; X-IronPort-AV: E=McAfee;i="6400,9594,10415"; a="351141619" X-IronPort-AV: E=Sophos;i="5.93,183,1654585200"; d="scan'208";a="351141619" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jul 2022 11:57:23 -0700 X-IronPort-AV: E=Sophos;i="5.93,183,1654585200"; d="scan'208";a="598585208" 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 11:57:23 -0700 Message-ID: Date: Thu, 21 Jul 2022 11:57:22 -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 , Isaku Yamahata Cc: 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 , 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> <20220721184221.GA3288872@ls.amr.corp.intel.com> <1fdecc17-8f4f-fceb-8da0-4a21ca0d58be@intel.com> From: Sathyanarayanan Kuppuswamy In-Reply-To: <1fdecc17-8f4f-fceb-8da0-4a21ca0d58be@intel.com> 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, 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 On 7/21/22 11:52 AM, Dave Hansen wrote: > On 7/21/22 11:42, Isaku Yamahata wrote: >> 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. > > Again, we're off in the weeds. > > How does the VMM know how much to read/write? I have a theory: the spec > says that R12 is: > > "Shared 4KB GPA as input – the memory contains a > TDREPORT_STRUCT." > > That's *A* 4KB GPA. The maximum is one 4KB page. That's the only thing > that makes sense because there's no length in the ABI anywhere. > > What am I missing? I think you are looking into the old spec. Please check the version "FEBRUARY 2022" Following are the ABI details: R11 - TDG.VP.VMCALL< GetQuote > sub-function per Table 2-3 R12 - Shared GPA as input – the memory contains a TDREPORT_STRUCT. The same buffer is used as output – the memory contains a TD Quote. R13 - Size of shared GPA. The size must be 4KB-aligned. -- Sathyanarayanan Kuppuswamy Linux Kernel Developer