From nobody Sun May 19 23:41:31 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 1697722831473721.0277673447233; Thu, 19 Oct 2023 06:40:31 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.619340.964246 (Exim 4.92) (envelope-from ) id 1qtTG2-00087l-Hh; Thu, 19 Oct 2023 13:40:14 +0000 Received: by outflank-mailman (output) from mailman id 619340.964246; Thu, 19 Oct 2023 13:40:14 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qtTG2-00085p-E0; Thu, 19 Oct 2023 13:40:14 +0000 Received: by outflank-mailman (input) for mailman id 619340; Thu, 19 Oct 2023 13:40:13 +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 1qtTG1-0007zm-Rt for xen-devel@lists.xenproject.org; Thu, 19 Oct 2023 13:40:13 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 0769bdd0-6e85-11ee-98d5-6d05b1d4d9a1; Thu, 19 Oct 2023 15:40:13 +0200 (CEST) Received: from nico.bugseng.com (unknown [147.123.100.131]) by support.bugseng.com (Postfix) with ESMTPSA id 8DE5C4EE0740; Thu, 19 Oct 2023 15:40:11 +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: 0769bdd0-6e85-11ee-98d5-6d05b1d4d9a1 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, jbeulich@suse.com, andrew.cooper3@citrix.com, roger.pau@citrix.com, Nicola Vetrini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk , George Dunlap , Wei Liu Subject: [XEN PATCH][for-4.19 v3 1/8] xen: add declarations for variables where needed Date: Thu, 19 Oct 2023 15:39:59 +0200 Message-Id: <4d419cbffc84e0f9934794d105705ac64094a54a.1697722648.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: 1697722832952100001 Content-Type: text/plain; charset="utf-8" Some variables with external linkage used in C code do not have a visible declaration where they are defined. Providing such declaration also resolves violations of MISRA C:2012 Rule 8.4. Signed-off-by: Nicola Vetrini Reviewed-by: Stefano Stabellini --- Changes in v2: - make xenpf_lock static on ARM Changes in v3: - moved back code from symbols.h to symbols.c - dropped two declarations, now deviated --- xen/arch/arm/include/asm/setup.h | 3 +++ xen/arch/arm/include/asm/smp.h | 3 +++ xen/arch/arm/platform_hypercall.c | 2 +- xen/arch/x86/cpu/mcheck/mce.c | 6 +++--- xen/arch/x86/irq.c | 2 +- xen/include/xen/symbols.h | 1 + 6 files changed, 12 insertions(+), 5 deletions(-) diff --git a/xen/arch/arm/include/asm/setup.h b/xen/arch/arm/include/asm/se= tup.h index 98af6f55f5a0..2a2d6114f2eb 100644 --- a/xen/arch/arm/include/asm/setup.h +++ b/xen/arch/arm/include/asm/setup.h @@ -184,9 +184,12 @@ int map_range_to_domain(const struct dt_device_node *d= ev, extern lpae_t boot_pgtable[XEN_PT_LPAE_ENTRIES]; =20 #ifdef CONFIG_ARM_64 +extern lpae_t boot_first[XEN_PT_LPAE_ENTRIES]; extern lpae_t boot_first_id[XEN_PT_LPAE_ENTRIES]; #endif +extern lpae_t boot_second[XEN_PT_LPAE_ENTRIES]; extern lpae_t boot_second_id[XEN_PT_LPAE_ENTRIES]; +extern lpae_t boot_third[XEN_PT_LPAE_ENTRIES * XEN_NR_ENTRIES(2)]; extern lpae_t boot_third_id[XEN_PT_LPAE_ENTRIES]; =20 /* Find where Xen will be residing at runtime and return a PT entry */ diff --git a/xen/arch/arm/include/asm/smp.h b/xen/arch/arm/include/asm/smp.h index 4fabdf5310d8..28bf24a01d95 100644 --- a/xen/arch/arm/include/asm/smp.h +++ b/xen/arch/arm/include/asm/smp.h @@ -6,6 +6,9 @@ #include #endif =20 +extern struct init_info init_data; +extern unsigned long smp_up_cpu; + DECLARE_PER_CPU(cpumask_var_t, cpu_sibling_mask); DECLARE_PER_CPU(cpumask_var_t, cpu_core_mask); =20 diff --git a/xen/arch/arm/platform_hypercall.c b/xen/arch/arm/platform_hype= rcall.c index 743687a30390..fde4bc3e5809 100644 --- a/xen/arch/arm/platform_hypercall.c +++ b/xen/arch/arm/platform_hypercall.c @@ -17,7 +17,7 @@ #include #include =20 -DEFINE_SPINLOCK(xenpf_lock); +static DEFINE_SPINLOCK(xenpf_lock); =20 long do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op) { diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c index 6141b7eb9cf1..e855f958030d 100644 --- a/xen/arch/x86/cpu/mcheck/mce.c +++ b/xen/arch/x86/cpu/mcheck/mce.c @@ -1682,13 +1682,13 @@ long do_mca(XEN_GUEST_HANDLE_PARAM(xen_mc_t) u_xen_= mc) return ret; } =20 -int mcinfo_dumpped; +static int mcinfo_dumped; static int cf_check x86_mcinfo_dump_panic(mctelem_cookie_t mctc) { struct mc_info *mcip =3D mctelem_dataptr(mctc); =20 x86_mcinfo_dump(mcip); - mcinfo_dumpped++; + mcinfo_dumped++; =20 return 0; } @@ -1702,7 +1702,7 @@ static void mc_panic_dump(void) for_each_online_cpu(cpu) mctelem_process_deferred(cpu, x86_mcinfo_dump_panic, mctelem_has_deferred_lmce(cpu)); - dprintk(XENLOG_ERR, "End dump mc_info, %x mcinfo dumped\n", mcinfo_dum= pped); + dprintk(XENLOG_ERR, "End dump mc_info, %x mcinfo dumped\n", mcinfo_dum= ped); } =20 void mc_panic(const char *s) diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c index 6abfd8162120..604dba94b052 100644 --- a/xen/arch/x86/irq.c +++ b/xen/arch/x86/irq.c @@ -43,7 +43,7 @@ int __read_mostly opt_irq_vector_map =3D OPT_IRQ_VECTOR_M= AP_DEFAULT; static unsigned char __read_mostly irq_max_guests; integer_param("irq-max-guests", irq_max_guests); =20 -vmask_t global_used_vector_map; +static vmask_t global_used_vector_map; =20 struct irq_desc __read_mostly *irq_desc =3D NULL; =20 diff --git a/xen/include/xen/symbols.h b/xen/include/xen/symbols.h index 20bbb28ef226..1b2863663aa0 100644 --- a/xen/include/xen/symbols.h +++ b/xen/include/xen/symbols.h @@ -33,4 +33,5 @@ struct symbol_offset { uint32_t stream; /* .. in the compressed stream.*/ uint32_t addr; /* .. and in the fixed size address array. */ }; + #endif /*_XEN_SYMBOLS_H*/ --=20 2.34.1 From nobody Sun May 19 23:41:31 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 1697722841217852.2539723122258; Thu, 19 Oct 2023 06:40:41 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.619341.964260 (Exim 4.92) (envelope-from ) id 1qtTG5-0008W3-Oo; Thu, 19 Oct 2023 13:40:17 +0000 Received: by outflank-mailman (output) from mailman id 619341.964260; Thu, 19 Oct 2023 13:40:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qtTG5-0008Vw-M5; Thu, 19 Oct 2023 13:40:17 +0000 Received: by outflank-mailman (input) for mailman id 619341; Thu, 19 Oct 2023 13:40:16 +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 1qtTG4-0008Uq-EP for xen-devel@lists.xenproject.org; Thu, 19 Oct 2023 13:40:16 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 08465909-6e85-11ee-9b0e-b553b5be7939; Thu, 19 Oct 2023 15:40:14 +0200 (CEST) Received: from nico.bugseng.com (unknown [147.123.100.131]) by support.bugseng.com (Postfix) with ESMTPSA id 4CE9E4EE0741; Thu, 19 Oct 2023 15:40:13 +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: 08465909-6e85-11ee-9b0e-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, jbeulich@suse.com, andrew.cooper3@citrix.com, roger.pau@citrix.com, Nicola Vetrini , Wei Liu Subject: [XEN PATCH][for-4.19 v3 2/8] x86: add deviations for variables only used in asm code Date: Thu, 19 Oct 2023 15:40:00 +0200 Message-Id: <3d4c3f6a1a62acc6c625f32448862a8be47b05aa.1697722648.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: 1697722843219100001 Content-Type: text/plain; charset="utf-8" To avoid a violation of MISRA C:2012 Rule 8.4, as permitted by docs/misra/rules.rst. Signed-off-by: Nicola Vetrini Reviewed-by: Stefano Stabellini --- Changes in v3: - Edited commit message - Add two new variables --- xen/arch/x86/include/asm/asm_defns.h | 1 + xen/arch/x86/setup.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/include/asm/asm_defns.h b/xen/arch/x86/include/as= m/asm_defns.h index baaaccb26e17..a2516de7749b 100644 --- a/xen/arch/x86/include/asm/asm_defns.h +++ b/xen/arch/x86/include/asm/asm_defns.h @@ -31,6 +31,7 @@ asm ( "\t.equ CONFIG_INDIRECT_THUNK, " * gets set up by the containing function. */ #ifdef CONFIG_FRAME_POINTER +/* SAF-1-safe */ register unsigned long current_stack_pointer asm("rsp"); # define ASM_CALL_CONSTRAINT , "+r" (current_stack_pointer) #else diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 08ba1f95d635..4480f08de718 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -75,6 +75,7 @@ static bool __initdata opt_invpcid =3D true; boolean_param("invpcid", opt_invpcid); bool __read_mostly use_invpcid; =20 +/* SAF-1-safe Only used in asm code and within this source file */ unsigned long __read_mostly cr4_pv32_mask; =20 /* **** Linux config option: propagated to domain0. */ @@ -147,12 +148,13 @@ cpumask_t __read_mostly cpu_present_map; unsigned long __read_mostly xen_phys_start; =20 char __section(".init.bss.stack_aligned") __aligned(STACK_SIZE) - cpu0_stack[STACK_SIZE]; + cpu0_stack[STACK_SIZE]; /* SAF-1-safe Only used in asm code and below = */ =20 /* Used by the BSP/AP paths to find the higher half stack mapping to use. = */ void *stack_start =3D cpu0_stack + STACK_SIZE - sizeof(struct cpu_info); =20 /* Used by the boot asm to stash the relocated multiboot info pointer. */ +/* SAF-1-safe */ unsigned int __initdata multiboot_ptr; =20 struct cpuinfo_x86 __read_mostly boot_cpu_data =3D { 0, 0, 0, 0, -1 }; --=20 2.34.1 From nobody Sun May 19 23:41:31 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 1697722843957233.37699451907702; Thu, 19 Oct 2023 06:40:43 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.619343.964272 (Exim 4.92) (envelope-from ) id 1qtTG6-0000FM-Hb; Thu, 19 Oct 2023 13:40:18 +0000 Received: by outflank-mailman (output) from mailman id 619343.964272; Thu, 19 Oct 2023 13:40:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qtTG6-0000E1-An; Thu, 19 Oct 2023 13:40:18 +0000 Received: by outflank-mailman (input) for mailman id 619343; Thu, 19 Oct 2023 13:40:17 +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 1qtTG5-0008Uq-3n for xen-devel@lists.xenproject.org; Thu, 19 Oct 2023 13:40:17 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 08cbf97f-6e85-11ee-9b0e-b553b5be7939; Thu, 19 Oct 2023 15:40:15 +0200 (CEST) Received: from nico.bugseng.com (unknown [147.123.100.131]) by support.bugseng.com (Postfix) with ESMTPSA id 85C4A4EE0744; Thu, 19 Oct 2023 15:40:14 +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: 08cbf97f-6e85-11ee-9b0e-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, jbeulich@suse.com, andrew.cooper3@citrix.com, roger.pau@citrix.com, Nicola Vetrini , Wei Liu , Jun Nakajima , Kevin Tian Subject: [XEN PATCH][for-4.19 v3 3/8] x86: add deviation comments for asm-only functions Date: Thu, 19 Oct 2023 15:40:01 +0200 Message-Id: <2e7d4a55c3b6c317fd00e8ce32f992af423193f1.1697722648.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: 1697722844961100004 Content-Type: text/plain; charset="utf-8" As stated in rules.rst, functions used only in asm code are allowed to have no prior declaration visible when being defined, hence these functions are deviated. This also fixes violations of MISRA C:2012 Rule 8.4. Signed-off-by: Nicola Vetrini Reviewed-by: Stefano Stabellini --- Changes in v3: - added SAF deviations for vmx counterparts to svm functions. --- xen/arch/x86/hvm/svm/intr.c | 1 + xen/arch/x86/hvm/svm/nestedsvm.c | 1 + xen/arch/x86/hvm/svm/svm.c | 2 ++ xen/arch/x86/hvm/vmx/intr.c | 1 + xen/arch/x86/hvm/vmx/vmx.c | 2 ++ xen/arch/x86/hvm/vmx/vvmx.c | 1 + xen/arch/x86/traps.c | 1 + xen/arch/x86/x86_64/traps.c | 1 + 8 files changed, 10 insertions(+) diff --git a/xen/arch/x86/hvm/svm/intr.c b/xen/arch/x86/hvm/svm/intr.c index 192e17ebbfbb..bd9dc560bbc6 100644 --- a/xen/arch/x86/hvm/svm/intr.c +++ b/xen/arch/x86/hvm/svm/intr.c @@ -123,6 +123,7 @@ static void svm_enable_intr_window(struct vcpu *v, stru= ct hvm_intack intack) vmcb, general1_intercepts | GENERAL1_INTERCEPT_VINTR); } =20 +/* SAF-1-safe */ void svm_intr_assist(void) { struct vcpu *v =3D current; diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nested= svm.c index a09b6abaaeaf..c80d59e0728e 100644 --- a/xen/arch/x86/hvm/svm/nestedsvm.c +++ b/xen/arch/x86/hvm/svm/nestedsvm.c @@ -1441,6 +1441,7 @@ nestedsvm_vcpu_vmexit(struct vcpu *v, struct cpu_user= _regs *regs, } =20 /* VCPU switch */ +/* SAF-1-safe */ void nsvm_vcpu_switch(void) { struct cpu_user_regs *regs =3D guest_cpu_user_regs(); diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index 24c417ca7199..40ba69bcdfa1 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -1056,6 +1056,7 @@ static void noreturn cf_check svm_do_resume(void) reset_stack_and_jump(svm_asm_do_resume); } =20 +/* SAF-1-safe */ void svm_vmenter_helper(void) { const struct cpu_user_regs *regs =3D guest_cpu_user_regs(); @@ -2586,6 +2587,7 @@ const struct hvm_function_table * __init start_svm(vo= id) return &svm_function_table; } =20 +/* SAF-1-safe */ void svm_vmexit_handler(void) { struct cpu_user_regs *regs =3D guest_cpu_user_regs(); diff --git a/xen/arch/x86/hvm/vmx/intr.c b/xen/arch/x86/hvm/vmx/intr.c index fd719c4c01d2..1805aafb086d 100644 --- a/xen/arch/x86/hvm/vmx/intr.c +++ b/xen/arch/x86/hvm/vmx/intr.c @@ -224,6 +224,7 @@ void vmx_sync_exit_bitmap(struct vcpu *v) } } =20 +/* SAF-1-safe */ void vmx_intr_assist(void) { struct hvm_intack intack; diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index 1edc7f1e919f..0936a263154e 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -4035,6 +4035,7 @@ static void undo_nmis_unblocked_by_iret(void) guest_info | VMX_INTR_SHADOW_NMI); } =20 +/* SAF-1-safe */ void vmx_vmexit_handler(struct cpu_user_regs *regs) { unsigned long exit_qualification, exit_reason, idtv_info, intr_info = =3D 0; @@ -4787,6 +4788,7 @@ static void lbr_fixup(void) } =20 /* Returns false if the vmentry has to be restarted */ +/* SAF-1-safe */ bool vmx_vmenter_helper(const struct cpu_user_regs *regs) { struct vcpu *curr =3D current; diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c index 16b0ef82b6c8..99d93b869307 100644 --- a/xen/arch/x86/hvm/vmx/vvmx.c +++ b/xen/arch/x86/hvm/vmx/vvmx.c @@ -1490,6 +1490,7 @@ static void nvmx_eptp_update(void) __vmwrite(EPT_POINTER, get_shadow_eptp(curr)); } =20 +/* SAF-1-safe */ void nvmx_switch_guest(void) { struct vcpu *v =3D current; diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index e1356f696aba..6af35a468199 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -2265,6 +2265,7 @@ void asm_domain_crash_synchronous(unsigned long addr) } =20 #ifdef CONFIG_DEBUG +/* SAF-1-safe */ void check_ist_exit(const struct cpu_user_regs *regs, bool ist_exit) { const unsigned int ist_mask =3D diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c index e03e80813e36..5963d26d7848 100644 --- a/xen/arch/x86/x86_64/traps.c +++ b/xen/arch/x86/x86_64/traps.c @@ -266,6 +266,7 @@ void show_page_walk(unsigned long addr) l1_table_offset(addr), l1e_get_intpte(l1e), pfn); } =20 +/* SAF-1-safe */ void do_double_fault(struct cpu_user_regs *regs) { unsigned int cpu; --=20 2.34.1 From nobody Sun May 19 23:41:31 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 169772283668874.81029584145222; Thu, 19 Oct 2023 06:40:36 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.619342.964264 (Exim 4.92) (envelope-from ) id 1qtTG6-00008j-3N; Thu, 19 Oct 2023 13:40:18 +0000 Received: by outflank-mailman (output) from mailman id 619342.964264; Thu, 19 Oct 2023 13:40:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qtTG5-00007p-Vk; Thu, 19 Oct 2023 13:40:17 +0000 Received: by outflank-mailman (input) for mailman id 619342; Thu, 19 Oct 2023 13:40:16 +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 1qtTG4-0007zm-Ij for xen-devel@lists.xenproject.org; Thu, 19 Oct 2023 13:40:16 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 091312dd-6e85-11ee-98d5-6d05b1d4d9a1; Thu, 19 Oct 2023 15:40:15 +0200 (CEST) Received: from nico.bugseng.com (unknown [147.123.100.131]) by support.bugseng.com (Postfix) with ESMTPSA id 4C4634EE0745; Thu, 19 Oct 2023 15:40:15 +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: 091312dd-6e85-11ee-98d5-6d05b1d4d9a1 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, jbeulich@suse.com, andrew.cooper3@citrix.com, roger.pau@citrix.com, Nicola Vetrini , Wei Liu Subject: [XEN PATCH][for-4.19 v3 4/8] x86/grant: switch included header to make declarations visible Date: Thu, 19 Oct 2023 15:40:02 +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: 1697722836957100001 Content-Type: text/plain; charset="utf-8" The declarations for {create,replace}_grant_p2m_mapping are not visible when these functions are defined, therefore the right header needs to be included to allow them to be visible. Signed-off-by: Nicola Vetrini Reviewed-by: Stefano Stabellini --- Changes in v3: - asm/paging.h can be replaced with mm-frame.h, because just the definition of mfn_t is needed. --- xen/arch/x86/hvm/grant_table.c | 3 +-- xen/arch/x86/include/asm/hvm/grant_table.h | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/hvm/grant_table.c b/xen/arch/x86/hvm/grant_table.c index 30d51d54a949..afe449d8882c 100644 --- a/xen/arch/x86/hvm/grant_table.c +++ b/xen/arch/x86/hvm/grant_table.c @@ -9,8 +9,7 @@ =20 #include =20 -#include - +#include #include =20 int create_grant_p2m_mapping(uint64_t addr, mfn_t frame, diff --git a/xen/arch/x86/include/asm/hvm/grant_table.h b/xen/arch/x86/incl= ude/asm/hvm/grant_table.h index 33c1da1a25f3..01e23f79b8cf 100644 --- a/xen/arch/x86/include/asm/hvm/grant_table.h +++ b/xen/arch/x86/include/asm/hvm/grant_table.h @@ -10,6 +10,8 @@ #ifndef __X86_HVM_GRANT_TABLE_H__ #define __X86_HVM_GRANT_TABLE_H__ =20 +#include + #ifdef CONFIG_HVM =20 int create_grant_p2m_mapping(uint64_t addr, mfn_t frame, --=20 2.34.1 From nobody Sun May 19 23:41:31 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 169772284454456.72520515096869; Thu, 19 Oct 2023 06:40:44 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.619344.964288 (Exim 4.92) (envelope-from ) id 1qtTG7-0000k0-R6; Thu, 19 Oct 2023 13:40:19 +0000 Received: by outflank-mailman (output) from mailman id 619344.964288; Thu, 19 Oct 2023 13:40:19 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qtTG7-0000in-LI; Thu, 19 Oct 2023 13:40:19 +0000 Received: by outflank-mailman (input) for mailman id 619344; Thu, 19 Oct 2023 13:40:18 +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 1qtTG6-0008Uq-Hn for xen-devel@lists.xenproject.org; Thu, 19 Oct 2023 13:40:18 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 09c2f7b5-6e85-11ee-9b0e-b553b5be7939; Thu, 19 Oct 2023 15:40:17 +0200 (CEST) Received: from nico.bugseng.com (unknown [147.123.100.131]) by support.bugseng.com (Postfix) with ESMTPSA id 00F094EE0746; Thu, 19 Oct 2023 15:40:15 +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: 09c2f7b5-6e85-11ee-9b0e-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, jbeulich@suse.com, andrew.cooper3@citrix.com, roger.pau@citrix.com, Nicola Vetrini , Tamas K Lengyel , Alexandru Isaila , Petre Pircalabu , Wei Liu Subject: [XEN PATCH][for-4.19 v3 5/8] x86/vm_event: add missing include for hvm_vm_event_do_resume Date: Thu, 19 Oct 2023 15:40:03 +0200 Message-Id: <03492e824d326071a6694bb1eb3a055232b1a45c.1697722648.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: 1697722844961100003 Content-Type: text/plain; charset="utf-8" The missing header makes the declaration visible when the function is defined, thereby fixing a violation of MISRA C:2012 Rule 8.4. Fixes: 1366a0e76db6 ("x86/vm_event: add hvm/vm_event.{h,c}") Signed-off-by: Nicola Vetrini Acked-by: Tamas K Lengyel --- xen/arch/x86/hvm/vm_event.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/x86/hvm/vm_event.c b/xen/arch/x86/hvm/vm_event.c index 3b064bcfade5..c1af230e7aed 100644 --- a/xen/arch/x86/hvm/vm_event.c +++ b/xen/arch/x86/hvm/vm_event.c @@ -24,6 +24,7 @@ #include #include #include +#include #include =20 static void hvm_vm_event_set_registers(const struct vcpu *v) --=20 2.34.1 From nobody Sun May 19 23:41:31 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 1697722845651453.222629421512; Thu, 19 Oct 2023 06:40:45 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.619346.964305 (Exim 4.92) (envelope-from ) id 1qtTG9-0001Bu-IH; Thu, 19 Oct 2023 13:40:21 +0000 Received: by outflank-mailman (output) from mailman id 619346.964305; Thu, 19 Oct 2023 13:40:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qtTG9-0001Ai-AC; Thu, 19 Oct 2023 13:40:21 +0000 Received: by outflank-mailman (input) for mailman id 619346; Thu, 19 Oct 2023 13:40:19 +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 1qtTG7-0008Uq-Bp for xen-devel@lists.xenproject.org; Thu, 19 Oct 2023 13:40:19 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 0a457ac3-6e85-11ee-9b0e-b553b5be7939; Thu, 19 Oct 2023 15:40:17 +0200 (CEST) Received: from nico.bugseng.com (unknown [147.123.100.131]) by support.bugseng.com (Postfix) with ESMTPSA id E3FA24EE0740; Thu, 19 Oct 2023 15:40:16 +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: 0a457ac3-6e85-11ee-9b0e-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, jbeulich@suse.com, andrew.cooper3@citrix.com, roger.pau@citrix.com, Nicola Vetrini , George Dunlap , Julien Grall , Wei Liu Subject: [XEN PATCH][for-4.19 v3 6/8] xen/console: remove stub definition in consoled.h Date: Thu, 19 Oct 2023 15:40:04 +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: 1697722846982100007 Content-Type: text/plain; charset="utf-8" The stub definition of 'consoled_guest_tx' can be removed, since its its single caller uses the implementation built with PV_SHIM enabled. Fixes: 5ef49f185c2d ("x86/pv-shim: shadow PV console's page for L2 DomU") Signed-off-by: Nicola Vetrini Reviewed-by: Stefano Stabellini --- xen/include/xen/consoled.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/xen/include/xen/consoled.h b/xen/include/xen/consoled.h index fd5d220a8aca..2b30516b3a0a 100644 --- a/xen/include/xen/consoled.h +++ b/xen/include/xen/consoled.h @@ -3,18 +3,11 @@ =20 #include =20 -#ifdef CONFIG_PV_SHIM - void consoled_set_ring_addr(struct xencons_interface *ring); struct xencons_interface *consoled_get_ring_addr(void); size_t consoled_guest_rx(void); size_t consoled_guest_tx(char c); =20 -#else - -size_t consoled_guest_tx(char c) { return 0; } - -#endif /* !CONFIG_PV_SHIM */ #endif /* __XEN_CONSOLED_H__ */ /* * Local variables: --=20 2.34.1 From nobody Sun May 19 23:41:31 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 1697722851868752.6603772059634; Thu, 19 Oct 2023 06:40:51 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.619345.964300 (Exim 4.92) (envelope-from ) id 1qtTG9-000178-3Y; Thu, 19 Oct 2023 13:40:21 +0000 Received: by outflank-mailman (output) from mailman id 619345.964300; Thu, 19 Oct 2023 13:40:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qtTG8-00016v-V8; Thu, 19 Oct 2023 13:40:20 +0000 Received: by outflank-mailman (input) for mailman id 619345; Thu, 19 Oct 2023 13:40:19 +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 1qtTG7-0007zm-7f for xen-devel@lists.xenproject.org; Thu, 19 Oct 2023 13:40:19 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 0aa9d556-6e85-11ee-98d5-6d05b1d4d9a1; Thu, 19 Oct 2023 15:40:18 +0200 (CEST) Received: from nico.bugseng.com (unknown [147.123.100.131]) by support.bugseng.com (Postfix) with ESMTPSA id C03604EE0741; Thu, 19 Oct 2023 15:40:17 +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: 0aa9d556-6e85-11ee-98d5-6d05b1d4d9a1 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, jbeulich@suse.com, andrew.cooper3@citrix.com, roger.pau@citrix.com, Nicola Vetrini , Tamas K Lengyel , Alexandru Isaila , Petre Pircalabu , George Dunlap , Wei Liu Subject: [XEN PATCH][for-4.19 v3 7/8] x86/mem_access: make function static Date: Thu, 19 Oct 2023 15:40:05 +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: 1697722853002100002 Content-Type: text/plain; charset="utf-8" The function is used only within this file, and therefore can be static. No functional change. Signed-off-by: Nicola Vetrini Acked-by: Tamas K Lengyel --- Changes in v3: - style fix --- xen/arch/x86/mm/mem_access.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/mm/mem_access.c b/xen/arch/x86/mm/mem_access.c index c472fa1ee58b..d3dd5ab5ef8b 100644 --- a/xen/arch/x86/mm/mem_access.c +++ b/xen/arch/x86/mm/mem_access.c @@ -249,9 +249,9 @@ bool p2m_mem_access_check(paddr_t gpa, unsigned long gl= a, return (p2ma !=3D p2m_access_n2rwx); } =20 -int p2m_set_altp2m_mem_access(struct domain *d, struct p2m_domain *hp2m, - struct p2m_domain *ap2m, p2m_access_t a, - gfn_t gfn) +static int p2m_set_altp2m_mem_access(struct domain *d, struct p2m_domain *= hp2m, + struct p2m_domain *ap2m, p2m_access_t= a, + gfn_t gfn) { mfn_t mfn; p2m_type_t t; --=20 2.34.1 From nobody Sun May 19 23:41:31 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 1697722852086579.5745433125094; Thu, 19 Oct 2023 06:40:52 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.619347.964318 (Exim 4.92) (envelope-from ) id 1qtTGB-0001en-3x; Thu, 19 Oct 2023 13:40:23 +0000 Received: by outflank-mailman (output) from mailman id 619347.964318; Thu, 19 Oct 2023 13:40:23 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qtTGA-0001d1-Si; Thu, 19 Oct 2023 13:40:22 +0000 Received: by outflank-mailman (input) for mailman id 619347; Thu, 19 Oct 2023 13:40:21 +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 1qtTG9-0008Uq-3K for xen-devel@lists.xenproject.org; Thu, 19 Oct 2023 13:40:21 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 0b45632f-6e85-11ee-9b0e-b553b5be7939; Thu, 19 Oct 2023 15:40:19 +0200 (CEST) Received: from nico.bugseng.com (unknown [147.123.100.131]) by support.bugseng.com (Postfix) with ESMTPSA id A36264EE0747; Thu, 19 Oct 2023 15:40:18 +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: 0b45632f-6e85-11ee-9b0e-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, jbeulich@suse.com, andrew.cooper3@citrix.com, roger.pau@citrix.com, Nicola Vetrini , George Dunlap , Julien Grall , Wei Liu Subject: [XEN PATCH][for-4.19 v3 8/8] docs/misra: exclude three more files Date: Thu, 19 Oct 2023 15:40:06 +0200 Message-Id: <0eae39cdc68e48932936e2c510a867ebe1f7c298.1697722648.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: 1697722852993100001 Content-Type: text/plain; charset="utf-8" These files should not conform to MISRA guidelines at the moment, therefore they are added to the exclusion list. Signed-off-by: Nicola Vetrini Reviewed-by: Stefano Stabellini --- These exclusions are automatically picked up by ECLAIR's automation to hide reports originating from these files. --- docs/misra/exclude-list.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/misra/exclude-list.json b/docs/misra/exclude-list.json index 575ed22a7f67..b2b4b9253615 100644 --- a/docs/misra/exclude-list.json +++ b/docs/misra/exclude-list.json @@ -145,6 +145,10 @@ "rel_path": "common/zstd/*", "comment": "Imported from Linux, ignore for now" }, + { + "rel_path": "common/symbols-dummy.c", + "comment": "The resulting code is not included in the final Xe= n binary, ignore for now" + }, { "rel_path": "crypto/*", "comment": "Origin is external and documented in crypto/README= .source" @@ -189,6 +193,14 @@ "rel_path": "include/acpi/acpixf.h", "comment": "Imported from Linux, ignore for now" }, + { + "rel_path": "include/acpi/acexep.h", + "comment": "Imported from Linux, ignore for now" + }, + { + "rel_path": "include/acpi/acglobal.h", + "comment": "Imported from Linux, ignore for now" + }, { "rel_path": "include/xen/acpi.h", "comment": "Imported from Linux, ignore for now" --=20 2.34.1