[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC XEN PATCH v4 5/5] libxl: Use gsi instead of irq for mapping pirq
- To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
- From: "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
- Date: Mon, 8 Jan 2024 06:02:55 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.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=5SZnQhqlVHJys+CNWBd65TgWNzYoC5ZjT49rCV1ZqCU=; b=SztOt970gA+l9j31sRc3i2EeXTe8QUTUb9KBkxZij6CzYCb3ffI+4nR9Sbsaekh1WtKUMiXiJcYRnl50c3IjJQSX2m41UwWakPf81ACVV+yADllW6JZGJqKKk0ePWDpHrHtSylM8nin21EdHJypkCD7K9t0ih35OlY041zQE+jPk1ino7/pqhmf6xv+YCv0zwDysJbpMmtyiI1lIVCt9+p7sQzYAlrxESkA1CtV22GZ/FW6EZq/lMLSDZeJxfwGS5YF1k3Ji8CFh4Brlksre+kViTt5jqavm1WE9lQg2MPVKp5HUX75gfNzCN+rZhTFW0RwrKhEFGhytqtGcWZ8fGA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JyzBZMk/43H8gPZPVsR3UbAV1Ng2Q1edkQu6AeAdScxjI4wR98xSPnOGne8Wp2kEuvNDGqcOWLYxvKPzydJHfbhgVIbwIKZiInm53Z6Mb0AcUoSKr8qGHyhMzrLyeRMN/CSqJRcYi2h2ebpLiYtQISAlMl5vug7zXfsrQSXA1Yc+lePZ9m1Nf0NgTbAwmRtGNjzruJiLpxXQG4taUdE5G6WVnpK2Y0nnFuDl2baEBXWETUM59/J+6ovUxfaNKPpr1IrhFIU3a+aHqWgG90lC2qyPSDrvi55+j7jY8v40RQ+bm2ACY3LZioTeI29PtwOHvZVcIAJ3IIQDtPddaiGJGA==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, "Hildebrand, Stewart" <Stewart.Hildebrand@xxxxxxx>, "Huang, Ray" <Ray.Huang@xxxxxxx>, "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
- Delivery-date: Mon, 08 Jan 2024 06:03:24 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHaP6Y3HXW6ZoMbT0+Rfz8pptyOwLDL+zqAgAP6aAA=
- Thread-topic: [RFC XEN PATCH v4 5/5] libxl: Use gsi instead of irq for mapping pirq
On 2024/1/6 09:11, Stefano Stabellini wrote:
> On Fri, 5 Jan 2024, Jiqian Chen wrote:
>> In PVH dom0, it uses the linux local interrupt mechanism,
>> when it allocs irq for a gsi, it is dynamic, and follow
>> the principle of applying first, distributing first. And
>> the irq number is alloced from small to large, but the
>> applying gsi number is not, may gsi 38 comes before gsi
>> 28, that causes the irq number is not equal with the gsi
>> number. And when passthrough a device, xl wants to use
>> gsi to map pirq, see pci_add_dm_done->xc_physdev_map_pirq,
>> but the gsi number is got from file
>> /sys/bus/pci/devices/<sbdf>/irq in current code, so it
>> will fail when mapping.
>>
>> So, use real gsi number read from gsi sysfs.
>>
>> Co-developed-by: Huang Rui <ray.huang@xxxxxxx>
>> Signed-off-by: Jiqian Chen <Jiqian.Chen@xxxxxxx>
>
> Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
Thank you very much! I will add this in next version.
And this implementation depends on the third patch on kernel side, if the
maintainer doesn't like to add a gsi sysfs, this implementation may be changed
in the future, if so, I will let you know.
>
--
Best regards,
Jiqian Chen.
|