[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: Huang Rui <ray.huang@xxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Wed, 15 Mar 2023 17:35:56 +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=+7PFXXZInkYNt0+FeBk+Da9MFGAphwlmvDAKkgx+XhA=; b=R4gsJw3/eKzu8vTskiNwkZwEaXqvrMXg98hqfBZty+h0hky7KlT78cZZ/e5Y3H/jcvui+FFDVLb8Ad6VdNUlTSlNzRw0w9AZH9lS6Rq7RXMo+GElD5A7WQ9WtvSKmHag5uV5aqpFzDmmf76QK8jxKX6L0E5B8xI4UPlKCxZyewtEPmuULur4t9I6SAft1wE2NUwEpINpfSxSD4OpPcakyeuYqRb9mvpl3DKwbKVNxOeQz72+qWgR1CVdJiD3Af8mrxNPX6tXRC/gzOJxJy7W6/RXBpndIdoCozqxytNH4U5wOXxWM3ZgTRlK9o9wGSBob6zeDODesmybJcBHCQOMRg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RVa7FFqU1b+tD3T+S+fUbe6IBiXuB5CWbb7/jaKzIKDvsaU9tAxF7C/NxIKXsLstZFUS+FgxV9cGC2WD/58Fk0dOi+vvoBlTspZFB0TkEULu/iD1X2pv0ugJ7lpAp63bQ0XqU6+Mb7TTKXw402hMVd1IurXabwpU+SRpIHTgW8O62IG/8QK/pcDFAcDo/Y74ENpdK03D6PZYF4JG6uHKdNI8XDqcxweVHDGp2jZZMl7iKMUgI44pWY9y14zJjI3vN5iwOLMEz6e0eZCaSobitK6asyQZrS8th4udxNuOWp/Ale9cMDPuapJkWnTZvayeONxWv4emcs5u3we2FgyU3w==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: Jan Beulich <jbeulich@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, 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: Wed, 15 Mar 2023 16:36:51 +0000
- Ironport-data: A9a23:NWu6bKir4EVzdcsfvYprIeG2X161CBAKZh0ujC45NGQN5FlHY01je htvWG2EOv/YMTfzfYx/a43j8R9UuZeAx4NhSAJkqiw2FHsb9cadCdqndUqhZCn6wu8v7q5Ex 55HNoSfdpBcolv0/ErF3m3J9CEkvU2wbuOgTrWCYmYpHlUMpB4J0XpLg/Q+jpNjne+3CgaMv cKai8DEMRqu1iUc3lg8sspvkzsy+qWi0N8klgZmP6sT5waDzyN94K83fsldEVOpGuG4IcbiL wrz5OnR1n/U+R4rFuSknt7TGqHdauePVeQmoiM+t5mK2nCulARrukoIHKN0hXNsoyeIh7hMJ OBl7vRcf+uL0prkw4zxWzEAe8130DYvFLXveRBTuuTLp6HKnueFL1yDwyjaMKVBktubD12i+ tRfKSAsPhOYv9uP65KkT+tOrJsBC5bkadZ3VnFIlVk1DN4AaLWaG+Dgw4Ad2z09wMdTAfzZe swVLyJ1awjNaAFOPVFRD48imOCvhT/0dDgwRFC9/PJrpTSMilMpluG1bbI5efTTLSlRtlyfq W/cuXzwHzkRNcCFyCrD+XWp7gPKtXqjAdlDS+DirpaGhnWLgUEqMEcoC2G9vP+XpWCxRYtjI kktr39GQa8asRbDosPGdwexsTiEoxcaVPJZFuF84waIooLW6QuEAmkPThZadccr8sQxQFQCz USVltnkAThutry9Sn+H8LqQ6zSoNkA9PWIEICMJUwYBy93iu50oyALCSM55F6y4hcGzHiv/q xiDqCUujrMfgNRN26im9lDKmRqlo5SPRQkwji3cXnik9R94bYjjZIul71nUxf9FIMCSSVzpl EMYlteX9vxILZCJmCGHWuwLEJmg4vrDOzrZ6XZlAoMz/jCq93m8dKhf5Th/IAFiNcNsUT/uZ kDXtAIIop9ONX2lRaZyb8S6DMFC5ar9EdXsEOLUZ9xBSpF0eEmM+yQGTWyRxmHklg4Hkaw5E Z6efYCnCnNyNEh85D+/RuNY27l0wCk7nDvXXcqil0nh1qeCbnmIT7tDKEGJcu0y8KKDpkPS7 spbMMyJjR5YVYUSfxXqzGLaFnhSRVBTOHw8g5MPHgJfCmKKwF0cNsI=
- Ironport-hdrordr: A9a23:cjc+MalnD8jISCinCjVQQqBmIxzpDfLo3DAbv31ZSRFFG/Fw9/ rCoB17726QtN91YhsdcL+7V5VoLUmzyXcX2/hyAV7BZmnbUQKTRekP0WKL+Vbd8kbFh41gPM lbEpSXCLfLfCJHZcSR2njELz73quP3jJxBho3lvghQpRkBUdAF0+/gYDzranGfQmN9dP0EPa vZ3OVrjRy6d08aa8yqb0N1JNQq97Xw5fTbiQdtPW9f1DWz
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Sun, Mar 12, 2023 at 03:54:55PM +0800, Huang Rui wrote:
> From: Chen Jiqian <Jiqian.Chen@xxxxxxx>
>
> Use new xc_physdev_gsi_from_irq to get the GSI number
>
> Signed-off-by: Chen Jiqian <Jiqian.Chen@xxxxxxx>
> Signed-off-by: Huang Rui <ray.huang@xxxxxxx>
> ---
> tools/libs/light/libxl_pci.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/libs/light/libxl_pci.c b/tools/libs/light/libxl_pci.c
> index f4c4f17545..47cf2799bf 100644
> --- a/tools/libs/light/libxl_pci.c
> +++ b/tools/libs/light/libxl_pci.c
> @@ -1486,6 +1486,7 @@ static void pci_add_dm_done(libxl__egc *egc,
> goto out_no_irq;
> }
> if ((fscanf(f, "%u", &irq) == 1) && irq) {
> + irq = xc_physdev_gsi_from_irq(ctx->xch, irq);
This is just a shot in the dark, because I don't really have enough
context to understand what's going on here, but see below.
I've taken a look at this on my box, and it seems like on
dom0 the value returned by /sys/bus/pci/devices/SBDF/irq is not
very consistent.
If devices are in use by a driver the irq sysfs node reports either
the GSI irq or the MSI IRQ (in case a single MSI interrupt is
setup).
It seems like pciback in Linux does something to report the correct
value:
root@lcy2-dt107:~# cat /sys/bus/pci/devices/0000\:00\:14.0/irq
74
root@lcy2-dt107:~# xl pci-assignable-add 00:14.0
root@lcy2-dt107:~# cat /sys/bus/pci/devices/0000\:00\:14.0/irq
16
As you can see, making the device assignable changed the value
reported by the irq node to be the GSI instead of the MSI IRQ, I would
think you are missing something similar in the PVH setup (some pciback
magic)?
Albeit I have no idea why you would need to translate from IRQ to GSI
in the way you do in this and related patches, because I'm missing the
context.
Regards, Roger.
|