Re: [XenPPC] PATCH: xencomm - kernel side

2006-08-24 Thread Tristan Gingold
Le Mercredi 23 Août 2006 18:39, Hollis Blanchard a écrit :
 On Wed, 2006-08-23 at 14:31 +0200, Tristan Gingold wrote:
  taking into account Hollis comments I now submit this patch.
 
  IA64 specific stuff will be posted to xen-ia64-unstable after merge.

 NAK pending outcome of other comments.

 Also, please let me add my own Signed-off-by line -- that way we'll know
 that I agree the patch is in fact final (which I don't right now).

 There is at least a /* XXX could we call this from irq context? */
 comment that needs removal. I didn't check the rest of the patch to see
 if you'd followed all my other suggestions.
I think the comment could be removed as this is never call during irq.

Here are the full patches (common and ia64).  Only the common patches (mainly 
11059) was formally submitted.

Tristan.

# HG changeset patch
# User [EMAIL PROTECTED]
# Node ID 80137e1a97cf27e026e6eb6a51a5757e160e979a
# Parent  f32793cae274028d939dba4909be280c9df712a5
linux-ia64

diff -r f32793cae274 -r 80137e1a97cf linux-2.6-xen-sparse/arch/ia64/Kconfig
--- a/linux-2.6-xen-sparse/arch/ia64/Kconfig	Wed Aug 23 11:12:25 2006 +0200
+++ b/linux-2.6-xen-sparse/arch/ia64/Kconfig	Wed Aug 23 11:17:06 2006 +0200
@@ -530,6 +530,9 @@ config XEN_REBOOT
 
 config XEN_SMPBOOT
 	default n
+
+config XEN_XENCOMM
+	default y
 endif
 
 source drivers/xen/Kconfig
diff -r f32793cae274 -r 80137e1a97cf linux-2.6-xen-sparse/arch/ia64/kernel/setup.c
--- a/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c	Wed Aug 23 11:12:25 2006 +0200
+++ b/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c	Wed Aug 23 11:17:06 2006 +0200
@@ -76,6 +76,8 @@ EXPORT_SYMBOL(__per_cpu_offset);
 #endif
 
 #ifdef CONFIG_XEN
+unsigned long kernel_start_pa;
+
 static int
 xen_panic_event(struct notifier_block *this, unsigned long event, void *ptr)
 {
@@ -433,6 +435,7 @@ setup_arch (char **cmdline_p)
 
 #ifdef CONFIG_XEN
 	if (is_running_on_xen()) {
+		kernel_start_pa = KERNEL_START - ia64_tpa (KERNEL_START);
 		setup_xen_features();
 		/* Register a call for panic conditions. */
 		notifier_chain_register(panic_notifier_list, xen_panic_block);
diff -r f32793cae274 -r 80137e1a97cf linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c
--- a/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c	Wed Aug 23 11:12:25 2006 +0200
+++ b/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c	Wed Aug 23 11:17:06 2006 +0200
@@ -70,7 +70,7 @@ ia64_xenmem_reservation_op(unsigned long
 		reservation.nr_extents = nr_extents;
 
 		dummy = frame_list[0];// re-install tlb entry before hypercall
-		tmp_ret = HYPERVISOR_memory_op(op, reservation);
+		tmp_ret = xencomm_hypercall_memory_op(op, reservation);
 		if (tmp_ret  0) {
 			if (ret == 0) {
 ret = tmp_ret;
@@ -371,8 +371,6 @@ int
 int
 HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count)
 {
-	__u64 va1, va2, pa1, pa2;
-
 	if (cmd == GNTTABOP_map_grant_ref) {
 		unsigned int i;
 		for (i = 0; i  count; i++) {
@@ -380,29 +378,7 @@ HYPERVISOR_grant_table_op(unsigned int c
 (struct gnttab_map_grant_ref*)uop + i);
 		}
 	}
-	va1 = (__u64)uop  PAGE_MASK;
-	pa1 = pa2 = 0;
-	if ((REGION_NUMBER(va1) == 5) 
-	((va1 - KERNEL_START) = KERNEL_TR_PAGE_SIZE)) {
-		pa1 = ia64_tpa(va1);
-		if (cmd = GNTTABOP_transfer) {
-			static uint32_t uop_size[GNTTABOP_transfer + 1] = {
-sizeof(struct gnttab_map_grant_ref),
-sizeof(struct gnttab_unmap_grant_ref),
-sizeof(struct gnttab_setup_table),
-sizeof(struct gnttab_dump_table),
-sizeof(struct gnttab_transfer),
-			};
-			va2 = (__u64)uop + (uop_size[cmd] * count) - 1;
-			va2 = PAGE_MASK;
-			if (va1 != va2) {
-/* maximum size of uop is 2pages */
-BUG_ON(va2  va1 + PAGE_SIZE);
-pa2 = ia64_tpa(va2);
-			}
-		}
-	}
-	return HYPERVISOR_grant_table_op(cmd, uop, count, pa1, pa2);
+	return xencomm_hypercall_grant_table_op(cmd, uop, count);
 }
 EXPORT_SYMBOL(HYPERVISOR_grant_table_op);
 
diff -r f32793cae274 -r 80137e1a97cf linux-2.6-xen-sparse/include/asm-ia64/hypercall.h
--- a/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h	Wed Aug 23 11:12:25 2006 +0200
+++ b/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h	Wed Aug 23 11:17:06 2006 +0200
@@ -33,11 +33,12 @@
 #ifndef __HYPERCALL_H__
 #define __HYPERCALL_H__
 
-#include linux/string.h /* memcpy() */
-
 #ifndef __HYPERVISOR_H__
 # error please don't include this file directly
 #endif
+
+#include xen/xencomm_hcall.h
+struct xencomm_handle;
 
 /*
  * Assembler stubs for hyper-calls.
@@ -157,16 +158,10 @@
 	(type)__res;\
 })
 
-static inline int
-HYPERVISOR_sched_op_compat(
-int cmd, unsigned long arg)
-{
-	return _hypercall2(int, sched_op_compat, cmd, arg);
-}
-
-static inline int
-HYPERVISOR_sched_op(
-	int cmd, void *arg)
+
+static inline int
+xencomm_arch_hypercall_sched_op(
+	int cmd, struct xencomm_handle *arg)
 {
 	return _hypercall2(int, sched_op, cmd, arg);
 }
@@ -181,25 +176,22 @@ HYPERVISOR_set_timer_op(
 }
 
 static inline int
-HYPERVISOR_dom0_op(
-dom0_op_t 

Re: [XenPPC] PATCH: xencomm - kernel side

2006-08-23 Thread Hollis Blanchard
On Wed, 2006-08-23 at 14:31 +0200, Tristan Gingold wrote:
 
 taking into account Hollis comments I now submit this patch.
 
 IA64 specific stuff will be posted to xen-ia64-unstable after merge.

NAK pending outcome of other comments.

Also, please let me add my own Signed-off-by line -- that way we'll know
that I agree the patch is in fact final (which I don't right now).

There is at least a /* XXX could we call this from irq context? */
comment that needs removal. I didn't check the rest of the patch to see
if you'd followed all my other suggestions.

-- 
Hollis Blanchard
IBM Linux Technology Center


___
Xen-ppc-devel mailing list
Xen-ppc-devel@lists.xensource.com
http://lists.xensource.com/xen-ppc-devel