The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
To: "pbonzini@redhat.com" <pbonzini@redhat.com>,
	"Hunter, Adrian" <adrian.hunter@intel.com>,
	"kas@kernel.org" <kas@kernel.org>,
	"Fang, Peter" <peter.fang@intel.com>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"seanjc@google.com" <seanjc@google.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"Li, Xiaoyao" <xiaoyao.li@intel.com>,
	"linux-coco@lists.linux.dev" <linux-coco@lists.linux.dev>,
	"Reshetova, Elena" <elena.reshetova@intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"binbin.wu@linux.intel.com" <binbin.wu@linux.intel.com>,
	"tony.lindgren@linux.intel.com" <tony.lindgren@linux.intel.com>,
	"jgg@nvidia.com" <jgg@nvidia.com>,
	"nik.borisov@suse.com" <nik.borisov@suse.com>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"Mehta, Sohil" <sohil.mehta@intel.com>,
	"tglx@kernel.org" <tglx@kernel.org>,
	"Gao, Chao" <chao.gao@intel.com>, "bp@alien8.de" <bp@alien8.de>,
	"Bityutskiy, Artem" <artem.bityutskiy@intel.com>,
	"Maloor, Kishen" <kishen.maloor@intel.com>,
	"yilun.xu@linux.intel.com" <yilun.xu@linux.intel.com>,
	"x86@kernel.org" <x86@kernel.org>
Subject: Re: [PATCH v3 1/8] x86/virt/tdx: Add interface to generate a Quote
Date: Fri, 4 Dec 2026 22:04:24 +0000	[thread overview]
Message-ID: <1a9d23233a1cd68b65c9ab6fb98165ac53a28eb2.camel@intel.com> (raw)
In-Reply-To: <75eabe4d-00c4-49d3-9bff-54fe9ac29eb9@intel.com>

On Fri, 2026-12-04 at 23:44 +0200, Adrian Hunter wrote:
> On 04/12/2026 20:18, Peter Fang wrote:
> > +int tdx_quote_generate(struct tdx_td *td, u16 session_id,
> > +		       struct page *report_page, u64 report_size,
> > +		       struct page **quote_pages, u64 quote_buf_size,
> > +		       u64 *quote_size, u64 *seamcall_err)
> > +{
> > +	int num_quote_pages, num_nodes, ret = 0;
> > +	u64 *node_head, *node_entry;
> > +	u64 r;
> > +
> > +	/*
> > +	 * Pass the quote buffer to the TDX module as an HPA linked list. Each
> > +	 * node holds 4KB page HPAs and the last entry points to the next node.
> > +	 */
> > +	node_head = kmalloc(PAGE_SIZE, GFP_KERNEL);
> > +	if (!node_head)
> > +		return -ENOMEM;
> > +
> > +	node_entry = node_head;
> > +	num_quote_pages = PFN_UP(quote_buf_size);
> > +	num_nodes = 1;
> > +
> > +	/* Populate the linked list. Allocate new nodes as needed. */
> > +	for (int i = 0, pages = 0; pages < num_quote_pages;
> > +	     i = (i + 1) % HPAS_PER_NODE) {
> > +		if (i == HPAS_PER_NODE - 1) {
> > +			u64 *new_node = kmalloc(PAGE_SIZE, GFP_KERNEL);
> > +
> > +			if (!new_node) {
> > +				ret = -ENOMEM;
> > +				goto out_free_nodes;
> > +			}
> > +
> > +			/* Write the 'next' pointer. */
> > +			node_entry[i] = __pa(new_node);
> > +			node_entry = new_node;
> > +			num_nodes++;
> > +			continue;
> > +		}
> > +
> > +		node_entry[i] = page_to_phys(quote_pages[pages]);
> > +		pages++;
> > +	}
> 
> TDX HPA_LINKED_LIST format is used also by TDX Live Migration, so
> it needs to be separate from quote functions.

No thanks. We can refactor when we get to the migration patches if appropriate
when that stuff is getting reviewed.

  reply	other threads:[~2026-12-04 22:04 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 18:18 [PATCH v3 0/8] Enable DICE-based TDX quoting Peter Fang
2026-12-04 18:18 ` [PATCH v3 1/8] x86/virt/tdx: Add interface to generate a Quote Peter Fang
2026-12-04 19:15   ` Dave Hansen
2026-12-04 22:02     ` Edgecombe, Rick P
2026-12-04 21:44   ` Adrian Hunter
2026-12-04 22:04     ` Edgecombe, Rick P [this message]
2026-12-04 18:18 ` [PATCH v3 2/8] x86/virt/tdx: Add interface to check quoting capabilities Peter Fang
2026-12-04 18:18 ` [PATCH v3 3/8] KVM: TDX: Require at least one quoting session and thread per CPU Peter Fang
2026-12-04 18:18 ` [PATCH v3 4/8] KVM: TDX: Add KVM_TDX_GET_QUOTE sub-ioctl for quoting Peter Fang
2026-12-04 18:18 ` [PATCH v3 5/8] KVM: TDX: Report maximum Quote size in TDX capabilities Peter Fang
2026-12-04 18:18 ` [PATCH v3 6/8] KVM: TDX: Document KVM_TDX_GET_QUOTE Peter Fang
2026-12-04 18:18 ` [PATCH v3 7/8] x86/virt/tdx: Enable the quoting extension Peter Fang
2026-12-04 18:18 ` [PATCH v3 8/8] x86/virt/tdx: Add documentation for DICE-based quoting Peter Fang
2026-12-04 18:40 ` [PATCH v3 0/8] Enable DICE-based TDX quoting Jason Gunthorpe
2026-12-04 18:47   ` Edgecombe, Rick P
2026-12-04 18:50     ` Jason Gunthorpe
2026-12-04 19:11       ` Edgecombe, Rick P

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1a9d23233a1cd68b65c9ab6fb98165ac53a28eb2.camel@intel.com \
    --to=rick.p.edgecombe@intel.com \
    --cc=adrian.hunter@intel.com \
    --cc=artem.bityutskiy@intel.com \
    --cc=binbin.wu@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=chao.gao@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=elena.reshetova@intel.com \
    --cc=hpa@zytor.com \
    --cc=jgg@nvidia.com \
    --cc=kas@kernel.org \
    --cc=kishen.maloor@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=nik.borisov@suse.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.fang@intel.com \
    --cc=seanjc@google.com \
    --cc=sohil.mehta@intel.com \
    --cc=tglx@kernel.org \
    --cc=tony.lindgren@linux.intel.com \
    --cc=x86@kernel.org \
    --cc=xiaoyao.li@intel.com \
    --cc=yilun.xu@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox