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

Re: [PATCH v1 02/14] xen/pci: solve compilation error on ARM with HAS_PCI enabled


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Rahul Singh <Rahul.Singh@xxxxxxx>
  • Date: Fri, 20 Aug 2021 11:21:20 +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=GWwoyQDVbWoc1gV197GUIo3AFzui+JZogHS6GLjkp+4=; b=EgBVyjLJoY1jNfbf0MQDeB+Hg6/Ou6xDsgUbm/IOsLz/sKmy3WDGAyh3W0dH/S4fmzrg61jo4IC35DxeRc7x2ZKwPk+STYCyrtu8AXB/4x6ggNMXX4yEGvixDBBmcL3NW9fAPQBkexIEbD0WPV7PqsIAymKcIdJszopUPtMP2Bm0WFDym4N+PlmaUwvZdQJxB3bepZSf8drJIa2aV7FkEXLlPMV1SCMhP3PMsdO5YlodDd6s82nFIGPwdD/XbyIyWBsF++baQFoVAw/YlnzTpE0ATetmr6q5nKIHrxM7Ig7qOd9Hdi1UoR5LLbpjpGrUu6hci9oapmVM+0/PNXnfpQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TASW4qHSXawr3nqwpJ23dlY8DZTO1lXk+7De626JV4xwV/e1VSiYVJDcd3DXmpFvIJlFnFFOeMiIyCqn/MDavB5rvj9OxV8ahkH9qZsdUgKJAIYl2m2Wo1QEZWBATGNaTCRo8cCdVxcsFzFryi0T35reSd59lJWE5jyVV1mcpwnpb1MinxEeRSx8ufHq0+0ZtBTZAu7mNBx/9rSTJn/f5+r+66UyZQpRYjGy+2qebIwiencXdGTNSdiWYR4A6a7tDSWNX4MDxn0itDZCXm43aMY6ydAlZNttKXkt6mls8qH02zBw0X3ZjL4KpXAxuZTl9kW2KLRiMijP+U76MpOziw==
  • Authentication-results-original: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=arm.com;
  • Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 20 Aug 2021 11:21:37 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHXlPJ69O5DKvBqZU6v8IxjA4iLvqt7+GgAgABIsYA=
  • Thread-topic: [PATCH v1 02/14] xen/pci: solve compilation error on ARM with HAS_PCI enabled

Hi Jan

> On 20 Aug 2021, at 8:01 am, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
> On 19.08.2021 14:02, Rahul Singh wrote:
>> Compilation error is observed when HAS_PCI is enabled for ARM
>> architecture.
>> 
>> Add definition for arch_iommu_use_permitted() and
>> arch_pci_clean_pirqs().Implement dummy functions for pci_conf_read*() to
>> fix compilation error.
>> 
>> pci.c: In function ‘deassign_device’:
>> pci.c:849:49: error: implicit declaration of function ‘pci_to_dev’;
>> did you mean ‘dt_to_dev’? [-Werror=implicit-function-declaration]
>>            pci_to_dev(pdev));
>> 
>> pci.c:18: undefined reference to `pci_conf_read16’
>> pci.c:880: undefined reference to `arch_pci_clean_pirqs’
>> pci.c:1392: undefined reference to `arch_iommu_use_permitted'
>> 
>> Signed-off-by: Rahul Singh <rahul.singh@xxxxxxx>
> 
> A couple of nits, notwithstanding Julien's more general concern:
> 
>> --- /dev/null
>> +++ b/xen/arch/arm/pci/pci-access.c
>> @@ -0,0 +1,61 @@
>> +/*
>> + * Copyright (C) 2021 Arm Ltd.
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License version 2 as
>> + * published by the Free Software Foundation.
>> + *
>> + * This program is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> + * GNU General Public License for more details.
>> + *
>> + * You should have received a copy of the GNU General Public License
>> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
>> + */
>> +
>> +#include <xen/pci.h>
>> +
>> +static uint32_t pci_config_read(pci_sbdf_t sbdf, unsigned int reg,
>> +                                unsigned int len)
>> +{
>> +    return ~0U;
>> +}
>> +
>> +static void pci_config_write(pci_sbdf_t sbdf, unsigned int reg,
>> +                             unsigned int len, uint32_t val)
>> +{
>> +}
>> +
>> +/*
>> + * Wrappers for all PCI configuration access functions.
>> + */
>> +
>> +#define PCI_OP_WRITE(size, type)                                            
>> \
>> +    void pci_conf_write##size (pci_sbdf_t sbdf,unsigned int reg, type val)  
>> \
> 
> One of the two blanks preceding the backslash wants to move after the first
> comma. And the blank preceding the opening parenthesis wants to be dropped.

I will modify as below . Please correct me if I misunderstood wrongly.

#define PCI_OP_WRITE(size, type)                            \                   
    void pci_conf_write##size(pci_sbdf_t sbdf,              \                   
                              unsigned int reg, type val)            \          
         
{                                                                               
     \                   
    pci_config_write(sbdf, reg, size / 8, val);                   \             
      
}

> 
>> +{                                                                           
>> \
>> +    pci_config_write(sbdf, reg, size / 8, val);                             
>> \
>> +}
>> +
>> +#define PCI_OP_READ(size, type)                                             
>> \
>> +    type pci_conf_read##size (pci_sbdf_t sbdf, unsigned int reg)            
>> \
> 
> The latter of the two applies here as well.
> 
>> +{                                                                           
>> \
>> +    return pci_config_read(sbdf, reg, size / 8);                            
>> \
>> +}
>> +
>> +PCI_OP_READ(8, u8)
>> +PCI_OP_READ(16, u16)
>> +PCI_OP_READ(32, u32)
>> +PCI_OP_WRITE(8, u8)
>> +PCI_OP_WRITE(16, u16)
>> +PCI_OP_WRITE(32, u32)
> 
> We aim at eliminating u<N> uses in favor of uint<N>_t - please don't
> introduce new uses.

Ok . I will modify in next version.

Regards,
Rahul
> 
> Jan


 


Rackspace

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