Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1886326pxv; Fri, 2 Jul 2021 15:10:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGszVfKbn78Cl0sBJ1IqLWNkJKEC/epPwtp4R3eRDC7zD9z8Diq6QPONWHcMzs9/wtfK95 X-Received: by 2002:a50:d64a:: with SMTP id c10mr1995944edj.199.1625263815789; Fri, 02 Jul 2021 15:10:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625263815; cv=none; d=google.com; s=arc-20160816; b=IrsrntwxCPZxzxjv7iZv9LTxQ4DuPneVDbeYGWe6AWQcLhSRkkN1JJcOET+uCP+An9 wb8AhNes59J+nKUUumpz4gZFuizJxh+DgJtdeW54af2wh3+MkxaSd+KlX+gETGw92T3O dnVayvv5HgN2WHI0EHc+yKbLwlt/gAqKBGhrzbtWqjZSAHrktjK3woNoiHtk6BWx4KHm nQCkzBzI5jzGRM619XRqsHEuuJLiyVYqzCM1jnTx2Fx5SQSwGTb+ZLCyD5fX2f3eHj05 OJeoel6Mm6Kw3eyhdH5nmWz/Muk9zCVmCLdRAMoL99nzbzdPHSY2e7rmLKM7eZDoT2yS XQiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=GiLYSukVE1y6Ey233Lq9O+i8fDRGyM2x75ZcfykXscI=; b=crmGtdQignA3CrC5NhMhPL6DCQVwpxRI5CRbPoUmKP84szQnmQ+6KVgW5DHjioob0n /otwgp12HMSpQLbsjRyBKjC7uI9lVoaFUO+VYFCnZ9GMjwsD0rkmLF2ukyEf+Ci5i9QJ YcENSPnjSycthQ+usL67zEy1IXRhaK8ZrL7ZaCU0Bb5jHa+vpymV9QpHbU88sH30nW9w kJcUPb/cpZ/zpyHGVLMXNF3wZT3bzdXBQiuCbg+hX/D0TV51lTqLQreTmfFtkU4oGd63 XN7EafRkdh7G6XZpC0XM73ABKZuHbafJED1Li6HmUCmDwia318kSqDW37u0mnCOrj6Tr +SCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k26si4153622eds.589.2021.07.02.15.09.53; Fri, 02 Jul 2021 15:10:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234280AbhGBWK5 (ORCPT + 99 others); Fri, 2 Jul 2021 18:10:57 -0400 Received: from mga17.intel.com ([192.55.52.151]:15304 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234181AbhGBWJS (ORCPT ); Fri, 2 Jul 2021 18:09:18 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10033"; a="189168428" X-IronPort-AV: E=Sophos;i="5.83,320,1616482800"; d="scan'208";a="189168428" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2021 15:05:33 -0700 X-IronPort-AV: E=Sophos;i="5.83,320,1616482800"; d="scan'208";a="642814908" Received: from ls.sc.intel.com (HELO localhost) ([143.183.96.54]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2021 15:05:32 -0700 From: isaku.yamahata@intel.com To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , erdemaktas@google.com, Connor Kuehl , Sean Christopherson , x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: isaku.yamahata@intel.com, isaku.yamahata@gmail.com Subject: [RFC PATCH v2 68/69] KVM: TDX: add document on TDX MODULE Date: Fri, 2 Jul 2021 15:05:14 -0700 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Isaku Yamahata Add a document on how to integrate TDX MODULE into initrd so that TDX MODULE can be updated on kernel startup. Signed-off-by: Isaku Yamahata --- Documentation/virt/kvm/tdx-module.rst | 48 +++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Documentation/virt/kvm/tdx-module.rst diff --git a/Documentation/virt/kvm/tdx-module.rst b/Documentation/virt/kvm/tdx-module.rst new file mode 100644 index 000000000000..8beea8302f94 --- /dev/null +++ b/Documentation/virt/kvm/tdx-module.rst @@ -0,0 +1,48 @@ +.. SPDX-License-Identifier: GPL-2.0 + +========== +TDX MODULE +========== + +Integrating TDX MODULE into initrd +================================== +If TDX is enabled in KVM(CONFIG_KVM_INTEL_TDX=y), kernel is able to load +tdx seam module from initrd. +The related modules (seamldr.ac, libtdx.so and libtdx.so.sigstruct) need to be +stored in initrd. + +tdx-seam is a sample hook script for initramfs-tools. +TDXSEAM_SRCDIR are the directory in the host file system to store files related +to TDX MODULE. + +Since it heavily depends on distro how to prepare initrd, here's a example how +to prepare an initrd. +(Actually this is taken from Documentation/x86/microcode.rst) +:: + #!/bin/bash + + if [ -z "$1" ]; then + echo "You need to supply an initrd file" + exit 1 + fi + + INITRD="$1" + + DSTDIR=lib/firmware/intel-seam + TMPDIR=/tmp/initrd + LIBTDX="/lib/firmware/intel-seam/seamldr.acm /lib/firmware/intel-seam/libtdx.so /lib/firmware/intel-seam/libtdx.so.sigstruct" + + rm -rf $TMPDIR + + mkdir $TMPDIR + cd $TMPDIR + mkdir -p $DSTDIR + + cp ${LIBTDX} ${DSTDIR} + + find . | cpio -o -H newc > ../tdx-seam.cpio + cd .. + mv $INITRD $INITRD.orig + cat tdx-seam.cpio $INITRD.orig > $INITRD + + rm -rf $TMPDIR -- 2.25.1