Linux Confidential Computing Development
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Ackerley Tng <ackerleytng@google.com>
Cc: "David Hildenbrand (Arm)" <david@kernel.org>,
	 "linux-coco@lists.linux.dev" <linux-coco@lists.linux.dev>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	 KVM <kvm@vger.kernel.org>,
	amit@infradead.org, aneeshkumar.kizhakeveetil@arm.com,
	 ashish.kalra@amd.com, dwmw2@infradead.org, eberman@quicinc.com,
	 fvdl@google.com, gshan@redhat.com, jackmanb@google.com,
	jackyli@google.com,  jthoughton@google.com, kalyazin@amazon.com,
	kas@kernel.org,  kevinloughlin@google.com, liruxin@google.com,
	michael.day@amd.com,  michael.roth@amd.com,
	mike.rapoport@gmail.com, mvaralar@redhat.com,
	 pankaj.gupta@amd.com, papaluri@amd.com, patrick.roy@linux.dev,
	 Peter Xu <peterx@redhat.com>,
	pheragu@quicinc.com, pkondeti@qti.qualcomm.com,  prty@google.com,
	psalian@google.com, qinkun@google.com, shan.gavin@gmail.com,
	 shivankg@amd.com, sidtelang@google.com, suzuki.poulose@arm.com,
	 tabba@google.com, tatashin@google.com, vannapurve@google.com,
	vbabka@suse.com,  wyihan@google.com
Subject: Re: [Invitation] bi-weekly guest_memfd upstream call on 2026-09-17
Date: Thu, 17 Sep 2026 12:30:00 -0700	[thread overview]
Message-ID: <aqw_uBIYig_uo5Eq@google.com> (raw)
In-Reply-To: <CAEvNRgGW_VHmT82q+bUqHh_5G2Z9sUF1jJOTiVN4Z8_cA9A50g@mail.gmail.com>

On Thu, Sep 17, 2026, Ackerley Tng wrote:
> At the call Sean suggested mirroring the RMM's tracking in KVM, but that
> sounds quite arch-specific and it's like doing arch-specific validation
> within KVM.

I suggested "mirroring" the tracking in KVM arm64, not in guest_memfd.

E.g. put a structure in arm64's kvm_vcpu_arch with a list_head object, then insert
into a per-VM list store in kvm_arch on a conversion request.  But before inserting,
walk the list to see if there are conflicting requests, and if so, reject the new
request.

Then on KVM_RUN, if a vCPU has an outstanding request, verify the gmem page exists,
is in the correct state, and is mapped into the guest (or at least, is known to the
RMM?).  If any steps fail, exit to userspace with -EFAULT + KVM_EXIT_MEMORY_FAULT.

The downside to such a simplistic implementation is that it'll require a per-VM
lock to serialize the requests.  If the contention ends up being too painful, e.g.
because there are usage patterns where guests due batched conversions across many
vCPUs, then KVM could use a more sophisticated approach as needed.  E.g. shard the
tracking+locking at 1GiB or something?

> p.s. Fuad, for pKVM you also mentioned that you'll need to check if the
> guest had requested for conversion first? This might be the same/similar
> problem.

  reply	other threads:[~2026-09-17 19:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-16 15:11 [Invitation] bi-weekly guest_memfd upstream call on 2026-09-16 David Hildenbrand (Arm)
2026-09-16 15:16 ` [Invitation] bi-weekly guest_memfd upstream call on 2026-09-17 David Hildenbrand (Arm)
2026-09-17 18:41   ` Ackerley Tng
2026-09-17 19:30     ` Sean Christopherson [this message]
2026-09-18 16:56       ` Ackerley Tng
2026-09-18  9:28     ` Suzuki K Poulose
2026-09-18 16:21       ` Ackerley Tng
2026-09-20 11:22         ` Suzuki K Poulose
2026-09-25  8:40     ` Fuad Tabba

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=aqw_uBIYig_uo5Eq@google.com \
    --to=seanjc@google.com \
    --cc=ackerleytng@google.com \
    --cc=amit@infradead.org \
    --cc=aneeshkumar.kizhakeveetil@arm.com \
    --cc=ashish.kalra@amd.com \
    --cc=david@kernel.org \
    --cc=dwmw2@infradead.org \
    --cc=eberman@quicinc.com \
    --cc=fvdl@google.com \
    --cc=gshan@redhat.com \
    --cc=jackmanb@google.com \
    --cc=jackyli@google.com \
    --cc=jthoughton@google.com \
    --cc=kalyazin@amazon.com \
    --cc=kas@kernel.org \
    --cc=kevinloughlin@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-mm@kvack.org \
    --cc=liruxin@google.com \
    --cc=michael.day@amd.com \
    --cc=michael.roth@amd.com \
    --cc=mike.rapoport@gmail.com \
    --cc=mvaralar@redhat.com \
    --cc=pankaj.gupta@amd.com \
    --cc=papaluri@amd.com \
    --cc=patrick.roy@linux.dev \
    --cc=peterx@redhat.com \
    --cc=pheragu@quicinc.com \
    --cc=pkondeti@qti.qualcomm.com \
    --cc=prty@google.com \
    --cc=psalian@google.com \
    --cc=qinkun@google.com \
    --cc=shan.gavin@gmail.com \
    --cc=shivankg@amd.com \
    --cc=sidtelang@google.com \
    --cc=suzuki.poulose@arm.com \
    --cc=tabba@google.com \
    --cc=tatashin@google.com \
    --cc=vannapurve@google.com \
    --cc=vbabka@suse.com \
    --cc=wyihan@google.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