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

Re: [RFC XEN PATCH v4 4/5] domctl: Use gsi to grant/revoke irq permission


  • To: Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
  • Date: Wed, 10 Jan 2024 08:49:53 +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=lNC/m6Wg6FaUyMsWgAOZ2EL6+k1/Fx+GZGIBf8QCP+Q=; b=k8R75vJ4DK7wlYQ1E7rRg4eFSIHu4abto3v5heySdsRO+A8KZyrr8DPXtBSzmKiPfsiifP3SvXKKHo1M46L3l3TVuVqa5313XBSlxcEOStvSGxLbJ389h4uYK62XEe8ILj4beZXPBFsX7wPPH5cNXzfK3TmZbVWw9urslQmb+T13Z7GAnlil2+1FykAbr/e1ipHr0Fry2hHqFejAO6JxkhXMEtcL6XcvxoESDTZO129MWv52WluD+QIUcEL9bvx9qZZelqz6wW5+U4+P83ucDdM97DTlAwJFIsFMmQRb6CsrAvwqFZ+XvhJrWCyQVNfoGklfrto+p3/VtfAOrt92Zg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X3RaG42MxSgbLwFSQoNhV+Lk6ILGQS7WhsCB85GXPOeAis0BuZDwjre7g7U9cIgUQ6SoUZlDcykOYOvOj9FVJ2TAr2kykbBs7Wuk0PSlcGfa2QZ0l8D5nGdvlGvZf93RL9d+lO3Az+MXVbclymQYMbvTvABD2b+fkZY8FkPLFXx2an8uOwjiqcaAnRsDTV2D4jg1onzj5ftmIJVVxPwqsVLahHpJk8FpipA2TjTkwAVBotdgAGyNeJFHLMFoHpUW6Z5JBeuY0CEdrro4rTjVuS3ttujhxNMKe0/2V79DB5SoBZ7v637cOazpYK63ZC9+RNXmy2gRi6XY3858D2hOxw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, "Hildebrand, Stewart" <Stewart.Hildebrand@xxxxxxx>, "Huang, Ray" <Ray.Huang@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
  • Delivery-date: Wed, 10 Jan 2024 08:50:06 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHaP6Y1pt0ckfKChE+VsjXCWSj8+LDL+oWAgAOnBgCAAGd3gIABof4A//+U/YCAAIregP//iA0AgAH3KYA=
  • Thread-topic: [RFC XEN PATCH v4 4/5] domctl: Use gsi to grant/revoke irq permission

Thank Jan and Roger, I may know how to add a new hypercall 
XEN_DOMCTL_gsi_permission, I will implement it in next version.

On 2024/1/9 18:46, Jan Beulich wrote:
> On 09.01.2024 11:16, Chen, Jiqian wrote:
>> On 2024/1/9 17:38, Jan Beulich wrote:
>>> On 09.01.2024 09:18, Chen, Jiqian wrote:
>>>> A new hypercall using for granting gsi? If so, how does the caller know to 
>>>> call which hypercall to grant permission, XEN_DOMCTL_irq_permission or 
>>>> that new hypercall?
>>>
>>> Either we add a feature indicator, or the caller simply tries the
>>> new GSI interface first.
>> I am still not sure how to use and implement it.
>> Taking pci_add_dm_done as an example, for now its implementation is:
>> pci_add_dm_done
>>      xc_physdev_map_pirq
>>      xc_domain_irq_permission(,,pirq,)
>>              XEN_DOMCTL_irq_permission
>>
>> And assume the new hypercall is XEN_DOMCTL_gsi_permission, do you mean:
>> pci_add_dm_done
>>      xc_physdev_map_pirq
>>      ret = xc_domain_gsi_permission(,,gsi,)
>>              XEN_DOMCTL_gsi_permission
>>      if ( ret != 0 )
>>              xc_domain_irq_permission(,,pirq,)
>>                      XEN_DOMCTL_irq_permission
> 
> No, falling back shouldn't be "blind". Fallback should only happen
> when the new sub-op isn't implemented (hence why a feature indicator
> may be necessary), and only if calling the existing sub-op promises
> to be useful (which iirc would limit that to the PV Dom0 case).
> 
>> But if so, I have a question that in XEN_DOMCTL_gsi_permission, when to fail 
>> and when to success?
> 
> I'm afraid I don't understand the question. Behavior there isn't to
> be fundamentally different from that for XEN_DOMCTL_irq_permission.
> It's just that the incoming value is in another value space.
> 
>> Or do you mean:
>> pci_add_dm_done
>>      xc_physdev_map_pirq
>>      ret = xc_domain_irq_permission(,,pirq,)
>>              XEN_DOMCTL_irq_permission
>>      if ( ret != 0 )
>>              xc_domain_gsi_permission(,,gsi,)
>>                      XEN_DOMCTL_gsi_permission
> 
> No, this looks the wrong way round.
> 
>> And in XEN_DOMCTL_gsi_permission, as long as the current domain has the 
>> access of gsi, then granting gsi to caller should be successful. Right?
> 
> I think so; see above.
> 
> Jan

-- 
Best regards,
Jiqian Chen.

 


Rackspace

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