[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [QEMU PATCH v10] xen/passthrough: use gsi to map pirq when dom0 is PVH
- To: Anthony PERARD <anthony@xxxxxxxxxxxxxx>
- From: "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
- Date: Mon, 24 Feb 2025 09:57:58 +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=arcselector10001; 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=UwAXadfIdE8XTjN3Bcp3nX/OZSfAPWa0U5tDv/bbkHo=; b=vlMivHq9X49Gsqk7coJNOyqVUXe0axlOe3cz3ZMkg4wpWgYjIH+A6S6pWX1qbxOeLz2O8qgmM/yLGEkBXc0E/jViRJrMWIiZpc9OIZ1+MblEYWMpjblO+r314WTcHo7SXh9NOJNR5G35zhTm99tPKwGw0+FD9XsRcGjLfMigosq1YMjK9/satbhFaXMxItsKXZkJpadY/Y25XgUPXBXlJ/Tt0xDY1JZxwcAef89MhrXPlrRIaCz98Z8EP2LT/nuKvUYvafinU+D1kBBVNbhT6IlgdJL5bTMExwgaEdf/XCBixnT4lKXpQfSmiUSldMPKGLss7+Uv0xE4wJzFPZ1Ysg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Jw5P9GkJHZ0/h1F/aFj6zkELyUApfidDn+YP0ktg5BsRl9QlaLkMxbHzvdSDSKhD4ZwB40SJeIVoieO2ccIKGXGKnfdCkTifChY+hT8c2FtwnCH/0TZU1Zy7hS18JO2/cnK9tVAtodr2glH8BI/eCgpxWy4tCO7kHs3J+4u+bAWTetPwakGQ/xGky2ScXsZPFbxxtqfc/++ClYkMKvXKsHu3LyXOwaPx8VIiaHirekl0+2zJLJb8nGAkrnWr+SHggkRaiVD+zre1XUxWUwUS0HE882WIr2QWmb/8Ff8fi+blxGC8bERpcCWgrpq2aOJuCSEl/lxb/JmBDqAHXENnUg==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
- Cc: "Hildebrand, Stewart" <Stewart.Hildebrand@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, "Edgar E . Iglesias" <edgar.iglesias@xxxxxxxxx>, "Michael S. Tsirkin" <mst@xxxxxxxxxx>, Marcel Apfelbaum <marcel.apfelbaum@xxxxxxxxx>, "qemu-devel@xxxxxxxxxx" <qemu-devel@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Huang, Ray" <Ray.Huang@xxxxxxx>, "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
- Delivery-date: Mon, 24 Feb 2025 09:58:14 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHbMBN9zgKXu6QHp0mudGAMtCr+w7K9RysAgCKFMICAAyspgIB0b8GA
- Thread-topic: [QEMU PATCH v10] xen/passthrough: use gsi to map pirq when dom0 is PVH
Hi Anthony,
On 2024/12/12 23:38, Anthony PERARD wrote:
> On Tue, Dec 10, 2024 at 07:17:30AM +0000, Chen, Jiqian wrote:
>> On 2024/11/19 00:05, Anthony PERARD wrote:
>>> On Wed, Nov 06, 2024 at 02:14:18PM +0800, Jiqian Chen wrote:
>>>> In PVH dom0, when passthrough a device to domU, QEMU code
>>>> xen_pt_realize->xc_physdev_map_pirq wants to use gsi, but in current codes
>>>> the gsi number is got from file /sys/bus/pci/devices/<sbdf>/irq, that is
>>>> wrong, because irq is not equal with gsi, they are in different spaces, so
>>>> pirq mapping fails.
>>>>
>>>> To solve above problem, use new interface of Xen, xc_pcidev_get_gsi to get
>>>> gsi and use xc_physdev_map_pirq_gsi to map pirq when dom0 is PVH.
>>>>
>>>> Signed-off-by: Jiqian Chen <Jiqian.Chen@xxxxxxx>
>>>> Signed-off-by: Huang Rui <ray.huang@xxxxxxx>
>>>> Signed-off-by: Jiqian Chen <Jiqian.Chen@xxxxxxx>
>>>
>>> Acked-by: Anthony PERARD <anthony@xxxxxxxxxxxxxx>
>>>
>>> But, this following change probably needs an ack from PCI maintaners,
>>> CCed.
>> As PCI maintainers didn't response for weeks,
>> can I just move the definition of the macro back to xen_pt.c file ?
>
> No, that's fine. I should be able to send a pull-request with this
> change without too much trouble.
No meaning to urge you.
May I know the status of your pull-request?
>
> Cheers,
>
>>>> diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
>>>> index eb26cac81098..07805aa8a5f3 100644
>>>> --- a/include/hw/pci/pci.h
>>>> +++ b/include/hw/pci/pci.h
>>>> @@ -23,6 +23,10 @@ extern bool pci_available;
>>>> #define PCI_SLOT_MAX 32
>>>> #define PCI_FUNC_MAX 8
>>>>
>>>> +#define PCI_SBDF(seg, bus, dev, func) \
>>>> + ((((uint32_t)(seg)) << 16) | \
>>>> + (PCI_BUILD_BDF(bus, PCI_DEVFN(dev, func))))
>>>> +
>>>> /* Class, Vendor and Device IDs from Linux's pci_ids.h */
>>>> #include "hw/pci/pci_ids.h"
>
--
Best regards,
Jiqian Chen.
|