Skip to contentSkip to conversation

ia64 build fixes

PATCH In review Alex Williamson 3 participants 6 messages Mar 31, 2006 – Apr 2, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ia64 build fixes

Include features header in xenbus_probe and build features.c

---

linux-2.6-xen-sparse/arch/ia64/xen/drivers/coreMakefile +1 -1
diff -r d76a7a40f3a9 linux-2.6-xen-sparse/arch/ia64/xen/drivers/coreMakefile
@@ -10,7 +10,7 @@ CPPFLAGS_vmlinux.lds += -U$(XENARCH)
 	@ln -fsn $(srctree)/arch/$(XENARCH)/kernel/vmlinux.lds.S $@
 
 
-obj-y   := gnttab.o
+obj-y   := gnttab.o features.o
 obj-$(CONFIG_PROC_FS) += xen_proc.o
 
 ifeq ($(ARCH),ia64)
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c +1 -0
diff -r d76a7a40f3a9 linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
@@ -49,6 +49,7 @@
 #include <xen/xenbus.h>
 #include <xen/xen_proc.h>
 #include <xen/evtchn.h>
+#include <xen/features.h>
 
 #include "xenbus_comms.h"
#1 lore raw
Quoted 3 lines · Alex Williamson

Include features header in xenbus_probe and build features.c

Taken, thanks. Can you also look at supporting HYPERVISOR_sched_op() before 3.0.2, in addition to the old HYPERVISOR_sched_op_compat()? It should be pretty trivial to do. You'd want to base the patch on a tree after changeset 9510, as I internally rename sched_op/sched_op_new in that patch.

After 3.0.2 we'll be removing the fallback to sched_op_compat in the Linux tree (it's fairly pointless as we broke compatibility of new guest on old Xen in other ways too since 3.0.1). If we do that before you add support for the new hypercall, we'll break ia64.

-- Keir

#2 lore raw
Quoted 2 lines · Keir Fraser

Taken, thanks. Can you also look at supporting HYPERVISOR_sched_op() before 3.0.2, in addition to the old HYPERVISOR_sched_op_compat()?

Keir,

Here's a patch that enables HYPERVISOR_sched_op() and
HYPERVISOR_sched_opt_compat() for ia64. We currently have no users of this call, but there's no harm in enabling it (tested by adding a HYPERVISOR_yield() call to default_idle()). I did notice a problem with the compat interface though, nothing defines __XEN_INTERFACE_VERSION__ for the build of xen. We're therefore stuck on interface version 0x00000000 where __HYPERVISOR_sched_op_compat == __HYPERVISOR_sched_op. Thanks,

Alex

---

xen/arch/ia64/xen/hypercall.c +14 -2
diff -r 60071beccf18 xen/arch/ia64/xen/hypercall.c
@@ -38,7 +38,7 @@ hypercall_t ia64_hypercall_table[] =
 	(hypercall_t)do_ni_hypercall,		/* do_stack_switch */
 	(hypercall_t)do_ni_hypercall,		/* do_set_callbacks */
 	(hypercall_t)do_ni_hypercall,		/* do_fpu_taskswitch */		/*  5 */
-	(hypercall_t)do_ni_hypercall,		/* do_sched_op_compat */
+	(hypercall_t)do_sched_op_compat,
 	(hypercall_t)do_dom0_op,
 	(hypercall_t)do_ni_hypercall,		/* do_set_debugreg */
 	(hypercall_t)do_ni_hypercall,		/* do_get_debugreg */
@@ -61,7 +61,7 @@ hypercall_t ia64_hypercall_table[] =
 	(hypercall_t)do_ni_hypercall,		/* do_mmuext_op */
 	(hypercall_t)do_ni_hypercall,		/* do_acm_op */
 	(hypercall_t)do_ni_hypercall,		/* do_nmi_op */
-	(hypercall_t)do_ni_hypercall,		/*  */
+	(hypercall_t)do_sched_op,
 	(hypercall_t)do_ni_hypercall,		/*  */				/* 30 */
 	(hypercall_t)do_ni_hypercall		/*  */
 	};
@@ -70,6 +70,11 @@ xen_hypercall (struct pt_regs *regs)
 xen_hypercall (struct pt_regs *regs)
 {
 	switch (regs->r2) {
+	    case __HYPERVISOR_sched_op_compat:
+		regs->r8 = do_sched_op_compat((int) regs->r14,
+		                              (unsigned long) regs->r15);
+		break;
+
 	    case __HYPERVISOR_dom0_op:
 		regs->r8 = do_dom0_op(guest_handle_from_ptr(regs->r14,
 							    dom0_op_t));
@@ -116,6 +121,13 @@ xen_hypercall (struct pt_regs *regs)
 	    case __HYPERVISOR_multicall:
 		regs->r8 = do_multicall(guest_handle_from_ptr(regs->r14, multicall_entry_t), (unsigned int) regs->r15);
 		break;
+
+#if __XEN_INTERFACE_VERSION__ >= 0x00030101
+	    case __HYPERVISOR_sched_op:
+		regs->r8 = do_sched_op((int) regs->r14,
+		                       guest_handle_from_ptr(regs->r15, void));
+		break;
+#endif
 
 	    default:
 		printf("unknown xen hypercall %lx\n", regs->r2);
#3 lore raw
Quoted 7 lines · Alex Williamson

Here's a patch that enables HYPERVISOR_sched_op() and
HYPERVISOR_sched_opt_compat() for ia64. We currently have no users of this call, but there's no harm in enabling it (tested by adding a HYPERVISOR_yield() call to default_idle()). I did notice a problem with the compat interface though, nothing defines __XEN_INTERFACE_VERSION__ for the build of xen. We're therefore stuck on interface version 0x00000000 where __HYPERVISOR_sched_op_compat == __HYPERVISOR_sched_op.

Well, it doesn't actually matter right now since Xen itself does not use the __HYPERVISOR_foo numbers. But yes, I can see this might bite us later so we ought to define it.

-- Keir

#4 lore raw
Quoted 9 lines · Keir Fraser
Quoted 7 lines

Here's a patch that enables HYPERVISOR_sched_op() and
HYPERVISOR_sched_opt_compat() for ia64. We currently have no users of this call, but there's no harm in enabling it (tested by adding a HYPERVISOR_yield() call to default_idle()). I did notice a problem with the compat interface though, nothing defines __XEN_INTERFACE_VERSION__ for the build of xen. We're therefore stuck on interface version 0x00000000 where __HYPERVISOR_sched_op_compat == __HYPERVISOR_sched_op.

Well, it doesn't actually matter right now since Xen itself does not use the __HYPERVISOR_foo numbers. But yes, I can see this might bite us later so we ought to define it.

Ah, I'm forgetting you have a hypercall switch statement. I'll add the version number.

With regard to your patch, actually I was thinking more about the vmx hypercall interface which already supports sched_op_compat --- should that one have sched_op added too, in vmx_hypercall.c?

-- Keir

#5 lore raw
In reply to Keir Fraser
Quoted 11 lines · Keir Fraser
Quoted 8 lines · Alex Williamson

Here's a patch that enables HYPERVISOR_sched_op() and
HYPERVISOR_sched_opt_compat() for ia64. We currently have no users of this call, but there's no harm in enabling it (tested by adding a HYPERVISOR_yield() call to default_idle()). I did notice a problem with
the compat interface though, nothing defines __XEN_INTERFACE_VERSION__ for the build of xen. We're therefore stuck on interface version 0x00000000 where __HYPERVISOR_sched_op_compat == __HYPERVISOR_sched_op.

Quoted 3 lines

Well, it doesn't actually matter right now since Xen itself does not use the __HYPERVISOR_foo numbers. But yes, I can see this might bite us later so we ought to define it.

I was using them in some debugging code the other day and it bit me :-(

Christian suggested changing xen-compat.h to use the maximum version when compiling Xen. e.g.

        #ifndef __XEN_INTERFACE_VERSION__
        #ifdef __XEN__
        #define __XEN_INTERFACE_VERSION__ 0xffffffff
        #else
        #define __XEN_INTERFACE_VERSION__ 0x00000000
        #endif
        #endif

Ian.