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] Patch for PV-on-HVM for IPF

To: xen-ia64-devel <xen-ia64-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-ia64-devel] Patch for PV-on-HVM for IPF
From: DOI Tsunehisa <Doi.Tsunehisa@xxxxxxxxxxxxxx>
Date: Wed, 27 Sep 2006 18:46:45 +0900
Delivery-date: Wed, 27 Sep 2006 02:45:40 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <451A47FB.8060900@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: <451A47FB.8060900@xxxxxxxxxxxxxx>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.5 (Windows/20060719)
Sorry, I forgot to attach the patch.

DOI Tsunehisa wrote:
> Hi all,
> 
>   Currently, we are testing PV-on-HVM driver for IPF. so, we found
> a problem that hypervisor crashes during VT-i domain destruction
> with PV-on-HVM driver.
> 
>   The procedure to reproduce this problem are:
> 
>    * Create a VT-i domain.
>      [dom0]# xm create -f hvm.conf
>    * Insert modules for PV-on-HVM on the domain.
>      [domvti]# insmod xen-platform-pci.ko
>      [domvti]# insmod xenbus.ko
>      [domvti]# insmod xen-vbd.ko
>      [domvti]# insmod xen-vnif.ko
>    * Activate VNIF network interface.
>      [dom0]# xm network-attach <domid> eth1
>      [domvti]# ifconfig eth1 up
>    * Destruct the domain
>      [dom0]# xm destroy <domid>
>      ..... hypervisor crash  ....
> 
>   We were investigating the hypervisor crash mechanism, thus we found
> a reason of it.
> 
>   * VNIF of PV-on-HVM uses gnttab_copy() function.
>     - it's used for copy-method of VNIF backend.
>     - it needs to refer p2m table.
>   * gnttab_copy() function may be called during the domain destruction.
>     - it's called by dom0 VNIF backend.
>   * Hypervisor invalidates p2m table at first during the destruction.
>     - gnttab_copy() won't be able to refer p2m table, thus it occurs
>       hypervisor crash.
>     - In x86 code, p2m table invalidation is delayed at last phase of
>       domain destruction.
>       => but we don't like it. it seems that p2m table exists after
>          memory relinquised.
> 
>   So, I'll post a patch to avoid hypervisor crash.
> 
>    * pv-avoid-crash.patch
>      + modify p2m table converter (gmfn_to_mfn_foreign())
>        - return INVALID_MFN during VT-i domain destruction
> 
>   We tested that the problem is solved.
> 
> Thanks,
> - Tsunehisa Doi
> 
> 
> _______________________________________________
> Xen-ia64-devel mailing list
> Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-ia64-devel
# HG changeset patch
# User Doi.Tsunehisa@xxxxxxxxxxxxxx
# Node ID 354f40902eb9e3f92fdf8b5e9268052cd955230b
# Parent  f34e37d0742d80ccfefd017a91f93310ebc2dfe8
Modify p2m converter to avoid hypervisor crash
during destruction of VT-i domain with PV-on-HVM.

Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@xxxxxxxxxxxxxx>
Signed-off-by: Tomonari Horikoshi <t.horikoshi@xxxxxxxxxxxxxx>

diff -r f34e37d0742d -r 354f40902eb9 xen/arch/ia64/xen/mm.c
--- a/xen/arch/ia64/xen/mm.c    Tue Sep 26 19:11:33 2006 -0600
+++ b/xen/arch/ia64/xen/mm.c    Wed Sep 27 17:24:58 2006 +0900
@@ -396,6 +396,12 @@ gmfn_to_mfn_foreign(struct domain *d, un
 {
        unsigned long pte;
 
+       // This function may be called from __gnttab_copy()
+       // during destruction of VT-i domain with PV-on-HVM driver.
+       if (unlikely(d->arch.mm.pgd == NULL)) {
+               if (VMX_DOMAIN(d->vcpu[0]))
+                       return INVALID_MFN;
+       }
        pte = lookup_domain_mpa(d,gpfn << PAGE_SHIFT, NULL);
        if (!pte) {
                panic("gmfn_to_mfn_foreign: bad gpfn. spinning...\n");
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel