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] [Patch] cmpxchg emulation returns wrong ZF

To: Jan Beulich <JBeulich@xxxxxxxxxx>
Subject: Re: [Xen-devel] [Patch] cmpxchg emulation returns wrong ZF
From: Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
Date: Thu, 06 Aug 2009 10:12:24 +0200
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 06 Aug 2009 01:12:53 -0700
Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=ts.fujitsu.com; i=juergen.gross@xxxxxxxxxxxxxx; q=dns/txt; s=s1536b; t=1249546304; x=1281082304; h=from:sender:reply-to:subject:date:message-id:to:cc: mime-version:content-transfer-encoding:content-id: content-description:resent-date:resent-from:resent-sender: resent-to:resent-cc:resent-message-id:in-reply-to: references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:list-owner:list-archive; z=From:=20Juergen=20Gross=20<juergen.gross@xxxxxxxxxxxxxx> |Subject:=20Re:=20[Xen-devel]=20[Patch]=20cmpxchg=20emula tion=20returns=20wrong=20ZF|Date:=20Thu,=2006=20Aug=20200 9=2010:12:24=20+0200|Message-ID:=20<4A7A9068.8020603@xxxx ujitsu.com>|To:=20Jan=20Beulich=20<JBeulich@xxxxxxxxxx> |CC:=20"xen-devel@xxxxxxxxxxxxxxxxxxx"=20<xen-devel@lists .xensource.com>|MIME-Version:=201.0 |Content-Transfer-Encoding:=207bit|In-Reply-To:=20<4A7AAA 0C020000780000E59B@xxxxxxxxxxxxxxxxxx>|References:=20<4A7 A7CEB.9080702@xxxxxxxxxxxxxx>=20<4A7AAA0C020000780000E59B @vpn.id2.novell.com>; bh=+CgAzpVirhFuk8YPkmyWebTvohDl2bKOblnrpeowsIE=; b=M1uQWgRYTUwwo08f9yF+fdjj8TudnmkmHCV+UnbaLCB4ERnwQqfC1lOh SXLzDLAG1wd9FIp5+6y1Fupa2OGOa76p1jbMzUqiK6GdHgRcdiV/MBiXG aVFewiQKvYMWPlREw7+BvvdbpFR7DeyS7joGaJwNU4bjpv4Jv8GSIjvDw kTZdIAZtaKVA6E3wXd+9cLy8pVjVndJ6aK3TwQJ9Kbm1c6Pdc6MzFqs9W VVngxHDwVgtrH6cAuWX176hBK5f1F;
Domainkey-signature: s=s1536a; d=ts.fujitsu.com; c=nofws; q=dns; h=X-SBRSScore:X-IronPort-AV:Received:X-IronPort-AV: Received:Received:Message-ID:Date:From:Organization: User-Agent:MIME-Version:To:CC:Subject:References: In-Reply-To:X-Enigmail-Version:Content-Type: Content-Transfer-Encoding; b=nCBgyWyjEdJbab7NQ4DxZX+NbNXaPOes9KxqaJ1WqbOQpondMIaEkG0s cSMJsOwKl1HXkDn7Or9oLBYipajXRVjol31JWPKtVEcmswtuUKWymDHW9 ZB3esytYURn47+FZXtQUfKZyvAYBb9eSuTlQJXmiVJdYwrgf++Rzz6M7f BC1yjVM0jTP8WRGIKGP1L4dshtV9k5KSJFKZp3d2ZcQI3pEYjSbyxlQHh rRVjUr36yKQGDH7h2Yjexp5EGWTL6;
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4A7AAA0C020000780000E59B@xxxxxxxxxxxxxxxxxx>
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>
Organization: Fujitsu Technology Solutions
References: <4A7A7CEB.9080702@xxxxxxxxxxxxxx> <4A7AAA0C020000780000E59B@xxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090707)
Jan Beulich wrote:
>>>> Juergen Gross <juergen.gross@xxxxxxxxxxxxxx> 06.08.09 08:49 >>>
>> Hi,
>>
>> attached patch corrects a bug in cmpxchg emulation in the hypervisor.
>>
>> BS2000 running as HVM-domain on 4 vcpus (no HAP) hit an error due to this bug
>> after several days.
> 
> Why don't you just clear ZF in that case? I think it is intentional that the
> code doesn't loop inside the hypervisor, since that loop is non-preemptible
> (whereas returning to the guest and re-issuing the instruction is).
> 
> Further, I'm not really clear why that change is necessary at all: In the
> code prior to the patch, register state is not being updated if
> ops->cmpxchg() failed, and hence the old value of ZF is simply being
> retained - which is the correct thing to do when intending to re-start
> the instruction.

Oh yes, you are right!
I missed that eip isn't updated then, too.

Please forget that patch. I'll continue to investigate the problem...


Juergen

-- 
Juergen Gross                 Principal Developer Operating Systems
TSP ES&S SWE OS6                       Telephone: +49 (0) 89 636 47950
Fujitsu Technolgy Solutions               e-mail: juergen.gross@xxxxxxxxxxxxxx
Otto-Hahn-Ring 6                        Internet: ts.fujitsu.com
D-81739 Muenchen                 Company details: ts.fujitsu.com/imprint.html

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

<Prev in Thread] Current Thread [Next in Thread>