From nobody Thu May 16 01:09:43 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 1690969521197882.5460506626781; Wed, 2 Aug 2023 02:45:21 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.574819.900411 (Exim 4.92) (envelope-from ) id 1qR8Pd-0000M5-QJ; Wed, 02 Aug 2023 09:45:01 +0000 Received: by outflank-mailman (output) from mailman id 574819.900411; Wed, 02 Aug 2023 09:45:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qR8Pd-0000Ly-NE; Wed, 02 Aug 2023 09:45:01 +0000 Received: by outflank-mailman (input) for mailman id 574819; Wed, 02 Aug 2023 09:44:59 +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 1qR8Pb-0000LL-LD for xen-devel@lists.xenproject.org; Wed, 02 Aug 2023 09:44:59 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 3e698eaf-3119-11ee-b25f-6b7b168915f2; Wed, 02 Aug 2023 11:44:58 +0200 (CEST) Received: from nico.bugseng.com (unknown [147.123.100.131]) by support.bugseng.com (Postfix) with ESMTPSA id CE9A64EE0740; Wed, 2 Aug 2023 11:44:57 +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: 3e698eaf-3119-11ee-b25f-6b7b168915f2 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 Subject: [XEN PATCH 1/4] x86/mce: address MISRA C:2012 Rule 5.3 Date: Wed, 2 Aug 2023 11:44:28 +0200 Message-Id: <52ec7caf08089e3aaaad2bcf709a7d387d55d58f.1690969271.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: 1690969522915100002 Content-Type: text/plain; charset="utf-8" Suitable mechanical renames are made to avoid shadowing, thus addressing violations of MISRA C:2012 Rule 5.3: "An identifier declared in an inner scope shall not hide an identifier declared in an outer scope" Signed-off-by: Nicola Vetrini --- xen/arch/x86/cpu/mcheck/barrier.c | 8 ++++---- xen/arch/x86/cpu/mcheck/barrier.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xen/arch/x86/cpu/mcheck/barrier.c b/xen/arch/x86/cpu/mcheck/ba= rrier.c index a7e5b19a44..51a1d37a76 100644 --- a/xen/arch/x86/cpu/mcheck/barrier.c +++ b/xen/arch/x86/cpu/mcheck/barrier.c @@ -16,11 +16,11 @@ void mce_barrier_dec(struct mce_softirq_barrier *bar) atomic_dec(&bar->val); } =20 -void mce_barrier_enter(struct mce_softirq_barrier *bar, bool wait) +void mce_barrier_enter(struct mce_softirq_barrier *bar, bool do_wait) { int gen; =20 - if ( !wait ) + if ( !do_wait ) return; atomic_inc(&bar->ingen); gen =3D atomic_read(&bar->outgen); @@ -34,11 +34,11 @@ void mce_barrier_enter(struct mce_softirq_barrier *bar,= bool wait) } } =20 -void mce_barrier_exit(struct mce_softirq_barrier *bar, bool wait) +void mce_barrier_exit(struct mce_softirq_barrier *bar, bool do_wait) { int gen; =20 - if ( !wait ) + if ( !do_wait ) return; atomic_inc(&bar->outgen); gen =3D atomic_read(&bar->ingen); diff --git a/xen/arch/x86/cpu/mcheck/barrier.h b/xen/arch/x86/cpu/mcheck/ba= rrier.h index c4d52b6192..5cd1b4e4bf 100644 --- a/xen/arch/x86/cpu/mcheck/barrier.h +++ b/xen/arch/x86/cpu/mcheck/barrier.h @@ -32,14 +32,14 @@ void mce_barrier_init(struct mce_softirq_barrier *); void mce_barrier_dec(struct mce_softirq_barrier *); =20 /* - * If @wait is false, mce_barrier_enter/exit() will return immediately + * If @do_wait is false, mce_barrier_enter/exit() will return immediately * without touching the barrier. It's used when handling a * non-broadcasting MCE (e.g. MCE on some old Intel CPU, MCE on AMD * CPU and LMCE on Intel Skylake-server CPU) which is received on only * one CPU and thus does not invoke mce_barrier_enter/exit() calls on * all CPUs. * - * If @wait is true, mce_barrier_enter/exit() will handle the given + * If @do_wait is true, mce_barrier_enter/exit() will handle the given * barrier as below. * * Increment the generation number and the value. The generation number @@ -53,8 +53,8 @@ void mce_barrier_dec(struct mce_softirq_barrier *); * These barrier functions should always be paired, so that the * counter value will reach 0 again after all CPUs have exited. */ -void mce_barrier_enter(struct mce_softirq_barrier *, bool wait); -void mce_barrier_exit(struct mce_softirq_barrier *, bool wait); +void mce_barrier_enter(struct mce_softirq_barrier *, bool do_wait); +void mce_barrier_exit(struct mce_softirq_barrier *, bool do_wait); =20 void mce_barrier(struct mce_softirq_barrier *); =20 --=20 2.34.1 From nobody Thu May 16 01:09:43 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 1690969524217870.2960169775519; Wed, 2 Aug 2023 02:45:24 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.574821.900422 (Exim 4.92) (envelope-from ) id 1qR8Pe-0000TX-93; Wed, 02 Aug 2023 09:45:02 +0000 Received: by outflank-mailman (output) from mailman id 574821.900422; Wed, 02 Aug 2023 09:45:02 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qR8Pe-0000Qh-4x; Wed, 02 Aug 2023 09:45:02 +0000 Received: by outflank-mailman (input) for mailman id 574821; Wed, 02 Aug 2023 09:45:00 +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 1qR8Pc-0000LL-AA for xen-devel@lists.xenproject.org; Wed, 02 Aug 2023 09:45:00 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 3ed653e6-3119-11ee-b25f-6b7b168915f2; Wed, 02 Aug 2023 11:44:59 +0200 (CEST) Received: from nico.bugseng.com (unknown [147.123.100.131]) by support.bugseng.com (Postfix) with ESMTPSA id 9C0044EE0741; Wed, 2 Aug 2023 11:44:58 +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: 3ed653e6-3119-11ee-b25f-6b7b168915f2 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 Subject: [XEN PATCH 2/4] x86/mtrr: address MISRA C:2012 Rule 5.3 Date: Wed, 2 Aug 2023 11:44:29 +0200 Message-Id: <16fa23ecb465442c566a18af0a569092075eef26.1690969271.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: 1690969526633100001 Content-Type: text/plain; charset="utf-8" Rename variables to avoid shadowing and thus address MISRA C:2012 Rule 5.3: "An identifier declared in an inner scope shall not hide an identifier declared in an outer scope" No functional changes. Signed-off-by: Nicola Vetrini --- xen/arch/x86/hvm/mtrr.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/xen/arch/x86/hvm/mtrr.c b/xen/arch/x86/hvm/mtrr.c index 29f3fb1607..d504d1e43b 100644 --- a/xen/arch/x86/hvm/mtrr.c +++ b/xen/arch/x86/hvm/mtrr.c @@ -687,13 +687,13 @@ int hvm_set_mem_pinned_cacheattr(struct domain *d, ui= nt64_t gfn_start, =20 static int cf_check hvm_save_mtrr_msr(struct vcpu *v, hvm_domain_context_t= *h) { - const struct mtrr_state *mtrr_state =3D &v->arch.hvm.mtrr; + const struct mtrr_state *mtrr =3D &v->arch.hvm.mtrr; struct hvm_hw_mtrr hw_mtrr =3D { - .msr_mtrr_def_type =3D mtrr_state->def_type | - MASK_INSR(mtrr_state->fixed_enabled, + .msr_mtrr_def_type =3D mtrr->def_type | + MASK_INSR(mtrr->fixed_enabled, MTRRdefType_FE) | - MASK_INSR(mtrr_state->enabled, MTRRdefType_E), - .msr_mtrr_cap =3D mtrr_state->mtrr_cap, + MASK_INSR(mtrr->enabled, MTRRdefType_E), + .msr_mtrr_cap =3D mtrr->mtrr_cap, }; unsigned int i; =20 @@ -710,14 +710,14 @@ static int cf_check hvm_save_mtrr_msr(struct vcpu *v,= hvm_domain_context_t *h) =20 for ( i =3D 0; i < MASK_EXTR(hw_mtrr.msr_mtrr_cap, MTRRcap_VCNT); i++ ) { - hw_mtrr.msr_mtrr_var[i * 2] =3D mtrr_state->var_ranges->base; - hw_mtrr.msr_mtrr_var[i * 2 + 1] =3D mtrr_state->var_ranges->mask; + hw_mtrr.msr_mtrr_var[i * 2] =3D mtrr->var_ranges->base; + hw_mtrr.msr_mtrr_var[i * 2 + 1] =3D mtrr->var_ranges->mask; } =20 BUILD_BUG_ON(sizeof(hw_mtrr.msr_mtrr_fixed) !=3D - sizeof(mtrr_state->fixed_ranges)); + sizeof(mtrr->fixed_ranges)); =20 - memcpy(hw_mtrr.msr_mtrr_fixed, mtrr_state->fixed_ranges, + memcpy(hw_mtrr.msr_mtrr_fixed, mtrr->fixed_ranges, sizeof(hw_mtrr.msr_mtrr_fixed)); =20 return hvm_save_entry(MTRR, v->vcpu_id, h, &hw_mtrr); @@ -727,7 +727,7 @@ static int cf_check hvm_load_mtrr_msr(struct domain *d,= hvm_domain_context_t *h) { unsigned int vcpuid, i; struct vcpu *v; - struct mtrr_state *mtrr_state; + struct mtrr_state *mtrr; struct hvm_hw_mtrr hw_mtrr; =20 vcpuid =3D hvm_load_instance(h); @@ -749,26 +749,26 @@ static int cf_check hvm_load_mtrr_msr(struct domain *= d, hvm_domain_context_t *h) return -EINVAL; } =20 - mtrr_state =3D &v->arch.hvm.mtrr; + mtrr =3D &v->arch.hvm.mtrr; =20 hvm_set_guest_pat(v, hw_mtrr.msr_pat_cr); =20 - mtrr_state->mtrr_cap =3D hw_mtrr.msr_mtrr_cap; + mtrr->mtrr_cap =3D hw_mtrr.msr_mtrr_cap; =20 for ( i =3D 0; i < NUM_FIXED_MSR; i++ ) - mtrr_fix_range_msr_set(d, mtrr_state, i, hw_mtrr.msr_mtrr_fixed[i]= ); + mtrr_fix_range_msr_set(d, mtrr, i, hw_mtrr.msr_mtrr_fixed[i]); =20 for ( i =3D 0; i < MASK_EXTR(hw_mtrr.msr_mtrr_cap, MTRRcap_VCNT); i++ ) { - mtrr_var_range_msr_set(d, mtrr_state, + mtrr_var_range_msr_set(d, mtrr, MSR_IA32_MTRR_PHYSBASE(i), hw_mtrr.msr_mtrr_var[i * 2]); - mtrr_var_range_msr_set(d, mtrr_state, + mtrr_var_range_msr_set(d, mtrr, MSR_IA32_MTRR_PHYSMASK(i), hw_mtrr.msr_mtrr_var[i * 2 + 1]); } =20 - mtrr_def_type_msr_set(d, mtrr_state, hw_mtrr.msr_mtrr_def_type); + mtrr_def_type_msr_set(d, mtrr, hw_mtrr.msr_mtrr_def_type); =20 return 0; } --=20 2.34.1 From nobody Thu May 16 01:09:43 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 1690969520683372.04840769272244; Wed, 2 Aug 2023 02:45:20 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.574822.900427 (Exim 4.92) (envelope-from ) id 1qR8Pe-0000cs-Kv; Wed, 02 Aug 2023 09:45:02 +0000 Received: by outflank-mailman (output) from mailman id 574822.900427; Wed, 02 Aug 2023 09:45:02 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qR8Pe-0000ag-Fp; Wed, 02 Aug 2023 09:45:02 +0000 Received: by outflank-mailman (input) for mailman id 574822; Wed, 02 Aug 2023 09:45:01 +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 1qR8Pd-0000LL-AU for xen-devel@lists.xenproject.org; Wed, 02 Aug 2023 09:45:01 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 3f5c049e-3119-11ee-b25f-6b7b168915f2; Wed, 02 Aug 2023 11:45:00 +0200 (CEST) Received: from nico.bugseng.com (unknown [147.123.100.131]) by support.bugseng.com (Postfix) with ESMTPSA id 5CF0D4EE0742; Wed, 2 Aug 2023 11:44:59 +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: 3f5c049e-3119-11ee-b25f-6b7b168915f2 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 3/4] x86/irq: rename variable to address MISRA C:2012 Rule 5.3 Date: Wed, 2 Aug 2023 11:44:30 +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: 1690969522868100001 Content-Type: text/plain; charset="utf-8" The extern variable 'irq_desc' defined in 'irq.h' is shadowed by local variables in the changed file. To avoid this, the variable is renamed to 'irq_description'. No functional change. Signed-off-by: Nicola Vetrini Reviewed-by: Stefano Stabellini --- xen/arch/x86/hvm/hvm.c | 2 +- xen/arch/x86/include/asm/irq.h | 2 +- xen/arch/x86/io_apic.c | 10 +++++----- xen/arch/x86/irq.c | 12 ++++++------ xen/arch/x86/msi.c | 4 ++-- xen/include/xen/irq.h | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 2180abeb33..ca5bb96388 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -474,7 +474,7 @@ void hvm_migrate_pirq(struct hvm_pirq_dpci *pirq_dpci, = const struct vcpu *v) =20 if ( !desc ) return; - ASSERT(MSI_IRQ(desc - irq_desc)); + ASSERT(MSI_IRQ(desc - irq_descriptor)); irq_set_affinity(desc, cpumask_of(v->processor)); spin_unlock_irq(&desc->lock); } diff --git a/xen/arch/x86/include/asm/irq.h b/xen/arch/x86/include/asm/irq.h index ad907fc97f..f6df977170 100644 --- a/xen/arch/x86/include/asm/irq.h +++ b/xen/arch/x86/include/asm/irq.h @@ -172,7 +172,7 @@ int assign_irq_vector(int irq, const cpumask_t *mask); =20 void cf_check irq_complete_move(struct irq_desc *desc); =20 -extern struct irq_desc *irq_desc; +extern struct irq_desc *irq_descriptor; =20 void lock_vector_lock(void); void unlock_vector_lock(void); diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c index b3afef8933..b59d6cfb9e 100644 --- a/xen/arch/x86/io_apic.c +++ b/xen/arch/x86/io_apic.c @@ -990,9 +990,9 @@ static inline void ioapic_register_intr(int irq, unsign= ed long trigger) { if ((trigger =3D=3D IOAPIC_AUTO && IO_APIC_irq_trigger(irq)) || trigger =3D=3D IOAPIC_LEVEL) - irq_desc[irq].handler =3D &ioapic_level_type; + irq_descriptor[irq].handler =3D &ioapic_level_type; else - irq_desc[irq].handler =3D &ioapic_edge_type; + irq_descriptor[irq].handler =3D &ioapic_edge_type; } =20 static void __init setup_IO_APIC_irqs(void) @@ -1098,7 +1098,7 @@ static void __init setup_ExtINT_IRQ0_pin(unsigned int= apic, unsigned int pin, in * The timer IRQ doesn't have to know that behind the * scene we have a 8259A-master in AEOI mode ... */ - irq_desc[0].handler =3D &ioapic_edge_type; + irq_descriptor[0].handler =3D &ioapic_edge_type; =20 /* * Add it to the IO-APIC irq-routing table: @@ -1912,7 +1912,7 @@ static void __init check_timer(void) if ((ret =3D bind_irq_vector(0, vector, &cpumask_all))) printk(KERN_ERR"..IRQ0 is not set correctly with ioapic!!!, err:%d= \n", ret); =20 - irq_desc[0].status &=3D ~IRQ_DISABLED; + irq_descriptor[0].status &=3D ~IRQ_DISABLED; =20 /* * Subtle, code in do_timer_interrupt() expects an AEOI @@ -2009,7 +2009,7 @@ static void __init check_timer(void) printk(KERN_INFO "...trying to set up timer as Virtual Wire IRQ..."); =20 disable_8259A_irq(irq_to_desc(0)); - irq_desc[0].handler =3D &lapic_irq_type; + irq_descriptor[0].handler =3D &lapic_irq_type; apic_write(APIC_LVT0, APIC_DM_FIXED | vector); /* Fixed mode */ enable_8259A_irq(irq_to_desc(0)); =20 diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c index 6abfd81621..ed95896bce 100644 --- a/xen/arch/x86/irq.c +++ b/xen/arch/x86/irq.c @@ -45,7 +45,7 @@ integer_param("irq-max-guests", irq_max_guests); =20 vmask_t global_used_vector_map; =20 -struct irq_desc __read_mostly *irq_desc =3D NULL; +struct irq_desc __read_mostly *irq_descriptor =3D NULL; =20 static DECLARE_BITMAP(used_vectors, X86_NR_VECTORS); =20 @@ -424,9 +424,9 @@ int __init init_irq_data(void) for ( vector =3D 0; vector < X86_NR_VECTORS; ++vector ) this_cpu(vector_irq)[vector] =3D INT_MIN; =20 - irq_desc =3D xzalloc_array(struct irq_desc, nr_irqs); - =20 - if ( !irq_desc ) + irq_descriptor =3D xzalloc_array(struct irq_desc, nr_irqs); + + if ( !irq_descriptor ) return -ENOMEM; =20 for ( irq =3D 0; irq < nr_irqs_gsi; irq++ ) @@ -1133,7 +1133,7 @@ static void cf_check set_eoi_ready(void *data); static void cf_check irq_guest_eoi_timer_fn(void *data) { struct irq_desc *desc =3D data; - unsigned int i, irq =3D desc - irq_desc; + unsigned int i, irq =3D desc - irq_descriptor; irq_guest_action_t *action; =20 spin_lock_irq(&desc->lock); @@ -1382,7 +1382,7 @@ static void __set_eoi_ready(const struct irq_desc *de= sc) struct pending_eoi *peoi =3D this_cpu(pending_eoi); int irq, sp; =20 - irq =3D desc - irq_desc; + irq =3D desc - irq_descriptor; =20 if ( !action || action->in_flight || !cpumask_test_and_clear_cpu(smp_processor_id(), diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c index d0bf63df1d..35d417c63a 100644 --- a/xen/arch/x86/msi.c +++ b/xen/arch/x86/msi.c @@ -1322,7 +1322,7 @@ int pci_restore_msi_state(struct pci_dev *pdev) unsigned int i =3D 0, nr =3D 1; =20 irq =3D entry->irq; - desc =3D &irq_desc[irq]; + desc =3D &irq_descriptor[irq]; =20 spin_lock_irqsave(&desc->lock, flags); =20 @@ -1377,7 +1377,7 @@ int pci_restore_msi_state(struct pci_dev *pdev) break; =20 spin_unlock_irqrestore(&desc->lock, flags); - desc =3D &irq_desc[entry[++i].irq]; + desc =3D &irq_descriptor[entry[++i].irq]; spin_lock_irqsave(&desc->lock, flags); if ( desc->msi_desc !=3D entry + i ) goto bogus; diff --git a/xen/include/xen/irq.h b/xen/include/xen/irq.h index 9747e818f7..56a3aa6a29 100644 --- a/xen/include/xen/irq.h +++ b/xen/include/xen/irq.h @@ -107,7 +107,7 @@ typedef struct irq_desc { } __cacheline_aligned irq_desc_t; =20 #ifndef irq_to_desc -#define irq_to_desc(irq) (&irq_desc[irq]) +#define irq_to_desc(irq) (&irq_descriptor[irq]) #endif =20 int init_one_irq_desc(struct irq_desc *desc); --=20 2.34.1 From nobody Thu May 16 01:09:43 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 1690969525972999.2845680624614; Wed, 2 Aug 2023 02:45:25 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.574823.900451 (Exim 4.92) (envelope-from ) id 1qR8Pg-0001Hw-86; Wed, 02 Aug 2023 09:45:04 +0000 Received: by outflank-mailman (output) from mailman id 574823.900451; Wed, 02 Aug 2023 09:45:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qR8Pg-0001GB-2a; Wed, 02 Aug 2023 09:45:04 +0000 Received: by outflank-mailman (input) for mailman id 574823; Wed, 02 Aug 2023 09:45:02 +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 1qR8Pe-0000Lc-Oz for xen-devel@lists.xenproject.org; Wed, 02 Aug 2023 09:45:02 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 3fdaf24d-3119-11ee-8613-37d641c3527e; Wed, 02 Aug 2023 11:45:01 +0200 (CEST) Received: from nico.bugseng.com (unknown [147.123.100.131]) by support.bugseng.com (Postfix) with ESMTPSA id 452BD4EE0743; Wed, 2 Aug 2023 11:45:00 +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: 3fdaf24d-3119-11ee-8613-37d641c3527e 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 Subject: [XEN PATCH 4/4] x86/setup: address MISRA C:2012 Rule 5.3 Date: Wed, 2 Aug 2023 11:44:31 +0200 Message-Id: <807b238780c3e2dfce785c6bb173099a4bd38e4b.1690969271.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: 1690969534348100001 Content-Type: text/plain; charset="utf-8" The parameters renamed in the function declaration caused shadowing with the homonymous variable in 'xen/common/efi/boot.c'. Renaming them also addresses Rule 8.3: "All declarations of an object or function shall use the same names and type qualifiers". The local variable 'mask' is removed because it shadows the homonymous variable defined in an outer scope, with no change to the semantics. It was introduced by commit 5a771800114c437fb857b44b3ed74f60e87979c2 as a refactoring of the branch that handles 'CONFIG_X86_64' for function '__start_xen'. No functional changes. Signed-off-by: Nicola Vetrini Reviewed-by: Stefano Stabellini --- xen/arch/x86/include/asm/setup.h | 2 +- xen/arch/x86/setup.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/include/asm/setup.h b/xen/arch/x86/include/asm/se= tup.h index 51fce66607..b0e6a39e23 100644 --- a/xen/arch/x86/include/asm/setup.h +++ b/xen/arch/x86/include/asm/setup.h @@ -33,7 +33,7 @@ static inline void vesa_init(void) {}; =20 int construct_dom0( struct domain *d, - const module_t *kernel, unsigned long kernel_headroom, + const module_t *image, unsigned long image_headroom, module_t *initrd, const char *cmdline); void setup_io_bitmap(struct domain *d); diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 2dbe9857aa..80ae973d64 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -1577,8 +1577,7 @@ void __init noreturn __start_xen(unsigned long mbi_p) s =3D map_s; if ( s < map_e ) { - uint64_t mask =3D (1UL << L2_PAGETABLE_SHIFT) - 1; - + mask =3D (1UL << L2_PAGETABLE_SHIFT) - 1; map_s =3D (s + mask) & ~mask; map_e &=3D ~mask; init_boot_pages(map_s, map_e); --=20 2.34.1