[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <b5d0446fedfe5d47a8aa5e623f39cb04d62837ce.1625186503.git.isaku.yamahata@intel.com>
Date: Fri, 2 Jul 2021 15:05:14 -0700
From: isaku.yamahata@...el.com
To: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"H . Peter Anvin" <hpa@...or.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>, erdemaktas@...gle.com,
Connor Kuehl <ckuehl@...hat.com>,
Sean Christopherson <seanjc@...gle.com>, x86@...nel.org,
linux-kernel@...r.kernel.org, kvm@...r.kernel.org
Cc: isaku.yamahata@...el.com, isaku.yamahata@...il.com
Subject: [RFC PATCH v2 68/69] KVM: TDX: add document on TDX MODULE
From: Isaku Yamahata <isaku.yamahata@...el.com>
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 <isaku.yamahata@...el.com>
---
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
Powered by blists - more mailing lists