From patchwork Fri Jul 28 14:12:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13331978 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 63CC2C001DE for ; Fri, 28 Jul 2023 14:12:30 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.571474.895416 (Exim 4.92) (envelope-from ) id 1qPOCV-0002Ai-JB; Fri, 28 Jul 2023 14:12:15 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 571474.895416; Fri, 28 Jul 2023 14:12:15 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qPOCV-0002Ab-EJ; Fri, 28 Jul 2023 14:12:15 +0000 Received: by outflank-mailman (input) for mailman id 571474; Fri, 28 Jul 2023 14:12:13 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qPOCT-0002AV-Kd for xen-devel@lists.xenproject.org; Fri, 28 Jul 2023 14:12:13 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id be6e510e-2d50-11ee-8613-37d641c3527e; Fri, 28 Jul 2023 16:12:11 +0200 (CEST) Received: from Dell.bugseng.com (unknown [37.163.4.37]) by support.bugseng.com (Postfix) with ESMTPSA id F26BB4EE073F; Fri, 28 Jul 2023 16:12:09 +0200 (CEST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: be6e510e-2d50-11ee-8613-37d641c3527e From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Jan Beulich , Paul Durrant , =?utf-8?q?Rog?= =?utf-8?q?er_Pau_Monn=C3=A9?= , Stefano Stabellini , Michal Orzel , Xenia Ragiadakou , Ayan Kumar Halder Subject: [XEN PATCH] IOMMU: address violations of MISRA C:2012 Rules 8.2 and 8.3 Date: Fri, 28 Jul 2023 16:12:02 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Give a name to unnamed parameters to address violations of MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with named parameters"). Keep consistency between parameter names and types used in function declarations and the ones used in the corresponding function definitions, thus addressing violations of MISRA C:2012 Rule 8.3 ("All declarations of an object or function shall use the same names and type qualifiers"). No functional changes. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- xen/drivers/passthrough/iommu.c | 10 +++++----- xen/include/xen/iommu.h | 30 ++++++++++++++++-------------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c index 0e187f6ae3..7bbe3889a2 100644 --- a/xen/drivers/passthrough/iommu.c +++ b/xen/drivers/passthrough/iommu.c @@ -25,10 +25,10 @@ unsigned int __read_mostly iommu_dev_iotlb_timeout = 1000; integer_param("iommu_dev_iotlb_timeout", iommu_dev_iotlb_timeout); -bool_t __initdata iommu_enable = 1; -bool_t __read_mostly iommu_enabled; -bool_t __read_mostly force_iommu; -bool_t __read_mostly iommu_verbose; +bool __initdata iommu_enable = 1; +bool __read_mostly iommu_enabled; +bool __read_mostly force_iommu; +bool __read_mostly iommu_verbose; static bool_t __read_mostly iommu_crash_disable; #define IOMMU_quarantine_none 0 /* aka false */ @@ -57,7 +57,7 @@ int8_t __hwdom_initdata iommu_hwdom_reserved = -1; bool __read_mostly iommu_hap_pt_share = true; #endif -bool_t __read_mostly iommu_debug; +bool __read_mostly iommu_debug; DEFINE_PER_CPU(bool_t, iommu_dont_flush_iotlb); diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h index 405db59971..8c0818cd01 100644 --- a/xen/include/xen/iommu.h +++ b/xen/include/xen/iommu.h @@ -52,7 +52,7 @@ static inline bool_t dfn_eq(dfn_t x, dfn_t y) } #ifdef CONFIG_HAS_PASSTHROUGH -extern bool_t iommu_enable, iommu_enabled; +extern bool iommu_enable, iommu_enabled; extern bool force_iommu, iommu_verbose; /* Boolean except for the specific purposes of drivers/passthrough/iommu.c. */ extern uint8_t iommu_quarantine; @@ -108,8 +108,8 @@ static inline void clear_iommu_hap_pt_share(void) #endif } -extern bool_t iommu_debug; -extern bool_t amd_iommu_perdev_intremap; +extern bool iommu_debug; +extern bool amd_iommu_perdev_intremap; extern bool iommu_hwdom_strict, iommu_hwdom_passthrough, iommu_hwdom_inclusive; extern int8_t iommu_hwdom_reserved; @@ -165,10 +165,10 @@ enum * values indicate partial completion, which is possible only with * IOMMUF_preempt passed in. */ -long __must_check iommu_map(struct domain *d, dfn_t dfn, mfn_t mfn, +long __must_check iommu_map(struct domain *d, dfn_t dfn0, mfn_t mfn0, unsigned long page_count, unsigned int flags, unsigned int *flush_flags); -long __must_check iommu_unmap(struct domain *d, dfn_t dfn, +long __must_check iommu_unmap(struct domain *d, dfn_t dfn0, unsigned long page_count, unsigned int flags, unsigned int *flush_flags); @@ -197,11 +197,13 @@ bool_t iommu_has_feature(struct domain *d, enum iommu_feature feature); #ifdef CONFIG_HAS_PCI struct pirq; -int hvm_do_IRQ_dpci(struct domain *, struct pirq *); -int pt_irq_create_bind(struct domain *, const struct xen_domctl_bind_pt_irq *); -int pt_irq_destroy_bind(struct domain *, const struct xen_domctl_bind_pt_irq *); +int hvm_do_IRQ_dpci(struct domain *d, struct pirq *pirq); +int pt_irq_create_bind(struct domain *d, + const struct xen_domctl_bind_pt_irq *pt_irq_bind); +int pt_irq_destroy_bind(struct domain *d, + const struct xen_domctl_bind_pt_irq *pt_irq_bind); -struct hvm_irq_dpci *domain_get_irq_dpci(const struct domain *); +struct hvm_irq_dpci *domain_get_irq_dpci(const struct domain *d); void free_hvm_irq_dpci(struct hvm_irq_dpci *dpci); struct msi_desc; @@ -229,8 +231,8 @@ int iommu_release_dt_devices(struct domain *d); */ int iommu_add_dt_device(struct dt_device_node *np); -int iommu_do_dt_domctl(struct xen_domctl *, struct domain *, - XEN_GUEST_HANDLE_PARAM(xen_domctl_t)); +int iommu_do_dt_domctl(struct xen_domctl *domctl, struct domain *d, + XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl); #endif /* HAS_DEVICE_TREE */ @@ -386,12 +388,12 @@ static inline int iommu_do_domctl(struct xen_domctl *domctl, struct domain *d, int __must_check iommu_suspend(void); void iommu_resume(void); void iommu_crash_shutdown(void); -int iommu_get_reserved_device_memory(iommu_grdm_t *, void *); +int iommu_get_reserved_device_memory(iommu_grdm_t *func, void *ctxt); int iommu_quarantine_dev_init(device_t *dev); #ifdef CONFIG_HAS_PCI -int iommu_do_pci_domctl(struct xen_domctl *, struct domain *d, - XEN_GUEST_HANDLE_PARAM(xen_domctl_t)); +int iommu_do_pci_domctl(struct xen_domctl *domctl, struct domain *d, + XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl); #endif void iommu_dev_iotlb_flush_timeout(struct domain *d, struct pci_dev *pdev);