All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Rahul Singh <rahul.singh@arm.com>
Cc: bertrand.marquis@arm.com, Paul Durrant <paul@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v3 3/3] xen/pci: solve compilation error on ARM with HAS_PCI enabled.
Date: Tue, 17 Nov 2020 12:12:48 +0100	[thread overview]
Message-ID: <fe73928e-bf95-234d-c181-4904a13ad0a1@suse.com> (raw)
In-Reply-To: <efa0c2578a6aabb642b8f38257cf96a983944301.1605527997.git.rahul.singh@arm.com>

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"?

> 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@arm.com>

In principle I'm okay with this now, but there continue to be a few
nits:

> --- 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.

> @@ -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.

> --- 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


  reply	other threads:[~2020-11-17 11:13 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-16 12:25 [PATCH v3 0/3] xen/arm: Make PCI passthrough code non-x86 specific Rahul Singh
2020-11-16 12:25 ` [PATCH v3 1/3] xen/ns16550: Make ns16550 driver usable on ARM with HAS_PCI enabled Rahul Singh
2020-11-17  1:11   ` Stefano Stabellini
2020-11-17 10:55   ` Jan Beulich
2020-11-18 15:02     ` Rahul Singh
2020-11-18 15:16       ` Jan Beulich
2020-11-18 15:35         ` Julien Grall
2020-11-19  8:56           ` Jan Beulich
2020-11-19  9:00           ` Jan Beulich
2020-11-19  9:45             ` Julien Grall
2020-11-18 15:50   ` Julien Grall
2020-11-19  9:05     ` Jan Beulich
2020-11-19  9:21       ` Julien Grall
2020-11-19  9:53         ` Jan Beulich
2020-11-19 10:16           ` Julien Grall
2020-11-19 15:54             ` Rahul Singh
2020-11-19 16:22               ` Jan Beulich
2020-11-19 23:37               ` Stefano Stabellini
2020-11-19 23:50                 ` Julien Grall
2020-11-20  0:14                   ` Stefano Stabellini
2020-11-23 11:54                     ` Rahul Singh
2020-11-23 13:19                       ` Jan Beulich
2020-11-23 22:38                         ` Stefano Stabellini
2020-11-23 17:13                     ` Julien Grall
2020-11-24  9:47                       ` Jan Beulich
2020-11-24 10:22                         ` Julien Grall
2020-11-24 10:49                           ` Jan Beulich
2020-11-16 12:25 ` [PATCH v3 2/3] xen/pci: Move x86 specific code to x86 directory Rahul Singh
2020-11-17  1:20   ` Stefano Stabellini
2020-11-17  9:49     ` Rahul Singh
2020-11-17 11:03   ` Jan Beulich
2020-11-17 16:52     ` Rahul Singh
2020-11-16 12:25 ` [PATCH v3 3/3] xen/pci: solve compilation error on ARM with HAS_PCI enabled Rahul Singh
2020-11-17 11:12   ` Jan Beulich [this message]
2020-11-17 16:15     ` Rahul Singh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fe73928e-bf95-234d-c181-4904a13ad0a1@suse.com \
    --to=jbeulich@suse.com \
    --cc=bertrand.marquis@arm.com \
    --cc=paul@xen.org \
    --cc=rahul.singh@arm.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.