From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org, 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, Henry.Wang@arm.com,
Julien Grall <julien@xen.org>,
Bertrand Marquis <bertrand.marquis@arm.com>,
Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
George Dunlap <george.dunlap@citrix.com>, Wei Liu <wl@xen.org>
Subject: Re: [XEN PATCH 1/7] xen: add declarations for variables where needed
Date: Tue, 03 Oct 2023 09:52:18 +0200 [thread overview]
Message-ID: <d9652187e9d0f15c5678273112c4ba56@bugseng.com> (raw)
In-Reply-To: <ZRvAOdKKD6T6l2cK@MacBookPdeRoger>
On 03/10/2023 09:18, Roger Pau Monné wrote:
> On Tue, Oct 03, 2023 at 09:05:34AM +0200, Nicola Vetrini wrote:
>> On 02/10/2023 13:07, Roger Pau Monné wrote:
>> > On Mon, Oct 02, 2023 at 09:49:44AM +0200, Nicola Vetrini wrote:
>> > > 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 <nicola.vetrini@bugseng.com>
>> > > ---
>> > > 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/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 <xen/hypercall-defs.h>
>> > >
>> > > +/* Declarations for items shared with the compat mode handler. */
>> > > +extern spinlock_t xenpf_lock;
>> >
>> > I'm confused about why this needs to be moved, AFAICT xenpf_lock is
>> > only used in platform_hypercall.c, and the declaration is
>> > unconditional, so there's no definition without declaration issue.
>> >
>>
>> The violation was on ARM code, because of a slight inconsistency:
>> xen/arch/arm/platform_hypercall.c:DEFINE_SPINLOCK(xenpf_lock);
>>
>> xen/arch/x86/platform_hypercall.c:extern spinlock_t xenpf_lock;
>> xen/arch/x86/platform_hypercall.c:DEFINE_SPINLOCK(xenpf_lock);
>>
>> therefore, by moving the extern declaration to the common header there
>> should be no issue.
>
> Just make xenpf_lock static on arm, that would be a better solution.
> The only need for the lock to be global is because of compat code, and
> arm doesn't seem to need it.
>
> Thanks, Roger.
I'll do that, thanks.
--
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)
next prev parent reply other threads:[~2023-10-03 7:52 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-02 7:49 [XEN PATCH 0/7] Fix or deviate various instances of missing declarations Nicola Vetrini
2023-10-02 7:49 ` [XEN PATCH 1/7] xen: add declarations for variables where needed Nicola Vetrini
2023-10-02 11:07 ` Roger Pau Monné
2023-10-03 7:05 ` Nicola Vetrini
2023-10-03 7:18 ` Roger Pau Monné
2023-10-03 7:52 ` Nicola Vetrini [this message]
2023-10-02 7:49 ` [XEN PATCH 2/7] x86: add deviations for variables only used in asm code Nicola Vetrini
2023-10-02 22:37 ` Stefano Stabellini
2023-10-02 7:49 ` [XEN PATCH 3/7] x86: add deviation comments for asm-only functions Nicola Vetrini
2023-10-02 22:40 ` Stefano Stabellini
2023-10-02 7:49 ` [XEN PATCH 4/7] x86/grant: switch included header to make declarations visible Nicola Vetrini
2023-10-02 22:42 ` Stefano Stabellini
2023-10-03 7:00 ` Nicola Vetrini
2023-10-03 20:41 ` Stefano Stabellini
2023-10-02 7:49 ` [XEN PATCH 5/7] x86/vm_event: add missing include for hvm_vm_event_do_resume Nicola Vetrini
2023-10-02 7:49 ` [XEN PATCH 6/7] xen/console: make function static inline Nicola Vetrini
2023-10-02 22:42 ` Stefano Stabellini
2023-10-02 7:49 ` [XEN PATCH 7/7] x86/mem_access: make function static Nicola Vetrini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d9652187e9d0f15c5678273112c4ba56@bugseng.com \
--to=nicola.vetrini@bugseng.com \
--cc=Henry.Wang@arm.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=andrew.cooper3@citrix.com \
--cc=ayan.kumar.halder@amd.com \
--cc=bertrand.marquis@arm.com \
--cc=consulting@bugseng.com \
--cc=george.dunlap@citrix.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.org \
--cc=xenia.ragiadakou@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.