[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>, "Hildebrand, Stewart" <Stewart.Hildebrand@xxxxxxx>
- From: "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
- Date: Tue, 10 Dec 2024 07:17:30 +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=+NGLjlrSD3dU4ZgxJf8dhYbDMLvlKQyK8dPKaHoyDmY=; b=nrTLgnjU0jSPtjNFQD/HnmBaX6pnutJQDITA13DIeTfSJ4rbhJydaLyG2crOLALpFJZNEToQcne8fgO+k/BC9QuO4OF12DlSB8TlGhmyVoPU5HfQMeLYEk0XUY2bZo86PNznTtxfrsU/vLrXSzVwIl8rL5HWL8r91IaeoFRc8qQv8RZTUvnyLC5JTSBgwRJ4RO1m+TKXcQwQIyNZEtrjaT1QvQQFeY/8+wK8749HsyHHPTitWuf5X1Eg8Hcan1M7Osm+FhsHVqIZqU6DzXgJQRX6sP/hxixLmrwsW7QE6hqnNEgAV4FrO+acXoqQqygfbjAzSiMcSdJYobe8jtIyEA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Kro/ipH8Q4KDMqv7ySHO0CHfWPyfqTgXIu9jmjew2qliVRPeP2N3gKl+6dmjTXEaAXHuIZNXKsIECWZYvBPKz+CMi8vG8QpAW2q4tH7aQAMQsle7Gk1pABweSAZ9R7s/gAsx2EQ2i2Rr8Bp82i2ZgP45b53VwZLy71DWIkP1hihKwJKrfpaa+P9OunCiPmkCvxPED6nxj73IhrgtlIMuxkEhWk6CBr/+twFHBrRrN+jsbpCFK1QVf29xdFQAajxLPU0E9yd0O/559O73e4dUqZm0cf8ytK7/OP3yTTdFgle/5v3QiE65hcTuSQHFbb4/PWjeawivWRUd2QNat98StA==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
- Cc: 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: Tue, 10 Dec 2024 07:17:41 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHbMBN9zgKXu6QHp0mudGAMtCr+w7K9RysAgCKFMIA=
- Thread-topic: [QEMU PATCH v10] xen/passthrough: use gsi to map pirq when dom0 is PVH
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 ?
>
>> 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"
>
> Thanks,
>
--
Best regards,
Jiqian Chen.
|