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

[Xen-devel] Re: [PATCH 0/5] Collected vdso/vsyscall fixes for 3.1

To: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH 0/5] Collected vdso/vsyscall fixes for 3.1
From: Andrew Lutomirski <luto@xxxxxxx>
Date: Wed, 27 Jul 2011 12:15:51 -0400
Cc: jeremy@xxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx, x86@xxxxxxxxxx, Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>, virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx, keir.xen@xxxxxxxxx
Delivery-date: Wed, 27 Jul 2011 09:16:57 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=ErO53eRK7vRdXJHL5ZxA23nyYg2ex71lq44Aqcd3/+0=; b=pnUgaZCO+X6Lq0aSZPZ5Aq6Qq4nll/yZc+CoyZyvTsOBmRxJKO9CT2DiR+cswHF1wx ZaykpY/brprg8SvaDKPei4Dq7lyThDIRse4WWqGYF87rhIthiXaLwwM5InyZWN0bfcyu KJImzHFohTL3buFDyqtMJpMtX2RceL2A2yQQs=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20110727154316.GA16909@xxxxxxxxxxxx>
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>
References: <cover.1311736366.git.luto@xxxxxxx> <20110727145745.GA11872@xxxxxxxxxxxx> <CAObL_7FT8QLg-wihasBahhAtS=pA7+KeU8E=E9x8NPZ0+QJ5iQ@xxxxxxxxxxxxxx> <20110727153015.GA16688@xxxxxxxxxxxx> <CAObL_7GWGx4rYJFLpucEX=ozNpk+5ipyq0=vw16xcGetEXSuGQ@xxxxxxxxxxxxxx> <20110727154316.GA16909@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Wed, Jul 27, 2011 at 11:43 AM, Konrad Rzeszutek Wilk
<konrad.wilk@xxxxxxxxxx> wrote:
> On Wed, Jul 27, 2011 at 11:34:21AM -0400, Andrew Lutomirski wrote:
>> On Wed, Jul 27, 2011 at 11:30 AM, Konrad Rzeszutek Wilk
>> <konrad.wilk@xxxxxxxxxx> wrote:
>> >> > Anyhow, removed the benchmark code and ran it on 64-bit:
>> >> >
>> >> > sh-4.1# /test_vsyscall  test
>> >> > Testing gettimeofday...
>> >> > [  109.552261] test_vsyscall[2462] trap invalid opcode ip:400c8d 
>> >> > sp:7fff84fab470 error:0 in test_vsyscall[400000+2000]
>> >> > Illegal instruction
>> >> > sh-4.1# /test_vsyscall  intcc
>> >> > About to execute int 0xcc from RIP = 400959
>> >> > [  114.137150] test_vsyscall[2463] illegal int 0xcc (exploit attempt?) 
>> >> > ip:400959 cs:e033 sp:7fff8b328310 ax:2c si:0 di:7fff8b3280f0
>> >> > Caught SIGSEGV: Segmentation fault (Signal sent by the kernel 
>> >> > [(nil)])RIP = 400959
>> >> >
>> >> > [This is on 
>> >> > git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git #testing, 
>> >> > which
>> >> > has todays linus/master and your patchset]
>> >> >
>> >>
>> >> I'll set up Xen.  Something's clearly still buggy.
>> >
>> > You sure? This is what I get when I boot baremetal:
>> >
>> > sh-4.1#
>> > sh-4.1# xen-detect
>> > Not running on Xen.
>> > sh-4.1# /test_vsyscall test
>> > Testing gettimeo[   84.442819] test_vsyscall[3175] trap invalid opcode 
>> > ip:400c8d sp:7fffa8a72dc0 error:0fday...
>> >  in test_vsyscall[400000+2000]
>>
>> $ test_vsyscall test
>> Testing gettimeofday...
>>   vDSO offset = 0.000001s
>>   vsyscall offset = 0.000001s
>>
>> Testing time...
>>   vDSO offset = 0
>>   vsyscall offset = 0
>> Testing getcpu...
>>   ok!  cpu=6 node=0
>>
>> Can you send me your test_vsyscall binary so I can disassemble it?
>
> Here it is (also including source since I uncommented parts of it).
>
> One extra thing - I've been using AMD machines for this - I hadn't
> tried this on an Intel box.
>

Whoops!  The offending instruction is:

400c8d:       c4 e1 f3 2a c8          vcvtsi2sd %rax,%xmm1,%xmm1

which is unlikely to work on AMD unless you're the lucky owner of a
prerelease Bulldozer chip.  I

I bet if you pull a new copy or remove -mavx from Makefile it will
work.  I got a grossly hacked-up Xen domU booted and everything seems
to work.

(Testing native kernels is really fun with qemu-kvm -kernel <image>
-initrd <my silly initramfs>.  But Xen doesn't seem to support that.)

--Andy

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel