Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3030433imw; Wed, 6 Jul 2022 16:16:06 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tX5m8j2v3R2vs1bXf2xNX8TBpMeLKOkkZxrAfObhlMDgb7Cr6rv7/p+en0Ib8WfTFi4Nv8 X-Received: by 2002:a63:1803:0:b0:40d:159e:91af with SMTP id y3-20020a631803000000b0040d159e91afmr37572011pgl.371.1657149366717; Wed, 06 Jul 2022 16:16:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657149366; cv=none; d=google.com; s=arc-20160816; b=v+dffGasjs2hcnkp6EQTUUbBWUPzGLhn0tJeivs+gzXiH3FrGdWhpMzctmgibIFFZr e55WwhBW39RTpI4kFfQxcsqkt6OyzFHSXqWDOKoqD+xk9eK/pcLfkjwvLuDvaMKkVeUL wj62w/nkZ7Kj7rOxaDHJRPlLRt65AK2Y2qjTIl/wYydAfDCsoi3FdLXWPn0JXqCj6uaO 0e0kDi5Gb4Kq08P4Dfhd7aIxbnvXzcMLZEtXudUhgF012MlEDNqHF9dISOh7viLAfu7C NQM0nVNYQJeNZRmonLu58Yt/Z/zQj1R7k8SBTjPi6PtxpLI9bKLFOpNb8fdr/WW6Ll2O 7KHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=g1XX5tucNVCnSUah5W/xRphKBKXEEZnvfy3X1+Zdz4U=; b=hGRuZwD2l45O1cyBPu6romA1xu2a2CPHSdDfk54nKlHKdHH1BPvcvt+D2O63UZ5PLG /re5IvdBaokaGty+WkFdLlqv8pX+bgKwJo+XMnfayn8A7VR1zgEloAjXA6zqD++bB0YU UQKdAZoNCpOyOKNlIw+nxkux25ZQ3jSgrMFSbYvQnqNNtC8ppJfE4iNfT/KHMxS6fRUT zC3BriTbN2UzSLnP64rHNm7NrVf4mQaW3TySzY9BcixeZHiowwVnAdTuL7JD8tSplqjJ DTpyWJgOeVU5V93JruHinmbixl5V0m+YPqL3ieBqK5xSG4DJ8wxMdNjPkMqahNm61v2e E+xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bGor7x4V; 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 g11-20020a170902934b00b0016413affb73si46880402plp.208.2022.07.06.16.15.54; Wed, 06 Jul 2022 16:16:06 -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=bGor7x4V; 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 S233061AbiGFW7f (ORCPT + 99 others); Wed, 6 Jul 2022 18:59:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229768AbiGFW7e (ORCPT ); Wed, 6 Jul 2022 18:59:34 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B23E18E36 for ; Wed, 6 Jul 2022 15:59:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657148374; x=1688684374; h=message-id:subject:from:to:cc:date:in-reply-to: references:content-transfer-encoding:mime-version; bh=bh75gl/ZpQtcHPqssKBS7MqGiz/R4n3x9LdQifuC0KQ=; b=bGor7x4V39/t1piJ1UdA7UGsvesmDPCYPBFzJQAFufxMdQ5DpIPmxc63 XhU37abNXwhbhGFUzZKV+s0TYPv4D2E0Dde+iVxu3xYUY1p3ap9ZaVOFo FMyguvoM9fGOtNJ26GAoxG6Pa2d1Y5tgcmLwDLs72FtpCkx+5Z3wHGb0T lMy2mMK4AZ3IuZWfRZ8LN4jWbGHQTs97kQckpidkueM3WrbJ/j8/5EaBt 5bUMnzJq2RRJgMxYubVUPy5G0qapChHV2g/GmKr/0aLZ0Yi0VvmzfYVSW fvQ0+BV+YqB+j422bg0gZMI2PrKM1HMWxkhoLFDvCg2IB3lgHwAa5hGoE w==; X-IronPort-AV: E=McAfee;i="6400,9594,10400"; a="345575238" X-IronPort-AV: E=Sophos;i="5.92,251,1650956400"; d="scan'208";a="345575238" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2022 15:59:33 -0700 X-IronPort-AV: E=Sophos;i="5.92,251,1650956400"; d="scan'208";a="597829362" Received: from ctrainor-mobl1.amr.corp.intel.com (HELO khuang2-desk.gar.corp.intel.com) ([10.209.178.157]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2022 15:59:30 -0700 Message-ID: <82d4c654ce78416ba3635bad15f8bb21c3a42a4f.camel@intel.com> Subject: Re: [PATCH v8 1/5] x86/tdx: Add TDX Guest attestation interface driver From: Kai Huang To: Sathyanarayanan Kuppuswamy , Dave Hansen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org Cc: "H . Peter Anvin" , "Kirill A . Shutemov" , Tony Luck , Andi Kleen , 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 Date: Thu, 07 Jul 2022 10:59:28 +1200 In-Reply-To: References: <20220609025220.2615197-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20220609025220.2615197-2-sathyanarayanan.kuppuswamy@linux.intel.com> <0f6bedbb-14cc-bf93-5d9f-bfd2c49dc7b2@intel.com> <48b9d807-2d9e-016f-bada-906911d6ecb0@linux.intel.com> <331abea18e728061979301772a9d0d61543f59fb.camel@intel.com> <0b5884b8-9240-63b2-ca4c-20c86fd2e8c1@linux.intel.com> <8b6f3f9f-71c8-2b6f-20a3-5e9c259a1b9a@intel.com> <74383158-460e-0cd1-94bc-faca5b8175ea@linux.intel.com> <932869b757b384426ada376cd9791697353c2247.camel@intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.2 (3.44.2-1.fc36) MIME-Version: 1.0 X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Wed, 2022-07-06 at 15:27 -0700, Sathyanarayanan Kuppuswamy wrote: >=20 > On 7/5/22 3:31 PM, Kai Huang wrote: > > On Tue, 2022-07-05 at 14:21 -0700, Sathyanarayanan Kuppuswamy wrote: > > > SGX is a related feature. It also uses IOCTL approach for enclave pro= visioning. > > >=20 > > > arch/x86/kernel/cpu/sgx/ioctl.c > >=20 > > SGX isn't a good example here. The IOCTLs are used to create enclaves,= but not > > for attestation. SGX attestation relies on enclave itself to get/verif= y the > > report, etc, so has no interaction with the kernel. >=20 > If you are looking for an attestation specific example, you can only chec= k the AMD > code. >=20 > https://patchwork.kernel.org/project/linux-mm/patch/20220307213356.279720= 5-44-brijesh.singh@amd.com/ >=20 > Also, sev_get_attestation_report() in arch/x86/kvm/svm/sev.c also impleme= nts attestation > IOCTL specific to KVM. >=20 I think we only need to look at how attestation is implemented in kernel fo= r other vendors, so yes it would be helpful to look at AMD's implementation. = =20 I'll probably also look at it when I have some time. --=20 Thanks, -Kai