From nobody Tue May 14 18:12:25 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 1696233034472754.798115842827; Mon, 2 Oct 2023 00:50:34 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.611144.950584 (Exim 4.92) (envelope-from ) id 1qnDgs-00072p-Pc; Mon, 02 Oct 2023 07:50:06 +0000 Received: by outflank-mailman (output) from mailman id 611144.950584; Mon, 02 Oct 2023 07:50:06 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qnDgs-00072i-Jo; Mon, 02 Oct 2023 07:50:06 +0000 Received: by outflank-mailman (input) for mailman id 611144; Mon, 02 Oct 2023 07:50:05 +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 1qnDgr-0006dn-CO for xen-devel@lists.xenproject.org; Mon, 02 Oct 2023 07:50:05 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 4aface3c-60f8-11ee-9b0d-b553b5be7939; Mon, 02 Oct 2023 09:50:02 +0200 (CEST) Received: from nico.bugseng.com (unknown [147.123.100.131]) by support.bugseng.com (Postfix) with ESMTPSA id DC7B84EE073E; Mon, 2 Oct 2023 09:50:01 +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: 4aface3c-60f8-11ee-9b0d-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, Henry.Wang@arm.com, Nicola Vetrini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk , George Dunlap , Wei Liu Subject: [XEN PATCH 1/7] xen: add declarations for variables where needed Date: Mon, 2 Oct 2023 09:49:44 +0200 Message-Id: <357a35c3035d0f8659a64d767791bc41d57494d3.1696232393.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: 1696233037024100001 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 --- xen/arch/arm/include/asm/setup.h | 3 +++ xen/arch/arm/include/asm/smp.h | 3 +++ xen/arch/x86/cpu/mcheck/mce.c | 6 +++--- xen/arch/x86/include/asm/setup.h | 3 +++ xen/arch/x86/irq.c | 2 +- xen/arch/x86/platform_hypercall.c | 3 --- xen/common/symbols.c | 17 ----------------- xen/include/xen/hypercall.h | 3 +++ xen/include/xen/symbols.h | 18 ++++++++++++++++++ 9 files changed, 34 insertions(+), 24 deletions(-) diff --git a/xen/arch/arm/include/asm/setup.h b/xen/arch/arm/include/asm/se= tup.h index b8866c20f462..8806a74b216d 100644 --- a/xen/arch/arm/include/asm/setup.h +++ b/xen/arch/arm/include/asm/setup.h @@ -183,9 +183,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/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/include/asm/setup.h b/xen/arch/x86/include/asm/se= tup.h index dfdd9e555149..3c27fe915ed4 100644 --- a/xen/arch/x86/include/asm/setup.h +++ b/xen/arch/x86/include/asm/setup.h @@ -13,8 +13,11 @@ extern char __2M_rwdata_start[], __2M_rwdata_end[]; extern unsigned long xenheap_initial_phys_start; extern uint64_t boot_tsc_stamp; =20 +extern char cpu0_stack[STACK_SIZE]; extern void *stack_start; =20 +extern unsigned long cr4_pv32_mask; + void early_cpu_init(void); void early_time_init(void); =20 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/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hype= rcall.c index 9469de9045c7..e4dbec73d784 100644 --- a/xen/arch/x86/platform_hypercall.c +++ b/xen/arch/x86/platform_hypercall.c @@ -36,9 +36,6 @@ #include "cpu/mtrr/mtrr.h" #include =20 -/* Declarations for items shared with the compat mode handler. */ -extern spinlock_t xenpf_lock; - #define RESOURCE_ACCESS_MAX_ENTRIES 3 struct resource_access { unsigned int nr_done; diff --git a/xen/common/symbols.c b/xen/common/symbols.c index 691e61792506..7c3514c65f2e 100644 --- a/xen/common/symbols.c +++ b/xen/common/symbols.c @@ -21,23 +21,6 @@ #include #include =20 -#ifdef SYMBOLS_ORIGIN -extern const unsigned int symbols_offsets[]; -#define symbols_address(n) (SYMBOLS_ORIGIN + symbols_offsets[n]) -#else -extern const unsigned long symbols_addresses[]; -#define symbols_address(n) symbols_addresses[n] -#endif -extern const unsigned int symbols_num_syms; -extern const u8 symbols_names[]; - -extern const struct symbol_offset symbols_sorted_offsets[]; - -extern const u8 symbols_token_table[]; -extern const u16 symbols_token_index[]; - -extern const unsigned int symbols_markers[]; - /* expand a compressed symbol data into the resulting uncompressed string, given the offset to where the symbol is in the compressed stream */ static unsigned int symbols_expand_symbol(unsigned int off, char *result) diff --git a/xen/include/xen/hypercall.h b/xen/include/xen/hypercall.h index f307dfb59760..12de5a69b5b1 100644 --- a/xen/include/xen/hypercall.h +++ b/xen/include/xen/hypercall.h @@ -24,6 +24,9 @@ /* Needs to be after asm/hypercall.h. */ #include =20 +/* Declarations for items shared with the compat mode handler. */ +extern spinlock_t xenpf_lock; + extern long arch_do_domctl( struct xen_domctl *domctl, struct domain *d, diff --git a/xen/include/xen/symbols.h b/xen/include/xen/symbols.h index 20bbb28ef226..92540409265e 100644 --- a/xen/include/xen/symbols.h +++ b/xen/include/xen/symbols.h @@ -33,4 +33,22 @@ struct symbol_offset { uint32_t stream; /* .. in the compressed stream.*/ uint32_t addr; /* .. and in the fixed size address array. */ }; + +#ifdef SYMBOLS_ORIGIN +extern const unsigned int symbols_offsets[]; +#define symbols_address(n) (SYMBOLS_ORIGIN + symbols_offsets[n]) +#else +extern const unsigned long symbols_addresses[]; +#define symbols_address(n) symbols_addresses[n] +#endif +extern const unsigned int symbols_num_syms; +extern const u8 symbols_names[]; + +extern const struct symbol_offset symbols_sorted_offsets[]; + +extern const u8 symbols_token_table[]; +extern const u16 symbols_token_index[]; + +extern const unsigned int symbols_markers[]; + #endif /*_XEN_SYMBOLS_H*/ --=20 2.34.1 From nobody Tue May 14 18:12:25 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 169623302846524.02213007984824; Mon, 2 Oct 2023 00:50:28 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.611143.950573 (Exim 4.92) (envelope-from ) id 1qnDgr-0006kB-GZ; Mon, 02 Oct 2023 07:50:05 +0000 Received: by outflank-mailman (output) from mailman id 611143.950573; Mon, 02 Oct 2023 07:50:05 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qnDgr-0006jo-DL; Mon, 02 Oct 2023 07:50:05 +0000 Received: by outflank-mailman (input) for mailman id 611143; Mon, 02 Oct 2023 07:50:04 +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 1qnDgq-00065N-2r for xen-devel@lists.xenproject.org; Mon, 02 Oct 2023 07:50:04 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 4bc71713-60f8-11ee-878e-cb3800f73035; Mon, 02 Oct 2023 09:50:03 +0200 (CEST) Received: from nico.bugseng.com (unknown [147.123.100.131]) by support.bugseng.com (Postfix) with ESMTPSA id BF3B84EE074E; Mon, 2 Oct 2023 09:50:02 +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: 4bc71713-60f8-11ee-878e-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, jbeulich@suse.com, andrew.cooper3@citrix.com, roger.pau@citrix.com, Henry.Wang@arm.com, Nicola Vetrini , Wei Liu Subject: [XEN PATCH 2/7] x86: add deviations for variables only used in asm code Date: Mon, 2 Oct 2023 09:49:45 +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: 1696233030821100002 Content-Type: text/plain; charset="utf-8" These variables are only used by asm code, and therefore the lack of a declaration is justified by the corresponding SAF comment. Signed-off-by: Nicola Vetrini Reviewed-by: Stefano Stabellini --- xen/arch/x86/include/asm/asm_defns.h | 1 + xen/arch/x86/setup.c | 1 + 2 files changed, 2 insertions(+) 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..7e2979f419af 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -153,6 +153,7 @@ char __section(".init.bss.stack_aligned") __aligned(STA= CK_SIZE) 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 Tue May 14 18:12:25 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 16962330310575.7384046334505; Mon, 2 Oct 2023 00:50:31 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.611145.950593 (Exim 4.92) (envelope-from ) id 1qnDgu-0007Jk-4H; Mon, 02 Oct 2023 07:50:08 +0000 Received: by outflank-mailman (output) from mailman id 611145.950593; Mon, 02 Oct 2023 07:50: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 1qnDgu-0007JX-0d; Mon, 02 Oct 2023 07:50:08 +0000 Received: by outflank-mailman (input) for mailman id 611145; Mon, 02 Oct 2023 07:50:06 +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 1qnDgs-0006dn-0d for xen-devel@lists.xenproject.org; Mon, 02 Oct 2023 07:50:06 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 4bcd8670-60f8-11ee-9b0d-b553b5be7939; Mon, 02 Oct 2023 09:50:03 +0200 (CEST) Received: from nico.bugseng.com (unknown [147.123.100.131]) by support.bugseng.com (Postfix) with ESMTPSA id 741074EE0C87; Mon, 2 Oct 2023 09:50:03 +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: 4bcd8670-60f8-11ee-9b0d-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, Henry.Wang@arm.com, Nicola Vetrini , Wei Liu Subject: [XEN PATCH 3/7] x86: add deviation comments for asm-only functions Date: Mon, 2 Oct 2023 09:49:46 +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: 1696233032556100005 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 --- 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/traps.c | 1 + xen/arch/x86/x86_64/traps.c | 1 + 5 files changed, 6 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 beb076ea8d62..b9fabd45a119 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -1044,6 +1044,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(); @@ -2574,6 +2575,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/traps.c b/xen/arch/x86/traps.c index 0a005f088bca..f27ddb728b2c 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -2260,6 +2260,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 f4d17b483032..bcb7559b21c3 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 Tue May 14 18:12:25 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 1696233032950942.013128022149; Mon, 2 Oct 2023 00:50:32 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.611146.950598 (Exim 4.92) (envelope-from ) id 1qnDgu-0007MM-FT; Mon, 02 Oct 2023 07:50:08 +0000 Received: by outflank-mailman (output) from mailman id 611146.950598; Mon, 02 Oct 2023 07:50: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 1qnDgu-0007LN-8k; Mon, 02 Oct 2023 07:50:08 +0000 Received: by outflank-mailman (input) for mailman id 611146; Mon, 02 Oct 2023 07:50: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 1qnDgt-0006dn-0e for xen-devel@lists.xenproject.org; Mon, 02 Oct 2023 07:50:07 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 4c3b0e9e-60f8-11ee-9b0d-b553b5be7939; Mon, 02 Oct 2023 09:50:04 +0200 (CEST) Received: from nico.bugseng.com (unknown [147.123.100.131]) by support.bugseng.com (Postfix) with ESMTPSA id 2E6414EE0C81; Mon, 2 Oct 2023 09:50:04 +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: 4c3b0e9e-60f8-11ee-9b0d-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, Henry.Wang@arm.com, Nicola Vetrini , Wei Liu Subject: [XEN PATCH 4/7] x86/grant: switch included header to make declarations visible Date: Mon, 2 Oct 2023 09:49:47 +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: 1696233034881100001 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 --- 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..576aeb50adf4 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 Tue May 14 18:12:25 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 1696233027950488.2159864288501; Mon, 2 Oct 2023 00:50:27 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.611147.950603 (Exim 4.92) (envelope-from ) id 1qnDgu-0007ST-OZ; Mon, 02 Oct 2023 07:50:08 +0000 Received: by outflank-mailman (output) from mailman id 611147.950603; Mon, 02 Oct 2023 07:50: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 1qnDgu-0007Ql-IG; Mon, 02 Oct 2023 07:50:08 +0000 Received: by outflank-mailman (input) for mailman id 611147; Mon, 02 Oct 2023 07:50:08 +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 1qnDgu-0006dn-10 for xen-devel@lists.xenproject.org; Mon, 02 Oct 2023 07:50:08 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 4cc70ec6-60f8-11ee-9b0d-b553b5be7939; Mon, 02 Oct 2023 09:50:05 +0200 (CEST) Received: from nico.bugseng.com (unknown [147.123.100.131]) by support.bugseng.com (Postfix) with ESMTPSA id DDEA64EE0C88; Mon, 2 Oct 2023 09:50:04 +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: 4cc70ec6-60f8-11ee-9b0d-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, Henry.Wang@arm.com, Nicola Vetrini , Tamas K Lengyel , Alexandru Isaila , Petre Pircalabu , Wei Liu Subject: [XEN PATCH 5/7] x86/vm_event: add missing include for hvm_vm_event_do_resume Date: Mon, 2 Oct 2023 09:49:48 +0200 Message-Id: <5bed20248f3e86d013bdf76d208c597b0bb9fd91.1696232393.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: 1696233030797100001 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 --- 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 Tue May 14 18:12:25 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 1696233038128464.08776421243795; Mon, 2 Oct 2023 00:50:38 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.611148.950623 (Exim 4.92) (envelope-from ) id 1qnDgx-00088l-2U; Mon, 02 Oct 2023 07:50:11 +0000 Received: by outflank-mailman (output) from mailman id 611148.950623; Mon, 02 Oct 2023 07:50: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 1qnDgw-00088W-Vg; Mon, 02 Oct 2023 07:50:10 +0000 Received: by outflank-mailman (input) for mailman id 611148; Mon, 02 Oct 2023 07:50: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 1qnDgv-0006dn-1o for xen-devel@lists.xenproject.org; Mon, 02 Oct 2023 07:50:09 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 4d4b3207-60f8-11ee-9b0d-b553b5be7939; Mon, 02 Oct 2023 09:50:06 +0200 (CEST) Received: from nico.bugseng.com (unknown [147.123.100.131]) by support.bugseng.com (Postfix) with ESMTPSA id CA0AB4EE0C89; Mon, 2 Oct 2023 09:50:05 +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: 4d4b3207-60f8-11ee-9b0d-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, Henry.Wang@arm.com, Nicola Vetrini , George Dunlap , Julien Grall , Wei Liu Subject: [XEN PATCH 6/7] xen/console: make function static inline Date: Mon, 2 Oct 2023 09:49:49 +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: 1696233038945100003 Content-Type: text/plain; charset="utf-8" The definition of 'consoled_guest_tx' can be static inline, thereby fixing a violation of MISRA C:2012 Rule 8.4. 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/include/xen/consoled.h b/xen/include/xen/consoled.h index fd5d220a8aca..e943d8d48f7b 100644 --- a/xen/include/xen/consoled.h +++ b/xen/include/xen/consoled.h @@ -12,7 +12,7 @@ size_t consoled_guest_tx(char c); =20 #else =20 -size_t consoled_guest_tx(char c) { return 0; } +static inline size_t consoled_guest_tx(char c) { return 0; } =20 #endif /* !CONFIG_PV_SHIM */ #endif /* __XEN_CONSOLED_H__ */ --=20 2.34.1 From nobody Tue May 14 18:12:25 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 1696233038605371.67834844793435; Mon, 2 Oct 2023 00:50:38 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.611149.950628 (Exim 4.92) (envelope-from ) id 1qnDgx-0008Bz-Fr; Mon, 02 Oct 2023 07:50:11 +0000 Received: by outflank-mailman (output) from mailman id 611149.950628; Mon, 02 Oct 2023 07:50: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 1qnDgx-0008B4-9U; Mon, 02 Oct 2023 07:50:11 +0000 Received: by outflank-mailman (input) for mailman id 611149; Mon, 02 Oct 2023 07:50:10 +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 1qnDgw-0006dn-1N for xen-devel@lists.xenproject.org; Mon, 02 Oct 2023 07:50:10 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 4dd87652-60f8-11ee-9b0d-b553b5be7939; Mon, 02 Oct 2023 09:50:07 +0200 (CEST) Received: from nico.bugseng.com (unknown [147.123.100.131]) by support.bugseng.com (Postfix) with ESMTPSA id AA5634EE073E; Mon, 2 Oct 2023 09:50:06 +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: 4dd87652-60f8-11ee-9b0d-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, Henry.Wang@arm.com, Nicola Vetrini , Tamas K Lengyel , Alexandru Isaila , Petre Pircalabu , George Dunlap , Wei Liu Subject: [XEN PATCH 7/7] x86/mem_access: make function static Date: Mon, 2 Oct 2023 09:49:50 +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: 1696233039471100007 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 --- xen/arch/x86/mm/mem_access.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/mm/mem_access.c b/xen/arch/x86/mm/mem_access.c index c472fa1ee58b..78633d335d72 100644 --- a/xen/arch/x86/mm/mem_access.c +++ b/xen/arch/x86/mm/mem_access.c @@ -249,7 +249,7 @@ 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, +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) { --=20 2.34.1