[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ca688bca-df3f-4d82-97e7-20fc26f7d69e@intel.com>
Date: Fri, 24 Oct 2025 11:02:49 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Chao Gao <chao.gao@...el.com>
Cc: Vishal Annapurve <vannapurve@...gle.com>,
"Reshetova, Elena" <elena.reshetova@...el.com>,
"linux-coco@...ts.linux.dev" <linux-coco@...ts.linux.dev>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"x86@...nel.org" <x86@...nel.org>,
"Chatre, Reinette" <reinette.chatre@...el.com>,
"Weiny, Ira" <ira.weiny@...el.com>, "Huang, Kai" <kai.huang@...el.com>,
"Williams, Dan J" <dan.j.williams@...el.com>,
"yilun.xu@...ux.intel.com" <yilun.xu@...ux.intel.com>,
"sagis@...gle.com" <sagis@...gle.com>,
"paulmck@...nel.org" <paulmck@...nel.org>,
"nik.borisov@...e.com" <nik.borisov@...e.com>, Borislav Petkov
<bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...hat.com>,
"Kirill A. Shutemov" <kas@...nel.org>, Paolo Bonzini <pbonzini@...hat.com>,
"Edgecombe, Rick P" <rick.p.edgecombe@...el.com>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH v2 00/21] Runtime TDX Module update support
On 10/24/25 00:43, Chao Gao wrote:
...
> Beyond "the kvm_tdx object gets torn down during a build," I see two potential
> issues:
>
> 1. TD Build and TDX migration aren't purely kernel processes -- they span multiple
> KVM ioctls. Holding a read-write lock throughout the entire process would
> require exiting to userspace while the lock is held. I think this is
> irregular, but I'm not sure if it's acceptable for read-write semaphores.
Sure, I guess it's irregular. But look at it this way: let's say we
concocted some scheme to use a TD build refcount and a module update
flag, had them both wait_event_interruptible() on each other, and then
did wakeups. That would get the same semantics without an rwsem.
So is your issue with the rwsem, or the idea that one bit of userspace
can block another bit of userspace from doing something for arbitrary
lengths of time?
The one thing that worries me is solidly tying the build-side
down_read() to the lifetime of kvm_tdx. But that shouldn't be rocket
science. There also isn't a down_write_interruptible(), only
down_write_killable().
> 2. The kernel may need to hold this read-write lock for operations not yet
> defined in the future. The TDX Module Base spec [*] notes on page 55:
>
> : Future TDX Module versions may have different or additional update-sensitive
> : cases. By design, such cases apply to a small portion of the overall TD
> : lifecycle.
Sure... But that's not a license for the TDX module to do completely
silly things. Elena is on cc here for a reason and I'm sure she'll
ensure that nothing silly gets put into the TDX module that will cause
problems here.
Powered by blists - more mailing lists