From: Mike Frysinger <vapier@gentoo.org>
To: David Howells <dhowells@redhat.com>
Cc: linux-arch@vger.kernel.org, mingo@elte.hu, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/7] Add conditional oopsing with annotation
Date: Sat, 17 Dec 2011 14:15:55 -0500 [thread overview]
Message-ID: <201112171415.57601.vapier@gentoo.org> (raw)
In-Reply-To: <20111216141357.24668.49793.stgit@warthog.procyon.org.uk>
[-- Attachment #1: Type: Text/Plain, Size: 1477 bytes --]
On Friday 16 December 2011 09:13:57 David Howells wrote:
> --- a/arch/x86/include/asm/bug.h
> +++ b/arch/x86/include/asm/bug.h
>
> +extern const void __arch_annotated_bug;
> +#define arch_annotated_bug(desc) \
> + do { \
> + asm volatile(".globl __arch_annotated_bug\n" \
> + "__arch_annotated_bug:\n" \
> + " ud2\n" \
> + : : "d" (desc)); \
> + unreachable(); \
> + } while (0)
> +
> +#define is_arch_annotated_bug(regs) \
> + ({ ((const void *)regs->ip == &__arch_annotated_bug) ? \
> + (struct annotated_bug *)regs->dx : NULL; })
seems like this is making arches duplicate a bit of logic they shouldn't have
to ... you could have asm-generic/bug.h do:
#ifdef arch_annotated_bug_fail
extern const void __arch_annotated_bug;
# define ARCH_ANNOTATED_SYM_STR CONFIG_SYMBOL_PREFIX"__arch_annotated_bug"
# define arch_annotated_bug(desc) \
do { \
asm volatile(".globl " ARCH_ANNOTATED_SYM ";\n" \
ARCH_ANNOTATED_SYM_STR":\n"); \
arch_annotated_bug_fail(desc) ; \
unreachable(); \
} while (0)
# define is_arch_annotated_bug(regs) \
({ (instruction_pointer(regs) == &__arch_annotated_bug) ? \
(struct annotated_bug *)arch_annotated_bug_struct(regs) : \
NULL; })
#endif
so now arches have to define two small bits. in the x86 case:
#define arch_annotated_bug_fail(desc) asm volatile("ud2;" : : "d" (desc))
#define arch_annotated_bug_struct(regs) (regs)->dx
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2011-12-17 19:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-16 14:13 [PATCH 1/7] Add conditional oopsing with annotation David Howells
2011-12-16 14:14 ` [PATCH 2/7] Make shrink_dcache_for_umount_subtree() use ANNOTATED_BUG() David Howells
2011-12-16 14:14 ` [PATCH 3/7] Add assertion checking macros David Howells
2011-12-16 21:36 ` Andi Kleen
2011-12-20 15:38 ` David Howells
2011-12-16 14:14 ` [PATCH 4/7] FS-Cache: Use new core assertion macros David Howells
2011-12-16 14:14 ` [PATCH 5/7] CacheFiles: " David Howells
2011-12-16 14:14 ` [PATCH 6/7] AFS: " David Howells
2011-12-16 14:14 ` [PATCH 7/7] RxRPC: " David Howells
2011-12-17 19:15 ` Mike Frysinger [this message]
2011-12-18 8:02 ` [PATCH 1/7] Add conditional oopsing with annotation Ingo Molnar
2011-12-20 15:34 ` David Howells
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=201112171415.57601.vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=dhowells@redhat.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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.