[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: Thu, 29 Oct 2020 16:58:16 +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=wwmvJxEH7BLwjJAT9lkSUzA36bu5zsN2kgvd1zbkEBQ=; b=AFiDhUFlMftqxHysEAXW7tPO8ViEerayQQ7UFm23dhXChkpvM9/FDaN8+pFKJRU1JnmAvcmFeTTatICi9x+KjGogPTeaVuUnXmt+X4Ubb02NpRDr2EutYxbv1hGG06WgM6k6Z8u+31t91FVZGBpvheVJuULJot/pXM5dY3g17ZUa0Gp7071GDG+CwFhNhv3F0LoR3OXzOVNMsnLf0rvbN3AOhvYk5h4mRELbNmlXyT5CPDmm8FykqZJQ6uR2POxZQeWXnMT8GBgIfRZlEzs+i6380g+GxAdjXm5bgUTvIIX6DHDBm8i0NRZL8Tw3lBrGJ+25PrFCkWuy5IGfly2fIA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f6i/oJHPzCMS7eQB1Zu4IVsw/xWXhf/25q0IXuscezF+IQdXzJfyOgYZol4c/pcC/rTffaujT1BgT8URASX37pxWD9qBIXA9QGE1o7zCQRhQQ2sP9gY89LHqoCu22efpX9ILNrL9PZWJH997ZbUfXxCIj0h+0wJnBB1u0bTv7qMFB9Wde6YJR+gSBcqV/EtCQx7M6o9+DVTECJzJf8qctYOSgvhHAfcKIhL/KCiimmBO/OICqzxm5VUuE/CzXUNR+cbK7MiemC9gU5BLxHP3NVe+aYF78o86GaoZfg60KrQdC6I+NZjAQXS3mScv2iY2cO9YtHZGU/Fa83MrqxULFQ==
- 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: Thu, 29 Oct 2020 16:58:46 +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+LAA==
- Thread-topic: [PATCH v1 4/4] xen/pci: solve compilation error when memory paging is not enabled.
Hello Jan,
> On 28 Oct 2020, at 3:13 pm, Rahul Singh <Rahul.Singh@xxxxxxx> wrote:
>
> Hello Jan,
>
>> 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 ?
>
>> Jan
Regards,
Rahul
|