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

Re: [RFC XEN PATCH v3 2/3] x86/pvh: Add (un)map_pirq and setup_gsi for PVH dom0


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
  • Date: Wed, 13 Dec 2023 02:47:18 +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=5nPLFwk9mtpN3JdlrGA0jQbp4AS228Zi0u1ktmTPUVg=; b=lxhgA+TbT/ht6hUm+Pq5v8Ljoy/d/xujzwEVfbO9/9+e7NvjDH7p2SvROmmCyhrfFV5/FU7i1zg7y9F/00Clj2psgIPx09k2Bte1bqlGO470OiVWuhT0kje1OWjNCqQWqYjSzC5BNxz0h/8nQK69hbMjmp1JSLGopDkHTdlauAyAVt+YA1QW5MVcsulH8JXvTEfkVZbQ3yfYec7+QBRgNm/DDK8Mc9uIjpcvhtT0ZLUstv5EgbIDYgB0YhBIQuJFfm+eMNrLhJoEAY/R6mxMxesHStdXkbHh2RSjyljPsJII4RwAHLEKJX9qVPDNb0W4lTZc4g1U0Q9v6d5ijCEgPA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bLAtuwND6IiIeEPX8o1GKLq59LJ3uqH9kXXqk1lXxt2sf0Y34htVI/sYwZxtWkQWYUc7kl9iNfltiObhhyGD0c8vD67lg0LIZiiWzWsvDxKdNsoutqm7jz49UlWltYnnQO1kryZukM6vnF9DX7DIG93cKTiaJo/0gEYtAIuCvFTHo+qxILIbOY8cygNOD8HS3TEFJ7m/XmjUohCHqUGs81Hb7m++UyqG0Y0vV4tHZaQB/U2auz0S0NTil8Jtm5dRaggjUX8Y5n15b5y9HAjHdRmT/KMvie0sp5rdrUwRkJ5WGpNHYNaxpKTUVAHZONb+81zDbSyeFjdx98Kk/VmHdA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: "Daniel P . Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Hildebrand, Stewart" <Stewart.Hildebrand@xxxxxxx>, "Deucher, Alexander" <Alexander.Deucher@xxxxxxx>, "Ragiadakou, Xenia" <Xenia.Ragiadakou@xxxxxxx>, "Stabellini, Stefano" <stefano.stabellini@xxxxxxx>, "Huang, Ray" <Ray.Huang@xxxxxxx>, "Huang, Honglei1" <Honglei1.Huang@xxxxxxx>, "Zhang, Julia" <Julia.Zhang@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
  • Delivery-date: Wed, 13 Dec 2023 02:47:42 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHaK4ebBv/EWT+No0GAUR8lU4172LCkNzqAgAGFPID//6gjAIABpqIA
  • Thread-topic: [RFC XEN PATCH v3 2/3] x86/pvh: Add (un)map_pirq and setup_gsi for PVH dom0

On 2023/12/12 17:30, Jan Beulich wrote:
> On 12.12.2023 07:49, Chen, Jiqian wrote:
>> On 2023/12/11 23:31, Roger Pau Monné wrote:
>>> On Mon, Dec 11, 2023 at 12:40:08AM +0800, Jiqian Chen wrote:
>>>> --- a/xen/arch/x86/hvm/hypercall.c
>>>> +++ b/xen/arch/x86/hvm/hypercall.c
>>>> @@ -72,8 +72,11 @@ long hvm_physdev_op(int cmd, 
>>>> XEN_GUEST_HANDLE_PARAM(void) arg)
>>>>  
>>>>      switch ( cmd )
>>>>      {
>>>> +    case PHYSDEVOP_setup_gsi:
>>>
>>> I think given the new approach on the Linux side patches, where
>>> pciback will configure the interrupt, there's no need to expose
>>> setup_gsi anymore?
>> The latest patch(the second patch of v3 on kernel side) does setup_gsi and 
>> map_pirq for passthrough device in pciback, so we need this and below.
>>
>>>
>>>>      case PHYSDEVOP_map_pirq:
>>>>      case PHYSDEVOP_unmap_pirq:
>>>> +        if ( is_hardware_domain(currd) )
>>>> +            break;
>>>
>>> Also Jan already pointed this out in v2: this hypercall needs to be
>>> limited so a PVH dom0 cannot execute it against itself.  IOW: refuse
>>> the hypercall if DOMID_SELF or the passed domid matches the current
>>> domain domid.
>> Yes, I remember Jan's suggestion, but since the latest patch(the second 
>> patch of v3 on kernel side) has change the implementation, it does setup_gsi 
>> and map_pirq for dom0 itself, so I didn't add the DOMID_SELF check.
> 
> And why exactly would it do specifically the map_pirq? (Even the setup_gsi
> looks questionable to me, but there might be reasons there.)
Map_pirq is to solve the check failure problem. (pci_add_dm_done-> 
xc_domain_irq_permission-> XEN_DOMCTL_irq_permission-> 
pirq_access_permitted->domain_pirq_to_irq->return irq is 0)
Setup_gsi is because the gsi is never be unmasked, so the gsi is never be 
registered( vioapic_hwdom_map_gsi-> mp_register_gsi is never be called).

> 
> Jan

-- 
Best regards,
Jiqian Chen.

 


Rackspace

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