[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: Rahul Singh <rahul.singh@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 20 Aug 2021 09:01:08 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=fDMFeztG2YFrgSsFOaTBP3sTriRUsScYBM23J+zzJ88=; b=FpZkkPvD63PIUrN51s8mmVyX7X0X1v3DHT3qbFCXhRFWUnt+5zPvKrd9IfbMFe8g1ySG/b7C408aGgOkeKJ/IOgKEFuIF/RoISD7pLca3b5Gaa7xzTpahCA3008Il5cLqDrmIv8RqExmANjQC1qq9+0O3tiCamsXQvZU71TTQi4RkIECckSq4HYmH96SjjPhg3OVl64lyrJsHZZrBjwbNF1z5h80hJ1T5v1lcDFwLlscTwjM2JdVY5ItfaYxw/vbjCZsJ6JXRh5DV4H3AcW4DF3qVGhArKY3W0J32xISfft05kdYyFB75SG9FWj/pjkwp657iaaI8JGopC/uaQHUWw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hkB9iegY34WyNHGZwtIpf0MXTRCW6tM4RrNeRDnRA9DArcgvG20ixm6PFEOTX9za2Ce7XOAce1kBDF8E/vz+BvTaQU8i4+zocFQdNwnQEls8uDEU874XDAvXMj3YKRJgh6Qx/xICfqJ9+qe4oeoyF60U0Vay3s3a2FbL2q935D9kyXgjRE5l4kYoGxlu1+rEYb5gvh/pe0Wr0y8iGrqp+IR/fRDuJb3WZ57GlXSImqlGgrXPQSr2HKU28dZ9oCbgnB5Owqk+U8fKGOrkRqEW5BW3Y/acxpU3ov2Gtt4r7R1pzAgiDlWWn2aCbSm9eQu+8MdyaTluu0JJqbRoTX9hVg==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: bertrand.marquis@xxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 20 Aug 2021 07:01:33 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.

> +{                                                                           \
> +    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.

Jan




 


Rackspace

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