[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN PATCH v11 6/8] tools/libxc: Allow gsi be mapped into a free pirq


  • To: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • From: "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
  • Date: Tue, 2 Jul 2024 03:41:39 +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=jmPT1YJvmPzNg9RBdRHkwJQrmw0IZGZF67Vw17Zr1/8=; b=jyp2Ve2rfMCDAtNyjw07s+gEK8L47g6UqizJpF3i9rjcFYFQhh95dIwS8XcydhkzpwpGZzkU6CMXAWjDLKMXYniYTj6JShBy+buwMoibYrqsFVZZRazbkjBNgKfpOdweDva0mvHUsV2uqzXz8J3AEgfdRtEqnKpRnm+zkKYWaavwLOgSfTd4MZANT2aFf7lLB4EGTfPzxOn8ZK5ZFRXWvaQ8krdC+hLlNqYHoRDrw4/YZyYU+FjeLyOCZI55t1upyBjwl/oQ/Bpe6WG9q0DA87fhPEV4cMkDq2zJEuztQrRkeAGU4WbDrHf65FC298aKam4USRaUNhgli5ePE4tnNw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f+rYbNzbR1LQqo9cYFKXd0Voccs6seUdmtvmi84oXj/CiiVqB1i3iQuYZLD96auRSw7sp4CZ09zXiMt8CpUPY25+/Y5/d0Fqyj4+Zuw8TH5bYBYYE7xMjAhy8rVbwR+LCKV6pzNkp3ilKv+nqubNXFXp2FFUemii0IXdz1MFfDSzZksOVEZGQhivrlpXlA8iNVzJ6PnvODVBwlp/E53Wd3nwBkoQ7Ygdj+XXjqm5Iu1k5jsklfUSMaFgFOlKnMgR91j9Nxofc8PX4Mf68zKg80ZQ29veLhlKNYJf1lBBkisX6HXzrG8crJKxQSVXcPAWme3ZEjpN9EpHBSSGpD5PDQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <gwd@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony PERARD <anthony@xxxxxxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, "Daniel P . Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, "Hildebrand, Stewart" <Stewart.Hildebrand@xxxxxxx>, "Huang, Ray" <Ray.Huang@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
  • Delivery-date: Tue, 02 Jul 2024 03:41:55 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHayunZQYBg9v9t9kyJNwcunL3OKbHhgf6AgAHPpIA=
  • Thread-topic: [XEN PATCH v11 6/8] tools/libxc: Allow gsi be mapped into a free pirq

On 2024/7/1 15:54, Jan Beulich wrote:
> On 30.06.2024 14:33, Jiqian Chen wrote:
>> Hypercall PHYSDEVOP_map_pirq support to map a gsi into a specific
>> pirq or a free pirq, it depends on the parameter pirq(>0 or <0).
>> But in current xc_physdev_map_pirq, it set *pirq=index when
>> parameter pirq is <0, it causes to force all cases to be mapped
>> to a specific pirq. That has some problems, one is caller can't
>> get a free pirq value, another is that once the pecific pirq was
>> already mapped to other gsi, then it will fail.
>>
>> So, change xc_physdev_map_pirq to allow to pass negative parameter
>> in and then get a free pirq.
>>
>> Signed-off-by: Jiqian Chen <Jiqian.Chen@xxxxxxx>
>> Signed-off-by: Huang Rui <ray.huang@xxxxxxx>
>> Signed-off-by: Jiqian Chen <Jiqian.Chen@xxxxxxx>
>> ---
>>  tools/libs/ctrl/xc_physdev.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tools/libs/ctrl/xc_physdev.c b/tools/libs/ctrl/xc_physdev.c
>> index 460a8e779ce8..e9fcd755fa62 100644
>> --- a/tools/libs/ctrl/xc_physdev.c
>> +++ b/tools/libs/ctrl/xc_physdev.c
>> @@ -50,7 +50,7 @@ int xc_physdev_map_pirq(xc_interface *xch,
>>      map.domid = domid;
>>      map.type = MAP_PIRQ_TYPE_GSI;
>>      map.index = index;
>> -    map.pirq = *pirq < 0 ? index : *pirq;
>> +    map.pirq = *pirq;
>>  
>>      rc = do_physdev_op(xch, PHYSDEVOP_map_pirq, &map, sizeof(map));
>>  
> 
> This is a functional change to existing callers, without any kind of
> clarification whether this changed behavior is actually okay for them.
Make sense.
There are three callers pci_add_dm_done, libxl__arch_domain_map_irq and 
pyxc_physdev_map_pirq,
I know how to clarify the first two, but the last one, I have no idea.

Hi Marek,
Will this patch break the existing behavior of pyxc_physdev_map_pirq, and why?

> 
> Jan

-- 
Best regards,
Jiqian Chen.

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.