Re: [PATCH v8 2/2] Drivers: hv: Introduce mshv_vtl driver

From: Naman Jain

Date: Tue Oct 14 2025 - 01:34:59 EST




On 10/13/2025 7:42 PM, Sean Christopherson wrote:
On Mon, Oct 13, 2025, Naman Jain wrote:
+static int mshv_vtl_ioctl_return_to_lower_vtl(void)
+{
+ preempt_disable();
+ for (;;) {
+ u32 cancel;
+ unsigned long irq_flags;
+ struct hv_vp_assist_page *hvp;
+ int ret;
+
+ local_irq_save(irq_flags);
+ cancel = READ_ONCE(mshv_vtl_this_run()->cancel);
+ if (cancel)
+ current_thread_info()->flags |= _TIF_SIGPENDING;

There's no need to force SIGPENDING, this code can return directly if cancel is
set[1]. And then you can wait to disable IRQs until after handling pending work,
and thus avoid having to immediately re-enable IRQs[2].

[1] https://lore.kernel.org/all/20250828000156.23389-3-seanjc@xxxxxxxxxx
[2] https://lore.kernel.org/all/20250828000156.23389-4-seanjc@xxxxxxxxxx


Thank you for reviewing and sharing your inputs. I will incorporate
these changes in the next version.

Regards,
Naman