public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug tapsets/18650] New: powerpc variant of longlong_arg() for uprobes swaps the byte order
@ 2015-07-09  9:39 mcermak at redhat dot com
  2015-07-09 11:38 ` [Bug tapsets/18650] powerpc variant of longlong_arg() for uprobes swaps the high and low half of its 64bit retval mcermak at redhat dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: mcermak at redhat dot com @ 2015-07-09  9:39 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=18650

            Bug ID: 18650
           Summary: powerpc variant of longlong_arg() for uprobes swaps
                    the byte order
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: tapsets
          Assignee: systemtap at sourceware dot org
          Reporter: mcermak at redhat dot com
  Target Milestone: ---

After some testing I came to a conclusion that following change should be done
in tapsets:

=======
$ git diff
diff --git a/tapset/powerpc/registers.stp b/tapset/powerpc/registers.stp
index 1daf5ba..3adcc73 100644
--- a/tapset/powerpc/registers.stp
+++ b/tapset/powerpc/registers.stp
@@ -186,8 +186,8 @@ function ulong_arg:long (argnum:long) {

 function longlong_arg:long (argnum:long) {
        if (probing_32bit_app()) {
-               lowbits = _stp_arg2(argnum, 0, 1, 0)
-               highbits = _stp_arg2(argnum+1, 0, 1, 0)
+               highbits = _stp_arg2(argnum, 0, 1, 0)
+               lowbits = _stp_arg2(argnum+1, 0, 1, 0)
                return ((highbits << 32) | lowbits)
        } else
                return _stp_arg2(argnum, 0, 0, 1)
diff --git a/tapset/s390/registers.stp b/tapset/s390/registers.stp
index 3fd2560..3e33baa 100644
--- a/tapset/s390/registers.stp
+++ b/tapset/s390/registers.stp
@@ -272,7 +272,6 @@ function ulong_arg:long (argnum:long) {

 function longlong_arg:long (argnum:long) {
        if (probing_32bit_app()) {
-               /* TODO verify if this is correct for 31bit apps */
                highbits = _stp_arg2(argnum, 0, 1, 0)
                lowbits = _stp_arg2(argnum+1, 0, 1, 0)
                return ((highbits << 32) | lowbits)
$
=======

Does this look about correct?

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tapsets/18650] powerpc variant of longlong_arg() for uprobes swaps the high and low half of its 64bit retval
  2015-07-09  9:39 [Bug tapsets/18650] New: powerpc variant of longlong_arg() for uprobes swaps the byte order mcermak at redhat dot com
@ 2015-07-09 11:38 ` mcermak at redhat dot com
  2015-07-09 15:59 ` dsmith at redhat dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: mcermak at redhat dot com @ 2015-07-09 11:38 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=18650

Martin Cermak <mcermak at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|powerpc variant of          |powerpc variant of
                   |longlong_arg() for uprobes  |longlong_arg() for uprobes
                   |swaps the byte order        |swaps the high and low half
                   |                            |of its 64bit retval

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tapsets/18650] powerpc variant of longlong_arg() for uprobes swaps the high and low half of its 64bit retval
  2015-07-09  9:39 [Bug tapsets/18650] New: powerpc variant of longlong_arg() for uprobes swaps the byte order mcermak at redhat dot com
  2015-07-09 11:38 ` [Bug tapsets/18650] powerpc variant of longlong_arg() for uprobes swaps the high and low half of its 64bit retval mcermak at redhat dot com
@ 2015-07-09 15:59 ` dsmith at redhat dot com
  2015-07-10 14:11 ` mcermak at redhat dot com
  2015-07-14  6:14 ` mcermak at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: dsmith at redhat dot com @ 2015-07-09 15:59 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=18650

David Smith <dsmith at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dsmith at redhat dot com

--- Comment #1 from David Smith <dsmith at redhat dot com> ---
The powerpc change seems correct, as can be seen in the following function
prototypes:

asmlinkage int compat_sys_ftruncate64(unsigned int fd, u32 reg4,              
                                      unsigned long high, unsigned long low)  
asmlinkage int compat_sys_truncate64(const char __user * path, u32 reg4,      
                                     unsigned long high, unsigned long low)   

I'd say your patch looks correct.

Up to this fairly recently 'powerpc' has always meant big-endian powerpc. With
the introduction of little-endian powerpc linux support, things have changed.
Have you tried this code work on a ppc64le system?

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tapsets/18650] powerpc variant of longlong_arg() for uprobes swaps the high and low half of its 64bit retval
  2015-07-09  9:39 [Bug tapsets/18650] New: powerpc variant of longlong_arg() for uprobes swaps the byte order mcermak at redhat dot com
  2015-07-09 11:38 ` [Bug tapsets/18650] powerpc variant of longlong_arg() for uprobes swaps the high and low half of its 64bit retval mcermak at redhat dot com
  2015-07-09 15:59 ` dsmith at redhat dot com
@ 2015-07-10 14:11 ` mcermak at redhat dot com
  2015-07-14  6:14 ` mcermak at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: mcermak at redhat dot com @ 2015-07-10 14:11 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=18650

--- Comment #2 from Martin Cermak <mcermak at redhat dot com> ---
(In reply to David Smith from comment #1)
> Up to this fairly recently 'powerpc' has always meant big-endian powerpc.
> With the introduction of little-endian powerpc linux support, things have
> changed. Have you tried this code work on a ppc64le system?

I did test it, but ppc64le doesn't have compat tasks. This change doesn't
affect ppc64le.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tapsets/18650] powerpc variant of longlong_arg() for uprobes swaps the high and low half of its 64bit retval
  2015-07-09  9:39 [Bug tapsets/18650] New: powerpc variant of longlong_arg() for uprobes swaps the byte order mcermak at redhat dot com
                   ` (2 preceding siblings ...)
  2015-07-10 14:11 ` mcermak at redhat dot com
@ 2015-07-14  6:14 ` mcermak at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: mcermak at redhat dot com @ 2015-07-14  6:14 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=18650

Martin Cermak <mcermak at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Martin Cermak <mcermak at redhat dot com> ---
Fixed in commit e506e9e1676f122b86d7b288da19beb59b4f240a

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-07-14  6:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-09  9:39 [Bug tapsets/18650] New: powerpc variant of longlong_arg() for uprobes swaps the byte order mcermak at redhat dot com
2015-07-09 11:38 ` [Bug tapsets/18650] powerpc variant of longlong_arg() for uprobes swaps the high and low half of its 64bit retval mcermak at redhat dot com
2015-07-09 15:59 ` dsmith at redhat dot com
2015-07-10 14:11 ` mcermak at redhat dot com
2015-07-14  6:14 ` mcermak at redhat dot com

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).