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

Re: [PATCH 2/2] xen/pci: Gate all MSI code in common code with CONFIG_HAS_PCI_MSI


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Rahul Singh <Rahul.Singh@xxxxxxx>
  • Date: Wed, 7 Apr 2021 17:52:26 +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=yioT2oQUvK5WvIuU4k+PjiO2PwemmBYLpnx//Kj+fKE=; b=oDSU6If+nJp8EOiIaxKDPD7ZnzU3C691RqNqRCP1+LqlQjMA1aBpoPGBDU8diX04+8r9is9pb76QxuFasGtliyNzEpJt8yjOQzy0gL6qBrpxHErjTVzu2Abk0tgja+20sdRh3AdadgAay7L8oiUl5J46fYidxNB1j5EbMg7a0ZrNttSyEfsvLaWMlHmUW4Zuw/kyEk60bfuNulNVLgKph8IDCWKFyAoKBAbtng6swWijO6QfSjX45LhhNQGCASa5ibdpkHudjli6x4REeCxOWEWvuTzDFNbHo3nf8Ze/Qtes5ALgNC74S/zyzk5J8dnQqgEgrVwuHlUOsgnPbujiQA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GvnqEiPAtLisednMN/7O66n81SMnE6CZtw+dpy551h3fM3vFgTQq2zzgg05m2m54XQ1u9h3JldZgIIO3Bbiq+27dfkaL9PyMUgmI7ZmoI0vPALY9r3mT2cIAs0HfvPaVcnNKfMEX2LI5nA/yuh5FS1Mn3WQtfL+2H9hJEBYzt9/r9F3jzXQ0u5/A9uv0QecKJJGuTv7MJ5x29QmgDG9qIex4IfShb76tzysSBvTOgxPwSKatXXA/kAmUsqk+wOQsaYmVZCwoNFaSt5TEnup8GJSjII5kE+U3yNWAVgXEFQ+o91o3BmQJegC2mT0PoJ0SSjGj2WcH1lLn3kl7Ux3jug==
  • Authentication-results-original: citrix.com; dkim=none (message not signed) header.d=none;citrix.com; dmarc=none action=none header.from=arm.com;
  • Cc: Julien Grall <julien@xxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
  • Delivery-date: Wed, 07 Apr 2021 17:53:13 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: citrix.com; dkim=none (message not signed) header.d=none;citrix.com; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHXKtnMgQfSb5EUJ0m5ImZxjYO+aaqniEaAgAAErYCAAAg4AIAAAtUAgAANswCAAbIjAA==
  • Thread-topic: [PATCH 2/2] xen/pci: Gate all MSI code in common code with CONFIG_HAS_PCI_MSI

Hi,

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


 


Rackspace

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