[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: Fri, 29 Nov 2024 09:11:02 +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=XkypCtvj4fuEFCAWhn4mfK3b2hlonmzxLHtwleu+YpQ=; b=SQXfiVxcCVEx9zs+yPo3mFAI+hVc37i4FUITwvTe9NFrc+bJl5359X45saKsen0TwoW9P2bdNf60lNjs7dYYS5h/efydS4hesWomuVTLUcHMsZH0YORGMgtRFDGNpw2ryXBWB3VuaB2X3r74R0RwjXTJ223EQAfjRAiOnXm9f0HtB+s9FFTTP2eWqec51JmbTufwyPVwDZ7eOJ3YPGdZYGDPPqMNAjkUInnb3qGRHcAndHLjG2NJwG5tTfMx/Ief12B4aHCVijZVtnykvmMe+0ryHFA7DuB1T6FwKKCI2qUCM+R4aZTa3QLWc2H+W02xotRtVjoXpSS+90pywGVqlA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EkZZkGiewAcLO2oIx6KXRfF9/uYpABvCI7ailLZ44xutGUL43HBxq+SVB9zpb0b9Qf65RBb4A5PrWAoZAOXisOYFGEuYkt+3i4oeeoTOcYl6gFgAbWmyLl0ecJiCkNMdnc1TU+gD1imcc8nHmXeFs4za6j1PCk9ZpywDfCaUEG2kK9B55X0DFBzcwwDCC/tSkLEzjrPWLCMdHaN62J1wt+wdQeRUSTPmf7WdE7KBOkmbyBtVe/L/9KJp+/Dtkj9aBkQhFwQE+X/rYCKvQ5ULj5+r9kp7uTGa8IraYtMEPmJmdJbcte+c7iuAZcg6Tvbzb3TnJzPBaHKn9MsLu84JEw==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
- Cc: Anthony PERARD <anthony@xxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, 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: Fri, 29 Nov 2024 09:11:16 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHbMBN9zgKXu6QHp0mudGAMtCr+w7K9RysAgBFY+YA=
- 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.
Could you please add some comments on below changes?
>
>> 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.
|