Re: [PATCH] KVM: interrupt kvm_gmem_populate() on signals

From: Isaku Yamahata
Date: Wed Jun 12 2024 - 19:13:40 EST


On Tue, Jun 11, 2024 at 06:22:43AM -0400,
Paolo Bonzini <pbonzini@xxxxxxxxxx> wrote:

> kvm_gmem_populate() is a potentially lengthy operation that can involve
> multiple calls to the firmware. Interrupt it if a signal arrives.

What about cond_resched() in the loop? kvm_gmem_allocate() has both.

The change itself looks good for TDX because KVM_TDX_INIT_MEMREGION checks the
signal. I can drop the duplicated check. Similar to cond_resched().
--
Isaku Yamahata <isaku.yamahata@xxxxxxxxx>