This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-users] Need help with -PIE patch

To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-users] Need help with -PIE patch
From: Benjamin Schweikert <b.schweikert@xxxxxxxxxxxxxx>
Date: Fri, 13 May 2011 17:58:31 +0200
Delivery-date: Fri, 13 May 2011 09:07:29 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:content-type:content-transfer-encoding; bh=8T7AXbyswWK4IsPG1a7hoIKQS4O/j88mfYlzG1SEQv8=; b=GxffFZmi/uOfk+5T4+cxPcV0/Rcc9RMZhfbMwSJcmChpIqoe0nr+MAWgAn+aJsyf8I KVNxDRQpXRCebhP+OKJcgL/TaRvihONrpTBmOOMgoRtrGTqMzq3DGQzduCXGPNxoo0Cn 9CqSO/lJw4iN2dkGcSAAIDKhirlzBmobqC3y0=
Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=XSTYjMQRAB07bhmbZgOgeXPn7n0/9q1NsT+bZKD8VJEhyUt2dAvMBhOUMu5+mCNXbV duGxOR7o2h7pFJQFMWvLiWGbhXYrpGJYGHiU8wA8RoAsQbHWeF9p2ZDaeVVopTrdwIJp xfesaY0fw7XebAKiMyZKHld98BrADL8A86t6U=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Thunderbird/3.1.10
me and a friend of mine working on a patch with which xen-tools build with the CFLAGS -fpie and -stack-protection. We saw, that everything build expect of xen.detect. We developed a patch with which xen.detect builds and we can execute the binary after that, but we dont get the right information, that for example we are running a PV fedora domain. Maybe someone, who is better in assambler than we are can give us some hints.

thanx and bye


xen-detect: Change assembly cpuinfo code that allows this to be built with 

diff -r 4b0692880dfa tools/misc/xen-detect.c
--- a/tools/misc/xen-detect.c   Thu May 05 17:40:34 2011 +0100
+++ b/tools/misc/xen-detect.c   Fri May 06 17:14:46 2011 +0200
@@ -41,8 +41,20 @@
                   int pv_context)
     asm volatile (
-        "test %1,%1 ; jz 1f ; ud2a ; .ascii \"xen\" ; 1: cpuid"
-        : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx)
+        "test %1,%1 ; jz 1f ; ud2a ; .ascii \"xen\" ;"
+#if defined(__PIC__)&&  defined(__i386__)
+        "1: pushl %%ebx;"
+        "cpuid;"
+        "movl %%ebx,%%esi;"
+        "popl %%ebx"
+        : "=S" (*ebx),
+        "1: cpuid"
+        : "=b" (*ebx),
+          "=a" (*eax),
+          "=c" (*ecx),
+          "=d" (*edx)
         : "0" (idx), "1" (pv_context) );

Xen-users mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-users] Need help with -PIE patch, Benjamin Schweikert <=