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

Re: [PATCH v2] x86/i8259: do not assume interrupts always target CPU0


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 24 Oct 2023 12:51:08 +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=eLor1xL0FOwsa7R/3yRFaJPcGfFx8Dd0voJKlrJtI+U=; b=RL4ujQnM1CUOx1w+1KFPFtML6j/8NX5dOrv369HZ2S/AEv/eDiqgsySL7gVNASyS60E5FWXYL+0f2eGQ3V/Nwf4A4oWkqzSSJCZn/FrOrQ3nfsG3ZQtEIT1Vd7QskZ+9IWOK8mDA98fBgVjwFHCaQJz+AuYJIFreiMzEobO2CPJhcEDfNMx7Vq1EbY60GY71oNFrAPlQh2BEpF7NzPL9y5OzBRuNA4uwXuIlCdgp5QDWZ9GogCqTd22RxeovJgxhL+lpajsAKFw7ojUSJmHkg8oZAhdHB0yj13DU3qQDsVfcG/3AuPgVD/ysPX1USp1FArqypVKsi/1Oo2c3npQQuw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mtEov3nFtdRyBGaTeJdVm4JljhWwBSi90IxFPiV/+aWu6OobTc31cb73/i4nE6Nk1MRRizVH1Se0E7BJJsRiV5V3nySz33PblXUEOUH3u4btbPLasN2XL6HBDMbSkiXkzjRwTJwY8IVsCJnwLS9tzHubNo8VJr9hsc5VFy4eHWEWXpmf43z9KNjRlPKB85jOFG6MDvNQL49oEEkEuqsxyKKNiGZQfbOdduvNFUJ9sE5L2wA2oN5+PYZ364/SslHXi4XhchJEOeThl+lEFsl8qzmxG9VV3vvRyZTOWohyc/ziX7A6J4fStvZ6+Xm7K1sPZlNvYPoVG4cAWHdgqfVVNQ==
  • 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, 24 Oct 2023 10:51:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 24.10.2023 12:14, Roger Pau Monné wrote:
> On Tue, Oct 24, 2023 at 11:33:21AM +0200, Jan Beulich wrote:
>> On 23.10.2023 14:46, Roger Pau Monne wrote:
>>> --- a/xen/arch/x86/i8259.c
>>> +++ b/xen/arch/x86/i8259.c
>>> @@ -37,6 +37,15 @@ static bool _mask_and_ack_8259A_irq(unsigned int irq);
>>>  
>>>  bool bogus_8259A_irq(unsigned int irq)
>>>  {
>>> +    if ( smp_processor_id() &&
>>> +         !(boot_cpu_data.x86_vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON)) 
>>> )
>>> +        /*
>>> +         * For AMD/Hygon do spurious PIC interrupt detection on all CPUs, 
>>> as it
>>> +         * has been observed that during unknown circumstances spurious PIC
>>> +         * interrupts have been delivered to CPUs different than the BSP.
>>> +         */
>>> +        return false;
>>> +
>>>      return !_mask_and_ack_8259A_irq(irq);
>>>  }
>>
>> I don't think this function should be changed; imo the adjustment belongs
>> at the call site.
> 
> It makes the call site much more complex to follow, in fact I was
> considering pulling the PIC vector range checks into
> bogus_8259A_irq().  Would that convince you into placing the check here
> rather than in the caller context?

Passing a vector and moving the range check into the function is something
that may make sense. But I'm afraid the same does not apply to the
smp_processor_id() check, unless the function was also renamed to
bogus_8259A_vector(). Which in turn doesn't make much sense, to me at
least, as the logic would better be in terms of IRQs (which is what the
chip deals with primarily), not vectors (which the chip deals with solely
during the INTA cycle with the CPU).

Jan



 


Rackspace

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