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] Re: how to handle paged hypercall args?

To: Olaf Hering <olaf@xxxxxxxxx>
Subject: Re: [Xen-devel] Re: how to handle paged hypercall args?
From: Keir Fraser <keir@xxxxxxx>
Date: Thu, 11 Nov 2010 21:00:03 +0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 11 Nov 2010 13:01:11 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:user-agent:date :subject:from:to:cc:message-id:thread-topic:thread-index:in-reply-to :mime-version:content-type:content-transfer-encoding; bh=ROYkCvoqwyE2npRlixWBhhdp4TC+aGM624v7uJHfejo=; b=Bm+FyHiCQ0zVPipJjH+LbqHJtnLM/1RZJwTSs6qhEwsI4ZvrRlxlbojx2nCQsMb7fN RnTJQwyE1nzZFCitxp5R4pwH65mi3XrJDH4r2JuqVsckR4kv9nhdsvzMEHfdG1a0ZY7M c2/7JrGzaBlo7i4gJxkPFXhnIwdTibMNY/QHA=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; b=fanLbbytwfsa1speHkqR+1zF2eJdON1DE+pMA83/cAk3dV1N7MkYZAH6tdj3Yy/9Td DUIAMsoAGYC+5LGlh2prYsXfYUx2qlEE88Zdgoq2mBG8/1YJ41GMwsQ+ZHL4iiIE0gCU p5nExu299ouw7qEtYo5sRSR43UXNZumjH33Y8=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20101111203438.GA18469@xxxxxxxxx>
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: AcuB42kJozqgotQj5UCVx9Kh5M9SKw==
Thread-topic: [Xen-devel] Re: how to handle paged hypercall args?
User-agent: Microsoft-Entourage/12.27.0.100910
On 11/11/2010 20:34, "Olaf Hering" <olaf@xxxxxxxxx> wrote:

> On Thu, Nov 11, Keir Fraser wrote:
> 
>> On 11/11/2010 14:33, "Olaf Hering" <olaf@xxxxxxxxx> wrote:
>> 
>>> So is that an acceptable way to deal with the HVMCOPY_gfn_paged_out
>>> return codes from __hvm_copy?
>>> Or should I explore some different way, like spinning there and possible
>>> let other threads-of-execution make progress while waiting for the gfns
>>> to come back?
>> 
>> You can't just spin because Xen is not preemptible. If it were a single CPU
>> system for example, no other thread would ever run again. You have to 'spin'
>> via a preemptible loop that returns to guest context and then back into the
>> hypercall. Which appears to be what you're doing.
> 
> Thanks for the answer.
> 
> It occoured to me that this is an issue for hypercalls made by the
> guest. There are probably not that many in use. So it shouldnt be that
> hard to audit the few drivers what they use and add some error handling.
> Up to now, only do_memory_op had an issue.

Only other thing I'd say is that depending on how often this happens,
because paging in may well require a slow I/O operation, it may even be nice
to sleep the waiting vcpu rather than spin. Would require some mechanism to
record what vcpus are waiting for what mfns, and to check that list when
paging stuff in. I guess it's rather a 'phase 2' thing after things actually
work reliably!

 -- Keir

> 
> Olaf
> 



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