[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z1gFhU0oTGUNssMP@intel.com>
Date: Tue, 10 Dec 2024 17:10:29 +0800
From: Chao Gao <chao.gao@...el.com>
To: Binbin Wu <binbin.wu@...ux.intel.com>
CC: <pbonzini@...hat.com>, <seanjc@...gle.com>, <kvm@...r.kernel.org>,
<rick.p.edgecombe@...el.com>, <kai.huang@...el.com>,
<adrian.hunter@...el.com>, <reinette.chatre@...el.com>,
<xiaoyao.li@...el.com>, <tony.lindgren@...ux.intel.com>,
<isaku.yamahata@...el.com>, <yan.y.zhao@...el.com>, <michael.roth@....com>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 4/7] KVM: TDX: Handle TDG.VP.VMCALL<MapGPA>
On Tue, Dec 10, 2024 at 10:51:56AM +0800, Binbin Wu wrote:
>
>
>
>On 12/9/2024 8:45 PM, Chao Gao wrote:
>> > +/*
>> > + * Split into chunks and check interrupt pending between chunks. This allows
>> > + * for timely injection of interrupts to prevent issues with guest lockup
>> > + * detection.
>> Would it cause any problems if an (intra-host or inter-host) migration happens
>> between chunks?
>>
>> My understanding is that KVM would lose track of the progress if
>> map_gpa_next/end are not migrated. I'm not sure if KVM should expose the
>> state or prevent migration in the middle. Or, we can let the userspace VMM
>> cut the range into chunks, making it the userspace VMM's responsibility to
>> ensure necessary state is migrated.
>>
>> I am not asking to fix this issue right now. I just want to ensure this issue
>> can be solved in a clean way when we start to support migration.
>How about:
>Before exiting to userspace, KVM always sets the start GPA to r11 and set
>return code to TDVMCALL_STATUS_RETRY.
>- If userspace finishes the part, the complete_userspace_io() callback will
> be called and the return code will be set to TDVMCALL_STATUS_SUCCESS.
>- If the live migration interrupts the MapGAP in the userspace, and
> complete_userspace_io() is not called, when the vCPU resumes from migration,
> TDX guest will see the return code is TDVMCALL_STATUS_RETRY with the failed
> GPA, and it can retry the MapGAP with the failed GAP.
Sounds good
Powered by blists - more mailing lists