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

Re: [PATCH v3 3/3] xen/pci: solve compilation error on ARM with HAS_PCI enabled.


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Rahul Singh <Rahul.Singh@xxxxxxx>
  • Date: Tue, 17 Nov 2020 16:15: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=4fASpjCsbyuVHI9z61R7qORpV7CHHXBCue/CIu4KnHA=; b=jRUsBqsqlZ2p41ATY1OXQlA4oKPxiIZxvGYeDMwb4Nou/I26oBKsfuC6x6k/ODbRPug5eZ1acHNEwzvfIPANfukSj/nRoKzNOF266c2HfRK6xhDOf+0fgpuixcozYIRhdYFUz+VI7/AsMWGPseiVjyBj96mZN4ZzEdojA+ZqwmI5pANgQ0H9h9WRMoR7zpDLipIabRowoXglrT1ndhEoMDp0ZPWX6ZTMi2dRBtWsJlsn5NnuSA+gM1cX9UJvWzUIqVfaXbZX0+aV5VLAUHLyiUf265fyyhA961luA9ha/OEqyUiezXb+d+kzeTJQb34Gn42vK5cT41q8HzboVoCBIw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JRRpY6cL/Ru0cbLL/CXrbjOGnZ1cylao0hsQbzhzQh8iVD6/PG1YGl9S2dCM4seYvnWzNKxNhVt9kLvIg/qNrnFEYup8VjJn8CX8fjMRw5O0LEEyMk9OE1PdRVyL0Zhprc1gskfljR4PHv/DuMg3IShwTeLL5qn/2BC7OHbjcazJxj99cYzLy4Uho98/E3gmw3x4B7/qmcAIlhFYEAqRfk8UoXk6ZqpXDplZT+olTYNX/DTjcrDm4nCxSiEL/5eW/W+RtlP2Nik8AtWeoKU3Fk1naiDL+In+f+1lccsTMd/7N07rGF5aD1BMfMvtjC1JKDKV//MRl28dC02THuPvgg==
  • 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: Tue, 17 Nov 2020 16:16:36 +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: AQHWvBO4hlySn5llrk6lgfFsXmzQpanMLQIAgABUtAA=
  • Thread-topic: [PATCH v3 3/3] xen/pci: solve compilation error on ARM with HAS_PCI enabled.

Hello Jan,

> On 17 Nov 2020, at 11:12 am, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
> On 16.11.2020 13:25, Rahul Singh wrote:
>> If mem-sharing, mem-paging, or log-dirty functionality is not enabled
>> for non-x86 architecture when HAS_PCI is enabled, the compiler will
>> throw an error.
>> 
>> Move code to x86 specific directory to fix compilation error.
> 
> Perhaps rather "file" than "directory”?
Ok.
> 
>> Also, modify the code to use likely() in place of unlikley() for each
>> condition to make code more optimized.
>> 
>> No functional change.
>> 
>> Signed-off-by: Rahul Singh <rahul.singh@xxxxxxx>
> 
> In principle I'm okay with this now, but there continue to be a few
> nits:

Thanks for reviewing the code I will fix all comments and will share the next 
version.
> 
>> --- a/xen/drivers/passthrough/x86/iommu.c
>> +++ b/xen/drivers/passthrough/x86/iommu.c
>> @@ -23,6 +23,7 @@
>> #include <asm/hvm/io.h>
>> #include <asm/io_apic.h>
>> #include <asm/setup.h>
>> +#include <xen/vm_event.h>
> 
> Please insert this alongside the other "#include <xen/...>" higher up.

Ok.
> 
>> @@ -315,6 +316,17 @@ int iommu_update_ire_from_msi(
>>            ? iommu_call(&iommu_ops, update_ire_from_msi, msi_desc, msg) : 0;
>> }
>> 
>> +bool arch_iommu_use_permitted(const struct domain *d)
>> +{
>> +    /*
>> +     * Prevent device assign if mem paging, mem sharing or log-dirty
>> +     * have been enabled for this domain.
>> +     */
>> +    return d == dom_io ||
>> +           (likely(!mem_sharing_enabled(d)) &&
>> +            likely(!vm_event_check_ring(d->vm_event_paging)) &&
>> +            likely(!p2m_get_hostp2m(d)->global_logdirty));
>> +}
>> /*
>>  * Local variables:
>>  * mode: C
> 
> Please don't alter stylistic aspects like this trailing comment
> being preceded by a blank line.

Ok.
> 
>> --- a/xen/include/xen/iommu.h
>> +++ b/xen/include/xen/iommu.h
>> @@ -381,6 +381,8 @@ DECLARE_PER_CPU(bool_t, iommu_dont_flush_iotlb);
>> extern struct spinlock iommu_pt_cleanup_lock;
>> extern struct page_list_head iommu_pt_cleanup_list;
>> 
>> +bool arch_iommu_use_permitted(const struct domain *d);
> 
> Just FTR - this way you effectively preclude an arch from
> making this a trivial static inline in one of its headers.
> 
> Jan


 


Rackspace

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