From: Keir Fraser <keir.xen@gmail.com>
To: Tim Deegan <tim@xen.org>, xen-devel@lists.xen.org
Cc: jbeulich@suse.com
Subject: Re: [PATCH] xen/x86: don't use '.ifnes' in bug frame construction.
Date: Thu, 29 Aug 2013 18:50:19 +0100 [thread overview]
Message-ID: <CE45486B.5BB7C%keir.xen@gmail.com> (raw)
In-Reply-To: <1377791751-31533-1-git-send-email-tim@xen.org>
On 29/08/2013 16:55, "Tim Deegan" <tim@xen.org> wrote:
> Spotted because it breaks the clang build for LLVM <3.2. .ifnes is
> not right here as it will choke on a string with embedded quotes.
>
> .ifnb would be better except that LLVM <3.2 doesn't support that either.
> It should be possible to use something like !!msg or !!msg[0] instead
> of a separate flag, but I gave up trying to find something that would
> make it through CPP, asm() and gas as a usable constant. :|
>
> Signed-off-by: Tim Deegan <tim@xen.org>
I'll leave it to Jan to Ack/apply this one.
-- Keir
> ---
> xen/include/asm-x86/bug.h | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/xen/include/asm-x86/bug.h b/xen/include/asm-x86/bug.h
> index 148975f..e5dd559 100644
> --- a/xen/include/asm-x86/bug.h
> +++ b/xen/include/asm-x86/bug.h
> @@ -25,7 +25,7 @@ struct bug_frame {
> #define BUGFRAME_bug 2
> #define BUGFRAME_assert 3
>
> -#define BUG_FRAME(type, line, ptr, msg) do {
> \
> +#define BUG_FRAME(type, line, ptr, second_frame, msg) do {
> \
> BUILD_BUG_ON((line) >> (BUG_LINE_LO_WIDTH + BUG_LINE_HI_WIDTH));
> \
> asm volatile ( ".Lbug%=: ud2\n"
> \
> ".pushsection .bug_frames.%c0, \"a\", @progbits\n"
> \
> @@ -33,7 +33,7 @@ struct bug_frame {
> ".Lfrm%=:\n"
> \
> ".long (.Lbug%= - .Lfrm%=) + %c4\n"
> \
> ".long (%c1 - .Lfrm%=) + %c3\n"
> \
> - ".ifnes \"" msg "\", \"\"\n"
> \
> + ".if " #second_frame "\n"
> \
> ".long 0, %c2 - .Lfrm%=\n"
> \
> ".endif\n"
> \
> ".popsection"
> \
> @@ -44,12 +44,14 @@ struct bug_frame {
> "i" (((line) >> BUG_LINE_LO_WIDTH) << BUG_DISP_WIDTH));
> \
> } while (0)
>
> -#define WARN() BUG_FRAME(BUGFRAME_warn, __LINE__, __FILE__, "")
> -#define BUG() BUG_FRAME(BUGFRAME_bug, __LINE__, __FILE__, "")
>
> -#define run_in_exception_handler(fn) BUG_FRAME(BUGFRAME_run_fn, 0, fn, "")
> +#define WARN() BUG_FRAME(BUGFRAME_warn, __LINE__, __FILE__, 0, NULL)
> +#define BUG() BUG_FRAME(BUGFRAME_bug, __LINE__, __FILE__, 0, NULL)
>
> -#define assert_failed(msg) BUG_FRAME(BUGFRAME_assert, __LINE__, __FILE__,
> msg)
> +#define run_in_exception_handler(fn) BUG_FRAME(BUGFRAME_run_fn, 0, fn, 0,
> NULL)
> +
> +#define assert_failed(msg) \
> + BUG_FRAME(BUGFRAME_assert, __LINE__, __FILE__, 1, msg)
>
> extern const struct bug_frame __start_bug_frames[],
> __stop_bug_frames_0[],
next prev parent reply other threads:[~2013-08-29 17:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-29 15:55 [PATCH] xen/x86: don't use '.ifnes' in bug frame construction Tim Deegan
2013-08-29 17:50 ` Keir Fraser [this message]
2013-08-30 8:29 ` Jan Beulich
2013-08-30 8:35 ` Andrew Cooper
2013-08-30 9:43 ` Tim Deegan
2013-08-30 9:58 ` 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=CE45486B.5BB7C%keir.xen@gmail.com \
--to=keir.xen@gmail.com \
--cc=jbeulich@suse.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xen.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 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.