xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien@xen.org>
To: Jan Beulich <jbeulich@suse.com>, Rahul Singh <Rahul.Singh@arm.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	"Bertrand Marquis" <Bertrand.Marquis@arm.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Wei Liu" <wl@xen.org>,
	"George Dunlap" <george.dunlap@citrix.com>,
	"Ian Jackson" <iwj@xenproject.org>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Paul Durrant" <paul@xen.org>,
	"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
	"Daniel De Graaf" <dgdegra@tycho.nsa.gov>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH v2] xen/pci: Refactor PCI MSI interrupts related code
Date: Mon, 19 Apr 2021 12:54:46 +0100	[thread overview]
Message-ID: <0d5539e3-32e3-8275-f695-351eda49cb29@xen.org> (raw)
In-Reply-To: <a365ffbd-5b88-85c3-9e68-46a9a730a6fa@suse.com>



On 19/04/2021 12:16, Jan Beulich wrote:
> On 19.04.2021 10:40, Roger Pau Monné wrote:
>> On Mon, Apr 19, 2021 at 07:16:52AM +0000, Rahul Singh wrote:
>>> Thanks you everyone for reviewing the code. I will summarise what I have understood from all the comments
>>> and what I will be doing for the next version of the patch.  Please let me know your view on this.
>>>
>>> 1. Create a separate non-arch specific file "msi-intercept.c"  for the below newly introduced function and
>>>      compile that file if CONFIG_PCI_MSI_INTERCEPT is enabled.CONFIG_PCI_MSI_INTERCEPT  will  be
>>>      enabled for x86 by default.
> 
> Everything up to here wants to be separate from ...
> 
>>> Also Mention in the commit message that these function will be needed for Xen to
>>>      support MSI interrupt within XEN.
>>>
>>> 	pdev_msi_initi(..)
>>> 	pdev_msi_deiniti(..)
> 
> ... this (if all of these functions really are needed beyond the
> purpose of intercepting MSI accesses).
> 
>> I would drop the last 'i' from both function names above, as we use
>> init/deinit in the rest of the code base.
> 
> +1
> 
>>> 	pdev_dump_msi(..),
>>> 	pdev_msix_assign(..)
>>>
>>> 2. Create separate patch for iommu_update_ire_from_msi() related code. There are two suggestion please help me which one to choose.
>>>   
>>>       - Move the iommu_update_ire_from_msi() function to asm-x86/iommu.h and also move the hook from iommu_ops under CONFIG_X86.
>>
>> I would go for this one.
> 
> Strictly speaking this isn't x86-specific and hence shouldn't move there.
> It merely depends on whether full MSI support is wanted by an arch. 

As I pointed out before, Arm doesn't use the IOMMU to setup the MSIs. So 
the naming and using an IOMMU callback is definitely wrong for Arm.

> I'd
> therefore guard the declaration by an #ifdef (if needed at all - have a
> declaration without implementation isn't really that problematic). For
> the definition question is going to be whether you introduce another new
> file for the pdev_*() functions above. If not, #ifdef may again be better
> than moving to an x86-specific file.
AFAIK, this helper is only called by x86 specific code and it will not 
be used as-is by Arm.

I can't tell for other arch (e.g RISCv, PowerPC). However... we can take 
the decision to move the code back to common back when it is necessary.

For the time being, I think move this code in x86 is a lot better than 
#ifdef or keep the code in common code.

Cheers,

-- 
Julien Grall


  reply	other threads:[~2021-04-19 11:55 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09 16:00 [PATCH v2] xen/pci: Refactor PCI MSI interrupts related code Rahul Singh
2021-04-12 10:49 ` Roger Pau Monné
2021-04-12 11:28   ` Jan Beulich
2021-04-12 18:26     ` Rahul Singh
2021-04-12 16:28   ` Rahul Singh
2021-04-13 17:12   ` Julien Grall
2021-04-14  7:08     ` Jan Beulich
2021-04-14  8:28       ` Roger Pau Monné
2021-04-14  8:47         ` Jan Beulich
2021-04-14  8:28       ` Julien Grall
2021-04-14  8:05     ` Roger Pau Monné
2021-04-14  8:49       ` Julien Grall
2021-04-15 13:26         ` Roger Pau Monné
2021-04-15 13:31           ` Julien Grall
2021-04-19  7:16             ` Rahul Singh
2021-04-19  8:40               ` Roger Pau Monné
2021-04-19 11:16                 ` Jan Beulich
2021-04-19 11:54                   ` Julien Grall [this message]
2021-04-19 12:33                     ` Jan Beulich
2021-04-20 13:45                       ` Rahul Singh
2021-04-20 15:36                         ` Jan Beulich
2021-04-21  8:07                           ` Rahul Singh
2021-04-21  8:16                             ` Roger Pau Monné
2021-04-21  9:15                               ` Rahul Singh
2021-04-21  9:33                                 ` Jan Beulich
2021-04-21 11:55                                   ` Rahul Singh
2021-04-21  9:32                               ` Jan Beulich
2021-04-21  9:01                             ` Jan Beulich

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=0d5539e3-32e3-8275-f695-351eda49cb29@xen.org \
    --to=julien@xen.org \
    --cc=Bertrand.Marquis@arm.com \
    --cc=Rahul.Singh@arm.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=george.dunlap@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=jbeulich@suse.com \
    --cc=paul@xen.org \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).