Hi,

> On 6 Apr 2021, at 4:58 pm, Roger Pau Monné <roger....@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 via email to