xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Rahul Singh <Rahul.Singh@arm.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: Julien Grall <julien@xen.org>,
	xen-devel <xen-devel@lists.xenproject.org>,
	Bertrand Marquis <Bertrand.Marquis@arm.com>,
	Jan Beulich <jbeulich@suse.com>, Paul Durrant <paul@xen.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Ian Jackson <iwj@xenproject.org>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>
Subject: Re: [PATCH 2/2] xen/pci: Gate all MSI code in common code with CONFIG_HAS_PCI_MSI
Date: Wed, 7 Apr 2021 17:52:26 +0000	[thread overview]
Message-ID: <6593B520-538C-4422-80BA-DDDEBC2724E5@arm.com> (raw)
In-Reply-To: <YGyFLIp8Ld0RjcoI@Air-de-Roger>

Hi,

> On 6 Apr 2021, at 4:58 pm, Roger Pau Monné <roger.pau@citrix.com> wrote:
> 
> On Tue, Apr 06, 2021 at 04:09:34PM +0100, Julien Grall wrote:
>> 
>> 
>> On 06/04/2021 15:59, Roger Pau Monné wrote:
>>> On Tue, Apr 06, 2021 at 03:30:01PM +0100, Julien Grall wrote:
>>>> So I think we want to be able to compile out the code if not used. That
>>>> said, I think providing stub would be better to avoid multiple #ifdef in the
>>>> same function.
>>> 
>>> I think providing stubs is the way to go, that should allow to remove
>>> the unneeded code without having to explicitly drop MSI support. As
>>> said before, I think it's fine to provide those unimplemented for Arm
>>> ATM, can be filled later if there's more pressing PCI work to do
>>> first.
>> 
>> We should remove unneeded and *avoid* allocation. Providing stub for
>> existing functions will only address the first problem.
>> 
>> For the allocation (see alloc_pdev()) , we will need to move it in separate
>> function and gate them to prevent the allocation.
>> 
>> It would be wrong to gate the code with #ifdef CONFIG_X86. So I think
>> Rahul's idea to provide the new #ifdef is correct.
> 
> I think all this needs to be in the commit message then, because from
> my reading of the current message it seems like MSI code is only
> removed because MSI support is not implemented on Arm, rather than Arm
> not requiring such strict tracking of MSI accesses and MSI interrupt
> setup. Likely the naming of the option needs to be adjusted also
> together with the reduction of it's scope to stuff that explicitly
> needs to be removed in the preprocessor opposed to adding arch
> specific stubs.
>  


Thanks everyone for reviewing the code.

MSI related code in the "passthrough/pci.c” file is not useful for ARM when MSI interrupts are injected
via GICv3 ITS and at the same time there is no plan to support MSI interrupts for ARM without GICv3
ITS that's why I thought it is ok to compile out the code with the new kconfig option.

I didn’t realize that HAS_PCI_MSI option will not work for x68 if someone disables the HAS_PCI_MSI option for X86. 
I was under the impression that MSI functionality always be enabled for x86.

I also agree that having too many #ifdef in the code is not good as it makes code harder to read.
I will try to modify the code to add a stub version of the unneeded code for Arm and will send the next version of the patch.
I will also modify the commit message accordingly.

Regards,
Rahul

> 
> Thanks, Roger.


  reply	other threads:[~2021-04-07 17:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-06 11:39 [PATCH 0/2] xen/pci: Make PCI passthrough code non-x86 specific Rahul Singh
2021-04-06 11:39 ` [PATCH 1/2] xen/pci: Move PCI ATS code to common directory Rahul Singh
2021-04-06 15:16   ` Jan Beulich
2021-04-06 11:39 ` [PATCH 2/2] xen/pci: Gate all MSI code in common code with CONFIG_HAS_PCI_MSI Rahul Singh
2021-04-06 14:13   ` Roger Pau Monné
2021-04-06 14:30     ` Julien Grall
2021-04-06 14:59       ` Roger Pau Monné
2021-04-06 15:09         ` Julien Grall
2021-04-06 15:58           ` Roger Pau Monné
2021-04-07 17:52             ` Rahul Singh [this message]
2021-04-06 15:25       ` Jan Beulich
2021-04-07 18:06         ` Julien Grall
2021-04-08  6:00           ` Jan Beulich
2021-04-08  8:45             ` 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=6593B520-538C-4422-80BA-DDDEBC2724E5@arm.com \
    --to=rahul.singh@arm.com \
    --cc=Bertrand.Marquis@arm.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=julien@xen.org \
    --cc=paul@xen.org \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    --subject='Re: [PATCH 2/2] xen/pci: Gate all MSI code in common code with CONFIG_HAS_PCI_MSI' \
    /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

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