From: Jan Beulich <jbeulich@suse.com>
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: "Julien Grall" <julien@xen.org>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Gianluca Guida" <gianluca@rivosinc.com>,
"Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v8 5/5] xen/x86: switch x86 to use generic implemetation of bug.h
Date: Thu, 16 Mar 2023 10:52:11 +0100 [thread overview]
Message-ID: <9af94e49-ff66-5e7f-bf5f-ba4095cfed13@suse.com> (raw)
In-Reply-To: <5e252e8dacea5c4f2fdbb4f7970e34a862987639.1678900513.git.oleksii.kurochko@gmail.com>
On 15.03.2023 18:21, Oleksii Kurochko wrote:
> The following changes were made:
> * Make GENERIC_BUG_FRAME mandatory for X86
> * Update asm/bug.h using generic implementation in <xen/bug.h>
> * Update do_invalid_op using generic do_bug_frame()
> * Define BUG_DEBUGGER_TRAP_FATAL to debugger_trap_fatal(X86_EXC_GP,regs)
> * type of eip variable was changed to 'const void *'
> * add '#include <xen/debugger.h>'
>
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> ---
> Changes in V8:
> * move <xen/debuger.h> from <asm/bug.h> to <common/bug.c> to fix compilation issue.
> The following compilation issue occurs:
> In file included from ./arch/x86/include/asm/smp.h:10,
> from ./include/xen/smp.h:4,
> from ./arch/x86/include/asm/processor.h:10,
> from ./arch/x86/include/asm/system.h:6,
> from ./arch/x86/include/asm/atomic.h:5,
> from ./include/xen/gdbstub.h:24,
> from ./arch/x86/include/asm/debugger.h:10,
> from ./include/xen/debugger.h:24,
> from ./arch/x86/include/asm/bug.h:7,
> from ./include/xen/bug.h:15,
> from ./include/xen/lib.h:27,
> from ./include/xen/perfc.h:6,
> from arch/x86/x86_64/asm-offsets.c:9:
> ./include/xen/cpumask.h: In function 'cpumask_check':
> ./include/xen/cpumask.h:84:9: error: implicit declaration of function 'ASSERT' [-Werror=implicit-function-declaration]
> 84 | ASSERT(cpu < nr_cpu_ids);
I'm going to post a patch to address this specific failure. But something
similar may then surface elsewhere.
> It happens in case when CONFIG_CRASH_DEBUG is enabled
I have to admit that I don't see the connection to CRASH_DEBUG: It's the
asm/atomic.h inclusion that's problematic afaics, yet that (needlessly)
happens outside the respective #ifdef in xen/gdbstub.h.
If another instance of this header interaction issue would surface despite
my to-be-posted patch, I'd be okay with going this route for the moment.
But I think the real issue here is xen/lib.h including xen/bug.h. Instead
of that, some stuff that's presently in xen/lib.h should instead move to
xen/bug.h, and the inclusion there be dropped. Any parties actually using
stuff from xen/bug.h (xen/lib.h then won't anymore) should then include
that header themselves.
Jan
> and the reason for that is when
> <xen/lib.h> is included in <x86_64/asm-offsets.c>:9 the "layout" of <xen/lib.h> would be
> the following:
> #include <xen/bug.h>:
> #include <asm/bug.h>:
> #include <xen/debugger.h>:
> ....
> cpumask.h:
> ....
> ASSERT(cpu < nr_cpu_ids);
> return cpu;
> ....
> ....
> #define ASSERT ...
> ....
> Thereby ASSERT is defined after it was used in <xen/cpumask.h>.
next prev parent reply other threads:[~2023-03-16 9:52 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-15 17:21 [PATCH v8 0/5] introduce generic implementation of macros from bug.h Oleksii Kurochko
2023-03-15 17:21 ` [PATCH v8 1/5] xen: introduce CONFIG_GENERIC_BUG_FRAME Oleksii Kurochko
2023-03-16 10:03 ` Jan Beulich
2023-03-16 11:26 ` Jan Beulich
2023-03-17 9:23 ` Oleksii
2023-03-17 14:59 ` Jan Beulich
2023-03-20 11:36 ` Oleksii
2023-03-21 11:18 ` Oleksii
2023-03-21 13:35 ` Jan Beulich
2023-03-21 14:44 ` Oleksii
2023-03-15 17:21 ` [PATCH v8 2/5] xen/arm: remove unused defines in <asm/bug.h> Oleksii Kurochko
2023-03-15 17:21 ` [PATCH v8 3/5] xen: change <asm/bug.h> to <xen/bug.h> Oleksii Kurochko
2023-03-15 17:21 ` [PATCH v8 4/5] xen/arm: switch ARM to use generic implementation of bug.h Oleksii Kurochko
2023-03-15 17:21 ` [PATCH v8 5/5] xen/x86: switch x86 to use generic implemetation " Oleksii Kurochko
2023-03-16 9:52 ` Jan Beulich [this message]
2023-03-27 16:10 ` Oleksii
2023-03-28 8:13 ` Jan Beulich
2023-03-28 15:38 ` Oleksii
2023-03-28 16:38 ` Oleksii
2023-03-28 16:55 ` Oleksii
2023-03-29 7:15 ` Jan Beulich
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=9af94e49-ff66-5e7f-bf5f-ba4095cfed13@suse.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=gianluca@rivosinc.com \
--cc=julien@xen.org \
--cc=oleksii.kurochko@gmail.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).