public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in app-emulation/open-vm-tools/files: checkvm-pie-safety.patch
@ 2009-11-07 13:46 Vadim Kuznetsov (vadimk)
  0 siblings, 0 replies; 2+ messages in thread
From: Vadim Kuznetsov (vadimk) @ 2009-11-07 13:46 UTC (permalink / raw
  To: gentoo-commits

vadimk      09/11/07 13:46:15

  Added:                checkvm-pie-safety.patch
  Log:
  Bug 200376
  (Portage version: 2.2_rc48/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  app-emulation/open-vm-tools/files/checkvm-pie-safety.patch

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/open-vm-tools/files/checkvm-pie-safety.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/open-vm-tools/files/checkvm-pie-safety.patch?rev=1.1&content-type=text/plain

Index: checkvm-pie-safety.patch
===================================================================
--- a/checkvm/checkvm.c
+++ b/checkvm/checkvm.c
@@ -79,8 +79,16 @@
 {
    uint32 eax, ebx, ecx, edx;
    
-   __asm__ volatile("inl (%%dx)" :
-   	            "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) :
+   __asm__ volatile(
+#if defined __PIC__ && !vm_x86_64 // %ebx is reserved by the compiler.
+		    "movl %%ebx, %3    \n\t"
+		    "inl (%%dx)        \n\t"
+		    "xchgl %%ebx, %3   \n\t" :
+		    "=a"(eax), "=c"(ecx), "=d"(edx), "=r"(ebx) :
+#else
+		    "inl (%%dx)" :
+		    "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) :
+#endif
 		    "0"(BDOOR_MAGIC), "1"(BDOOR_CMD_GETVERSION),
 		    "2"(BDOOR_PORT) : "memory");
    version[0] = eax;
@@ -96,8 +104,16 @@
 {
    uint32 eax, ebx, ecx, edx;
    
-   __asm__ volatile("inl (%%dx)" :
-   	            "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) :
+   __asm__ volatile(
+#if defined __PIC__ && !vm_x86_64 // %ebx is reserved by the compiler.
+		    "movl %%ebx, %3    \n\t"
+		    "inl (%%dx)        \n\t"
+		    "xchgl %%ebx, %3   \n\t" :
+		    "=a"(eax), "=c"(ecx), "=d"(edx), "=r"(ebx) :
+#else
+		    "inl (%%dx)" :
+		    "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) :
+#endif
 		    "0"(BDOOR_MAGIC), "1"(BDOOR_CMD_GETHWVERSION),
 		    "2"(BDOOR_PORT) : "memory");
    *hwVersion = eax;
@@ -112,8 +128,16 @@
 {
    uint32 eax, ebx, ecx, edx;
    
-   __asm__ volatile("inl (%%dx)" :
-   		    "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) :
+   __asm__ volatile(
+#if defined __PIC__ && !vm_x86_64 // %ebx is reserved by the compiler.
+		    "movl %%ebx, %3    \n\t"
+		    "inl (%%dx)        \n\t"
+		    "xchgl %%ebx, %3   \n\t" :
+		    "=a"(eax), "=c"(ecx), "=d"(edx), "=r"(ebx) :
+#else
+		    "inl (%%dx)" :
+		    "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) :
+#endif
 		    "0"(BDOOR_MAGIC), "1"(BDOOR_CMD_GETSCREENSIZE),
 		    "2"(BDOOR_PORT) : "memory");
    *screensize = eax;







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

* [gentoo-commits] gentoo-x86 commit in app-emulation/open-vm-tools/files: checkvm-pie-safety.patch
@ 2009-11-14 22:09 Gordon Malm (gengor)
  0 siblings, 0 replies; 2+ messages in thread
From: Gordon Malm (gengor) @ 2009-11-14 22:09 UTC (permalink / raw
  To: gentoo-commits

gengor      09/11/14 22:09:53

  Modified:             checkvm-pie-safety.patch
  Log:
  I appreciate your quickness to commit this patch, but please do not ever drop credits and references.
  (Portage version: 2.1.6.13/cvs/Linux i686)

Revision  Changes    Path
1.2                  app-emulation/open-vm-tools/files/checkvm-pie-safety.patch

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/open-vm-tools/files/checkvm-pie-safety.patch?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/open-vm-tools/files/checkvm-pie-safety.patch?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/open-vm-tools/files/checkvm-pie-safety.patch?r1=1.1&r2=1.2

Index: checkvm-pie-safety.patch
===================================================================
RCS file: /var/cvsroot/gentoo-x86/app-emulation/open-vm-tools/files/checkvm-pie-safety.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- checkvm-pie-safety.patch	7 Nov 2009 13:46:15 -0000	1.1
+++ checkvm-pie-safety.patch	14 Nov 2009 22:09:53 -0000	1.2
@@ -1,3 +1,11 @@
+From: Gordon Malm <gengor@gentoo.org>
+
+Make inline asm PIC-safe (do not clobber ebx).
+
+Thanks and credit to Anthony Basile for all his help and testing.
+
+Reference: http://bugs.gentoo.org/200376
+
 --- a/checkvm/checkvm.c
 +++ b/checkvm/checkvm.c
 @@ -79,8 +79,16 @@
@@ -57,4 +65,3 @@
  		    "0"(BDOOR_MAGIC), "1"(BDOOR_CMD_GETSCREENSIZE),
  		    "2"(BDOOR_PORT) : "memory");
     *screensize = eax;
-






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

end of thread, other threads:[~2009-11-14 22:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-14 22:09 [gentoo-commits] gentoo-x86 commit in app-emulation/open-vm-tools/files: checkvm-pie-safety.patch Gordon Malm (gengor)
  -- strict thread matches above, loose matches on Subject: below --
2009-11-07 13:46 Vadim Kuznetsov (vadimk)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox