[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: "Michael S. Tsirkin" <mst@xxxxxxxxxx>, Marcel Apfelbaum <marcel.apfelbaum@xxxxxxxxx>
- From: "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
- Date: Tue, 19 Nov 2024 05:58:04 +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=EE4xt8/SpO4Hem4bo3fJcds07C7oTvDNlwsdi0Xzz5U=; b=CjhPRPpDiJkfwN9nonnMB8qci4woGcmASuup1XHJXkCYMZI8Eppawa0cw4tvQP5cpKNrIloPZPtHQBs+zizluz4HbRHj7kTbiZZ/ZTqv5bWPigkzGdalq11vzOklZgSvaW4GBbnYXuV+Ud+lgWtfD0cwEm4EsCegXt6gYLiSqU/bCPCRgFDOiTTz2+lHnLos5CYJNozWdJYQq1huPQbQFjLa8YqxF3jO3jv95SVl98T6o0992L7NEdWjCXZW+NPd+PFSuNX1mckdWYDWolGCIiKeY0XLz7O10Tnk40kC4GL3Y0vNHdG5JNsKKfmM2CYIQb0MC0QB0kiDqvv9+4t6yA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QI+M0ivh2Extk/iwOJpn6oOmJVpYV0bWexDXBo109xfmDZpdOqoOmGtx3nuBMSaV2riA5VLw9ho07loq9kpxqgo2NY8z0DckqluvVXfzdYoMaHdD+D0gugq5B6aNiKG4d3+62iMYTCu/7Xqkkjw+x4F2RQpSep5hcVgGPmyTCM1FyustHDA9VC0pBTnyMUDAmzPOEwNJ9vhl4fApZKx6bwXjNzGMynkDxh84PZPoSQVLOsH54i8CtKeghuFPVTX4w8sKnUTL1ldpi3UbVm5/PTCyG2x08p2BJZWMS88t89hDylfwlJseFtAP45vi14NCV0ynG8zFjst4zcLZC0j3TQ==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
- Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony PERARD <anthony@xxxxxxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, "Edgar E . Iglesias" <edgar.iglesias@xxxxxxxxx>, "qemu-devel@xxxxxxxxxx" <qemu-devel@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Hildebrand, Stewart" <Stewart.Hildebrand@xxxxxxx>, "Huang, Ray" <Ray.Huang@xxxxxxx>, "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
- Delivery-date: Tue, 19 Nov 2024 05:58:35 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHbMBN9zgKXu6QHp0mudGAMtCr+w7K9RysAgAFuGYA=
- Thread-topic: [QEMU PATCH v10] xen/passthrough: use gsi to map pirq when dom0 is PVH
Hi MST and Marcel,
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.
>
>> 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"
May I get your ACK about this change?
>
> Thanks,
>
--
Best regards,
Jiqian Chen.
|