Bug#652146: hwinfo: diff for NMU version 16.0-2.2

2012-01-22 Thread Christoph Biedl
Steffen Winterfeldt wrote...

 On Wed, 18 Jan 2012, Christoph Biedl wrote:
 
 Steffen Winterfeldt wrote...
 
 Thanks! But shouldn't it be 'mov %%rbx,%%rdi' etc, then?
 
 Hm, why? cpuid affects only the lower 32 Bits. Using %rbx instead
 shouldn't do harm, though.
 
 No, the result is zero-extended to 64 bits in 64bit-mode.

I stand corrected.

(Call me Thomas, I wanted to see that with my own eye, this took a
while, sorry about that.)


By the way, I am quite confused by the fact

  cpuid with %eax set to 0 returns the ID in %ebx,%edx,%ecx

while

  cpuid with %eax set to 0x4000 appearently returns, if running
  under xen, the ID in %ebx,%ecx,%edx, read: With %ecx and %edx in
  swapped order.

Mind of you double-check your code does the right thing unless you've
already done so? I don't have a Xen installation at hand to do this,
they crashed or did other nasty things every time I've tried in the
past six years.

Christoph



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#652146: hwinfo: diff for NMU version 16.0-2.2

2012-01-19 Thread Steffen Winterfeldt

On Wed, 18 Jan 2012, Christoph Biedl wrote:


Steffen Winterfeldt wrote...


Thanks! But shouldn't it be 'mov %%rbx,%%rdi' etc, then?


Hm, why? cpuid affects only the lower 32 Bits. Using %rbx instead
shouldn't do harm, though.


No, the result is zero-extended to 64 bits in 64bit-mode.


Steffen



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#652146: hwinfo: diff for NMU version 16.0-2.2

2012-01-18 Thread Christoph Biedl
Steffen Winterfeldt wrote...

 Thanks! But shouldn't it be 'mov %%rbx,%%rdi' etc, then?

Hm, why? cpuid affects only the lower 32 Bits. Using %rbx instead
shouldn't do harm, though.

Christoph


signature.asc
Description: Digital signature


Bug#652146: hwinfo: diff for NMU version 16.0-2.2

2012-01-17 Thread Steffen Winterfeldt

On Mon, 16 Jan 2012, Michael Prokop wrote:


tags 652146 + pending
forwarded 652146 snw...@suse.de
thanks

Cc-ing Steffen Winterfeldt as being upstream of hwinfo, he might be
interested in this issue + patch as well. Dear Steffen, full details
are available in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652146


Thanks! But shouldn't it be 'mov %%rbx,%%rdi' etc, then?


Steffen

--
Give orange me give eat orange me eat orange give me eat orange give me you.
(chimp Nim, using sign language)



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#652146: hwinfo: diff for NMU version 16.0-2.2

2012-01-16 Thread Michael Prokop
tags 652146 + pending
forwarded 652146 snw...@suse.de
thanks

Cc-ing Steffen Winterfeldt as being upstream of hwinfo, he might be
interested in this issue + patch as well. Dear Steffen, full details
are available in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652146

* Christoph Biedl [Mon Jan 16, 2012 at 01:07:14AM +0100]:
 Michael Prokop wrote...

  Problem doesn't seem to be present on 32bit systems,
  but on amd64 it's definitely reproducable.

 The most likely culprit is

 push %%rbx\n\t

 in src/hd/hd.c:hd_is_xen, in combination with the compiler and perhaps
 libc.
[...]

I was involved in debugging this issue and have just verified the
patch by Christoph against today's Debian/unstable once again, it
works fine for i386 + amd64, the segfault is no longer present with
the patch applied.

I've prepared an NMU for hwinfo (versioned as 16.0-2.2) and uploaded
it to DELAYED/5 (see attached file for the diff). Please feel free
to tell me if I should delay it longer.

regards,
-mika-
diff -u hwinfo-16.0/debian/changelog hwinfo-16.0/debian/changelog
--- hwinfo-16.0/debian/changelog
+++ hwinfo-16.0/debian/changelog
@@ -1,3 +1,12 @@
+hwinfo (16.0-2.2) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Add patch fix_segfault_in_hd_is_xen_on_amd64 which fixes segfaults
+on amd64. Thanks Christoph Biedl debian.a...@manchmal.in-ulm.de
+(Closes: #652146)
+
+ -- Michael Prokop m...@debian.org  Mon, 16 Jan 2012 11:02:29 +0100
+
 hwinfo (16.0-2.1) unstable; urgency=low
 
   * Non-maintainer upload.
diff -u hwinfo-16.0/debian/patches/series hwinfo-16.0/debian/patches/series
--- hwinfo-16.0/debian/patches/series
+++ hwinfo-16.0/debian/patches/series
@@ -10,0 +11 @@
+fix_segfault_in_hd_is_xen_on_amd64
only in patch2:
unchanged:
--- hwinfo-16.0.orig/debian/patches/fix_segfault_in_hd_is_xen_on_amd64
+++ hwinfo-16.0/debian/patches/fix_segfault_in_hd_is_xen_on_amd64
@@ -0,0 +1,24 @@
+diff --git a/src/hd/hd.c b/src/hd/hd.c
+index 1539121..18e89c3 100644
+--- a/src/hd/hd.c
 b/src/hd/hd.c
+@@ -3245,16 +3245,16 @@ int hd_is_xen(hd_data_t *hd_data)
+ mov %%edx,8(%%esi)\n\t
+ pop %%ebx
+ #else
+-push %%rbx\n\t
++mov %%ebx,%%edi\n\t
+ cpuid\n\t
+ mov %%ebx,(%%rsi)\n\t
+ mov %%ecx,4(%%rsi)\n\t
+ mov %%edx,8(%%rsi)\n\t
+-pop %%rbx
++mov %%edi,%%ebx\n\t
+ #endif
+ : =a (u), =c (foo)
+ : a (0x4000), c (0), S (signature)
+-: %edx
++: %edx, %edi
+   );
+ 
+   signature[12] = 0;


signature.asc
Description: Digital signature