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 4/6] mm: New XENMEM space, XENMAPSPACE_gmfn_range

To: Jan Beulich <JBeulich@xxxxxxxx>, Jean Guyader <jean.guyader@xxxxxxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH 4/6] mm: New XENMEM space, XENMAPSPACE_gmfn_range
From: Keir Fraser <keir@xxxxxxx>
Date: Thu, 10 Nov 2011 10:21:31 +0000
Cc: tim@xxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx, allen.m.kay@xxxxxxxxx
Delivery-date: Thu, 10 Nov 2011 02:25:24 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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; bh=G9E/nvy4Xkp9XZBHQAjsIm4vn8xh5X6SALdqm3HWKoE=; b=kBcAkJSjzIR8tBcgdVhqDV/Q6lARSf819bpTmq9wk6egyvs2AvIjht4FP/IhjWT+Zl 3St2GTYlIsYcQ8HGW6eS5p5CkHXCwAijbwRZ1i4JLY2q7t++E+PpKMQBO/cNDiaDObwO M7fCotHQgBD0ro5FKKCoJAFl1kM8VHmkoszY0=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4EBBAD770200007800060155@xxxxxxxxxxxxxxxxxxxx>
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: AcyfkoOr/QpFdSasKU+nwa+XQIwEqg==
Thread-topic: [PATCH 4/6] mm: New XENMEM space, XENMAPSPACE_gmfn_range
User-agent: Microsoft-Entourage/12.30.0.110427
On 10/11/2011 09:54, "Jan Beulich" <JBeulich@xxxxxxxx> wrote:

>>>> On 10.11.11 at 09:44, Jean Guyader <jean.guyader@xxxxxxxxxxxxx> wrote:
> 
> In the native implementation I neither see the XENMAPSPACE_gmfn_range
> case getting actually handled in the main switch (did you mean to change
> xatp.space to XENMAPSPACE_gmfn in that case?), nor do I see how you
> communicate back how many of the pages were successfully processed in
> the event of an error in the middle of the processing or when a
> continuation is required.
> 
> But with the patch being pretty hard to read, maybe I'm simply
> overlooking something?
> 
> Further (I realize I should have commented on this earlier) I think that
> in order to allow forward progress you should not check for preemption
> on the very first iteration of each (re-)invocation. That would also
> guarantee no behavioral change to the original single-page variants.

There are plenty of other examples where we check for preemption before
doing any real work (eg. do_mmuext_op, do_mmu_update). I guess checking at
the end of the loop is a little bit better maybe. I'm not very bothered
either way.

 -- Keir

>> --- a/xen/arch/x86/x86_64/compat/mm.c
>> +++ b/xen/arch/x86/x86_64/compat/mm.c
>> @@ -63,6 +63,16 @@ int compat_arch_memory_op(int op, XEN_GUEST_HANDLE(void)
>> arg)
>> 
>>         XLAT_add_to_physmap(nat, &cmp);
>>         rc = arch_memory_op(op, guest_handle_from_ptr(nat, void));
>> +        if ( rc < 0 )
>> +            return rc;
>> +
>> +        if ( rc == __HYPERVISOR_memory_op )
>> +            hypercall_xlat_continuation(NULL, 0x2, nat, arg);
>> +
>> +        XLAT_add_to_physmap(&cmp, nat);
>> +
>> +        if ( copy_to_guest(arg, &cmp, 1) )
>> +            return -EFAULT;
> 
> Other than in the XENMEM_[gs]et_pod_target you (so far, subject to the
> above comment resulting in a behavioral change) don't have any real
> outputs here, and hence there's no need to always to the outbound
> translation - i.e. all of this could be moved into the if ()'s body.
> 
> Jan
> 
>> 
>>         break;
>>     }
> 



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