WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Need help with xen-detect patch

To: Benjamin Schweikert <b.schweikert@xxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Need help with xen-detect patch
From: Keir Fraser <keir.xen@xxxxxxxxx>
Date: Wed, 15 Jun 2011 20:15:59 +0100
Cc:
Delivery-date: Wed, 15 Jun 2011 12:17:36 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:user-agent:date:subject:from:to:message-id :thread-topic:thread-index:in-reply-to:mime-version:content-type; bh=Q2aKt4uIc2CvsP3UFJk7wLzdjbFjTH34Nd6btYI2OQg=; b=Lpakzpimt1fsM6313VU53sZ81yBlRnq/cBKlrxtkLZwFU3asATNRN03VLBFBYDQqSd mQU4jngPYNAKs2QCZyTOwpGri/QW34nu4hu4Fiy0pX4Dwy8pWZ1KZ4QCVSmxx3fm833Q 8M5wPd/8qqN7A2Hsx7wvhMtI8Ly+b1rRRIeFg=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=user-agent:date:subject:from:to:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type; b=qFvPchWTtt2FJPqWDJ6ViV2PfvHcIyF+H8We+TrMFXd5fcSvSbZewA0DQMRbT4PwIi 6gmt0zHLDZUzXX1TF4BOV/fKzeDWtOgrnxUXPzwIpi04y9TjScUAVEhXAbjGMshHNoCh OXcc8QdMk5BZ5HyQ5KParWeQmn6w1ltVfVHa8=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <BANLkTi=qFn2AwpOE9_qeokqXSmKniDvX9g@xxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcwrkKiN6xzhq7ScIE6uDihRSZJ9DA==
Thread-topic: [Xen-devel] Need help with xen-detect patch
User-agent: Microsoft-Entourage/12.29.0.110113
On 15/06/2011 12:28, "Benjamin Schweikert" <b.schweikert@xxxxxxxxxxxxxx>
wrote:

> Hi,
> 
> me and a friend of mine working on a patch with which xen-tools build with the
> CFLAGS pie/pic and stack-protection. We saw, that everything builds 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
> assembly than we are can give us some hints.

Try the attached patch. I can apply it to xen-unstable if it works okay for
you.

 -- Keir

> thanx and bye
> 
> Ben
> 
> xen-detect: Change assembly cpuinfo code that allows this to be built with
> -fPIC.
> 
> 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),
> +#else
> +        "1: cpuid"
> +        : "=b" (*ebx),
> +#endif
> +          "=a" (*eax),
> +          "=c" (*ecx),
> +          "=d" (*edx)
>          : "0" (idx), "1" (pv_context) );
>  } 
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel

Attachment: 00-xen-detect
Description: Binary data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>