From nobody Wed May 15 21:21:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1692276027591474.12302793528477; Thu, 17 Aug 2023 05:40:27 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.585374.916461 (Exim 4.92) (envelope-from ) id 1qWcI9-0000KZ-9v; Thu, 17 Aug 2023 12:39:57 +0000 Received: by outflank-mailman (output) from mailman id 585374.916461; Thu, 17 Aug 2023 12:39:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qWcI9-0000KS-6q; Thu, 17 Aug 2023 12:39:57 +0000 Received: by outflank-mailman (input) for mailman id 585374; Thu, 17 Aug 2023 12:39:55 +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 1qWcI7-0000KB-EJ for xen-devel@lists.xenproject.org; Thu, 17 Aug 2023 12:39:55 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 2a74b0ea-3cfb-11ee-877b-cb3800f73035; Thu, 17 Aug 2023 14:39:54 +0200 (CEST) Received: from nico.bugseng.com (unknown [147.123.100.131]) by support.bugseng.com (Postfix) with ESMTPSA id 2C7E54EE073C; Thu, 17 Aug 2023 14:39:53 +0200 (CEST) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 2a74b0ea-3cfb-11ee-877b-cb3800f73035 From: Nicola Vetrini To: xen-devel@lists.xenproject.org Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, consulting@bugseng.com, Nicola Vetrini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk , Tamas K Lengyel , Alexandru Isaila , Petre Pircalabu , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu Subject: [XEN PATCH v2 1/3] vm_event: rework inclusions to use arch-indipendent header Date: Thu, 17 Aug 2023 14:39:26 +0200 Message-Id: <6ef8207eee081e2c9a3914a14025077fc72b19e6.1692275359.git.nicola.vetrini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1692276030667100003 Content-Type: text/plain; charset="utf-8" The arch-specific header should be included by the common header , so that the latter can be included in the source files. This also resolves violations of MISRA C:2012 Rule 8.4 that were caused by declarations for 'vm_event_{fill_regs,set_registers,monitor_next_interrupt}' in not being visible when defining functions in 'xen/arch/x86/vm_event.c' Signed-off-by: Nicola Vetrini Reviewed-by: Stefano Stabellini --- Changes in v2: - Include the arch-specific header in the common one, and only include the latter in source files. The following functions have been mainly touched by the following commits, but the present commit does not solve a problem introduced by one of them p= er se, except perhaps the first one mentioned, which is why I didn't put a = Fixes tag in this v2: - 975efd3baa8d ("introduce VM_EVENT_FLAG_SET_REGISTERS") - adc75eba8b15 ("x86/vm_event: consolidate hvm_event_fill_regs and p2m_vm_e= vent_fill_regs") - 9864841914c2 ("x86/vm_event: add support for VM_EVENT_REASON_INTERRUPT") --- xen/arch/arm/include/asm/vm_event.h | 1 - xen/arch/arm/vm_event.c | 2 +- xen/arch/x86/vm_event.c | 2 +- xen/include/xen/vm_event.h | 1 + 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xen/arch/arm/include/asm/vm_event.h b/xen/arch/arm/include/asm= /vm_event.h index abe7db1970ca..4d861373b38d 100644 --- a/xen/arch/arm/include/asm/vm_event.h +++ b/xen/arch/arm/include/asm/vm_event.h @@ -20,7 +20,6 @@ #define __ASM_ARM_VM_EVENT_H__ =20 #include -#include #include =20 static inline int vm_event_init_domain(struct domain *d) diff --git a/xen/arch/arm/vm_event.c b/xen/arch/arm/vm_event.c index ba99f56eb20c..ccfd25bbbca9 100644 --- a/xen/arch/arm/vm_event.c +++ b/xen/arch/arm/vm_event.c @@ -8,7 +8,7 @@ */ =20 #include -#include +#include =20 void vm_event_fill_regs(vm_event_request_t *req) { diff --git a/xen/arch/x86/vm_event.c b/xen/arch/x86/vm_event.c index 7027c08a926b..e6c7ad5337dd 100644 --- a/xen/arch/x86/vm_event.c +++ b/xen/arch/x86/vm_event.c @@ -20,7 +20,7 @@ =20 #include #include -#include +#include =20 /* Implicitly serialized by the domctl lock. */ int vm_event_init_domain(struct domain *d) diff --git a/xen/include/xen/vm_event.h b/xen/include/xen/vm_event.h index 92811d9110e5..9a86358b42ae 100644 --- a/xen/include/xen/vm_event.h +++ b/xen/include/xen/vm_event.h @@ -25,6 +25,7 @@ =20 #include #include +#include =20 struct vm_event_domain { --=20 2.34.1 From nobody Wed May 15 21:21:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1692276027155919.1286287096054; Thu, 17 Aug 2023 05:40:27 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.585376.916475 (Exim 4.92) (envelope-from ) id 1qWcIA-0000Z2-34; Thu, 17 Aug 2023 12:39:58 +0000 Received: by outflank-mailman (output) from mailman id 585376.916475; Thu, 17 Aug 2023 12:39:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qWcI9-0000Xg-Sj; Thu, 17 Aug 2023 12:39:57 +0000 Received: by outflank-mailman (input) for mailman id 585376; Thu, 17 Aug 2023 12:39:56 +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 1qWcI8-0000KH-OJ for xen-devel@lists.xenproject.org; Thu, 17 Aug 2023 12:39:56 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 2af64e13-3cfb-11ee-9b0c-b553b5be7939; Thu, 17 Aug 2023 14:39:55 +0200 (CEST) Received: from nico.bugseng.com (unknown [147.123.100.131]) by support.bugseng.com (Postfix) with ESMTPSA id 384034EE073D; Thu, 17 Aug 2023 14:39:54 +0200 (CEST) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 2af64e13-3cfb-11ee-9b0c-b553b5be7939 From: Nicola Vetrini To: xen-devel@lists.xenproject.org Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, consulting@bugseng.com, Nicola Vetrini , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Julien Grall , Jan Beulich , Andrew Cooper , George Dunlap , Wei Liu Subject: [XEN PATCH v2 2/3] vpci/msix: make 'get_slot' static Date: Thu, 17 Aug 2023 14:39:27 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1692276030069100001 Content-Type: text/plain; charset="utf-8" The function can become static since it's used only within this file. This also resolves a violation of MISRA C:2012 Rule 8.4 due to the absence of a declaration before the function definition. Fixes: b177892d2d0e ("vpci/msix: handle accesses adjacent to the MSI-X tabl= e") Signed-off-by: Nicola Vetrini Reviewed-by: Stefano Stabellini Reviewed-by: Roger Pau Monn=C3=A9 --- Changes in v2: - Corrected wrong prefix in the commit subject. CC-ing maintainers from "THE REST" as well, perhaps this trivial change can= go in straight away. --- xen/drivers/vpci/msix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c index 25bde77586a4..f9df506f29bf 100644 --- a/xen/drivers/vpci/msix.c +++ b/xen/drivers/vpci/msix.c @@ -223,7 +223,7 @@ static void __iomem *get_table(const struct vpci *vpci,= unsigned int slot) return msix->table[slot]; } -unsigned int get_slot(const struct vpci *vpci, unsigned long addr) +static unsigned int get_slot(const struct vpci *vpci, unsigned long addr) { unsigned long pfn =3D PFN_DOWN(addr); -- 2.34.1 From nobody Wed May 15 21:21:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1692276033342732.5112936840113; Thu, 17 Aug 2023 05:40:33 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.585377.916492 (Exim 4.92) (envelope-from ) id 1qWcIB-00013C-8g; Thu, 17 Aug 2023 12:39:59 +0000 Received: by outflank-mailman (output) from mailman id 585377.916492; Thu, 17 Aug 2023 12:39:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qWcIB-000133-4d; Thu, 17 Aug 2023 12:39:59 +0000 Received: by outflank-mailman (input) for mailman id 585377; Thu, 17 Aug 2023 12:39:57 +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 1qWcI9-0000KH-OT for xen-devel@lists.xenproject.org; Thu, 17 Aug 2023 12:39:57 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 2b84098b-3cfb-11ee-9b0c-b553b5be7939; Thu, 17 Aug 2023 14:39:56 +0200 (CEST) Received: from nico.bugseng.com (unknown [147.123.100.131]) by support.bugseng.com (Postfix) with ESMTPSA id 183814EE073A; Thu, 17 Aug 2023 14:39:55 +0200 (CEST) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 2b84098b-3cfb-11ee-9b0c-b553b5be7939 From: Nicola Vetrini To: xen-devel@lists.xenproject.org Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, consulting@bugseng.com, Nicola Vetrini , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu , George Dunlap , Julien Grall Subject: [XEN PATCH v2 3/3] drivers/video: make declarations of defined functions available Date: Thu, 17 Aug 2023 14:39:28 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1692276035300100001 Content-Type: text/plain; charset="utf-8" The declarations for 'vesa_{init,early_init,endboot}' needed by 'xen/drivers/video/vesa.c' and 'fill_console_start_info' in 'vga.c' are now available by moving the relative code inside 'vga.h'. The latter is moved from 'xen/console.h' because of its close relation with= vga. This also resolves violations of MISRA C:2012 Rule 8.4. Fixes: 6d9199bd0f22 ("x86-64: enable hypervisor output on VESA frame buffer= ") Signed-off-by: Nicola Vetrini --- Changes in v2: - Moved fill_console_start_info to vga.h (21bee1787021 introduced this function) --- xen/arch/x86/include/asm/setup.h | 6 ------ xen/arch/x86/platform_hypercall.c | 2 +- xen/arch/x86/pv/dom0_build.c | 2 +- xen/drivers/video/vga.c | 8 -------- xen/include/xen/console.h | 2 -- xen/include/xen/vga.h | 16 ++++++++++++++++ 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/xen/arch/x86/include/asm/setup.h b/xen/arch/x86/include/asm/se= tup.h index b0e6a39e2365..dfdd9e555149 100644 --- a/xen/arch/x86/include/asm/setup.h +++ b/xen/arch/x86/include/asm/setup.h @@ -25,12 +25,6 @@ void subarch_init_memory(void); void init_IRQ(void); -#ifdef CONFIG_VIDEO -void vesa_init(void); -#else -static inline void vesa_init(void) {}; -#endif - int construct_dom0( struct domain *d, const module_t *image, unsigned long image_headroom, diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hype= rcall.c index 9ff2da8fc324..9469de9045c7 100644 --- a/xen/arch/x86/platform_hypercall.c +++ b/xen/arch/x86/platform_hypercall.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -24,6 +23,7 @@ #include #include #include +#include #include #include #include diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c index 909ee9a899a4..5bbed3a36a21 100644 --- a/xen/arch/x86/pv/dom0_build.c +++ b/xen/arch/x86/pv/dom0_build.c @@ -4,7 +4,6 @@ * Copyright (c) 2002-2005, K A Fraser */ -#include #include #include #include @@ -13,6 +12,7 @@ #include #include #include +#include #include #include diff --git a/xen/drivers/video/vga.c b/xen/drivers/video/vga.c index 0a03508bee60..18b590cdf072 100644 --- a/xen/drivers/video/vga.c +++ b/xen/drivers/video/vga.c @@ -54,14 +54,6 @@ string_param("vga", opt_vga); static unsigned int columns, lines; #define ATTRIBUTE 7 -#ifdef CONFIG_X86 -void vesa_early_init(void); -void vesa_endboot(bool_t keep); -#else -#define vesa_early_init() ((void)0) -#define vesa_endboot(x) ((void)0) -#endif - void __init video_init(void) { char *p; diff --git a/xen/include/xen/console.h b/xen/include/xen/console.h index 53c56191ba9e..ab5c30c0daf2 100644 --- a/xen/include/xen/console.h +++ b/xen/include/xen/console.h @@ -20,8 +20,6 @@ void console_init_postirq(void); void console_endboot(void); int console_has(const char *device); -int fill_console_start_info(struct dom0_vga_console_info *); - unsigned long console_lock_recursive_irqsave(void); void console_unlock_recursive_irqrestore(unsigned long flags); void console_force_unlock(void); diff --git a/xen/include/xen/vga.h b/xen/include/xen/vga.h index f72b63d446b1..1d53f0149433 100644 --- a/xen/include/xen/vga.h +++ b/xen/include/xen/vga.h @@ -15,4 +15,20 @@ extern struct xen_vga_console_info vga_console_info; #endif +int fill_console_start_info(struct dom0_vga_console_info *); + +#ifdef CONFIG_X86 +void vesa_early_init(void); +void vesa_endboot(bool_t keep); +#else +#define vesa_early_init() ((void)0) +#define vesa_endboot(x) ((void)0) +#endif + +#ifdef CONFIG_VIDEO +void vesa_init(void); +#else +static inline void vesa_init(void) {}; +#endif + #endif /* _XEN_VGA_H */ -- 2.34.1