[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC XEN PATCH 6/6] tools/libs/light: pci: translate irq to gsi
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Fri, 17 Mar 2023 10:51:08 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=Cl0/kShxx+HcEi+8NT7FKK9Xp6Zia32LdMzcPdnKER0=; b=lm1gbsy0/vU2WEHQybnsZr5KAV7pnVt2mcVNquGLzLEBH7usO297coqfJWzskWMAtN/yk++NdLlvz09v/+pYCkF+5gyFQqz3FG0MZLP+w2Vl2sQRvwgwn8LYWdpX39YS5oYu1XHPuYKtN2baaEE4hRcsvzOKdJ/5U/YykX5GOgk5yBevtjNoVCuzpGeqLD00qFVUglCB6tSUadhXMVNSp+lCPMgZQULEZhJsYr6vYAyj5it1gPmlgdBf0MzxJDgeu+qHwrpEvt3zL9M+vKEOZPHHfItDhaYbE3JQtcn0g5F9jsHONrtK2zDWkLEfOXj29WKvfWv8/FcnN8CnBGA/oQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YLyZKuLWR+qw4yfQkxJVY/86/EBt6xSOPi6CSo5xCOGgRbLgTuC2Uk2OKJfbJe/KfzIziPA2dQJvJPHPhG0/YnxdURPdWwI8WAcS19oE/H6G1hPDQQ1tbqVGnPmJAqkNWKel4Jxh8X+2Qz8ixKQjGNeuWBPDTCU57zFeQI6oOLN8ez0MTNWOHrrzblss6DuoPmABnUXYzfL53JSNnqD4z68mWfT4BMOnl1Ok4ywr6YK3SyvY/zrWOcuG/YKQw7hmUc87IXYcTbaJ34CGX/8ntQv/+dZNN7r7/vekNfK/ufaFtwQdTG+0qz5I9QZ6epGbFYXAjH+Fdh/zuUPh91ZvTQ==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Huang Rui <ray.huang@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Alex Deucher <alexander.deucher@xxxxxxx>, Christian König <christian.koenig@xxxxxxx>, Stewart Hildebrand <Stewart.Hildebrand@xxxxxxx>, Xenia Ragiadakou <burzalodowa@xxxxxxxxx>, Honglei Huang <honglei1.huang@xxxxxxx>, Julia Zhang <julia.zhang@xxxxxxx>, Chen Jiqian <Jiqian.Chen@xxxxxxx>
- Delivery-date: Fri, 17 Mar 2023 09:51:29 +0000
- Ironport-data: A9a23:HXJN3ahWg3czcu9ph36X4/PPX161CRAKZh0ujC45NGQN5FlHY01je htvWW7Xbq2OZjP1ftpwb4/joRhT7cTRmtVmTQc/rS42Ei4b9cadCdqndUqhZCn6wu8v7q5Ex 55HNoSfdpBcolv0/ErF3m3J9CEkvU2wbuOgTrWCYmYpHlUMpB4J0XpLg/Q+jpNjne+3CgaMv cKai8DEMRqu1iUc3lg8sspvkzsy+qWi0N8klgZmP6sT5waBzyB94K83fsldEVOpGuG4IcbiL wrz5OnR1n/U+R4rFuSknt7TGqHdauePVeQmoiM+t5mK2nCulARrukoIHKN0hXNsoyeIh7hMJ OBl7vRcf+uL0prkw4zxWzEAe8130DYvFLXveRBTuuTLp6HKnueFL1yDwyjaMKVBktubD12i+ tQ+NioOaS+Kjdms65GQR/JHip0ADtjCadZ3VnFIlVk1DN4AaLWbH+Dv2oUd2z09wMdTAfzZe swVLyJ1awjNaAFOPVFRD48imOCvhT/0dDgwRFC9/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Ya BTJfCZwMwTXUKRbnjfsGUq6NuwXk4rFhPDeUQGstz96UkioFlJi28jgOAPlHYJ85wwD7Ne4f 7fD6hunLZSCucLcKNUHo46MIWKI12IZSiJHHOZIFzhGq1CEWnKsYTL7LI84/zvUIAUzaE1hI /KXDpjxCEPknrVeI2zNaBwg1PwqD3XZ0Wu9ige3ek0hlTEfsurDcXZI2pe1vdJoJ0kc7/msr iISdZr6sTYXBrT8LZyrnLDsqZpWAcjue0uy6IGsgG107X2A7yvkNDnW9DuA5eoOQoYewrEcw g+tX7IVYh90nw=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Fri, Mar 17, 2023 at 09:39:52AM +0100, Jan Beulich wrote:
> On 17.03.2023 00:19, Stefano Stabellini wrote:
> > On Thu, 16 Mar 2023, Jan Beulich wrote:
> >> So yes, it then all boils down to that Linux-
> >> internal question.
> >
> > Excellent question but we'll have to wait for Ray as he is the one with
> > access to the hardware. But I have this data I can share in the
> > meantime:
> >
> > [ 1.260378] IRQ to pin mappings:
> > [ 1.260387] IRQ1 -> 0:1
> > [ 1.260395] IRQ2 -> 0:2
> > [ 1.260403] IRQ3 -> 0:3
> > [ 1.260410] IRQ4 -> 0:4
> > [ 1.260418] IRQ5 -> 0:5
> > [ 1.260425] IRQ6 -> 0:6
> > [ 1.260432] IRQ7 -> 0:7
> > [ 1.260440] IRQ8 -> 0:8
> > [ 1.260447] IRQ9 -> 0:9
> > [ 1.260455] IRQ10 -> 0:10
> > [ 1.260462] IRQ11 -> 0:11
> > [ 1.260470] IRQ12 -> 0:12
> > [ 1.260478] IRQ13 -> 0:13
> > [ 1.260485] IRQ14 -> 0:14
> > [ 1.260493] IRQ15 -> 0:15
> > [ 1.260505] IRQ106 -> 1:8
> > [ 1.260513] IRQ112 -> 1:4
> > [ 1.260521] IRQ116 -> 1:13
> > [ 1.260529] IRQ117 -> 1:14
> > [ 1.260537] IRQ118 -> 1:15
> > [ 1.260544] .................................... done.
>
> And what does Linux think are IRQs 16 ... 105? Have you compared with
> Linux running baremetal on the same hardware?
So I have some emails from Ray from he time he was looking into this,
and on Linux dom0 PVH dmesg there is:
[ 0.065063] IOAPIC[0]: apic_id 33, version 17, address 0xfec00000, GSI 0-23
[ 0.065096] IOAPIC[1]: apic_id 34, version 17, address 0xfec01000, GSI 24-55
So it seems the vIO-APIC data provided by Xen to dom0 is at least
consistent.
> > And I think Ray traced the point in Linux where Linux gives us an IRQ ==
> > 112 (which is the one causing issues):
> >
> > __acpi_register_gsi->
> > acpi_register_gsi_ioapic->
> > mp_map_gsi_to_irq->
> > mp_map_pin_to_irq->
> > __irq_resolve_mapping()
> >
> > if (likely(data)) {
> > desc = irq_data_to_desc(data);
> > if (irq)
> > *irq = data->irq;
> > /* this IRQ is 112, IO-APIC-34 domain */
> > }
Could this all be a result of patch 4/5 in the Linux series ("[RFC
PATCH 4/5] x86/xen: acpi registers gsi for xen pvh"), where a different
__acpi_register_gsi hook is installed for PVH in order to setup GSIs
using PHYSDEV ops instead of doing it natively from the IO-APIC?
FWIW, the introduced function in that patch
(acpi_register_gsi_xen_pvh()) seems to unconditionally call
acpi_register_gsi_ioapic() without checking if the GSI is already
registered, which might lead to multiple IRQs being allocated for the
same underlying GSI?
As I commented there, I think that approach is wrong. If the GSI has
not been mapped in Xen (because dom0 hasn't unmasked the respective
IO-APIC pin) we should add some logic in the toolstack to map it
before attempting to bind.
Thanks, Roger.
|