[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86/HVM: don't mark evtchn upcall vector as pending when vLAPIC is disabled


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 25 Nov 2022 10:09:22 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EkzG6vfyxgw8LTU7MRtKPm1Faxf1F4cCuwn/3h7f9WI=; b=esJNuMkcU2bVcpUAfkhI9Z3mWJOX/MKnYD6X5k0a51TYTBWQbvkgkOiJdW9QRDuwonMuhqYXxfuCF28TW0o9hJksVHU04R4MtrC1dbi2zJHW55Tpb2uRyJvQaz/ceeKpgg35PNl349+FNzJywNQ6/tKbM8a6m9pI7e4RRTSeH4v9W80A+4O19U3djSb+E3wbkBfmygwPeDIsKR9ACP7dhg5lPeno3mF+57PNWm4+iehw43/X1UhDRu3eAsBsSauHizGmO/H4TlAXgHT+h5YcprzBSba0+y2CBk/vBVZyxdd5YgFtpRG/rK9BUKlAxos2zxgQePrsQRiUI0z83Ipw4g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R8wolmveCHg78lKtgt3liFo0pDuJ2QzxU7KV7OAHhx3CbomRORU3GcJiLAa1gmjLiw6dNg2VhTMop84Kfnb1SchU/0miFXQuvGOadUlQBkoRTjHCgaNUWPl1z0GUu2gEaqpy5U/8awDZ3+iep2ba94GnvmLa7ezHgiUu5EiOc/m3goNQanIY766RBpKfQ18x6eJRMwcFk8zudbfsSjbsrXLk96GT6K1liZlX50mV93VF1nvznEPuxSmDIhKs7dF644LAZfEOhbMxf2Wl/w4MT3Y0ZeO6i2+zTOnmCmCG/NWho4zj2Zf7OWq1+nq8XAhW1LjLb40zWC3RNksxiqn+Kw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Paul Durrant <paul@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 25 Nov 2022 09:09:58 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 25.11.2022 10:00, Roger Pau Monné wrote:
> On Fri, Nov 25, 2022 at 09:43:59AM +0100, Jan Beulich wrote:
>> On 24.11.2022 16:12, Roger Pau Monné wrote:
>>> On Thu, Nov 24, 2022 at 12:16:13PM +0100, Jan Beulich wrote:
>>>> We need to be careful here - the kernel treating it as "edge" (like
>>>> any other interrupt coming directly from the LAPIC), it ack-s it
>>>> before calling the handler, i.e. before evtchn_upcall_pending would
>>>> have a chance to be cleared. See Linux'es sysvec_xen_hvm_callback().
>>>
>>> Hm, that's not how I handle it on FreeBSD, where the vector is acked
>>> after calling the handler (evtchn_upcall_pending gets cleared before
>>> the EOI).  Maybe there's some corner case I'm missing that requires
>>> the EOI to be performed before clearing evtchn_upcall_pending?
>>
>> I think for the purpose of the one vector doing the EOI late is okay,
>> but aiui the goal of doing it early for edge triggered interrupts in
>> general (and yet more generally as early as possible) is to unmask
>> lower priority vectors as well.
> 
> My reasoning for doing it late was in order to avoid adding extra
> latency to things like the timer handling, as the EOI will likely
> trigger a vmexit.
> 
>> Of course that's useful only if IRQs
>> as a whole are unmasked during (part of) the handling.
> 
> What do you mean with IRQs as a whole?  Are you referring to setting
> the interrupt flag?

Yes (it being cleared).

> Thanks for the input, it's appreciated, and sorry for diverging the
> conversation so much.

I think that's quite fine, because aspects like the one still in context
are at least potentially relevant. Especially since here we're not
dealing with architectural behavior, but with an extrapolation thereof.
And views may (and apparently do) differ as to what the correct
extrapolation would be, even if just for corner aspects.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.