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

Re: [PATCH v1 4/4] xen/pci: solve compilation error when memory paging is not enabled.


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Rahul Singh <Rahul.Singh@xxxxxxx>
  • Date: Fri, 30 Oct 2020 13:59:59 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.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-SenderADCheck; bh=SBR1mSaVq1AGjPqPcYHqftLodwa4oX7xnw31LeL3eWI=; b=D7oZP4mmTUIc0+j3Nek2lu2lo7NXKeWiIYL729Vsn5VeEglmxy5nwDadn7wj/1ZLHUsHlmsvAVhWleBPwAbNf7yJfxrPwmE7stAWSAJUM2c+so2LLR9MBs+BqOAItLy3sS2HIa0SGRJasQt2QknGBmOjUaNU3FSIxgvAfpedH7m+aSALldRz6MxomN8yNbOFxPJzHjD0tM8PvQE6JtxKf3Rf/29yTBxSPMPbIiBswZPdEK+XenqvFBntkDc6IzsgrZ3ve06wOmol9zbAxyqxCrU7PY9Z22sMKfOD/Ye2RSo7yNS6a4+msxRf0xt0FKhN2y25pDkNNkvZMLVvMrUOTQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e3w7gak5Qcq/FZ//DsFYrgOKR4jlZDBFOC/N1899/THr1PjD8lROb1zHlrj/sqKL7FEJl29WSoHb+M+lEuJtmtvpfCJVgzK6R7Lx4guD4oys+iPotwu8uBiYh1VqeisOyzihQ15nwJ3bDfBFW9eMFojuvHki64Jugwa83iEalk5YEdFF7x1/gtmGt9UXAKI61QhLiIwc8bOKK5OJYZL+HkzMV/bl3otGNUwULjobIHo3e2oeF6bbRMLQU/hSTuLpUnHo/tPKaULPe911V30ws8lQ1bH0CyhwaB0XRR6dg6moLpmuayp+08/DSGl4DsG8rPYz1Dqs0rACxgDqyY3dIQ==
  • Authentication-results-original: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=arm.com;
  • Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Paul Durrant <paul@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 30 Oct 2020 14:00:52 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHWq7wn1E1TPrUt3EyifJVqFrVmIams60gAgAA3GICAAa+LAIAABQGAgAFbgwA=
  • Thread-topic: [PATCH v1 4/4] xen/pci: solve compilation error when memory paging is not enabled.

Hello Jan,

> On 29 Oct 2020, at 5:16 pm, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
> On 29.10.2020 17:58, Rahul Singh wrote:
>>> On 28 Oct 2020, at 3:13 pm, Rahul Singh <Rahul.Singh@xxxxxxx> wrote:
>>>> On 28 Oct 2020, at 11:56 am, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>>>> On 26.10.2020 18:17, Rahul Singh wrote:
>>>>> --- a/xen/drivers/passthrough/pci.c
>>>>> +++ b/xen/drivers/passthrough/pci.c
>>>>> @@ -1419,13 +1419,15 @@ static int assign_device(struct domain *d, u16 
>>>>> seg, u8 bus, u8 devfn, u32 flag)
>>>>>   if ( !is_iommu_enabled(d) )
>>>>>       return 0;
>>>>> 
>>>>> -    /* Prevent device assign if mem paging or mem sharing have been 
>>>>> +#if defined(CONFIG_HAS_MEM_PAGING) || defined(CONFIG_MEM_SHARING)
>>>>> +    /* Prevent device assign if mem paging or mem sharing have been
>>>>>    * enabled for this domain */
>>>>>   if ( d != dom_io &&
>>>>>        unlikely(mem_sharing_enabled(d) ||
>>>>>                 vm_event_check_ring(d->vm_event_paging) ||
>>>>>                 p2m_get_hostp2m(d)->global_logdirty) )
>>>>>       return -EXDEV;
>>>>> +#endif
>>>> 
>>>> Besides this also disabling mem-sharing and log-dirty related
>>>> logic, I don't think the change is correct: Each item being
>>>> checked needs individually disabling depending on its associated
>>>> CONFIG_*. For this, perhaps you want to introduce something
>>>> like mem_paging_enabled(d), to avoid the need for #ifdef here?
>>>> 
>>> 
>>> Ok I will fix that in next version. 
>> 
>> I just check and found out that mem-sharing , men-paging and log-dirty is 
>> x86 specific and not implemented for ARM.
>> Is that will be ok if I move above code to x86 specific directory and 
>> introduce new function arch_pcidev_is_assignable() that will test if pcidev 
>> is assignable or not ?
> 
> As an immediate workaround - perhaps (long term the individual
> pieces should still be individually checked here, as they're
> not inherently x86-specific). Since there's no device property
> involved here, the suggested name looks misleading. Perhaps
> arch_iommu_usable(d)?

Thanks. I will modify the code as per suggestion and will share the version v2 
for review.

> 
> Jan

Regards,
Rahul




 


Rackspace

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