From patchwork Thu Sep 8 00:27:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuppuswamy Sathyanarayanan X-Patchwork-Id: 12969523 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F014DC38145 for ; Thu, 8 Sep 2022 00:27:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229560AbiIHA1s (ORCPT ); Wed, 7 Sep 2022 20:27:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229569AbiIHA1q (ORCPT ); Wed, 7 Sep 2022 20:27:46 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 716C6D0218; Wed, 7 Sep 2022 17:27:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662596865; x=1694132865; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=ftDogJIQCWUTb5UK7VS3661UIixUHel8n3Dm/IbgrRI=; b=DBnk36FIrAdWUy5j4VCUPEwVrYj+QDdvTz9Gz4xfq5/WlsVZEZFmN8qK nkDAjg+D630kMdbnec2ZYdli5QMQJHOfvcJxtvGt+s9e3XuSbx2LGTnz+ dQsF/TI9IejX1uTsdoEimS4fMkLrWTmBX5BoqzUPNi+XjzNp98r28Nw9D SHZDu2JskWe5VhUMaaYTqoikAvrIIhWEH+DzMi8DFK/HqEMjL7vuJzEtx w44vzKxQYISGEYaTjC37R2FylHdC0fYFqAUQYx6hjFfOV3RNO0AhrNoyJ 5BgRczdE+e6mGEgqSIAEiOjEAhvtRC3bXrcI5ptB7fqT33o3yJtEV7kyS Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10463"; a="360993115" X-IronPort-AV: E=Sophos;i="5.93,298,1654585200"; d="scan'208";a="360993115" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2022 17:27:44 -0700 X-IronPort-AV: E=Sophos;i="5.93,298,1654585200"; d="scan'208";a="676440336" Received: from pbarrios-mobl1.amr.corp.intel.com (HELO skuppusw-desk1.amr.corp.intel.com) ([10.252.133.9]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2022 17:27:43 -0700 From: Kuppuswamy Sathyanarayanan To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Shuah Khan Cc: "H . Peter Anvin" , Greg Kroah-Hartman , Kuppuswamy Sathyanarayanan , "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, linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org Subject: [PATCH v12 0/3] Add TDX Guest Attestation support Date: Wed, 7 Sep 2022 17:27:19 -0700 Message-Id: <20220908002723.923241-1-sathyanarayanan.kuppuswamy@linux.intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Hi All, Intel's Trust Domain Extensions (TDX) protect guest VMs from malicious hosts and some physical attacks. VM guest with TDX support is called as a TDX Guest. In TDX guest, attestation process is used to verify the TDX guest trustworthiness to other entities before provisioning secrets to the guest. For example, a key server may request for attestation before releasing the encryption keys to mount the encrypted rootfs or secondary drive. This patch set adds attestation support for the TDX guest. Details about the TDX attestation process and the steps involved are explained in the commit log of Patch 1/3 or in Documentation/x86/tdx.rst (added by patch 3/3). Following are the details of the patch set: Patch 1/3 -> Adds TDREPORT support. Patch 2/3 -> Adds selftest support for TDREPORT feature. Patch 3/3 -> Add attestation related documentation. Commit log history is maintained in the individual patches. Kuppuswamy Sathyanarayanan (3): x86/tdx: Add TDX Guest attestation interface driver selftests: tdx: Test TDX attestation GetReport support Documentation/x86: Document TDX attestation process Documentation/x86/tdx.rst | 75 +++++++++ arch/x86/coco/tdx/tdx.c | 112 +++++++++++++ arch/x86/include/uapi/asm/tdx.h | 54 ++++++ tools/arch/x86/include/uapi/asm/tdx.h | 54 ++++++ tools/testing/selftests/Makefile | 1 + tools/testing/selftests/tdx/Makefile | 11 ++ tools/testing/selftests/tdx/config | 1 + tools/testing/selftests/tdx/tdx_attest_test.c | 155 ++++++++++++++++++ 8 files changed, 463 insertions(+) create mode 100644 arch/x86/include/uapi/asm/tdx.h create mode 100644 tools/arch/x86/include/uapi/asm/tdx.h create mode 100644 tools/testing/selftests/tdx/Makefile create mode 100644 tools/testing/selftests/tdx/config create mode 100644 tools/testing/selftests/tdx/tdx_attest_test.c