All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>
To: xen-devel@lists.xensource.com
Cc: xen-ia64-devel@lists.xensource.com
Subject: Porting PV-on-HVM for ia64 platform
Date: Sat, 26 Aug 2006 14:50:57 +0900	[thread overview]
Message-ID: <44EFE141.6080201@jp.fujitsu.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1732 bytes --]

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



[-- Attachment #2: destroy-common.patch --]
[-- Type: text/plain, Size: 1073 bytes --]

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

Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>
Signed-off-by: Tomonari Horikoshi <t.horikoshi@jp.fujitsu.com>

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);

[-- Attachment #3: linux-common.patch --]
[-- Type: text/plain, Size: 1441 bytes --]

# HG changeset patch
# User Doi.Tsunehisa@jp.fujitsu.com
# Node ID a0a48f19ddba0ebab21befb076eba607b8221700
# Parent  21ac9a7848b36da95132eac54ad3cf4f1ee0f93a
Modify gnttab initialization code for PV-on-HVM on IPF

Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>
Signed-off-by: Tomonari Horikoshi <t.horikoshi@jp.fujitsu.com>

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;
 }
 

[-- Attachment #4: unmodified-common.patch --]
[-- Type: text/plain, Size: 3349 bytes --]

# HG changeset patch
# User Doi.Tsunehisa@jp.fujitsu.com
# Node ID bfc60efbd4f491f9c3ff494f655b4ab825f65d2c
# Parent  a0a48f19ddba0ebab21befb076eba607b8221700
Modify unmodified_drivers code for PV-on-HVM on IPF

Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>
Signed-off-by: Tomonari Horikoshi <t.horikoshi@jp.fujitsu.com>

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__ */

[-- Attachment #5: unmodified-build.patch --]
[-- Type: text/plain, Size: 1707 bytes --]

# HG changeset patch
# User Doi.Tsunehisa@jp.fujitsu.com
# Node ID 6ea38426ce26959e78fe2ffedbcaff6085c950b2
# Parent  bfc60efbd4f491f9c3ff494f655b4ab825f65d2c
Modify unmodified_drivers build rule for PV-on-HVM on IPF

Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>
Signed-off-by: Tomonari Horikoshi <t.horikoshi@jp.fujitsu.com>

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

[-- Attachment #6: Type: text/plain, Size: 152 bytes --]

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

             reply	other threads:[~2006-08-26  5:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-26  5:50 Tsunehisa Doi [this message]
2006-08-26  6:02 ` [Xen-devel] Porting PV-on-HVM for ia64 platform Tsunehisa Doi
2006-08-26  6:15   ` Doi.Tsunehisa
2006-08-26  7:10 ` Keir Fraser
2006-08-26 14:36   ` Doi.Tsunehisa
2006-08-26 21:52     ` [Xen-devel] " Doi.Tsunehisa
2006-08-27 14:51       ` Keir Fraser
2006-08-28  9:48         ` [Xen-devel] " Doi.Tsunehisa
2006-08-29 11:48           ` DOI Tsunehisa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44EFE141.6080201@jp.fujitsu.com \
    --to=doi.tsunehisa@jp.fujitsu.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=xen-ia64-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.