From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: Multicall result missing sign extension in Xen or Linux Date: Fri, 03 Aug 2012 22:26:29 +0100 Message-ID: References: <501C1F14.9000505@tycho.nsa.gov> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <501C1F14.9000505@tycho.nsa.gov> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Daniel De Graaf , xen-devel Cc: Jeremy Fitzhardinge , Konrad Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org On 03/08/2012 19:57, "Daniel De Graaf" wrote: > While trying to figure out why a failing component of a multicall did not > properly return its result, I discovered that multicall results are not > sign-extended when placed in the unsigned long result field. For hypercalls > such as do_mmu_update which return a (signed) int, this results in Linux > incorrectly thinking the hypercall succeeded when it has actually failed > since arch/x86/xen/multicalls.c uses a signed long for "result" and checks > (b->entries[i].result < 0). > > Is this a bug in Xen (using the wrong return type for do_mmu_op and other > hypercalls) or in Linux (assuming all returns are signed longs)? One or the > other needs to be changed, because the current setup is silently hiding > failed memory mapping operations. I think this is a Xen bug, and we should update all hypercalls to explicitly return a long. Nice and straightforward. -- Keir