From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Martin Schwidefsky <schwidefsky@de.ibm.com>,
Jan Glauber <jan.glauber@de.ibm.com>,
linux-kernel@vger.kernel.org,
systemtap@sources.redhat.com, dwilder@us.ibm.com,
Mike Grundy <grundym@us.ibm.com>
Subject: Re: [PATCH] kprobes for s390 architecture
Date: Mon, 10 Jul 2006 09:31:00 -0000 [thread overview]
Message-ID: <20060710092852.GC9440@osiris.boeblingen.de.ibm.com> (raw)
In-Reply-To: <20060708195823.GA4112@localhost.localdomain>
> +static int __kprobes swap_instruction(void *aref)
> +{
> + unsigned long addr, prev, tmp;
> + int shift;
> + struct ins_replace_args *args = aref;
> +
> + addr = (unsigned long) args->ptr;
> + shift = (2 ^ (addr & 2)) << 3;
> + addr ^= addr & 2;
> + asm volatile(
> + " l %0,0(%4)\n"
> + " nr %0,%5\n"
> + " lr %1,%0\n"
Whitespace :)
> + " or %0,%2\n"
> + " or %1,%3\n"
> + "0: cs %0,%1,0(%4)\n"
> + " jnl 1f\n"
> + " xr %1,%0\n"
> + " nr %1,%5\n"
> + " jnz 0b\n"
> + "1:"
> +#ifndef __s390x__
> + ".section .fixup,\"ax\"\n"
> + "2: lhi %0,%6\n"
> + " bras 1,3f\n"
> + " .long 1b\n"
> + "3: l 1,0(1)\n"
> + " br 1\n"
> + ".previous\n"
> + ".section __ex_table,\"a\"\n"
> + " .align 4\n"
> + " .long 0b,2b\n"
> + ".previous"
> +#else /* __s390x__ */
> + ".section .fixup,\"ax\"\n"
> + "2: lghi %0,%6\n"
> + " jg 1b\n"
> + ".previous\n"
> + ".section __ex_table,\"a\"\n"
> + " .align 8\n"
> + " .quad 0b,2b\n"
> + ".previous"
> +#endif /* __s390x__ */
> + : "=&d" (prev), "=&d" (tmp)
> + : "d" (args->old << shift), "d" (args->new << shift),
> + "a" (args->ptr), "d" (~(65535 << shift)), "K" (-EFAULT)
> + : "memory", "cc" );
> + return prev >> shift;
You need a label behind the cs instruction and put that into the __ex_table,
since the PSW will point to the instruction after cs if it fails.
Also, on failure this function seems to return -EFAULT >> shift, which
seems to be wrong.
> +EXPORT_SYMBOL(register_die_notifier);
> +EXPORT_SYMBOL(unregister_die_notifier);
_GPL?
next prev parent reply other threads:[~2006-07-10 9:31 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20060623150344.GL9446@osiris.boeblingen.de.ibm.com>
2006-06-23 16:04 ` [heiko.carstens@de.ibm.com: Re: [PATCH] kprobes for s390 architecture] Michael Grundy
2006-06-23 22:21 ` [PATCH] kprobes for s390 architecture Heiko Carstens
2006-06-24 12:16 ` Heiko Carstens
2006-06-24 14:27 ` Heiko Carstens
2006-06-26 8:10 ` Mike Grundy
2006-06-26 10:33 ` Heiko Carstens
2006-06-27 18:53 ` Martin Schwidefsky
2006-06-28 16:49 ` Heiko Carstens
2006-07-07 17:23 ` Mike Grundy
2006-07-07 17:27 ` Heiko Carstens
2006-07-07 19:51 ` Frank Ch. Eigler
2006-07-08 15:59 ` Mike Grundy
2006-07-08 18:54 ` Mike Grundy
2006-07-08 19:58 ` Mike Grundy
2006-07-10 9:31 ` Heiko Carstens [this message]
2006-07-10 22:20 ` Mike Grundy
2006-07-10 14:25 ` Frank Ch. Eigler
2006-07-10 15:51 ` Frank Ch. Eigler
2006-07-11 13:54 ` Mike Grundy
2006-07-11 14:13 ` Martin Schwidefsky
2006-06-24 11:37 ` [heiko.carstens@de.ibm.com: Re: [PATCH] kprobes for s390 architecture] Michael Grundy
2006-06-12 17:17 [PATCH] kprobes for s390 architecture Mike Grundy
2006-06-12 19:40 ` Martin Schwidefsky
2006-06-21 4:28 ` Mike Grundy
2006-06-21 16:38 ` Martin Schwidefsky
2006-06-21 17:15 ` Mike Grundy
2006-06-27 11:58 ` Martin Schwidefsky
2006-06-21 17:34 ` Mike Grundy
2006-06-22 11:28 ` Jan Glauber
2006-06-22 16:36 ` Mike Grundy
2006-06-23 8:50 ` Jan Glauber
2006-06-23 14:39 ` Heiko Carstens
2006-06-22 1:38 ` Mike Grundy
2006-06-21 9:40 ` Jan Glauber
2006-06-21 16:23 ` Jan Glauber
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=20060710092852.GC9440@osiris.boeblingen.de.ibm.com \
--to=heiko.carstens@de.ibm.com \
--cc=dwilder@us.ibm.com \
--cc=grundym@us.ibm.com \
--cc=jan.glauber@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=schwidefsky@de.ibm.com \
--cc=systemtap@sources.redhat.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 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 read-only IMAP folder(s) and NNTP newsgroup(s).