[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z1gJjCzDF6JNKCyl@tlindgre-MOBL1>
Date: Tue, 10 Dec 2024 11:27:40 +0200
From: Tony Lindgren <tony.lindgren@...ux.intel.com>
To: Chao Gao <chao.gao@...el.com>
Cc: Binbin Wu <binbin.wu@...ux.intel.com>, 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,
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 05:10:29PM +0800, Chao Gao wrote:
> 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
Makes sense to me too.
Regards,
Tony
Powered by blists - more mailing lists