From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8D5431891A9; Tue, 14 Oct 2025 05:34:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760420100; cv=none; b=JWSvLfk42vUVxcHnceIvPZoDHryP6DacYKYdm60WypPtzEpXnpCLBTLOCo+L03N7CgPO1UUhVDdkU0mhqDleE3jGnwmIOgy8IGrBBMiKidFnGMBhI+g9OyJR2+98vIaSSxhI2WrZMT2RULTGUMMyC418htFrYcG9FoecqxmV2w4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760420100; c=relaxed/simple; bh=625WgSnJiSezsXZmXYS0mFDkULTrHAwgaxfJYWupEG0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=PvIQLB3TVxomhffFR8MpG5WQuVPkk5V74rSIZY7X7L/we/M5p4jqP5MWswsLpCP6S+BfABWHhZoZDUcjp2az0lXJ7QmRlKG4IqjA6y4wYe/Tuv+iQQUNi12qgJD58ydzaaztwETtr/0Xt4vySB9+ZKoKztpAzDJd3+/sOkJEA3o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=Jv2mNxjL; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="Jv2mNxjL" Received: from [10.95.76.239] (unknown [167.220.238.207]) by linux.microsoft.com (Postfix) with ESMTPSA id DC8E12065951; Mon, 13 Oct 2025 22:34:53 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com DC8E12065951 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1760420098; bh=BlgehlMARAQjp3IsCJVfblI0gkZ7iJZCHXntzahh9kY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Jv2mNxjLPebnUUabvAtBH5bm4B6u/ikigz4IC6JY1yBZPw8AO7jARAIYVsX9epMJg iCV8pEOti7mMRWaPrfqh3ZGeQzm5uitXZHTaw895TlclT+mt+z7qhJIctyQyLtvHvf v0f862DoePXsZXFuyV03PyerE5/MFldTDVCKreRU= Message-ID: Date: Tue, 14 Oct 2025 11:04:51 +0530 Precedence: bulk X-Mailing-List: linux-hyperv@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v8 2/2] Drivers: hv: Introduce mshv_vtl driver To: Sean Christopherson Cc: "K . Y . Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H . Peter Anvin" , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, Mukesh Rathor , Stanislav Kinsburskii , Nuno Das Neves , Peter Zijlstra , Paolo Bonzini , Michael Kelley , Christoph Hellwig , Saurabh Sengar , ALOK TIWARI References: <20251013060353.67326-1-namjain@linux.microsoft.com> <20251013060353.67326-3-namjain@linux.microsoft.com> Content-Language: en-US From: Naman Jain In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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@google.com > [2] https://lore.kernel.org/all/20250828000156.23389-4-seanjc@google.com Thank you for reviewing and sharing your inputs. I will incorporate these changes in the next version. Regards, Naman