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

Re: [RFC XEN PATCH v4 3/5] x86/pvh: Add PHYSDEVOP_setup_gsi for PVH dom0


  • To: Jan Beulich <jbeulich@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
  • Date: Tue, 9 Jan 2024 08:01:24 +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=APEEs3xdBsbebMVnachXSnPg39wFpg4nTqq/kuREfxw=; b=B3KN7NRYUmKqzb5YrJYc/7QGcUEhLe0qd8qn5+tSF6Dk3UjTXQ1SNCMkFKckkKQvQ2Al2MEb2SzDLv+CpqHuVbk3sZWiESQu1/yfb0UbWMH9RnwPI3GHL34GU0tsDh3xQSjOmtxmE1qR6mg7yD19nKyTcjSES8F88gW/nTtyLdIrkmxsYa2xkC1LPwddszWhzqxmRVW1j0/jnt+iCKWnJjqpEcUk6X1mBJ6W04wZXZQ34kIQ8hjgVlobY2VFiv0DM5W+xwFG77qPFHnnASFPyP40rWv/nyF8YFxiX4QgZunsCA4iT6xkbr5I6T4RALtXZm/vS6vqJ5BEUZyshB/gXg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oTMcNSNuhNCzH1zAZc1QIgkBkaipAHZg/O7pzI24z4FeyO3FqoFJil1JLwno7Dvh8AI2E40Tnezv40t2zP1Pi83KXWgiwLBuxRFeTBYrlz3gmXwC5r6B2ib0ifh3EzZUS96061/j5aIttP4XbP5P/uaBvUkvJaz9Vzemk4piH+6VZ9StnZngScBg5JElvhXR5Jo1S9qzNuXIk3UvtbMeDtGeIA6nFZr2KYOHXqc/qGuHux7kkAC8jG1ZyVtjrjpTG9y/HNlhtP0RnLF6eG1C0+GY8jR+h+IWtAFDmFUrtZilhCZnoftWw3WmnoC6b8vcPn46i3bseq6ryZNsMU9qdw==
  • 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>, Roger Pau Monné <roger.pau@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>, "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
  • Delivery-date: Tue, 09 Jan 2024 08:01:36 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHaP6Y0Nj7ifAZhiEaHi72EzvHXWbDL9nOAgAOpxICAAgn6AA==
  • Thread-topic: [RFC XEN PATCH v4 3/5] x86/pvh: Add PHYSDEVOP_setup_gsi for PVH dom0

On 2024/1/8 16:50, Jan Beulich wrote:
> On 06.01.2024 01:54, Stefano Stabellini wrote:
>> On Fri, 5 Jan 2024, Jiqian Chen wrote:
>>> On PVH dom0, the gsis don't get registered, but
>>> the gsi of a passthrough device must be configured for it to
>>> be able to be mapped into a hvm domU.
>>> On Linux kernel side, it calles PHYSDEVOP_setup_gsi for
>>> passthrough devices to register gsi when dom0 is PVH.
>>> So, add PHYSDEVOP_setup_gsi for above purpose.
>>>
>>> Co-developed-by: Huang Rui <ray.huang@xxxxxxx>
>>> Signed-off-by: Jiqian Chen <Jiqian.Chen@xxxxxxx>
>>> ---
>>>  xen/arch/x86/hvm/hypercall.c | 6 ++++++
>>>  1 file changed, 6 insertions(+)
>>>
>>> diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
>>> index 632a68be3cc4..e27d3ca15185 100644
>>> --- a/xen/arch/x86/hvm/hypercall.c
>>> +++ b/xen/arch/x86/hvm/hypercall.c
>>> @@ -97,6 +97,12 @@ long hvm_physdev_op(int cmd, 
>>> XEN_GUEST_HANDLE_PARAM(void) arg)
>>>          break;
>>>      }
>>>  
>>> +    case PHYSDEVOP_setup_gsi:
>>> +        if ( is_hardware_domain(currd) && !has_pirq(currd) )
>>> +            break;
>>> +        else
>>> +            return -ENOSYS;
>>
>> I am not sure what is the best "if" check for this situation but I am
>> guessing we don't need has_pirq(currd). Maybe this is sufficient:
>>
>> if ( is_hardware_domain(currd) )
>>     break;
>> else
>>     return -ENOSYS;
> 
> Maybe
> 
>     if ( !is_hardware_domain(currd) )
>         return -EOPNOTSUPP;
>     ASSERT(!has_pirq(currd));
>     break;
> 
> ? What I primarily dislike in both earlier proposals is the (imo
> confusing) use of "else".
It looks like more reasonable. I will change to as this in next version if 
there are no other guys have different opinions.

> 
> Jan

-- 
Best regards,
Jiqian Chen.

 


Rackspace

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