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-ia64-devel] Porting PV-on-HVM for ia64 platform

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] Porting PV-on-HVM for ia64 platform
From: Tsunehisa Doi <Doi.Tsunehisa@xxxxxxxxxxxxxx>
Date: Sat, 26 Aug 2006 14:50:57 +0900
Cc: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 25 Aug 2006 22:51:19 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.5 (Windows/20060719)
Hi all,

My name is Tsunehisa Doi.

We have been porting PV-on-HVM feature for ia64 platform.

I will post patches for PV-on-HVM on ia64 platform. These patches modify
common code for PV-on-HVM on IPF.

We ported PV-on-HVM for IPF 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.
+ Introduce HVMOP_setup_gnttab_table
- Pages allocated on HVM-guest OS is swapped original grant_table
page frames with this hypercall.
- Same above.
* Change domain destroy logic
+ arch_domain_destroy() changed
- considered for swapping shared_info page.
+ grant_table_destroy() changed
- considered for swapping grant_frame pages.
* Modify linux-sparse for pv-on-hvm
+ gnttab.c in linux-sparse modified at initialization
+ modify hypervisor.h for pv-on-hvm
* Modify unmodified_drivers initialization
+ considered the different initialization with x86 code. + modify build
rule for IPF

This patch includes:

* destroy-common.patch
- grant_table destroy logic modification for PV-on-HVM on IPF
* linux-common.patch
- linux-sparse modification for PV-on-HVM on IPF
* unmodified-common.patch
- unmodified_drivers modification for IPF
* unmodified-build.patch
- unmodified_drivers build rule modification for IPF

We have tested that this patch doesn't affect dom0, domVTi without
pv-on-hvm driver attaching, and domVTi using pv-on-hvm driver works
VBD/VNIF on IPF.

Thanks,
- Tsunehisa Doi


# HG changeset patch
# User Doi.Tsunehisa@xxxxxxxxxxxxxx
# Node ID 21ac9a7848b36da95132eac54ad3cf4f1ee0f93a
# Parent  9647400b50415a7ef26729016ca11c58e3e3c5a5
Modify grant_table destroy code for PV-on-HVM on IPF

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

diff -r 9647400b5041 -r 21ac9a7848b3 xen/common/grant_table.c
--- a/xen/common/grant_table.c  Sat Aug 26 13:37:41 2006 +0900
+++ b/xen/common/grant_table.c  Sat Aug 26 13:40:55 2006 +0900
@@ -32,6 +32,7 @@
 #include <xen/guest_access.h>
 #include <xen/domain_page.h>
 #include <acm/acm_hooks.h>
+#include <xen/domain_page.h>
 
 /*
  * The first two members of a grant entry are updated as a combined pair.
@@ -1164,7 +1165,8 @@ grant_table_destroy(
     if ( t == NULL )
         return;
     
-    free_xenheap_pages(t->shared, ORDER_GRANT_FRAMES);
+    if (IS_XEN_HEAP_FRAME(virt_to_page(t->shared)))
+        free_xenheap_pages(t->shared, ORDER_GRANT_FRAMES);
     free_xenheap_page(t->maptrack);
     xfree(t->active);
     xfree(t);
# HG changeset patch
# User Doi.Tsunehisa@xxxxxxxxxxxxxx
# Node ID a0a48f19ddba0ebab21befb076eba607b8221700
# Parent  21ac9a7848b36da95132eac54ad3cf4f1ee0f93a
Modify gnttab initialization code for PV-on-HVM on IPF

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

diff -r 21ac9a7848b3 -r a0a48f19ddba 
linux-2.6-xen-sparse/drivers/xen/core/gnttab.c
--- a/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c    Sat Aug 26 13:40:55 
2006 +0900
+++ b/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c    Sat Aug 26 13:44:41 
2006 +0900
@@ -429,6 +429,7 @@ int gnttab_resume(void)
 int gnttab_resume(void)
 {
        unsigned long frames;
+#ifndef __ia64__
        struct xen_add_to_physmap xatp;
        unsigned int i;
 
@@ -448,13 +449,30 @@ int gnttab_resume(void)
                printk("error to ioremap gnttab share frames\n");
                return -1;
        }
+#else /* !__ia64__ */
+       struct xen_hvm_setup xhs;
+
+       shared = (struct grant_entry *)
+               __get_free_pages(GFP_KERNEL, get_order(PAGE_SIZE * 
NR_GRANT_FRAMES));
+       if (shared == NULL) {
+               printk("error to allocate gnttab share frames\n");
+               return -1;
+       }
+       frames = virt_to_phys((void *)shared);
+       xhs.arg1 = frames;
+       xhs.arg2 = NR_GRANT_FRAMES;
+       if (HYPERVISOR_hvm_op(HVMOP_setup_gnttab_table, &xhs))
+               BUG();
+#endif /* !__ia64__ */
 
        return 0;
 }
 
 int gnttab_suspend(void)
 {
+#ifndef __ia64__
        iounmap(shared);
+#endif /* !__ia64__ */
        return 0;
 }
 
# HG changeset patch
# User Doi.Tsunehisa@xxxxxxxxxxxxxx
# Node ID bfc60efbd4f491f9c3ff494f655b4ab825f65d2c
# Parent  a0a48f19ddba0ebab21befb076eba607b8221700
Modify unmodified_drivers code for PV-on-HVM on IPF

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

diff -r a0a48f19ddba -r bfc60efbd4f4 
unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
--- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c  Sat Aug 26 
13:44:41 2006 +0900
+++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c  Sat Aug 26 
13:50:25 2006 +0900
@@ -54,11 +54,15 @@ static int __init init_xen_info(void)
 static int __init init_xen_info(void)
 {
        unsigned long shared_info_frame;
+       extern void *shared_info_area;
+#ifndef __ia64__
        struct xen_add_to_physmap xatp;
-       extern void *shared_info_area;
-
+#else
+       struct xen_hvm_setup xhs;
+#endif
        setup_xen_features();
 
+#ifndef __ia64__
        shared_info_frame = alloc_xen_mmio(PAGE_SIZE) >> PAGE_SHIFT;
        xatp.domid = DOMID_SELF;
        xatp.idx = 0;
@@ -66,9 +70,17 @@ static int __init init_xen_info(void)
        xatp.gpfn = shared_info_frame;
        if (HYPERVISOR_memory_op(XENMEM_add_to_physmap, &xatp))
                BUG();
-
        shared_info_area =
                ioremap(shared_info_frame << PAGE_SHIFT, PAGE_SIZE);
+#else /* !__ia64__ */
+       shared_info_frame = __get_free_page(GFP_KERNEL);
+       xhs.arg1 = virt_to_phys((void *)shared_info_frame);
+       xhs.arg2 = 0;
+       if (HYPERVISOR_hvm_op(HVMOP_setup_shared_info_page, &xhs))
+               BUG();
+       shared_info_area = (shared_info_t *)shared_info_frame;
+#endif /* !__ia64__ */
+
        if (shared_info_area == NULL)
                panic("can't map shared info\n");
 
@@ -96,6 +108,7 @@ static void __devexit platform_pci_remov
        free_irq(pdev->irq, pdev);
 }
 
+#ifndef __ia64__
 static unsigned long platform_mmio;
 static unsigned long platform_mmio_alloc;
 static unsigned long platform_mmiolen;
@@ -160,6 +173,7 @@ static int get_hypercall_stubs(void)
 
        return 0;
 }
+#endif /* !__ia64__ */
 
 static int __devinit platform_pci_init(struct pci_dev *pdev,
                                       const struct pci_device_id *ent)
@@ -198,13 +212,14 @@ static int __devinit platform_pci_init(s
                return -EBUSY;
        }
 
+#ifndef __ia64__
        platform_mmio = mmio_addr;
        platform_mmiolen = mmio_len;
 
        ret = get_hypercall_stubs();
        if (ret < 0)
                goto out;
-
+#endif /* __ia64__ */
        
        if ((ret = init_xen_info()))
                goto out;
diff -r a0a48f19ddba -r bfc60efbd4f4 
unmodified_drivers/linux-2.6/platform-pci/xen_support.c
--- a/unmodified_drivers/linux-2.6/platform-pci/xen_support.c   Sat Aug 26 
13:44:41 2006 +0900
+++ b/unmodified_drivers/linux-2.6/platform-pci/xen_support.c   Sat Aug 26 
13:50:25 2006 +0900
@@ -26,11 +26,13 @@
 #include <asm/hypervisor.h>
 #include "platform-pci.h"
 
+#ifndef __ia64__
 void xen_machphys_update(unsigned long mfn, unsigned long pfn)
 {
        BUG();
 }
 EXPORT_SYMBOL(xen_machphys_update);
+#endif /* __ia64__ */
 
 void balloon_update_driver_allowance(long delta)
 {
@@ -41,3 +43,15 @@ void balloon_release_driver_page(struct 
 {
 }
 EXPORT_SYMBOL(balloon_release_driver_page);
+
+#ifdef __ia64__
+int running_on_xen=1;
+EXPORT_SYMBOL(running_on_xen);
+
+int ia64_xenmem_reservation_op(
+       unsigned long op, struct xen_memory_reservation* reservation__)
+{
+       return 0;
+}
+EXPORT_SYMBOL(ia64_xenmem_reservation_op);
+#endif /* __ia64__ */
# HG changeset patch
# User Doi.Tsunehisa@xxxxxxxxxxxxxx
# Node ID 6ea38426ce26959e78fe2ffedbcaff6085c950b2
# Parent  bfc60efbd4f491f9c3ff494f655b4ab825f65d2c
Modify unmodified_drivers build rule for PV-on-HVM on IPF

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

diff -r bfc60efbd4f4 -r 6ea38426ce26 unmodified_drivers/linux-2.6/mkbuildtree
--- a/unmodified_drivers/linux-2.6/mkbuildtree  Sat Aug 26 13:50:25 2006 +0900
+++ b/unmodified_drivers/linux-2.6/mkbuildtree  Sat Aug 26 13:53:17 2006 +0900
@@ -42,6 +42,12 @@ i[34567]86)
        ln -sf ${XL}/include/asm-i386/mach-xen/asm/synch_bitops.h include/asm
        ln -sf ${XL}/include/asm-i386/mach-xen/asm/maddr.h include/asm
        ;;
+"ia64")
+       ln -sf ${XL}/include/asm-ia64/hypervisor.h include/asm
+       ln -sf ${XL}/include/asm-ia64/hypercall.h include/asm
+       ln -sf ${XL}/include/asm-ia64/synch_bitops.h include/asm
+       ln -sf ${XL}/include/asm-ia64/maddr.h include/asm
+       ;;
 *)
        echo unknown architecture $uname
        exit 1
diff -r bfc60efbd4f4 -r 6ea38426ce26 unmodified_drivers/linux-2.6/overrides.mk
--- a/unmodified_drivers/linux-2.6/overrides.mk Sat Aug 26 13:50:25 2006 +0900
+++ b/unmodified_drivers/linux-2.6/overrides.mk Sat Aug 26 13:53:17 2006 +0900
@@ -4,7 +4,9 @@
 #
 # (i.e. we need the native config for things like -mregparm, but
 # a Xen kernel to find the right headers)
+ifneq ($(ARCH),ia64)
 EXTRA_CFLAGS += -DCONFIG_VMX -DCONFIG_VMX_GUEST -DCONFIG_X86_XEN
+endif
 EXTRA_CFLAGS += -DCONFIG_XEN_SHADOW_MODE -DCONFIG_XEN_SHADOW_TRANSLATE
 EXTRA_CFLAGS += -DCONFIG_XEN_BLKDEV_GRANT -DXEN_EVTCHN_MASK_OPS
 EXTRA_CFLAGS += -DCONFIG_XEN_NETDEV_GRANT_RX -DCONFIG_XEN_NETDEV_GRANT_TX
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel