Skip to contentSkip to conversation

Porting PV-on-HVM for ia64 platform

PATCH Tsunehisa Doi 2 participants 9 messages Aug 26, 2006 – Aug 29, 2006

lore
Share & tools
lore
#0 lore raw

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 [email protected]
# Node ID 21ac9a7848b36da95132eac54ad3cf4f1ee0f93a # Parent 9647400b50415a7ef26729016ca11c58e3e3c5a5 Modify grant_table destroy code for PV-on-HVM on IPF

xen/common/grant_table.c +3 -1
diff -r 9647400b5041 -r 21ac9a7848b3 xen/common/grant_table.c
@@ -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 [email protected]
# Node ID a0a48f19ddba0ebab21befb076eba607b8221700 # Parent 21ac9a7848b36da95132eac54ad3cf4f1ee0f93a Modify gnttab initialization code for PV-on-HVM on IPF

linux-2.6-xen-sparse/drivers/xen/core/gnttab.c +18 -0
diff -r 21ac9a7848b3 -r a0a48f19ddba linux-2.6-xen-sparse/drivers/xen/core/gnttab.c
@@ -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 [email protected]
# Node ID bfc60efbd4f491f9c3ff494f655b4ab825f65d2c # Parent a0a48f19ddba0ebab21befb076eba607b8221700 Modify unmodified_drivers code for PV-on-HVM on IPF

unmodified_drivers/linux-2.6/platform-pci/platform-pci.c +19 -4
diff -r a0a48f19ddba -r bfc60efbd4f4 unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
@@ -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;
unmodified_drivers/linux-2.6/platform-pci/xen_support.c +14 -0
diff -r a0a48f19ddba -r bfc60efbd4f4 unmodified_drivers/linux-2.6/platform-pci/xen_support.c
@@ -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 [email protected]
# Node ID 6ea38426ce26959e78fe2ffedbcaff6085c950b2 # Parent bfc60efbd4f491f9c3ff494f655b4ab825f65d2c Modify unmodified_drivers build rule for PV-on-HVM on IPF

unmodified_drivers/linux-2.6/mkbuildtree +6 -0
diff -r bfc60efbd4f4 -r 6ea38426ce26 unmodified_drivers/linux-2.6/mkbuildtree
@@ -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
unmodified_drivers/linux-2.6/overrides.mk +2 -0
diff -r bfc60efbd4f4 -r 6ea38426ce26 unmodified_drivers/linux-2.6/overrides.mk
@@ -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
[email protected]
http://lists.xensource.com/xen-ia64-devel

#1 lore raw
Quoted 4 lines · Tsunehisa Doi

Hi all,
My name is Tsunehisa Doi.
We have been porting PV-on-HVM feature for ia64 platform.

Sorry, This message is difficult to read. I'll resend same.

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 [email protected]
# Node ID 21ac9a7848b36da95132eac54ad3cf4f1ee0f93a # Parent 9647400b50415a7ef26729016ca11c58e3e3c5a5 Modify grant_table destroy code for PV-on-HVM on IPF

xen/common/grant_table.c +3 -1
diff -r 9647400b5041 -r 21ac9a7848b3 xen/common/grant_table.c
@@ -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 [email protected]
# Node ID a0a48f19ddba0ebab21befb076eba607b8221700 # Parent 21ac9a7848b36da95132eac54ad3cf4f1ee0f93a Modify gnttab initialization code for PV-on-HVM on IPF

linux-2.6-xen-sparse/drivers/xen/core/gnttab.c +18 -0
diff -r 21ac9a7848b3 -r a0a48f19ddba linux-2.6-xen-sparse/drivers/xen/core/gnttab.c
@@ -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 [email protected]
# Node ID bfc60efbd4f491f9c3ff494f655b4ab825f65d2c # Parent a0a48f19ddba0ebab21befb076eba607b8221700 Modify unmodified_drivers code for PV-on-HVM on IPF

unmodified_drivers/linux-2.6/platform-pci/platform-pci.c +19 -4
diff -r a0a48f19ddba -r bfc60efbd4f4 unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
@@ -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;
unmodified_drivers/linux-2.6/platform-pci/xen_support.c +14 -0
diff -r a0a48f19ddba -r bfc60efbd4f4 unmodified_drivers/linux-2.6/platform-pci/xen_support.c
@@ -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 [email protected]
# Node ID 6ea38426ce26959e78fe2ffedbcaff6085c950b2 # Parent bfc60efbd4f491f9c3ff494f655b4ab825f65d2c Modify unmodified_drivers build rule for PV-on-HVM on IPF

unmodified_drivers/linux-2.6/mkbuildtree +6 -0
diff -r bfc60efbd4f4 -r 6ea38426ce26 unmodified_drivers/linux-2.6/mkbuildtree
@@ -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
unmodified_drivers/linux-2.6/overrides.mk +2 -0
diff -r bfc60efbd4f4 -r 6ea38426ce26 unmodified_drivers/linux-2.6/overrides.mk
@@ -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
[email protected]
http://lists.xensource.com/xen-ia64-devel

#2 lore raw

Hi all,

Sorry, I have tried to repost it, but my mail tool reformated with format
which I don't want.

Quoted 6 lines · I (Doi.Tsunehisa)
Quoted 4 lines · Tsunehisa Doi

Hi all,
My name is Tsunehisa Doi.
We have been porting PV-on-HVM feature for ia64 platform.

Sorry, This message is difficult to read. I'll resend same.

Thanks,
- Tsunehisa Doi

#3 lore raw
In reply to Tsunehisa Doi
Quoted 4 lines · Tsunehisa Doi

- 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.

Why is that? It's a change to the P2M map -- it's not an x86-specific operation.

-- Keir

#4 lore raw
Quoted 8 lines · You (Keir.Fraser)
Quoted 4 lines · Tsunehisa Doi

- 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.

Why is that? It's a change to the P2M map -- it's not an x86-specific operation.

We had tried to implement it with the same method as x86 code, but we
couldn't success to implement it. If we will refere to implementation of grant table operation, we may be able to success to implement it, but it's not easy for us, I think.

Thanks,
- Tsunehisa Doi

#5 lore raw
Quoted 7 lines · I (Doi.Tsunehisa)
Quoted 6 lines · You (Keir.Fraser)
Quoted 4 lines · Tsunehisa Doi

- 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.

Quoted 7 lines
Quoted 2 lines

Why is that? It's a change to the P2M map -- it's not an x86-specific operation.

We had tried to implement it with the same method as x86 code, but we
couldn't success to implement it. If we will refere to implementation of grant table operation, we may be able to success to implement it, but it's not easy for us, I think.

I'll try to describe the reasoon which I think about.

In IPF, V2P address translation uses TR, TC and VHPT. VHPT is like page
table in x86 platform, and TC is like TLB in it exept for direct handling posibility. But TR is specific for IPF. TR is controled directly with MM, its entry does not be deleted by hardware if MM does not control it.

In additionaly, TR, TC and VHPT can use flexible page size for each entry.
Thus normal linux kernel uses a TR entry for kernel virtual space. So, in HVM domain on IPF, it is difficult to change a part of P2M map of kernel virtual space without MM modification.

Thanks,
-- Tsunehisa Doi

#6 lore raw
Quoted 9 lines · On 26/8/06 10:52 pm, "[email protected]"…

In IPF, V2P address translation uses TR, TC and VHPT. VHPT is like page
table in x86 platform, and TC is like TLB in it exept for direct handling posibility. But TR is specific for IPF. TR is controled directly with MM, its entry does not be deleted by hardware if MM does not control it.

In additionaly, TR, TC and VHPT can use flexible page size for each entry.
Thus normal linux kernel uses a TR entry for kernel virtual space. So, in HVM domain on IPF, it is difficult to change a part of P2M map of kernel virtual space without MM modification.

What's a TR? Assuming some sort of virtual->physical translation record, you couldn't have simple single mapping for the entire kernel va space because it won't map onto a contiguous block of physical addresses? There must be something doing translation from the guest's view of fake contiguous physical memory to underlying real scattered pages -- whatever structure that is is the one that gets modified by that memory_op.

-- Keir

#7 lore raw
Quoted 13 lines · You (Keir.Fraser)
Quoted 9 lines · On 26/8/06 10:52 pm, "[email protected]"…

In IPF, V2P address translation uses TR, TC and VHPT. VHPT is like page
table in x86 platform, and TC is like TLB in it exept for direct handling posibility. But TR is specific for IPF. TR is controled directly with MM, its entry does not be deleted by hardware if MM does not control it.

In additionaly, TR, TC and VHPT can use flexible page size for each entry.
Thus normal linux kernel uses a TR entry for kernel virtual space. So, in HVM domain on IPF, it is difficult to change a part of P2M map of kernel virtual space without MM modification.

Quoted 6 lines

What's a TR? Assuming some sort of virtual->physical translation record, you couldn't have simple single mapping for the entire kernel va space because it won't map onto a contiguous block of physical addresses? There must be something doing translation from the guest's view of fake contiguous physical memory to underlying real scattered pages -- whatever structure that is is the one that gets modified by that memory_op.

Sorry, I had misunderstood the TR/TC emulation for VT-i domain.

I thought that one virtual TR/TC entry was emulated with one physical
TC entry, and whole kernel virtual space used only one physical TC entry. Thus, a part of pages in kenrnel virtual space could not remapping to the other memory page, I thought.

Today, I discussed with my co-worker about this feature. So, one
virtual TR/TC is emulated with some physical VHPT entry per Xen pagesize. Thus, we should be able to implement with same method of x86 code.

Currently, we are trying to modify PV-on-HVM feature for IPF with
the same method of x86 code. And in preliminary implement, we could do the feature.

Thanks,
- Tsunehisa Doi

#8 lore raw

Hi,

Quoted 3 lines · [email protected] wrote:

Currently, we are trying to modify PV-on-HVM feature for IPF with
the same method of x86 code. And in preliminary implement, we could do the feature.

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 memory_op hypercall
+ Introduce XENMEM_add_to_physmap
- A virtual space allocated on HVM-guest OS is remapped original shared_info and grant_table page with this hypercall.
- This method is same as x86 method.
* Reduce hvm_op hypercall
+ Delete functions introduced for old PV-on-HVM on IPF.
* Revert domain destroy logic
+ revert arch_domain_destroy() for old PV-on-HVM on IPF.
* Modify unmodified_drivers initialization
+ cut off unused codes for IPF
+ modify build rule for IPF

These patch include: (common code)

* unmodified-driver.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 [email protected]
# Node ID 96749232df478225e939252e704927be89dbae07 # Parent 259aea558618ad79219d838dcb520142a5f04897 Modify unmodified_drivers code for IPF

unmodified_drivers/linux-2.6/platform-pci/platform-pci.c +4 -0
diff -r 259aea558618 -r 96749232df47 unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
@@ -115,6 +115,7 @@ unsigned long alloc_xen_mmio(unsigned lo
 	return addr;
 }
 
+#ifndef __ia64__
 /* Lifted from hvmloader.c */
 static int get_hypercall_stubs(void)
 {
@@ -160,6 +161,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)
@@ -201,9 +203,11 @@ static int __devinit platform_pci_init(s
 	platform_mmio = mmio_addr;
 	platform_mmiolen = mmio_len;
 
+#ifndef __ia64__
 	ret = get_hypercall_stubs();
 	if (ret < 0)
 		goto out;
+#endif /* __ia64__ */
 
 	
 	if ((ret = init_xen_info()))
unmodified_drivers/linux-2.6/platform-pci/xen_support.c +14 -0
diff -r 259aea558618 -r 96749232df47 unmodified_drivers/linux-2.6/platform-pci/xen_support.c
@@ -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 [email protected]
# Node ID b5cafa21c61f2789b6a78c5980a2414486917f69 # Parent 96749232df478225e939252e704927be89dbae07 Modify unmodified_drivers build rule for IPF

unmodified_drivers/linux-2.6/mkbuildtree +6 -0
diff -r 96749232df47 -r b5cafa21c61f unmodified_drivers/linux-2.6/mkbuildtree
@@ -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

_______________________________________________
Xen-ia64-devel mailing list
[email protected]
http://lists.xensource.com/xen-ia64-devel