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

Re: [PATCH RFC 1/6] x86/ioapic: set disable hook for masking edge interrupts


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 7 Jun 2022 10:02:54 +0200
  • 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=8+UGL11kf7cinjSaSYFT2bKH4Hc9cdI1wPnU9V4K7v4=; b=jpz+blz6EN7Rhb9/hrlWV6mYWD5Mj+l/QmaT3Wz/whldPDM3WYnk8yFOs/qHu27D3SC/eN2zbFyh74l2tmbDi9WWkiXZ4ZeXQehuHwhG0bWWCRl4iGL3HP24dFDXCXIvLau60ON89lTe4694Dz4Cc26BIvupVWc/mWCQsqeum/ZSb5e02Hl2kC1hOAb5p7d8+EOWhu3ywSnE8ziJ+I5wvZve4Pf7q14kttaHr6E8LtzIwIxz71aPyUnzhrncy0kPd9SjUAQs9q7ggA04YwCp4dLBDNELjUgFV8eyqdbVk6XKlCbwM5Nkwo/C+j/pAWrdJ0L/NXic8fvx/g8BtTAFVg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S8Beee25w8ip32EWgampJ5X8Fh1Qd/k5VxlLGy9BWILExC8zpwfyJmp02FUSeRfu7QH41eWAsF40ipW0yTCb+K0kFTAaYlDEIsmimT2bm8NOZn2kLmrvStasRIw6P98605cEgZTnH+do+ECiYzPhqZtMUoE4q5gV6GY6HwvD7cMgiEJvZCnZS0tOIwrzHIKs3IE1Hug4Lxr/tdOqt29ddCKA1/vSDW7anDKj4/y4HOP1Fu4WkiVCoB7JyEoz2jpYq7jnRsiGNNpnSnpjyEBjstBrq5MrdcxydJzAqwMwXmM1c6LjWfKGUI/u+gpSMp45rpT82TvTTSIuG+Q9+fgdMw==
  • 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>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 07 Jun 2022 08:03:05 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 03.06.2022 16:53, Roger Pau Monné wrote:
> On Fri, Jun 03, 2022 at 03:19:34PM +0200, Jan Beulich wrote:
>> On 21.04.2022 15:21, Roger Pau Monne wrote:
>>> Allow disabling (masking) IO-APIC pins set to edge trigger mode.  This
>>> is required in order to safely migrate such interrupts between CPUs,
>>> as the write to update the IO-APIC RTE (or the IRTE) is not done
>>> atomically,
>>
>> For IRTE on VT-d we use cmpxchg16b if available (i.e. virtually always).
>>
>>> so there's a window where there's a mismatch between the
>>> destination CPU and the vector:
>>>
>>> (XEN) CPU1: No irq handler for vector b5 (IRQ -11, LAPIC)
>>> (XEN) IRQ10 a=0002[0002,0008] v=bd[b5] t=IO-APIC-edge s=00000030
>>
>> I think this needs some further explanation, as we generally move
>> edge IRQs only when an un-acked interrupt is in flight (and hence
>> no further one can arrive).
> 
> A further one can arrive as soon as you modify either the vector or
> the destination fields of the IO-APIC RTE, as then the non-EOI'ed
> lapic vector is no longer there (because you have moved to a different
> destination or vector).

Right - this is what I'm asking you to spell out in the description.

Jan

> This is the issue with updating the IO-APIC RTE using two separate
> writes: even when using interrupt remapping the IRTE cannot be
> atomically updated and there's a window where the interrupt is not
> masked, but the destination and vector fields are not in sync, because
> they reside in different parts of the RTE (destination is in the high
> 32bits, vector in the low 32bits part of the RTE).
> 
> Thanks, Roger.
> 




 


Rackspace

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