Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
To: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"linux-coco@lists.linux.dev" <linux-coco@lists.linux.dev>,
	"yilun.xu@linux.intel.com" <yilun.xu@linux.intel.com>
Cc: "Li, Xiaoyao" <xiaoyao.li@intel.com>,
	"Yao, Jiewen" <jiewen.yao@intel.com>,
	"Reshetova, Elena" <elena.reshetova@intel.com>,
	"kas@kernel.org" <kas@kernel.org>,
	"seanjc@google.com" <seanjc@google.com>,
	"Xu, Yilun" <yilun.xu@intel.com>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>,
	"Tian, Kevin" <kevin.tian@intel.com>,
	"jgg@nvidia.com" <jgg@nvidia.com>,
	"aneesh.kumar@kernel.org" <aneesh.kumar@kernel.org>,
	"Fang, Peter" <peter.fang@intel.com>,
	"Duan, Zhenzhong" <zhenzhong.duan@intel.com>,
	"Gao, Chao" <chao.gao@intel.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"aik@amd.com" <aik@amd.com>, "x86@kernel.org" <x86@kernel.org>
Subject: Re: [RFC] CoCo: Use MMIO-based protocols (instead of vmcalls) for guest-host talk
Date: Fri, 4 Dec 2026 18:10:37 +0000	[thread overview]
Message-ID: <ac8a2fc285baeff816d2bd72aa4eeb84e6103a54.camel@intel.com> (raw)
In-Reply-To: <axJscptf4J1BxIF7@yilunxu-OptiPlex-7050>

On Fri, 2026-12-04 at 15:32 +0800, Xu Yilun wrote:

I was initially pretty excited about this, for the reason of getting to skip
adding KVM support for each new type of data that needs to be shuffled to
userspace. But I've started to wonder if it actually makes sense once you apply
it to the specific cases.

> Some ideas:
> ==========
> - Option 1:
> 
>  - An lightweight virtio-mmio like device, enumerated by ACPI or Device tree.
>    It supports all "guest requests" that GHCI/GHCB now has: Each vCPU can
> issue
>    guest requests in parallel via its shared page.
>  - Concerns:
>    - The definition of the device is vague, the architectures decides which
>      requests go through it. No clear definition.
>    - To mimic the nature of vmcalls which executes on per vCPU basis. A
>      device should have per vCPU interfaces, seems weird.

The nice thing about this is we could put all future GHCI calls that go to
userspace in it too. However, what goes to userspace and what is handled within
KVM is a KVM specific detail. Where as GHCI is supposed to be a cross-VMM
interface.

> 
> - Option 2:
> 
>  - Narrow the scope to Trusted-I/O. A virtual PCIe capability (a DVSEC) for
>    TDISP capable devices which forwards the TDISP state transition/attestation
>    request to the userspace VMM/firmware, so the scope of carried requests are
>    naturally affined to the device
>  - One PCI config register receives a shared communication page (GPA).
>  - Another config register for the doorbell.
>   -  Concerns:
>       - No support to other features like TSM report. Keep on using vmcall or
>      make a dedicated MMIO device for it?

For option 2, then this doesn't become a generic GHCI mechanism for the future.


But on the point of what to do about trusted IO GHCI calls. Today some GHCI
calls are handled by the kernel and some are morphed into KVM exits. Either to
existing exits or new TDX specific ones.

The TDX TDCM GHCI calls closely mirror the standard TDISP operations. IIUC SNP
has a special exit type, with a shared GPA. There is a clear text header in the
payload involved in these VM exits, which also mirrors the standard TDISP
operations.

We expect these will need to be passed to userspace too? So at least on the SNP
side, these will either need to go out with one big KVM exit type, or morphed
into 7-8 individual exits. Since the specific TDISP operation is embedded in the
data in the shared memory, it probably ends up looking like one big exit.

So we might have the case where KVM has an exit type for this already. The
matching SNP and TDX calls could be nudged to match, and use the same exit type
or routing that SNP ends up needing to add. (I think the formats are pretty
close already?) Then they share something like a KVM_EXIT_TIO.

But this would leave the generic problem still open.


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

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04  7:32 [RFC] CoCo: Use MMIO-based protocols (instead of vmcalls) for guest-host talk Xu Yilun
2026-12-04 18:10 ` Edgecombe, Rick P [this message]
2026-12-04 18:45   ` Jason Gunthorpe
2026-12-04 22:59     ` 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=ac8a2fc285baeff816d2bd72aa4eeb84e6103a54.camel@intel.com \
    --to=rick.p.edgecombe@intel.com \
    --cc=aik@amd.com \
    --cc=aneesh.kumar@kernel.org \
    --cc=chao.gao@intel.com \
    --cc=elena.reshetova@intel.com \
    --cc=jgg@nvidia.com \
    --cc=jiewen.yao@intel.com \
    --cc=kas@kernel.org \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-pci@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.fang@intel.com \
    --cc=seanjc@google.com \
    --cc=x86@kernel.org \
    --cc=xiaoyao.li@intel.com \
    --cc=yilun.xu@intel.com \
    --cc=yilun.xu@linux.intel.com \
    --cc=zhenzhong.duan@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