public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Rick P Edgecombe <rick.p.edgecombe@intel.com>
Cc: "ackerleytng@google.com" <ackerleytng@google.com>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>,
	 Yan Y Zhao <yan.y.zhao@intel.com>,
	 "dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"sagis@google.com" <sagis@google.com>,
	 Isaku Yamahata <isaku.yamahata@intel.com>,
	"x86@kernel.org" <x86@kernel.org>,
	 "kas@kernel.org" <kas@kernel.org>,
	"yilun.xu@linux.intel.com" <yilun.xu@linux.intel.com>,
	"bp@alien8.de" <bp@alien8.de>,
	 "mingo@redhat.com" <mingo@redhat.com>,
	 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Kai Huang <kai.huang@intel.com>,
	 "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	 "linux-coco@lists.linux.dev" <linux-coco@lists.linux.dev>,
	Xiaoyao Li <xiaoyao.li@intel.com>,
	 "tglx@kernel.org" <tglx@kernel.org>,
	"binbin.wu@linux.intel.com" <binbin.wu@linux.intel.com>,
	 Vishal Annapurve <vannapurve@google.com>
Subject: Re: [PATCH 1/2] x86/virt/tdx: Use PFN directly for mapping guest private memory
Date: Thu, 2 Apr 2026 16:46:01 -0700	[thread overview]
Message-ID: <ac7_uQc5t0uU3a1h@google.com> (raw)
In-Reply-To: <4f0a5d5f7b743e3872547e14d02b894cd9f60550.camel@intel.com>

On Thu, Apr 02, 2026, Rick P Edgecombe wrote:
> On Thu, 2026-04-02 at 16:23 -0700, Ackerley Tng wrote:
> > Yan Zhao <yan.y.zhao@intel.com> writes:
> > 
> > > 
> > > [...snip...]
> > > 
> > > -u64 tdh_mem_page_add(struct tdx_td *td, u64 gpa, struct page *page, struct page *source, u64 *ext_err1, u64 *ext_err2)
> > > +u64 tdh_mem_page_add(struct tdx_td *td, u64 gpa, kvm_pfn_t pfn, struct page *source,
> > > +		     u64 *ext_err1, u64 *ext_err2)
> > >   {
> > >   	struct tdx_module_args args = {
> > >   		.rcx = gpa,
> > >   		.rdx = tdx_tdr_pa(td),
> > > -		.r8 = page_to_phys(page),
> > > +		.r8 = PFN_PHYS(pfn),
> > >   		.r9 = page_to_phys(source),
> > 
> > Perhaps in some future patch, are we considering also passing pfn
> > instead of struct page for source? Would we also update
> > kvm_tdx->page_add_src to be a kvm_pfn_t?
> 
> Can you remind me, with the new API we were going to do an in-place add right?
> Then I'd wonder if we could maybe change tdh_mem_page_add() to only have a
> single pfn arg.

No.  In-place ADD will be supported, but it won't be mandatory.  Practically
speaking, we can't make it mandatory unless we're willing to completely rip out
support for per-VM attributes (or at least, per-VM PRIVATE tracking).  I suppose
we could require in-place ADD when using per-gmem attributes, but I don't see
the point given that TDH_MEM_PAGE_ADD itself takes a source and dest.

  reply	other threads:[~2026-04-02 23:46 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-19  0:56 [PATCH 0/2] struct page to PFN conversion for TDX guest private memory Yan Zhao
2026-03-19  0:57 ` [PATCH 1/2] x86/virt/tdx: Use PFN directly for mapping " Yan Zhao
2026-03-19 10:39   ` Kiryl Shutsemau
2026-03-19 11:59     ` Yan Zhao
2026-03-19 12:14       ` Yan Zhao
2026-03-19 12:57       ` Kiryl Shutsemau
2026-03-19 17:27         ` Edgecombe, Rick P
2026-03-20 12:59           ` Kiryl Shutsemau
2026-03-20 17:31             ` Edgecombe, Rick P
2026-03-20 17:38               ` Dave Hansen
2026-03-20 17:48                 ` Edgecombe, Rick P
2026-03-19 18:05   ` Dave Hansen
2026-03-25  9:10     ` Yan Zhao
2026-03-25 16:57       ` Edgecombe, Rick P
2026-03-27  7:03         ` Yan Zhao
2026-03-31 19:13           ` Sean Christopherson
2026-04-02 20:47     ` Sean Christopherson
2026-04-02 21:09       ` Dave Hansen
2026-04-02 22:11         ` Sean Christopherson
2026-04-02 23:23   ` Ackerley Tng
2026-04-02 23:35     ` Sean Christopherson
2026-04-02 23:36     ` Edgecombe, Rick P
2026-04-02 23:46       ` Sean Christopherson [this message]
2026-04-02 23:53         ` Edgecombe, Rick P
2026-03-19  0:58 ` [PATCH 2/2] x86/virt/tdx: Use PFN directly for unmapping " Yan Zhao
2026-03-19  3:20   ` Xiaoyao Li
2026-03-19  6:45     ` Yan Zhao
2026-03-19  8:56       ` Xiaoyao Li
2026-03-19  8:56         ` Yan Zhao
2026-04-04  6:39           ` Paolo Bonzini
2026-03-19 18:44         ` Edgecombe, Rick P
2026-03-19 10:48   ` Kiryl Shutsemau

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=ac7_uQc5t0uU3a1h@google.com \
    --to=seanjc@google.com \
    --cc=ackerleytng@google.com \
    --cc=binbin.wu@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=isaku.yamahata@intel.com \
    --cc=kai.huang@intel.com \
    --cc=kas@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rick.p.edgecombe@intel.com \
    --cc=sagis@google.com \
    --cc=tglx@kernel.org \
    --cc=vannapurve@google.com \
    --cc=x86@kernel.org \
    --cc=xiaoyao.li@intel.com \
    --cc=yan.y.zhao@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