From patchwork Thu Dec 7 08:47:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13482953 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 979C4C4167B for ; Thu, 7 Dec 2023 08:48:17 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.649607.1014307 (Exim 4.92) (envelope-from ) id 1rBA3E-0004fc-2a; Thu, 07 Dec 2023 08:48:08 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 649607.1014307; Thu, 07 Dec 2023 08:48:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rBA3D-0004fV-Vv; Thu, 07 Dec 2023 08:48:07 +0000 Received: by outflank-mailman (input) for mailman id 649607; Thu, 07 Dec 2023 08:48:07 +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 1rBA3C-0004QV-VO for xen-devel@lists.xenproject.org; Thu, 07 Dec 2023 08:48:06 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 56230068-94dd-11ee-9b0f-b553b5be7939; Thu, 07 Dec 2023 09:48:05 +0100 (CET) Received: from Dell.bugseng.com (unknown [78.210.131.21]) by support.bugseng.com (Postfix) with ESMTPSA id A91F14EE073E; Thu, 7 Dec 2023 09:48:03 +0100 (CET) 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: 56230068-94dd-11ee-9b0f-b553b5be7939 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Wei Liu , Stefano Stabellini Subject: [XEN PATCH v2 1/5] x86/acpi: remove acpi_pic_sci_set_trigger() Date: Thu, 7 Dec 2023 09:47:50 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Remove apci_pic_set_trigger() declaration: there is no definition and there are no calls to such function in the XEN project. Signed-off-by: Federico Serafini Reviewed-by: Jan Beulich --- xen/arch/x86/include/asm/acpi.h | 1 - 1 file changed, 1 deletion(-) diff --git a/xen/arch/x86/include/asm/acpi.h b/xen/arch/x86/include/asm/acpi.h index 0df92d3714..48b1d69946 100644 --- a/xen/arch/x86/include/asm/acpi.h +++ b/xen/arch/x86/include/asm/acpi.h @@ -81,7 +81,6 @@ extern bool acpi_lapic, acpi_ioapic, acpi_noirq; extern bool acpi_force, acpi_ht, acpi_disabled; extern u32 acpi_smi_cmd; extern u8 acpi_enable_value, acpi_disable_value; -void acpi_pic_sci_set_trigger(unsigned int, u16); static inline void disable_acpi(void) { From patchwork Thu Dec 7 08:47:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13482956 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 0A2E2C4167B for ; Thu, 7 Dec 2023 08:48:21 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.649609.1014321 (Exim 4.92) (envelope-from ) id 1rBA3G-00050P-M8; Thu, 07 Dec 2023 08:48:10 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 649609.1014321; Thu, 07 Dec 2023 08:48:10 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rBA3G-0004zs-Hl; Thu, 07 Dec 2023 08:48:10 +0000 Received: by outflank-mailman (input) for mailman id 649609; Thu, 07 Dec 2023 08:48:09 +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 1rBA3F-0004QV-08 for xen-devel@lists.xenproject.org; Thu, 07 Dec 2023 08:48:09 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 56be460f-94dd-11ee-9b0f-b553b5be7939; Thu, 07 Dec 2023 09:48:06 +0100 (CET) Received: from Dell.bugseng.com (unknown [78.210.131.21]) by support.bugseng.com (Postfix) with ESMTPSA id 498F34EE073F; Thu, 7 Dec 2023 09:48:05 +0100 (CET) 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: 56be460f-94dd-11ee-9b0f-b553b5be7939 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Jan Beulich Subject: [XEN PATCH v2 2/5] xen/acpi: address violations of MISRA C:2012 Rule 8.2 Date: Thu, 7 Dec 2023 09:47:51 +0100 Message-Id: <47c08c496a403d60bbf5b18c7a079ac7a575efbc.1701936906.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Add missing parameter names. No functional change. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- Changes in v2: - do not add parameters to acpi_pic_sci_set_trigger() (removed). --- xen/include/acpi/apei.h | 5 +++-- xen/include/acpi/cpufreq/cpufreq.h | 2 +- xen/include/acpi/cpufreq/processor_perf.h | 16 ++++++++-------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/xen/include/acpi/apei.h b/xen/include/acpi/apei.h index eab16e2543..495819e362 100644 --- a/xen/include/acpi/apei.h +++ b/xen/include/acpi/apei.h @@ -12,8 +12,9 @@ #define FIX_APEI_RANGE_MAX 64 -typedef int (*apei_hest_func_t)(const struct acpi_hest_header *, void *); -int apei_hest_parse(apei_hest_func_t, void *); +typedef int (*apei_hest_func_t)(const struct acpi_hest_header *hest_hdr, + void *data); +int apei_hest_parse(apei_hest_func_t func, void *data); int erst_write(const struct cper_record_header *record); ssize_t erst_get_record_count(void); diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h index 3456d4c95f..b4685a9085 100644 --- a/xen/include/acpi/cpufreq/cpufreq.h +++ b/xen/include/acpi/cpufreq/cpufreq.h @@ -177,7 +177,7 @@ struct cpufreq_driver { extern struct cpufreq_driver cpufreq_driver; -int cpufreq_register_driver(const struct cpufreq_driver *); +int cpufreq_register_driver(const struct cpufreq_driver *driver_data); static inline void cpufreq_verify_within_limits(struct cpufreq_policy *policy, diff --git a/xen/include/acpi/cpufreq/processor_perf.h b/xen/include/acpi/cpufreq/processor_perf.h index 8b5a1b9bde..7cd2400619 100644 --- a/xen/include/acpi/cpufreq/processor_perf.h +++ b/xen/include/acpi/cpufreq/processor_perf.h @@ -10,16 +10,16 @@ int powernow_cpufreq_init(void); unsigned int powernow_register_driver(void); unsigned int get_measured_perf(unsigned int cpu, unsigned int flag); -void cpufreq_residency_update(unsigned int, uint8_t); -void cpufreq_statistic_update(unsigned int, uint8_t, uint8_t); -int cpufreq_statistic_init(unsigned int); -void cpufreq_statistic_exit(unsigned int); -void cpufreq_statistic_reset(unsigned int); +void cpufreq_residency_update(unsigned int cpu, uint8_t state); +void cpufreq_statistic_update(unsigned int cpu, uint8_t from, uint8_t to); +int cpufreq_statistic_init(unsigned int cpuid); +void cpufreq_statistic_exit(unsigned int cpuid); +void cpufreq_statistic_reset(unsigned int cpuid); -int cpufreq_limit_change(unsigned int); +int cpufreq_limit_change(unsigned int cpu); -int cpufreq_add_cpu(unsigned int); -int cpufreq_del_cpu(unsigned int); +int cpufreq_add_cpu(unsigned int cpu); +int cpufreq_del_cpu(unsigned int cpu); struct processor_performance { uint32_t state; From patchwork Thu Dec 7 08:47:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13482955 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 9EEB8C10F05 for ; Thu, 7 Dec 2023 08:48:19 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.649608.1014317 (Exim 4.92) (envelope-from ) id 1rBA3G-0004wb-CX; Thu, 07 Dec 2023 08:48:10 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 649608.1014317; Thu, 07 Dec 2023 08:48:10 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rBA3G-0004wR-7F; Thu, 07 Dec 2023 08:48:10 +0000 Received: by outflank-mailman (input) for mailman id 649608; Thu, 07 Dec 2023 08:48:09 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rBA3E-0004rG-V5 for xen-devel@lists.xenproject.org; Thu, 07 Dec 2023 08:48:08 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 57c55fe4-94dd-11ee-98e7-6d05b1d4d9a1; Thu, 07 Dec 2023 09:48:07 +0100 (CET) Received: from Dell.bugseng.com (unknown [78.210.131.21]) by support.bugseng.com (Postfix) with ESMTPSA id 537594EE0740; Thu, 7 Dec 2023 09:48:06 +0100 (CET) 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: 57c55fe4-94dd-11ee-98e7-6d05b1d4d9a1 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Wei Liu , Stefano Stabellini Subject: [XEN PATCH v2 3/5] x86/mm: remove compat_subarch_memory_op() Date: Thu, 7 Dec 2023 09:47:52 +0100 Message-Id: <285de0decf8ffe4277ce7e14a2561a693103f72b.1701936906.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Remove remove compat_subarch_memory_op() declaration: there is no definition and there are no calls to such function in the XEN project. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- xen/arch/x86/include/asm/mm.h | 1 - 1 file changed, 1 deletion(-) diff --git a/xen/arch/x86/include/asm/mm.h b/xen/arch/x86/include/asm/mm.h index 05dfe35502..639163948e 100644 --- a/xen/arch/x86/include/asm/mm.h +++ b/xen/arch/x86/include/asm/mm.h @@ -573,7 +573,6 @@ int __sync_local_execstate(void); long arch_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg); long subarch_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg); int compat_arch_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void)); -int compat_subarch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void)); #define NIL(type) ((type *)-sizeof(type)) #define IS_NIL(ptr) (!((uintptr_t)(ptr) + sizeof(*(ptr)))) From patchwork Thu Dec 7 08:47:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13482957 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 205ECC10DCE for ; Thu, 7 Dec 2023 08:48:22 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.649610.1014337 (Exim 4.92) (envelope-from ) id 1rBA3H-0005RA-UI; Thu, 07 Dec 2023 08:48:11 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 649610.1014337; Thu, 07 Dec 2023 08:48:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rBA3H-0005Q8-Qb; Thu, 07 Dec 2023 08:48:11 +0000 Received: by outflank-mailman (input) for mailman id 649610; Thu, 07 Dec 2023 08:48:10 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rBA3G-0004rG-5x for xen-devel@lists.xenproject.org; Thu, 07 Dec 2023 08:48:10 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 58bddff4-94dd-11ee-98e7-6d05b1d4d9a1; Thu, 07 Dec 2023 09:48:09 +0100 (CET) Received: from Dell.bugseng.com (unknown [78.210.131.21]) by support.bugseng.com (Postfix) with ESMTPSA id D048C4EE0741; Thu, 7 Dec 2023 09:48:07 +0100 (CET) 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: 58bddff4-94dd-11ee-98e7-6d05b1d4d9a1 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Wei Liu , Stefano Stabellini Subject: [XEN PATCH v2 4/5] x86/mm: address violations of MISRA C:2012 Rule 8.2 Date: Thu, 7 Dec 2023 09:47:53 +0100 Message-Id: <428b868a2b1aec2b50ccbe510bc3089203ac9c7b.1701936906.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Add missing parameter names. No functional change. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- Changes in v2: - do not add parameters to compat_subarch_memory_op() (removed). --- xen/arch/x86/include/asm/mm.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/xen/arch/x86/include/asm/mm.h b/xen/arch/x86/include/asm/mm.h index 639163948e..7d26d9cd2f 100644 --- a/xen/arch/x86/include/asm/mm.h +++ b/xen/arch/x86/include/asm/mm.h @@ -406,7 +406,7 @@ void put_page_type(struct page_info *page); int get_page_type(struct page_info *page, unsigned long type); int put_page_type_preemptible(struct page_info *page); int get_page_type_preemptible(struct page_info *page, unsigned long type); -int put_old_guest_table(struct vcpu *); +int put_old_guest_table(struct vcpu *v); int get_page_from_l1e( l1_pgentry_t l1e, struct domain *l1e_owner, struct domain *pg_owner); void put_page_from_l1e(l1_pgentry_t l1e, struct domain *l1e_owner); @@ -557,7 +557,7 @@ void audit_domains(void); void make_cr3(struct vcpu *v, mfn_t mfn); pagetable_t update_cr3(struct vcpu *v); -int vcpu_destroy_pagetables(struct vcpu *); +int vcpu_destroy_pagetables(struct vcpu *v); void *do_page_walk(struct vcpu *v, unsigned long addr); /* Allocator functions for Xen pagetables. */ @@ -572,19 +572,19 @@ int __sync_local_execstate(void); /* Arch-specific portion of memory_op hypercall. */ long arch_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg); long subarch_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg); -int compat_arch_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void)); +int compat_arch_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg); #define NIL(type) ((type *)-sizeof(type)) #define IS_NIL(ptr) (!((uintptr_t)(ptr) + sizeof(*(ptr)))) -int create_perdomain_mapping(struct domain *, unsigned long va, - unsigned int nr, l1_pgentry_t **, - struct page_info **); -void destroy_perdomain_mapping(struct domain *, unsigned long va, +int create_perdomain_mapping(struct domain *d, unsigned long va, + unsigned int nr, l1_pgentry_t **pl1tab, + struct page_info **ppg); +void destroy_perdomain_mapping(struct domain *d, unsigned long va, unsigned int nr); -void free_perdomain_mappings(struct domain *); +void free_perdomain_mappings(struct domain *d); -void __iomem *ioremap_wc(paddr_t, size_t); +void __iomem *ioremap_wc(paddr_t pa, size_t len); extern int memory_add(unsigned long spfn, unsigned long epfn, unsigned int pxm); From patchwork Thu Dec 7 08:47:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13482958 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 C623BC10DC3 for ; Thu, 7 Dec 2023 08:48:22 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.649611.1014347 (Exim 4.92) (envelope-from ) id 1rBA3J-0005jp-7Z; Thu, 07 Dec 2023 08:48:13 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 649611.1014347; Thu, 07 Dec 2023 08:48:13 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rBA3J-0005ix-3g; Thu, 07 Dec 2023 08:48:13 +0000 Received: by outflank-mailman (input) for mailman id 649611; Thu, 07 Dec 2023 08:48:12 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rBA3I-0004rG-5q for xen-devel@lists.xenproject.org; Thu, 07 Dec 2023 08:48:12 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 59f5b252-94dd-11ee-98e7-6d05b1d4d9a1; Thu, 07 Dec 2023 09:48:11 +0100 (CET) Received: from Dell.bugseng.com (unknown [78.210.131.21]) by support.bugseng.com (Postfix) with ESMTPSA id 7AF714EE073F; Thu, 7 Dec 2023 09:48:09 +0100 (CET) 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: 59f5b252-94dd-11ee-98e7-6d05b1d4d9a1 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Jan Beulich , Andrew Cooper , Stefano Stabellini Subject: [XEN PATCH v2 5/5] AMD/IOMMU: address violations of MISRA C:2012 Rule 8.2 Date: Thu, 7 Dec 2023 09:47:54 +0100 Message-Id: <68a1922cce9a68a8b69661d564fccc012cf5f414.1701936906.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Add missing parameter names to address violations of MISRA C:2012 Rule 8.2. Remove trailing spaces and use C standard types to comply with XEN coding style. No functional change. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- Changes in v2: - use "enable" instead of "iommu_control" as parameter name. --- xen/drivers/passthrough/amd/iommu.h | 17 ++++++++++------- xen/drivers/passthrough/amd/iommu_init.c | 24 ++++++++++++++---------- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/xen/drivers/passthrough/amd/iommu.h b/xen/drivers/passthrough/amd/iommu.h index d4416ebc43..1b62c083ba 100644 --- a/xen/drivers/passthrough/amd/iommu.h +++ b/xen/drivers/passthrough/amd/iommu.h @@ -138,10 +138,12 @@ struct ivrs_mappings { extern unsigned int ivrs_bdf_entries; extern u8 ivhd_type; -struct ivrs_mappings *get_ivrs_mappings(u16 seg); -int iterate_ivrs_mappings(int (*)(u16 seg, struct ivrs_mappings *)); -int iterate_ivrs_entries(int (*)(const struct amd_iommu *, - struct ivrs_mappings *, uint16_t)); +struct ivrs_mappings *get_ivrs_mappings(uint16_t seg); +int iterate_ivrs_mappings(int (*handler)(uint16_t seg, + struct ivrs_mappings *map)); +int iterate_ivrs_entries(int (*handler)(const struct amd_iommu *iommu, + struct ivrs_mappings *map, + uint16_t bdf)); /* iommu tables in guest space */ struct mmio_reg { @@ -226,7 +228,7 @@ struct acpi_ivrs_hardware; /* amd-iommu-detect functions */ int amd_iommu_get_ivrs_dev_entries(void); int amd_iommu_get_supported_ivhd_type(void); -int amd_iommu_detect_one_acpi(const struct acpi_ivrs_hardware *); +int amd_iommu_detect_one_acpi(const struct acpi_ivrs_hardware *ivhd_block); int amd_iommu_detect_acpi(void); void get_iommu_features(struct amd_iommu *iommu); @@ -295,9 +297,10 @@ struct amd_iommu *find_iommu_for_device(int seg, int bdf); bool cf_check iov_supports_xt(void); int amd_iommu_setup_ioapic_remapping(void); void *amd_iommu_alloc_intremap_table( - const struct amd_iommu *, unsigned long **, unsigned int nr); + const struct amd_iommu *iommu, unsigned long **inuse_map, unsigned int nr); int cf_check amd_iommu_free_intremap_table( - const struct amd_iommu *, struct ivrs_mappings *, uint16_t); + const struct amd_iommu *iommu, struct ivrs_mappings *ivrs_mapping, + uint16_t bdf); unsigned int amd_iommu_intremap_table_order( const void *irt, const struct amd_iommu *iommu); void cf_check amd_iommu_ioapic_update_ire( diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthrough/amd/iommu_init.c index 5515cb70fd..25e62f20ae 100644 --- a/xen/drivers/passthrough/amd/iommu_init.c +++ b/xen/drivers/passthrough/amd/iommu_init.c @@ -300,12 +300,13 @@ static void cf_check set_iommu_ppr_log_control( static int iommu_read_log(struct amd_iommu *iommu, struct ring_buffer *log, unsigned int entry_size, - void (*parse_func)(struct amd_iommu *, u32 *)) + void (*parse_func)(struct amd_iommu *iommu, + uint32_t *entry)) { unsigned int tail, tail_offest, head_offset; BUG_ON(!iommu || ((log != &iommu->event_log) && (log != &iommu->ppr_log))); - + spin_lock(&log->lock); /* make sure there's an entry in the log */ @@ -361,14 +362,15 @@ static int iommu_read_log(struct amd_iommu *iommu, out: spin_unlock(&log->lock); - + return 0; } /* reset event log or ppr log when overflow */ static void iommu_reset_log(struct amd_iommu *iommu, struct ring_buffer *log, - void (*ctrl_func)(struct amd_iommu *iommu, bool)) + void (*ctrl_func)(struct amd_iommu *iommu, + bool enable)) { unsigned int entry, run_bit, loop_count = 1000; bool log_run; @@ -1158,14 +1160,15 @@ static void __init amd_iommu_init_cleanup(void) iommuv2_enabled = 0; } -struct ivrs_mappings *get_ivrs_mappings(u16 seg) +struct ivrs_mappings *get_ivrs_mappings(uint16_t seg) { return radix_tree_lookup(&ivrs_maps, seg); } -int iterate_ivrs_mappings(int (*handler)(u16 seg, struct ivrs_mappings *)) +int iterate_ivrs_mappings(int (*handler)(uint16_t seg, + struct ivrs_mappings *map)) { - u16 seg = 0; + uint16_t seg = 0; int rc = 0; do { @@ -1180,10 +1183,11 @@ int iterate_ivrs_mappings(int (*handler)(u16 seg, struct ivrs_mappings *)) return rc; } -int iterate_ivrs_entries(int (*handler)(const struct amd_iommu *, - struct ivrs_mappings *, uint16_t bdf)) +int iterate_ivrs_entries(int (*handler)(const struct amd_iommu *iommu, + struct ivrs_mappings *map, + uint16_t bdf)) { - u16 seg = 0; + uint16_t seg = 0; int rc = 0; do {