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-ia64-devel

Re: [Xen-ia64-devel] PV-on-HVM driver for IPF

To: DOI Tsunehisa <Doi.Tsunehisa@xxxxxxxxxxxxxx>, xen-ia64-devel <xen-ia64-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-ia64-devel] PV-on-HVM driver for IPF
From: Tristan Gingold <Tristan.Gingold@xxxxxxxx>
Date: Thu, 24 Aug 2006 15:46:25 +0200
Delivery-date: Thu, 24 Aug 2006 06:41:54 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <44EDA623.7020906@xxxxxxxxxxxxxx>
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
References: <44EDA623.7020906@xxxxxxxxxxxxxx>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.5
Le Jeudi 24 Août 2006 15:14, DOI Tsunehisa a écrit :
> Hi all,
Hi,

>   I will post patches of PV-on-HVM for IPF.
>
>   We wrote the patch under this consideration:
>
>    * Expand hvm_op hypercall
>      + Introduce HVMOP_setup_shared_info_page
>        - A page allocated on HVM-guest OS is swapped original shared_info
>          page with this hypercall.
>        - In x86 code, original shared_info page is used after pv-on-hvm
>          setup with remapping feature in arch depend HYPERVISOR_memory_op.
>          But, we can't implement same feature for IPF, thus we select to
>          implement with this method.
Can you explain why you can't reuse the HYPERVISOR_memory_op hcall ?
It isn't clear for me.

About the patch:
+static int
+vmx_gnttab_setup_table(unsigned long frame_pa, unsigned long nr_frames)
+{
+    struct domain *d = current->domain;
+    int rc = 0, i;
+    unsigned long o_grant_shared, pgaddr;
+
+    if (nr_frames != NR_GRANT_FRAMES) {
+        return -1;
You'd better to return -EINVAL.

+    }
+    o_grant_shared = (unsigned long)d->grant_table->shared;
+    d->grant_table->shared = (struct grant_entry *)domain_mpa_to_imva(d, 
frame_pa);
+
+    /* Copy existing grant table shared into new page */
+    if (o_grant_shared) {
+        memcpy((void*)d->grant_table->shared,
+                (void*)o_grant_shared, PAGE_SIZE * nr_frames);
You should check the result of domain_mpa_to_imva, as it could fail.

+            if (likely(IS_XEN_HEAP_FRAME(virt_to_page(pgaddr)))) {
+                free_domheap_page(virt_to_page(pgaddr));
+                free_xenheap_page((void *)pgaddr);
+            }
+            else {
+                put_page(virt_to_page(pgaddr));
+            }
May create a function to be called by gnttab_setup_table and 
setup_shared_info_page.

Tristan.

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