[XenPPC] [linux-ppc-2.6] [POWERPC][XEN] Don't leak frame_list and don'r post process gnttab if OP fails

2007-02-07 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 8bccc5d192be551cfe12e1c4d38bb49144f980aa
# Parent  5eca8383a521939f0d74e68eaddb049c5057742a
[POWERPC][XEN] Don't leak frame_list and don'r post process gnttab if OP fails

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 arch/powerpc/platforms/xen/gnttab.c |   21 +
 1 files changed, 9 insertions(+), 12 deletions(-)

diff -r 5eca8383a521 -r 8bccc5d192be arch/powerpc/platforms/xen/gnttab.c
--- a/arch/powerpc/platforms/xen/gnttab.c   Tue Feb 06 16:21:30 2007 -0500
+++ b/arch/powerpc/platforms/xen/gnttab.c   Tue Feb 06 16:30:08 2007 -0500
@@ -244,10 +244,10 @@ static void gnttab_post_map_grant_ref(
 
 int HYPERVISOR_grant_table_op(unsigned int cmd, void *op, unsigned int count)
 {
-   void *desc = NULL;
+   void *desc;
void *frame_list = NULL;
int argsize;
-   int ret;
+   int ret = -ENOMEM;
 
switch (cmd) {
case GNTTABOP_map_grant_ref:
@@ -292,17 +292,14 @@ int HYPERVISOR_grant_table_op(unsigned i
}
 
desc = xencomm_map_no_alloc(op, argsize);
-
-   if (desc == NULL)
-   return -ENOSPC;
-
-   ret = plpar_hcall_norets(XEN_MARK(__HYPERVISOR_grant_table_op), cmd,
-desc, count);
-   if (cmd == GNTTABOP_map_grant_ref)
-   gnttab_post_map_grant_ref(op, count);
-
+   if (desc) {
+   ret = plpar_hcall_norets(XEN_MARK(__HYPERVISOR_grant_table_op),
+cmd, desc, count);
+   if (!ret  cmd == GNTTABOP_map_grant_ref)
+   gnttab_post_map_grant_ref(op, count);
+   xencomm_free(desc);
+   }
xencomm_free(frame_list);
-   xencomm_free(desc);
 
return ret;
 }

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


[XenPPC] [linux-ppc-2.6] [XEN] xencomm fixes for various runtime situations

2007-02-07 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 5eca8383a521939f0d74e68eaddb049c5057742a
# Parent  ab3b5849331da89e578ae0813021376d66b7f333
[XEN] xencomm fixes for various runtime situations

This patch makes xencomm safe for all allocations scenarios including:
 - too early to use allocator
 - in IRQ
 - Recognize when inline can be used
 - vmalloc()
 - Automatic use of the xencomm_mini when the number of pages is small.

Signed-off-by: Jerone Young [EMAIL PROTECTED]
Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 arch/powerpc/platforms/xen/gnttab.c |   21 ++
 arch/powerpc/platforms/xen/hcall.c  |  283 ++--
 arch/powerpc/platforms/xen/setup.c  |2 
 drivers/xen/core/xencomm.c  |   73 -
 include/xen/xencomm.h   |   20 ++
 5 files changed, 280 insertions(+), 119 deletions(-)

diff -r ab3b5849331d -r 5eca8383a521 arch/powerpc/platforms/xen/gnttab.c
--- a/arch/powerpc/platforms/xen/gnttab.c   Sun Jan 21 08:36:53 2007 -0500
+++ b/arch/powerpc/platforms/xen/gnttab.c   Tue Feb 06 16:21:30 2007 -0500
@@ -244,8 +244,8 @@ static void gnttab_post_map_grant_ref(
 
 int HYPERVISOR_grant_table_op(unsigned int cmd, void *op, unsigned int count)
 {
-   void *desc;
-   void *frame_list;
+   void *desc = NULL;
+   void *frame_list = NULL;
int argsize;
int ret;
 
@@ -263,8 +263,13 @@ int HYPERVISOR_grant_table_op(unsigned i
memcpy(setup, op, sizeof(setup));
argsize = sizeof(setup);
 
-   frame_list = xencomm_create_inline(
-   xen_guest_handle(setup.frame_list));
+   frame_list = xencomm_map(
+   xen_guest_handle(setup.frame_list),
+   (sizeof(*xen_guest_handle(setup.frame_list)) 
+   * setup.nr_frames));
+
+   if (frame_list == NULL)
+   return -ENOMEM;
 
set_xen_guest_handle(setup.frame_list, frame_list);
memcpy(op, setup, sizeof(setup));
@@ -286,12 +291,18 @@ int HYPERVISOR_grant_table_op(unsigned i
return -ENOSYS;
}
 
-   desc = xencomm_create_inline(op);
+   desc = xencomm_map_no_alloc(op, argsize);
+
+   if (desc == NULL)
+   return -ENOSPC;
 
ret = plpar_hcall_norets(XEN_MARK(__HYPERVISOR_grant_table_op), cmd,
 desc, count);
if (cmd == GNTTABOP_map_grant_ref)
gnttab_post_map_grant_ref(op, count);
+
+   xencomm_free(frame_list);
+   xencomm_free(desc);
 
return ret;
 }
diff -r ab3b5849331d -r 5eca8383a521 arch/powerpc/platforms/xen/hcall.c
--- a/arch/powerpc/platforms/xen/hcall.cSun Jan 21 08:36:53 2007 -0500
+++ b/arch/powerpc/platforms/xen/hcall.cTue Feb 06 16:21:30 2007 -0500
@@ -54,25 +54,43 @@
 
 int HYPERVISOR_console_io(int cmd, int count, char *str)
 {
-   void *desc = xencomm_create_inline(str);
-
-   return plpar_hcall_norets(XEN_MARK(__HYPERVISOR_console_io),
+   int rc;
+
+   void *desc = xencomm_map_no_alloc(str, count); 
+
+   if (desc == NULL)
+   return -EINVAL;
+
+   rc = plpar_hcall_norets(XEN_MARK(__HYPERVISOR_console_io),
  cmd, count, desc);
+
+   xencomm_free(desc);
+
+   return rc;
 }
 EXPORT_SYMBOL(HYPERVISOR_console_io);
 
 int HYPERVISOR_event_channel_op(int cmd, void *op)
 {
-   void *desc = xencomm_create_inline(op);
-
-   return plpar_hcall_norets(XEN_MARK(__HYPERVISOR_event_channel_op),
+   int rc;
+
+   void *desc = xencomm_map_no_alloc(op, sizeof(evtchn_op_t));
+   if (desc == NULL)
+   return -EINVAL;
+
+   rc = plpar_hcall_norets(XEN_MARK(__HYPERVISOR_event_channel_op),
cmd, desc);
+
+   xencomm_free(desc);
+   
+   return rc;
+
 }
 EXPORT_SYMBOL(HYPERVISOR_event_channel_op);
 
-int HYPERVISOR_xen_version_userspace(int cmd, void *arg)
-{
-   struct xencomm_desc *desc;
+int HYPERVISOR_xen_version(int cmd, void *arg)
+{
+   void *desc;
const unsigned long hcall = __HYPERVISOR_xen_version;
int argsize;
int rc;
@@ -97,7 +115,10 @@ int HYPERVISOR_xen_version_userspace(int
argsize = sizeof(xen_platform_parameters_t);
break;
case XENVER_pagesize:
-   argsize = (arg == NULL) ? 0 : sizeof(void *);
+   if (arg == NULL)
+   argsize = 0;
+   else
+   argsize = sizeof(void *);
break;
case XENVER_get_features:
argsize = sizeof(xen_feature_info_t);
@@ -107,38 +128,41 @@ int HYPERVISOR_xen_version_userspace(int
return -ENOSYS;
}
 
-   rc = xencomm_create(arg, argsize, desc, GFP_KERNEL);
-   if (rc)
-   return rc;
-
-   rc = 

[XenPPC] [linux-ppc-2.6] [XEN][POWERPC] Turn on SMP.. Finally.

2007-01-21 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID a384dbf50d5934ba93eea17eccb7e43cf408dd87
# Parent  bbf2db4ddf5400e908ee6bf92ac798e5cfed82a0
[XEN][POWERPC] Turn on SMP.. Finally.

The following patch uses Xen specific methods to spin up secondary
processors and add them to the Linux devtree (not the flat-devtree).
Specifically:

 - Adds HYPERVISOR_vcpu_op() for probing and spinning.
 - Hot-Plug new CPU entries into the devtree
 - Start CPUs int he same place tha OF/prom_init.c would have
 - Wire up SMP IPI to Xen event channels
 - 6 line common code change in LinuxPPC to set the # possible CPUs correctly

Tested on JS21 (4-way) and Maple(2-way) creating 1-1 Dom0 and several
VIO/DomUs up to 32-way.

NOTE: we cannot yet:
 - _add_ a CPU after the normal boot spinup process
 - remove a CPU

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 arch/powerpc/kernel/setup-common.c   |6 
 arch/powerpc/platforms/xen/Makefile  |1 
 arch/powerpc/platforms/xen/hcall.c   |   30 ++
 arch/powerpc/platforms/xen/setup.c   |   36 --
 arch/powerpc/platforms/xen/setup.h   |1 
 arch/powerpc/platforms/xen/smp.c |  424 +++
 include/asm-powerpc/xen/asm/hypercall.h  |1 
 include/asm-powerpc/xen/asm/hypervisor.h |2 
 8 files changed, 468 insertions(+), 33 deletions(-)

diff -r bbf2db4ddf54 -r a384dbf50d59 arch/powerpc/kernel/setup-common.c
--- a/arch/powerpc/kernel/setup-common.cTue Dec 19 09:22:37 2006 -0500
+++ b/arch/powerpc/kernel/setup-common.cSun Jan 21 08:34:45 2007 -0500
@@ -388,6 +388,12 @@ void __init smp_setup_cpu_maps(void)
}
}
 
+   if (machine_is(xen)) {
+   /* something more inteligent perhaps? */
+   for (cpu = 0; cpu  NR_CPUS; cpu++)
+   cpu_set(cpu, cpu_possible_map);
+   }
+
 #ifdef CONFIG_PPC64
/*
 * On pSeries LPAR, we need to know how many cpus
diff -r bbf2db4ddf54 -r a384dbf50d59 arch/powerpc/platforms/xen/Makefile
--- a/arch/powerpc/platforms/xen/Makefile   Tue Dec 19 09:22:37 2006 -0500
+++ b/arch/powerpc/platforms/xen/Makefile   Sun Jan 21 08:34:45 2007 -0500
@@ -3,6 +3,7 @@ obj-y   += hcall.o
 obj-y  += hcall.o
 obj-y  += reboot.o
 obj-y  += setup.o
+obj-y  += smp.o
 obj-y  += time.o
 obj-y  += udbg_xen.o
 obj-y  += xen_guest.o
diff -r bbf2db4ddf54 -r a384dbf50d59 arch/powerpc/platforms/xen/hcall.c
--- a/arch/powerpc/platforms/xen/hcall.cTue Dec 19 09:22:37 2006 -0500
+++ b/arch/powerpc/platforms/xen/hcall.cSun Jan 21 08:34:45 2007 -0500
@@ -33,7 +33,7 @@
 #include xen/interface/sched.h
 #include xen/interface/event_channel.h
 #include xen/interface/physdev.h
-#include xen/interface/grant_table.h
+#include xen/interface/vcpu.h
 #include xen/public/privcmd.h
 #include asm/hypercall.h
 #include asm/page.h
@@ -599,3 +599,31 @@ int arch_privcmd_hypercall(privcmd_hyper
}
 }
 
+int HYPERVISOR_vcpu_op(int cmd, int vcpuid, void *extra_args)
+{
+   int argsize;
+   const unsigned long hcall = __HYPERVISOR_vcpu_op;
+   void *desc;
+
+   switch (cmd) {
+   case  VCPUOP_initialise:
+   argsize = sizeof(vcpu_guest_context_t);
+   break;
+   case VCPUOP_up:
+   case VCPUOP_down:
+   case VCPUOP_is_up:
+   return plpar_hcall_norets(XEN_MARK(hcall), cmd, vcpuid, 0);
+
+   case VCPUOP_get_runstate_info:
+   argsize = sizeof (vcpu_runstate_info_t);
+   break;
+   default:
+   printk(KERN_ERR %s: unknown version cmd %d\n, __func__, cmd);
+   return -ENOSYS;
+   }
+
+   desc = xencomm_create_inline(extra_args);
+   (void)argsize;
+   return plpar_hcall_norets(XEN_MARK(hcall), cmd, vcpuid, desc);
+}
+   
diff -r bbf2db4ddf54 -r a384dbf50d59 arch/powerpc/platforms/xen/setup.c
--- a/arch/powerpc/platforms/xen/setup.cTue Dec 19 09:22:37 2006 -0500
+++ b/arch/powerpc/platforms/xen/setup.cSun Jan 21 08:34:45 2007 -0500
@@ -168,42 +168,10 @@ static void xen_power_save(void)
HYPERVISOR_sched_op(SCHEDOP_block, NULL);
 }
 
-#ifdef CONFIG_SMP
-
-int __init smp_xen_probe(void)
-{
-   return 1;
-}
-
-void smp_xen_message_pass(int target, int msg)
-{
-   printk(%s(%d, %d)\n, __func__, target, msg);
-}
-
-void __devinit smp_xen_setup_cpu(int cpu)
-{
-   printk(%s(%d)\n, __func__, cpu);
-}
-
-struct smp_ops_t xen_smp_ops = {
-   .probe  = smp_xen_probe,
-   .message_pass   = smp_xen_message_pass,
-   .kick_cpu   = smp_generic_kick_cpu,
-   .setup_cpu  = smp_xen_setup_cpu,
-   .give_timebase  = smp_generic_give_timebase,
-   .take_timebase  = smp_generic_take_timebase,
-};
-#endif /* CONFIG_SMP */
-
 void __init xen_setup_arch(void)
 {
/* init to some ~sane value until calibrate_delay() runs */
loops_per_jiffy = 5000;
-
-   /* Setup SMP callback */
-#ifdef CONFIG_SMP
- 

[XenPPC] [linux-ppc-2.6] merge

2007-01-21 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID ab3b5849331da89e578ae0813021376d66b7f333
# Parent  a384dbf50d5934ba93eea17eccb7e43cf408dd87
# Parent  5faafe734b0e9e1092400196d3518730d21688ce
merge
---
 arch/powerpc/configs/xen_maple_defconfig |  149 ---
 1 files changed, 136 insertions(+), 13 deletions(-)

diff -r a384dbf50d59 -r ab3b5849331d arch/powerpc/configs/xen_maple_defconfig
--- a/arch/powerpc/configs/xen_maple_defconfig  Sun Jan 21 08:34:45 2007 -0500
+++ b/arch/powerpc/configs/xen_maple_defconfig  Sun Jan 21 08:36:53 2007 -0500
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.17
-# Thu Oct 12 16:16:49 2006
+# Mon Jan 15 23:48:47 2007
 #
 CONFIG_PPC64=y
 CONFIG_64BIT=y
@@ -230,15 +230,24 @@ CONFIG_XFRM=y
 # CONFIG_NET_KEY is not set
 CONFIG_INET=y
 CONFIG_IP_MULTICAST=y
-# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_ASK_IP_FIB_HASH=y
+# CONFIG_IP_FIB_TRIE is not set
 CONFIG_IP_FIB_HASH=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_FWMARK=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+# CONFIG_IP_ROUTE_MULTIPATH_CACHED is not set
+# CONFIG_IP_ROUTE_VERBOSE is not set
 CONFIG_IP_PNP=y
 CONFIG_IP_PNP_DHCP=y
 CONFIG_IP_PNP_BOOTP=y
 CONFIG_IP_PNP_RARP=y
 CONFIG_NET_IPIP=y
 # CONFIG_NET_IPGRE is not set
-# CONFIG_IP_MROUTE is not set
+CONFIG_IP_MROUTE=y
+CONFIG_IP_PIMSM_V1=y
+CONFIG_IP_PIMSM_V2=y
 # CONFIG_ARPD is not set
 CONFIG_SYN_COOKIES=y
 # CONFIG_INET_AH is not set
@@ -257,9 +266,18 @@ CONFIG_TCP_CONG_BIC=y
 # IP: Virtual Server Configuration
 #
 # CONFIG_IP_VS is not set
-# CONFIG_IPV6 is not set
-# CONFIG_INET6_XFRM_TUNNEL is not set
-# CONFIG_INET6_TUNNEL is not set
+CONFIG_IPV6=y
+CONFIG_IPV6_PRIVACY=y
+CONFIG_IPV6_ROUTER_PREF=y
+CONFIG_IPV6_ROUTE_INFO=y
+CONFIG_INET6_AH=y
+CONFIG_INET6_ESP=y
+CONFIG_INET6_IPCOMP=y
+CONFIG_INET6_XFRM_TUNNEL=y
+CONFIG_INET6_TUNNEL=y
+CONFIG_INET6_XFRM_MODE_TRANSPORT=y
+CONFIG_INET6_XFRM_MODE_TUNNEL=y
+CONFIG_IPV6_TUNNEL=y
 # CONFIG_NETWORK_SECMARK is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
@@ -268,15 +286,114 @@ CONFIG_BRIDGE_NETFILTER=y
 #
 # Core Netfilter Configuration
 #
-# CONFIG_NETFILTER_NETLINK is not set
-# CONFIG_NF_CONNTRACK is not set
-# CONFIG_NETFILTER_XTABLES is not set
+CONFIG_NETFILTER_NETLINK=y
+CONFIG_NETFILTER_NETLINK_QUEUE=y
+CONFIG_NETFILTER_NETLINK_LOG=y
+CONFIG_NETFILTER_XTABLES=y
+CONFIG_NETFILTER_XT_TARGET_CLASSIFY=y
+CONFIG_NETFILTER_XT_TARGET_CONNMARK=y
+CONFIG_NETFILTER_XT_TARGET_MARK=y
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=y
+CONFIG_NETFILTER_XT_TARGET_NOTRACK=y
+CONFIG_NETFILTER_XT_MATCH_COMMENT=y
+CONFIG_NETFILTER_XT_MATCH_CONNBYTES=y
+CONFIG_NETFILTER_XT_MATCH_CONNMARK=y
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=y
+CONFIG_NETFILTER_XT_MATCH_DCCP=y
+CONFIG_NETFILTER_XT_MATCH_ESP=y
+CONFIG_NETFILTER_XT_MATCH_HELPER=y
+CONFIG_NETFILTER_XT_MATCH_LENGTH=y
+CONFIG_NETFILTER_XT_MATCH_LIMIT=y
+CONFIG_NETFILTER_XT_MATCH_MAC=y
+CONFIG_NETFILTER_XT_MATCH_MARK=y
+CONFIG_NETFILTER_XT_MATCH_POLICY=y
+CONFIG_NETFILTER_XT_MATCH_MULTIPORT=y
+CONFIG_NETFILTER_XT_MATCH_PHYSDEV=y
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=y
+CONFIG_NETFILTER_XT_MATCH_QUOTA=y
+CONFIG_NETFILTER_XT_MATCH_REALM=y
+CONFIG_NETFILTER_XT_MATCH_SCTP=y
+CONFIG_NETFILTER_XT_MATCH_STATE=y
+CONFIG_NETFILTER_XT_MATCH_STATISTIC=y
+CONFIG_NETFILTER_XT_MATCH_STRING=y
+CONFIG_NETFILTER_XT_MATCH_TCPMSS=y
 
 #
 # IP: Netfilter Configuration
 #
-# CONFIG_IP_NF_CONNTRACK is not set
+CONFIG_IP_NF_CONNTRACK=y
+CONFIG_IP_NF_CT_ACCT=y
+CONFIG_IP_NF_CONNTRACK_MARK=y
+CONFIG_IP_NF_CONNTRACK_EVENTS=y
+CONFIG_IP_NF_CONNTRACK_NETLINK=y
+CONFIG_IP_NF_CT_PROTO_SCTP=y
+CONFIG_IP_NF_FTP=y
+CONFIG_IP_NF_IRC=y
+# CONFIG_IP_NF_NETBIOS_NS is not set
+CONFIG_IP_NF_TFTP=y
+CONFIG_IP_NF_AMANDA=y
+CONFIG_IP_NF_PPTP=y
+# CONFIG_IP_NF_H323 is not set
+# CONFIG_IP_NF_SIP is not set
 # CONFIG_IP_NF_QUEUE is not set
+CONFIG_IP_NF_IPTABLES=y
+CONFIG_IP_NF_MATCH_IPRANGE=y
+CONFIG_IP_NF_MATCH_TOS=y
+CONFIG_IP_NF_MATCH_RECENT=y
+CONFIG_IP_NF_MATCH_ECN=y
+CONFIG_IP_NF_MATCH_DSCP=y
+CONFIG_IP_NF_MATCH_AH=y
+CONFIG_IP_NF_MATCH_TTL=y
+CONFIG_IP_NF_MATCH_OWNER=y
+CONFIG_IP_NF_MATCH_ADDRTYPE=y
+CONFIG_IP_NF_MATCH_HASHLIMIT=y
+CONFIG_IP_NF_FILTER=y
+CONFIG_IP_NF_TARGET_REJECT=y
+CONFIG_IP_NF_TARGET_LOG=y
+CONFIG_IP_NF_TARGET_ULOG=y
+CONFIG_IP_NF_TARGET_TCPMSS=y
+CONFIG_IP_NF_NAT=y
+CONFIG_IP_NF_NAT_NEEDED=y
+CONFIG_IP_NF_TARGET_MASQUERADE=y
+CONFIG_IP_NF_TARGET_REDIRECT=y
+CONFIG_IP_NF_TARGET_NETMAP=y
+CONFIG_IP_NF_TARGET_SAME=y
+CONFIG_IP_NF_NAT_SNMP_BASIC=y
+CONFIG_IP_NF_NAT_IRC=y
+CONFIG_IP_NF_NAT_FTP=y
+CONFIG_IP_NF_NAT_TFTP=y
+CONFIG_IP_NF_NAT_AMANDA=y
+CONFIG_IP_NF_NAT_PPTP=y
+CONFIG_IP_NF_MANGLE=y
+CONFIG_IP_NF_TARGET_TOS=y
+CONFIG_IP_NF_TARGET_ECN=y
+CONFIG_IP_NF_TARGET_DSCP=y
+CONFIG_IP_NF_TARGET_TTL=y
+CONFIG_IP_NF_TARGET_CLUSTERIP=y
+CONFIG_IP_NF_RAW=y
+CONFIG_IP_NF_ARPTABLES=y
+CONFIG_IP_NF_ARPFILTER=y
+CONFIG_IP_NF_ARP_MANGLE=y
+
+#
+# IPv6: Netfilter Configuration (EXPERIMENTAL)
+#

[XenPPC] [linux-ppc-2.6] [POWERPC][XEN][LINUX] Enable firewall options to avoid breaking init scripts.

2007-01-18 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User [EMAIL PROTECTED]
# Node ID 5faafe734b0e9e1092400196d3518730d21688ce
# Parent  bbf2db4ddf5400e908ee6bf92ac798e5cfed82a0
[POWERPC][XEN][LINUX] Enable firewall options to avoid breaking init scripts.
Signed-off-by: Jerone Young [EMAIL PROTECTED]
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 arch/powerpc/configs/xen_maple_defconfig |  149 ---
 1 files changed, 136 insertions(+), 13 deletions(-)

diff -r bbf2db4ddf54 -r 5faafe734b0e arch/powerpc/configs/xen_maple_defconfig
--- a/arch/powerpc/configs/xen_maple_defconfig  Tue Dec 19 09:22:37 2006 -0500
+++ b/arch/powerpc/configs/xen_maple_defconfig  Tue Jan 16 00:12:50 2007 -0600
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.17
-# Thu Oct 12 16:16:49 2006
+# Mon Jan 15 23:48:47 2007
 #
 CONFIG_PPC64=y
 CONFIG_64BIT=y
@@ -230,15 +230,24 @@ CONFIG_XFRM=y
 # CONFIG_NET_KEY is not set
 CONFIG_INET=y
 CONFIG_IP_MULTICAST=y
-# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_ASK_IP_FIB_HASH=y
+# CONFIG_IP_FIB_TRIE is not set
 CONFIG_IP_FIB_HASH=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_FWMARK=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+# CONFIG_IP_ROUTE_MULTIPATH_CACHED is not set
+# CONFIG_IP_ROUTE_VERBOSE is not set
 CONFIG_IP_PNP=y
 CONFIG_IP_PNP_DHCP=y
 CONFIG_IP_PNP_BOOTP=y
 CONFIG_IP_PNP_RARP=y
 CONFIG_NET_IPIP=y
 # CONFIG_NET_IPGRE is not set
-# CONFIG_IP_MROUTE is not set
+CONFIG_IP_MROUTE=y
+CONFIG_IP_PIMSM_V1=y
+CONFIG_IP_PIMSM_V2=y
 # CONFIG_ARPD is not set
 CONFIG_SYN_COOKIES=y
 # CONFIG_INET_AH is not set
@@ -257,9 +266,18 @@ CONFIG_TCP_CONG_BIC=y
 # IP: Virtual Server Configuration
 #
 # CONFIG_IP_VS is not set
-# CONFIG_IPV6 is not set
-# CONFIG_INET6_XFRM_TUNNEL is not set
-# CONFIG_INET6_TUNNEL is not set
+CONFIG_IPV6=y
+CONFIG_IPV6_PRIVACY=y
+CONFIG_IPV6_ROUTER_PREF=y
+CONFIG_IPV6_ROUTE_INFO=y
+CONFIG_INET6_AH=y
+CONFIG_INET6_ESP=y
+CONFIG_INET6_IPCOMP=y
+CONFIG_INET6_XFRM_TUNNEL=y
+CONFIG_INET6_TUNNEL=y
+CONFIG_INET6_XFRM_MODE_TRANSPORT=y
+CONFIG_INET6_XFRM_MODE_TUNNEL=y
+CONFIG_IPV6_TUNNEL=y
 # CONFIG_NETWORK_SECMARK is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
@@ -268,15 +286,114 @@ CONFIG_BRIDGE_NETFILTER=y
 #
 # Core Netfilter Configuration
 #
-# CONFIG_NETFILTER_NETLINK is not set
-# CONFIG_NF_CONNTRACK is not set
-# CONFIG_NETFILTER_XTABLES is not set
+CONFIG_NETFILTER_NETLINK=y
+CONFIG_NETFILTER_NETLINK_QUEUE=y
+CONFIG_NETFILTER_NETLINK_LOG=y
+CONFIG_NETFILTER_XTABLES=y
+CONFIG_NETFILTER_XT_TARGET_CLASSIFY=y
+CONFIG_NETFILTER_XT_TARGET_CONNMARK=y
+CONFIG_NETFILTER_XT_TARGET_MARK=y
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=y
+CONFIG_NETFILTER_XT_TARGET_NOTRACK=y
+CONFIG_NETFILTER_XT_MATCH_COMMENT=y
+CONFIG_NETFILTER_XT_MATCH_CONNBYTES=y
+CONFIG_NETFILTER_XT_MATCH_CONNMARK=y
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=y
+CONFIG_NETFILTER_XT_MATCH_DCCP=y
+CONFIG_NETFILTER_XT_MATCH_ESP=y
+CONFIG_NETFILTER_XT_MATCH_HELPER=y
+CONFIG_NETFILTER_XT_MATCH_LENGTH=y
+CONFIG_NETFILTER_XT_MATCH_LIMIT=y
+CONFIG_NETFILTER_XT_MATCH_MAC=y
+CONFIG_NETFILTER_XT_MATCH_MARK=y
+CONFIG_NETFILTER_XT_MATCH_POLICY=y
+CONFIG_NETFILTER_XT_MATCH_MULTIPORT=y
+CONFIG_NETFILTER_XT_MATCH_PHYSDEV=y
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=y
+CONFIG_NETFILTER_XT_MATCH_QUOTA=y
+CONFIG_NETFILTER_XT_MATCH_REALM=y
+CONFIG_NETFILTER_XT_MATCH_SCTP=y
+CONFIG_NETFILTER_XT_MATCH_STATE=y
+CONFIG_NETFILTER_XT_MATCH_STATISTIC=y
+CONFIG_NETFILTER_XT_MATCH_STRING=y
+CONFIG_NETFILTER_XT_MATCH_TCPMSS=y
 
 #
 # IP: Netfilter Configuration
 #
-# CONFIG_IP_NF_CONNTRACK is not set
+CONFIG_IP_NF_CONNTRACK=y
+CONFIG_IP_NF_CT_ACCT=y
+CONFIG_IP_NF_CONNTRACK_MARK=y
+CONFIG_IP_NF_CONNTRACK_EVENTS=y
+CONFIG_IP_NF_CONNTRACK_NETLINK=y
+CONFIG_IP_NF_CT_PROTO_SCTP=y
+CONFIG_IP_NF_FTP=y
+CONFIG_IP_NF_IRC=y
+# CONFIG_IP_NF_NETBIOS_NS is not set
+CONFIG_IP_NF_TFTP=y
+CONFIG_IP_NF_AMANDA=y
+CONFIG_IP_NF_PPTP=y
+# CONFIG_IP_NF_H323 is not set
+# CONFIG_IP_NF_SIP is not set
 # CONFIG_IP_NF_QUEUE is not set
+CONFIG_IP_NF_IPTABLES=y
+CONFIG_IP_NF_MATCH_IPRANGE=y
+CONFIG_IP_NF_MATCH_TOS=y
+CONFIG_IP_NF_MATCH_RECENT=y
+CONFIG_IP_NF_MATCH_ECN=y
+CONFIG_IP_NF_MATCH_DSCP=y
+CONFIG_IP_NF_MATCH_AH=y
+CONFIG_IP_NF_MATCH_TTL=y
+CONFIG_IP_NF_MATCH_OWNER=y
+CONFIG_IP_NF_MATCH_ADDRTYPE=y
+CONFIG_IP_NF_MATCH_HASHLIMIT=y
+CONFIG_IP_NF_FILTER=y
+CONFIG_IP_NF_TARGET_REJECT=y
+CONFIG_IP_NF_TARGET_LOG=y
+CONFIG_IP_NF_TARGET_ULOG=y
+CONFIG_IP_NF_TARGET_TCPMSS=y
+CONFIG_IP_NF_NAT=y
+CONFIG_IP_NF_NAT_NEEDED=y
+CONFIG_IP_NF_TARGET_MASQUERADE=y
+CONFIG_IP_NF_TARGET_REDIRECT=y
+CONFIG_IP_NF_TARGET_NETMAP=y
+CONFIG_IP_NF_TARGET_SAME=y
+CONFIG_IP_NF_NAT_SNMP_BASIC=y
+CONFIG_IP_NF_NAT_IRC=y
+CONFIG_IP_NF_NAT_FTP=y
+CONFIG_IP_NF_NAT_TFTP=y
+CONFIG_IP_NF_NAT_AMANDA=y
+CONFIG_IP_NF_NAT_PPTP=y
+CONFIG_IP_NF_MANGLE=y
+CONFIG_IP_NF_TARGET_TOS=y
+CONFIG_IP_NF_TARGET_ECN=y
+CONFIG_IP_NF_TARGET_DSCP=y
+CONFIG_IP_NF_TARGET_TTL=y
+CONFIG_IP_NF_TARGET_CLUSTERIP=y
+CONFIG_IP_NF_RAW=y
+CONFIG_IP_NF_ARPTABLES=y

[XenPPC] [linux-ppc-2.6] [POWERPC][XEN] Use new Xen based Real Time Clock logic in DomUs

2006-12-19 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID bbf2db4ddf5400e908ee6bf92ac798e5cfed82a0
# Parent  c8d1f32fd7deebb9c15e5dc4ec3bcbd3678d9488
[POWERPC][XEN] Use new Xen based Real Time Clock logic in DomUs

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 arch/powerpc/platforms/xen/Makefile  |1 
 arch/powerpc/platforms/xen/setup.c   |   10 +--
 arch/powerpc/platforms/xen/setup.h   |1 
 arch/powerpc/platforms/xen/time.c|   96 +++
 include/xen/interface/arch-powerpc.h |2 
 5 files changed, 104 insertions(+), 6 deletions(-)

diff -r c8d1f32fd7de -r bbf2db4ddf54 arch/powerpc/platforms/xen/Makefile
--- a/arch/powerpc/platforms/xen/Makefile   Wed Nov 22 14:51:54 2006 -0500
+++ b/arch/powerpc/platforms/xen/Makefile   Tue Dec 19 09:22:37 2006 -0500
@@ -3,6 +3,7 @@ obj-y   += hcall.o
 obj-y  += hcall.o
 obj-y  += reboot.o
 obj-y  += setup.o
+obj-y  += time.o
 obj-y  += udbg_xen.o
 obj-y  += xen_guest.o
 obj-y  += xencomm.o
diff -r c8d1f32fd7de -r bbf2db4ddf54 arch/powerpc/platforms/xen/setup.c
--- a/arch/powerpc/platforms/xen/setup.cWed Nov 22 14:51:54 2006 -0500
+++ b/arch/powerpc/platforms/xen/setup.cTue Dec 19 09:22:37 2006 -0500
@@ -109,12 +109,12 @@ static void __init xen_init_early(void)
DBG(console_mfn%llx\n, xen_start_info-console.domU.mfn);
DBG(console_evtchn %x\n, xen_start_info-console.domU.evtchn);
 
+   xen_setup_time(mach_maple_md);
+
if (is_initial_xendomain()) {
-   ppc_md.pcibios_fixup= mach_maple_md.pcibios_fixup;
-   ppc_md.pci_get_legacy_ide_irq   = 
mach_maple_md.pci_get_legacy_ide_irq;
-   ppc_md.get_boot_time= mach_maple_md.get_boot_time;
-   ppc_md.set_rtc_time = mach_maple_md.set_rtc_time;
-   ppc_md.get_rtc_time = mach_maple_md.get_rtc_time;
+   ppc_md.pcibios_fixup = mach_maple_md.pcibios_fixup;
+   ppc_md.pci_get_legacy_ide_irq =
+   mach_maple_md.pci_get_legacy_ide_irq;
 
add_preferred_console(ttyS, 0, NULL);
}
diff -r c8d1f32fd7de -r bbf2db4ddf54 arch/powerpc/platforms/xen/setup.h
--- a/arch/powerpc/platforms/xen/setup.hWed Nov 22 14:51:54 2006 -0500
+++ b/arch/powerpc/platforms/xen/setup.hTue Dec 19 09:22:37 2006 -0500
@@ -26,3 +26,4 @@ extern struct page *alloc_foreign_page(v
 extern struct page *alloc_foreign_page(void);
 extern void free_foreign_page(struct page *page);
 
+extern void __init xen_setup_time(struct machdep_calls *host_md);
diff -r c8d1f32fd7de -r bbf2db4ddf54 include/xen/interface/arch-powerpc.h
--- a/include/xen/interface/arch-powerpc.h  Wed Nov 22 14:51:54 2006 -0500
+++ b/include/xen/interface/arch-powerpc.h  Tue Dec 19 09:22:37 2006 -0500
@@ -108,7 +108,7 @@ DEFINE_XEN_GUEST_HANDLE(vcpu_guest_conte
 DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
 
 struct arch_shared_info {
-uint64_t pad[32];
+uint64_t boot_timebase;
 };
 
 struct arch_vcpu_info {
diff -r c8d1f32fd7de -r bbf2db4ddf54 arch/powerpc/platforms/xen/time.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/arch/powerpc/platforms/xen/time.c Tue Dec 19 09:22:37 2006 -0500
@@ -0,0 +1,96 @@
+#include linux/module.h
+#include linux/time.h
+#include linux/rtc.h
+#include asm/hypervisor.h
+#include asm/machdep.h
+#include asm/time.h
+#include asm/udbg.h
+
+#define DEBUG
+
+#ifdef DEBUG
+#define DBG(fmt...) printk(fmt)
+#else
+#define DBG(fmt...)
+#endif
+
+static inline ulong time_from_shared(void)
+{
+   ulong t;
+
+   DBG(tb_freq: %ld\n, ppc_tb_freq);
+   
+   t = mftb() - HYPERVISOR_shared_info-arch.boot_timebase;
+   t /= ppc_tb_freq;
+   t += HYPERVISOR_shared_info-wc_sec;
+
+   return t;
+}
+
+static void (*host_md_get_rtc_time)(struct rtc_time *tm);
+static void xen_get_rtc_time(struct rtc_time *tm)
+{
+   if (is_initial_xendomain()) {
+   host_md_get_rtc_time(tm);
+   return;
+   } else {
+   ulong t;
+
+   t = time_from_shared();
+   to_tm(t, tm);
+   }
+}
+
+static int (*host_md_set_rtc_time)(struct rtc_time *tm);
+static int xen_set_rtc_time(struct rtc_time *tm)
+{
+   ulong sec;
+
+   if (is_initial_xendomain()) {
+   host_md_set_rtc_time(tm);
+   return 0;
+   }
+
+   sec = mktime(tm-tm_year, tm-tm_mon, tm-tm_mday,
+tm-tm_hour, tm-tm_min, tm-tm_sec);
+
+   HYPERVISOR_shared_info-wc_sec = sec;
+   HYPERVISOR_shared_info-arch.boot_timebase = mftb();
+
+   return 0;
+}
+
+static unsigned long (*host_md_get_boot_time)(void);
+static unsigned long __init xen_get_boot_time(void)
+{
+   ulong t;
+
+   if (is_initial_xendomain()) {
+   t = host_md_get_boot_time();
+
+   HYPERVISOR_shared_info-wc_sec = t;
+   HYPERVISOR_shared_info-arch.boot_timebase = 

[XenPPC] [linux-ppc-2.6] [XEN][POWERPC] HYPERVISOR_memory_op() return value now has meaning

2006-11-14 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 47cd37e8f8a91bdf10b314cbaa8d5a9088be30fc
# Parent  01f3c63f0343051ce1cc039b4bd38def61eb3def
[XEN][POWERPC] HYPERVISOR_memory_op() return value now has meaning

This patch fixes a false failure when calling HYPERVISOR_memory_op()
from user space, where the return value fromt he hcall is expected.

With this fix, the recent bits can can create domains beyond their RMA.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 arch/powerpc/platforms/xen/hcall.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -r 01f3c63f0343 -r 47cd37e8f8a9 arch/powerpc/platforms/xen/hcall.c
--- a/arch/powerpc/platforms/xen/hcall.cSat Nov 11 10:25:31 2006 -0500
+++ b/arch/powerpc/platforms/xen/hcall.cTue Nov 14 19:33:36 2006 -0500
@@ -520,7 +520,8 @@ static int xenppc_privcmd_memory_op(priv
   sizeof(xen_memory_reservation_t)))
return -EFAULT;
 
-   if (!HYPERVISOR_memory_op(cmd, kern_op)) {
+   ret = HYPERVISOR_memory_op(cmd, kern_op);
+   if (ret = 0) {
if (copy_to_user(user_op, kern_op,
 sizeof(xen_memory_reservation_t)))
return -EFAULT;

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


[XenPPC] [linux-ppc-2.6] [XEN] up the XEN_DOMCTL_INTERFACE_VERSION to 4

2006-11-10 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 7553b5170236ffe6ed3805c321bfd1ce2010793e
# Parent  e6688f786b21d74a4616a56415d2b11562d7fcc0
[XEN] up the XEN_DOMCTL_INTERFACE_VERSION to 4

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 include/xen/interface/domctl.h |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -r e6688f786b21 -r 7553b5170236 include/xen/interface/domctl.h
--- a/include/xen/interface/domctl.hFri Nov 10 18:46:39 2006 -0500
+++ b/include/xen/interface/domctl.hFri Nov 10 18:47:12 2006 -0500
@@ -16,7 +16,7 @@
 
 #include xen.h
 
-#define XEN_DOMCTL_INTERFACE_VERSION 0x0003
+#define XEN_DOMCTL_INTERFACE_VERSION 0x0004
 
 struct xenctl_cpumap {
 XEN_GUEST_HANDLE(uint8_t) bitmap;

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


[XenPPC] [linux-ppc-2.6] [XEN][POWERPC] Fixes int he bitmap managment of the Foriegn Map

2006-11-10 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID ef51ca28a1fc1e49299f0492194f921a309abc64
# Parent  7553b5170236ffe6ed3805c321bfd1ce2010793e
[XEN][POWERPC] Fixes int he bitmap managment of the Foriegn Map

Bitmap bit position are ulongs, and more error checking.
Thanks to: [EMAIL PROTECTED]

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 arch/powerpc/platforms/xen/balloon.c |1 +
 arch/powerpc/platforms/xen/gnttab.c  |8 
 2 files changed, 5 insertions(+), 4 deletions(-)

diff -r 7553b5170236 -r ef51ca28a1fc arch/powerpc/platforms/xen/balloon.c
--- a/arch/powerpc/platforms/xen/balloon.c  Fri Nov 10 18:47:12 2006 -0500
+++ b/arch/powerpc/platforms/xen/balloon.c  Fri Nov 10 18:49:48 2006 -0500
@@ -18,6 +18,7 @@ struct page **alloc_empty_pages_and_page
 
for (i = 0; i  nr_pages; i++) {
page = alloc_foreign_page();
+   BUG_ON(page == NULL);
pagevec[i] = page;
/* There is no real page backing us yet so it cannot
 * be scrubbed */
diff -r 7553b5170236 -r ef51ca28a1fc arch/powerpc/platforms/xen/gnttab.c
--- a/arch/powerpc/platforms/xen/gnttab.c   Fri Nov 10 18:47:12 2006 -0500
+++ b/arch/powerpc/platforms/xen/gnttab.c   Fri Nov 10 18:49:48 2006 -0500
@@ -355,7 +355,7 @@ int arch_gnttab_suspend(volatile void __
 
 struct page *alloc_foreign_page(void)
 {
-   int bit;
+   ulong bit;
do {
bit = find_first_zero_bit(foreign_map_bitmap,
  foreign_map_pgs);
@@ -368,10 +368,10 @@ struct page *alloc_foreign_page(void)
 
 void free_foreign_page(struct page *page)
 {
-   int bit = page_to_pfn(page) - foreign_map_pfn;
-
-   BUG_ON(bit  0);
+   ulong bit = page_to_pfn(page) - foreign_map_pfn;
+
BUG_ON(bit = foreign_map_pgs);
+   BUG_ON(!test_bit(bit, foreign_map_bitmap));
 
clear_bit(bit, foreign_map_bitmap);
 }

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


[XenPPC] [linux-ppc-2.6] [XEN][POWERPC] Use a bitmap to manage the foreign page area

2006-11-08 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 39d3d1cfe7146a6542a7708bace0ab38f11e48b5
# Parent  2a9c6a23cd1292e9ed361e33d640ce84a6fbdb53
[XEN][POWERPC] Use a bitmap to manage the foreign page area

We needed to be able to dispense pages from the foreign map to Xen VIO
back drivers.  I thougth mempool would be an easy way to do this, but
it seems that a bitmap is far easier and simpler to do this with.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 arch/powerpc/platforms/xen/balloon.c |   14 +---
 arch/powerpc/platforms/xen/gnttab.c  |  100 ---
 arch/powerpc/platforms/xen/setup.h   |4 -
 arch/powerpc/platforms/xen/util.c|2 
 4 files changed, 55 insertions(+), 65 deletions(-)

diff -r 2a9c6a23cd12 -r 39d3d1cfe714 arch/powerpc/platforms/xen/balloon.c
--- a/arch/powerpc/platforms/xen/balloon.c  Fri Nov 03 16:50:22 2006 -0500
+++ b/arch/powerpc/platforms/xen/balloon.c  Wed Nov 08 15:44:19 2006 -0500
@@ -11,22 +11,16 @@ struct page **alloc_empty_pages_and_page
 {
struct page *page, **pagevec;
int i;
-   int scrub = 0;
 
pagevec = kmalloc(sizeof(*pagevec) * nr_pages, GFP_KERNEL);
if (pagevec == NULL)
return  NULL;
 
for (i = 0; i  nr_pages; i++) {
-   page = alloc_grant_page();
+   page = alloc_foreign_page();
pagevec[i] = page;
-
-   if (scrub) {
-   void *vaddr;
-
-   vaddr = page_address(page);
-   scrub_pages(vaddr, 1);
-   }
+   /* There is no real page backing us yet so it cannot
+* be scrubbed */
}
 
return pagevec;
@@ -40,7 +34,7 @@ void free_empty_pages_and_pagevec(struct
return;
 
for (i = 0; i  nr_pages; i++) {
-   free_grant_page(pagevec[i]);
+   free_foreign_page(pagevec[i]);
}

kfree(pagevec);
diff -r 2a9c6a23cd12 -r 39d3d1cfe714 arch/powerpc/platforms/xen/gnttab.c
--- a/arch/powerpc/platforms/xen/gnttab.c   Fri Nov 03 16:50:22 2006 -0500
+++ b/arch/powerpc/platforms/xen/gnttab.c   Wed Nov 08 15:44:19 2006 -0500
@@ -2,7 +2,6 @@
 #include linux/config.h
 #include linux/vmalloc.h
 #include linux/memory_hotplug.h
-#include linux/mempool.h
 #include xen/gnttab.h
 #include asm/hypervisor.h
 #include xen/interface/grant_table.h
@@ -25,8 +24,9 @@
 
 struct address_space xen_foreign_dummy_mapping;
 
-static ulong foreign_map_base;
-static ulong foreign_map_end;
+static ulong foreign_map_pfn;
+static ulong foreign_map_pgs;
+static unsigned long *foreign_map_bitmap;
 
 
 /* hijack _mapcount */
@@ -215,7 +215,9 @@ static void gnttab_post_map_grant_ref(
continue;
}
 
-   BUG_ON(pa  foreign_map_base || pa = foreign_map_end);
+   BUG_ON(pa  (foreign_map_pfn  PAGE_SHIFT));
+   BUG_ON(pa = (foreign_map_pfn  PAGE_SHIFT) + 
+  (foreign_map_pgs  PAGE_SHIFT));
 
page = virt_to_page(__va(pa));
 
@@ -330,9 +332,7 @@ static ulong find_grant_maps(void)
panic(foreign-map is 0x%lx, expect 0x%lx\n,
  gm[0], expect);
 
-   foreign_map_base = 1UL  (gm[0] + PAGE_SHIFT);
-   foreign_map_end = foreign_map_base + (gm[1]  PAGE_SHIFT);
-
+   foreign_map_pfn = 1UL  gm[0];
return gm[1];
 }
 
@@ -353,40 +353,27 @@ int arch_gnttab_suspend(volatile void __
return 0;
 }
 
-static mempool_t *grant_pool;
-struct page *alloc_grant_page(void)
-{
-   void *va;
-
-   va = mempool_alloc(grant_pool, GFP_KERNEL);
-
-   return virt_to_page(va);
-}
-
-void free_grant_page(struct page *page)
-{
-   mempool_free(pfn_to_kaddr(page_to_pfn(page)), grant_pool);
-}
-
-static void *gp_alloc(gfp_t gfp_mask, void *pool_data)
-{
-   static ulong count;
-   ulong max = (ulong)pool_data;
-   void *ret = NULL;
-
-   if (count  max) {
-   ulong pfn;
-
-   pfn = (foreign_map_base  PAGE_SHIFT) + count;
-   ret = pfn_to_kaddr(pfn);
-   ++count;
-   }
-   return ret;
-}
-
-static void gp_free(void *element, void *pool_data)
-{
-   BUG();
+struct page *alloc_foreign_page(void)
+{
+   int bit;
+   do {
+   bit = find_first_zero_bit(foreign_map_bitmap,
+ foreign_map_pgs);
+   if (bit = foreign_map_pgs)
+   return NULL;
+   } while (test_and_set_bit(bit, foreign_map_bitmap) == 1);
+
+   return pfn_to_page(foreign_map_pfn + bit);
+}
+
+void free_foreign_page(struct page *page)
+{
+   int bit = page_to_pfn(page) - foreign_map_pfn;
+
+   BUG_ON(bit  0);
+   BUG_ON(bit = foreign_map_pgs);
+
+   clear_bit(bit, foreign_map_bitmap);
 }
 
 static void setup_grant_area(void)
@@ -400,25 +387,39 @@ static void 

[XenPPC] [linux-ppc-2.6] [XEN][POWERPC] Driver refresh

2006-11-08 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 15c1ca41a412014e942f72c908861c963a35e306
# Parent  39d3d1cfe7146a6542a7708bace0ab38f11e48b5
[XEN][POWERPC] Driver refresh

This fixes the problem with inter-domain networking.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 drivers/xen/netback/common.h   |2 
 drivers/xen/netback/interface.c|   29 +++
 drivers/xen/netback/netback.c  |   74 +++-
 drivers/xen/netback/xenbus.c   |   89 ++--
 drivers/xen/netfront/netfront.c|  135 -
 drivers/xen/xenbus/xenbus_client.c |3 
 drivers/xen/xenbus/xenbus_probe.c  |2 
 7 files changed, 143 insertions(+), 191 deletions(-)

diff -r 39d3d1cfe714 -r 15c1ca41a412 drivers/xen/netback/common.h
--- a/drivers/xen/netback/common.h  Wed Nov 08 15:44:19 2006 -0500
+++ b/drivers/xen/netback/common.h  Wed Nov 08 18:58:23 2006 -0500
@@ -106,7 +106,7 @@ typedef struct netif_st {
 
 void netif_disconnect(netif_t *netif);
 
-netif_t *netif_alloc(domid_t domid, unsigned int handle, u8 be_mac[ETH_ALEN]);
+netif_t *netif_alloc(domid_t domid, unsigned int handle);
 int netif_map(netif_t *netif, unsigned long tx_ring_ref,
  unsigned long rx_ring_ref, unsigned int evtchn);
 
diff -r 39d3d1cfe714 -r 15c1ca41a412 drivers/xen/netback/interface.c
--- a/drivers/xen/netback/interface.c   Wed Nov 08 15:44:19 2006 -0500
+++ b/drivers/xen/netback/interface.c   Wed Nov 08 18:58:23 2006 -0500
@@ -126,9 +126,9 @@ static struct ethtool_ops network_ethtoo
.get_link = ethtool_op_get_link,
 };
 
-netif_t *netif_alloc(domid_t domid, unsigned int handle, u8 be_mac[ETH_ALEN])
-{
-   int err = 0, i;
+netif_t *netif_alloc(domid_t domid, unsigned int handle)
+{
+   int err = 0;
struct net_device *dev;
netif_t *netif;
char name[IFNAMSIZ] = {};
@@ -169,20 +169,14 @@ netif_t *netif_alloc(domid_t domid, unsi
printk(KERN_WARNING netbk: WARNING: device '%s' has non-zero 
   queue length (%lu)!\n, dev-name, dev-tx_queue_len);
 
-   for (i = 0; i  ETH_ALEN; i++)
-   if (be_mac[i] != 0)
-   break;
-   if (i == ETH_ALEN) {
-   /*
-* Initialise a dummy MAC address. We choose the numerically
-* largest non-broadcast address to prevent the address getting
-* stolen by an Ethernet bridge for STP purposes.
-* (FE:FF:FF:FF:FF:FF)
-*/ 
-   memset(dev-dev_addr, 0xFF, ETH_ALEN);
-   dev-dev_addr[0] = ~0x01;
-   } else
-   memcpy(dev-dev_addr, be_mac, ETH_ALEN);
+   /*
+* Initialise a dummy MAC address. We choose the numerically
+* largest non-broadcast address to prevent the address getting
+* stolen by an Ethernet bridge for STP purposes.
+* (FE:FF:FF:FF:FF:FF)
+*/ 
+   memset(dev-dev_addr, 0xFF, ETH_ALEN);
+   dev-dev_addr[0] = ~0x01;
 
rtnl_lock();
err = register_netdevice(dev);
@@ -225,6 +219,7 @@ static int map_frontend_pages(
 
lock_vm_area(netif-rx_comms_area);
ret = HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, op, 1);
+   unlock_vm_area(netif-rx_comms_area);
BUG_ON(ret);
 
if (op.status) {
diff -r 39d3d1cfe714 -r 15c1ca41a412 drivers/xen/netback/netback.c
--- a/drivers/xen/netback/netback.c Wed Nov 08 15:44:19 2006 -0500
+++ b/drivers/xen/netback/netback.c Wed Nov 08 18:58:23 2006 -0500
@@ -78,7 +78,7 @@ static inline unsigned long idx_to_kaddr
 
 #define PKT_PROT_LEN 64
 
-static struct {
+static struct pending_tx_info {
netif_tx_request_t req;
netif_t *netif;
 } pending_tx_info[MAX_PENDING_REQS];
@@ -374,14 +374,22 @@ static u16 netbk_gop_frag(netif_t *netif
   flipped. */
meta-copy = 1;
copy_gop = npo-copy + npo-copy_prod++;
-   copy_gop-source.domid = DOMID_SELF;
+   copy_gop-flags = GNTCOPY_dest_gref;
+   if (PageForeign(page)) {
+   struct pending_tx_info *src_pend =
+   pending_tx_info[page-index];
+   copy_gop-source.domid = src_pend-netif-domid;
+   copy_gop-source.u.ref = src_pend-req.gref;
+   copy_gop-flags |= GNTCOPY_source_gref;
+   } else {
+   copy_gop-source.domid = DOMID_SELF;
+   copy_gop-source.u.gmfn = old_mfn;
+   }
copy_gop-source.offset = offset;
-   copy_gop-source.u.gmfn = old_mfn;
copy_gop-dest.domid = netif-domid;
copy_gop-dest.offset = 0;
copy_gop-dest.u.ref = req-gref;
copy_gop-len = size;
-   copy_gop-flags = GNTCOPY_dest_gref;
} else {
meta-copy 

[XenPPC] [linux-ppc-2.6] [XEN] The VIO rewrite

2006-11-03 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 2a9c6a23cd1292e9ed361e33d640ce84a6fbdb53
# Parent  f4d382795e57b926cd82256bcb3a74c539731796
[XEN] The VIO rewrite

Once you figure it all out, its time to do a rewrite, lots of code I
thougth I needed is now removed and less PPC specific code now exists.

This patch uses the MEMORY_HOTPLUG system to add a region to the
Kernel Linear Mapping that will be used exclusively to map in
Granted/Foreign pages.  This creates struct page objects in Linux
which are necessary to perform VIO operations.  When one of these
pages are grant_mapped the pfn2mfn() translation in Xen is updated to
reflect the association and the subsequent H_ENTER() from the domain
will contain the correct mapping.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 arch/powerpc/platforms/xen/balloon.c |   20 +--
 arch/powerpc/platforms/xen/gnttab.c  |  186 +++
 arch/powerpc/platforms/xen/setup.h   |4 
 arch/powerpc/platforms/xen/util.c|   18 +--
 drivers/xen/blkback/blkback.c|   18 ---
 drivers/xen/blkback/interface.c  |1 
 drivers/xen/netback/interface.c  |3 
 drivers/xen/netback/netback.c|   45 ---
 drivers/xen/netfront/netfront.c  |7 +
 drivers/xen/tpmback/interface.c  |1 
 include/asm-powerpc/xen/asm/hypervisor.h |2 
 include/xen/driver_util.h|5 
 include/xen/gnttab.h |4 
 13 files changed, 173 insertions(+), 141 deletions(-)

diff -r f4d382795e57 -r 2a9c6a23cd12 arch/powerpc/platforms/xen/balloon.c
--- a/arch/powerpc/platforms/xen/balloon.c  Wed Oct 25 17:22:54 2006 -0400
+++ b/arch/powerpc/platforms/xen/balloon.c  Fri Nov 03 16:50:22 2006 -0500
@@ -1,6 +1,7 @@
 #include linux/module.h
 #include linux/mm.h
 #include asm/hypervisor.h
+#include setup.h
 
 /*
  * FIXME: Port balloon driver, if ever
@@ -9,18 +10,23 @@ struct page **alloc_empty_pages_and_page
 struct page **alloc_empty_pages_and_pagevec(int nr_pages)
 {
struct page *page, **pagevec;
-   void *vaddr;
int i;
+   int scrub = 0;
 
pagevec = kmalloc(sizeof(*pagevec) * nr_pages, GFP_KERNEL);
if (pagevec == NULL)
return  NULL;
 
for (i = 0; i  nr_pages; i++) {
-   page = alloc_page(GFP_KERNEL);
+   page = alloc_grant_page();
pagevec[i] = page;
-   vaddr = page_address(page);
-   scrub_pages(vaddr, 1);
+
+   if (scrub) {
+   void *vaddr;
+
+   vaddr = page_address(page);
+   scrub_pages(vaddr, 1);
+   }
}
 
return pagevec;
@@ -28,17 +34,13 @@ struct page **alloc_empty_pages_and_page
 
 void free_empty_pages_and_pagevec(struct page **pagevec, int nr_pages)
 {
-   int arch_is_foreign_page(struct page *page);
-   struct page *page;
int i;
 
if (pagevec == NULL)
return;
 
for (i = 0; i  nr_pages; i++) {
-   page = pagevec[i];
-   if (!arch_is_foreign_page(page))
-   __free_page(page);
+   free_grant_page(pagevec[i]);
}

kfree(pagevec);
diff -r f4d382795e57 -r 2a9c6a23cd12 arch/powerpc/platforms/xen/gnttab.c
--- a/arch/powerpc/platforms/xen/gnttab.c   Wed Oct 25 17:22:54 2006 -0400
+++ b/arch/powerpc/platforms/xen/gnttab.c   Fri Nov 03 16:50:22 2006 -0500
@@ -2,6 +2,7 @@
 #include linux/config.h
 #include linux/vmalloc.h
 #include linux/memory_hotplug.h
+#include linux/mempool.h
 #include xen/gnttab.h
 #include asm/hypervisor.h
 #include xen/interface/grant_table.h
@@ -22,8 +23,37 @@
 #define DBG(fmt...)
 #endif
 
+struct address_space xen_foreign_dummy_mapping;
+
 static ulong foreign_map_base;
 static ulong foreign_map_end;
+
+
+/* hijack _mapcount */
+static inline int gnt_mapcount(struct page *page)
+{
+   return atomic_read((page)-_mapcount) + 1;
+}
+
+static inline int gnt_map(struct page *page)
+{
+   /* return true is transition from -1 to 0 */
+   return atomic_inc_and_test(page-_mapcount);
+}
+
+static inline int gnt_unmap(struct page *page)
+{
+   int val;
+
+   val = atomic_dec_return(page-_mapcount);
+   if (val  -1) {
+   atomic_inc(page-_mapcount);
+   printk(KERN_EMERG %s: %d\n, __func__, val);
+   }
+
+   return (val == -1);
+}
+
 
 static long map_to_linear(ulong paddr)
 {
@@ -136,21 +166,20 @@ static void gnttab_pre_unmap_grant_ref(
int i;
ulong ea;
unsigned long dummy1, dummy2;
+   ulong flags;
+
+   /* paranoia */
+   local_irq_save(flags);
 
for (i = 0 ; i  count; i++) {
struct page *page;
 
-   ea = unmap[i].host_addr;
+   ea = (ulong)__va(unmap[i].host_addr);
page = virt_to_page(ea);
-
-   /* 

[XenPPC] [linux-ppc-2.6] Backport the fix in current xen-unstable tree.

2006-10-24 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID bcd09a8690af89f3c8ac1bc92a003d2a9cddb0c6
# Parent  968ced1469e8cbf36d00f437ac084bf064f6df00
Backport the fix in current xen-unstable tree.

Signed-off-by: Tony Breeds [EMAIL PROTECTED]
Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---

---
 drivers/net/bnx2.c |2 +-
 drivers/net/chelsio/sge.c  |2 +-
 drivers/net/e1000/e1000_main.c |2 +-
 drivers/net/forcedeth.c|2 +-
 drivers/net/ixgb/ixgb_main.c   |2 +-
 drivers/net/loopback.c |2 +-
 drivers/net/sky2.c |2 +-
 drivers/net/typhoon.c  |4 ++--
 drivers/s390/net/qeth_main.c   |2 +-
 include/linux/netdevice.h  |   14 --
 include/linux/skbuff.h |5 +
 include/net/protocol.h |1 +
 include/net/tcp.h  |1 +
 net/bridge/br_netfilter.c  |2 +-
 net/core/dev.c |   36 
 net/ipv4/af_inet.c |   36 
 net/ipv4/ip_output.c   |4 ++--
 net/ipv4/tcp_ipv4.c|   18 ++
 net/ipv4/xfrm4_output.c|2 +-
 net/ipv6/ip6_output.c  |2 +-
 net/ipv6/xfrm6_output.c|2 +-
 21 files changed, 117 insertions(+), 26 deletions(-)

diff -r 968ced1469e8 -r bcd09a8690af drivers/net/bnx2.c
--- a/drivers/net/bnx2.cTue Oct 17 17:03:31 2006 -0400
+++ b/drivers/net/bnx2.cTue Oct 24 06:10:42 2006 -0400
@@ -1640,7 +1640,7 @@ bnx2_tx_int(struct bnx2 *bp)
skb = tx_buf-skb;
 #ifdef BCM_TSO 
/* partial BD completions possible with TSO packets */
-   if (skb_shinfo(skb)-gso_size) {
+   if (skb_is_gso(skb)) {
u16 last_idx, last_ring_idx;
 
last_idx = sw_cons +
diff -r 968ced1469e8 -r bcd09a8690af drivers/net/chelsio/sge.c
--- a/drivers/net/chelsio/sge.c Tue Oct 17 17:03:31 2006 -0400
+++ b/drivers/net/chelsio/sge.c Tue Oct 24 06:10:42 2006 -0400
@@ -1418,7 +1418,7 @@ int t1_start_xmit(struct sk_buff *skb, s
struct cpl_tx_pkt *cpl;
 
 #ifdef NETIF_F_TSO
-   if (skb_shinfo(skb)-gso_size) {
+   if (skb_is_gso(skb)) {
int eth_type;
struct cpl_tx_pkt_lso *hdr;
 
diff -r 968ced1469e8 -r bcd09a8690af drivers/net/e1000/e1000_main.c
--- a/drivers/net/e1000/e1000_main.cTue Oct 17 17:03:31 2006 -0400
+++ b/drivers/net/e1000/e1000_main.cTue Oct 24 06:10:42 2006 -0400
@@ -2394,7 +2394,7 @@ e1000_tso(struct e1000_adapter *adapter,
uint8_t ipcss, ipcso, tucss, tucso, hdr_len;
int err;
 
-   if (skb_shinfo(skb)-gso_size) {
+   if (skb_is_gso(skb)) {
if (skb_header_cloned(skb)) {
err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC);
if (err)
diff -r 968ced1469e8 -r bcd09a8690af drivers/net/forcedeth.c
--- a/drivers/net/forcedeth.c   Tue Oct 17 17:03:31 2006 -0400
+++ b/drivers/net/forcedeth.c   Tue Oct 24 06:10:42 2006 -0400
@@ -1495,7 +1495,7 @@ static int nv_start_xmit(struct sk_buff 
np-tx_skbuff[nr] = skb;
 
 #ifdef NETIF_F_TSO
-   if (skb_shinfo(skb)-gso_size)
+   if (skb_is_gso(skb))
tx_flags_extra = NV_TX2_TSO | (skb_shinfo(skb)-gso_size  
NV_TX2_TSO_SHIFT);
else
 #endif
diff -r 968ced1469e8 -r bcd09a8690af drivers/net/ixgb/ixgb_main.c
--- a/drivers/net/ixgb/ixgb_main.c  Tue Oct 17 17:03:31 2006 -0400
+++ b/drivers/net/ixgb/ixgb_main.c  Tue Oct 24 06:10:42 2006 -0400
@@ -1173,7 +1173,7 @@ ixgb_tso(struct ixgb_adapter *adapter, s
uint16_t ipcse, tucse, mss;
int err;
 
-   if(likely(skb_shinfo(skb)-gso_size)) {
+   if (likely(skb_is_gso(skb))) {
if (skb_header_cloned(skb)) {
err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC);
if (err)
diff -r 968ced1469e8 -r bcd09a8690af drivers/net/loopback.c
--- a/drivers/net/loopback.cTue Oct 17 17:03:31 2006 -0400
+++ b/drivers/net/loopback.cTue Oct 24 06:10:42 2006 -0400
@@ -139,7 +139,7 @@ static int loopback_xmit(struct sk_buff 
 #endif
 
 #ifdef LOOPBACK_TSO
-   if (skb_shinfo(skb)-gso_size) {
+   if (skb_is_gso(skb)) {
BUG_ON(skb-protocol != htons(ETH_P_IP));
BUG_ON(skb-nh.iph-protocol != IPPROTO_TCP);
 
diff -r 968ced1469e8 -r bcd09a8690af drivers/net/sky2.c
--- a/drivers/net/sky2.cTue Oct 17 17:03:31 2006 -0400
+++ b/drivers/net/sky2.cTue Oct 24 06:10:42 2006 -0400
@@ -1160,7 +1160,7 @@ static unsigned tx_le_req(const struct s
count = sizeof(dma_addr_t) / sizeof(u32);
count += skb_shinfo(skb)-nr_frags * count;
 
-   if (skb_shinfo(skb)-gso_size)
+   if (skb_is_gso(skb))
++count;
 
if (skb-ip_summed == CHECKSUM_HW)
diff -r 968ced1469e8 -r bcd09a8690af drivers/net/typhoon.c
--- a/drivers/net/typhoon.c 

[XenPPC] [linux-ppc-2.6] Packport: GSO/Checksum Fix

2006-10-24 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 298b4a676daeecb543e6372fbb78a16e385378a5
# Parent  bcd09a8690af89f3c8ac1bc92a003d2a9cddb0c6
Packport: GSO/Checksum Fix

Reasoning described here:
  
http://kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=b60dfc6c20bd5f19de0083362ce377c89b1e5a24

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 net/core/dev.c |   10 --
 1 files changed, 10 deletions(-)

diff -r bcd09a8690af -r 298b4a676dae net/core/dev.c
--- a/net/core/dev.cTue Oct 24 06:10:42 2006 -0400
+++ b/net/core/dev.cTue Oct 24 06:34:37 2006 -0400
@@ -1173,11 +1173,6 @@ int skb_checksum_help(struct sk_buff *sk
goto out_set_summed;
 
if (unlikely(skb_shinfo(skb)-gso_size)) {
-   static int warned;
-
-   WARN_ON(!warned);
-   warned = 1;
-
/* Let GSO fix up the checksum. */
goto out_set_summed;
}
@@ -1227,11 +1222,6 @@ struct sk_buff *skb_gso_segment(struct s
__skb_pull(skb, skb-mac_len);
 
if (unlikely(skb-ip_summed != CHECKSUM_HW)) {
-   static int warned;
-
-   WARN_ON(!warned);
-   warned = 1;
-
if (skb_header_cloned(skb) 
(err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC)))
return ERR_PTR(err);

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


[XenPPC] [linux-ppc-2.6] [XEN][POWERPC] Make sure that Xen Linux code can run if Xen is not present

2006-10-24 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 4ab8b63fcff117bec150b9f6afd3ff292f51c1dd
# Parent  298b4a676daeecb543e6372fbb78a16e385378a5
[XEN][POWERPC] Make sure that Xen Linux code can run if Xen is not present

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
Acked-by: Amos Waterland [EMAIL PROTECTED]
---
 include/asm-powerpc/xen/asm/hypervisor.h |3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -r 298b4a676dae -r 4ab8b63fcff1 include/asm-powerpc/xen/asm/hypervisor.h
--- a/include/asm-powerpc/xen/asm/hypervisor.h  Tue Oct 24 06:34:37 2006 -0400
+++ b/include/asm-powerpc/xen/asm/hypervisor.h  Tue Oct 24 11:24:33 2006 -0400
@@ -46,7 +46,8 @@ extern start_info_t *xen_start_info;
 extern start_info_t *xen_start_info;
 
 #ifdef CONFIG_XEN_PRIVILEGED_GUEST
-#define is_initial_xendomain() (!!(xen_start_info-flags  SIF_INITDOMAIN))
+#define is_initial_xendomain() (xen_start_info  \
+   (xen_start_info-flags  SIF_INITDOMAIN))
 #else
 #define is_initial_xendomain() 0
 #endif

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


[XenPPC] [linux-ppc-2.6] [LINUX][XEN][POWERPC] remove xen_idle()

2006-10-17 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID ad4044d0582162bf98e21bbe6a9c5c3d400e659f
# Parent  933b1d114a89abe409b50b948c39d3b28dd3e02f
[LINUX][XEN][POWERPC] remove xen_idle()

It is dead code now

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 arch/powerpc/platforms/xen/setup.c |   20 
 1 files changed, 20 deletions(-)

diff -r 933b1d114a89 -r ad4044d05821 arch/powerpc/platforms/xen/setup.c
--- a/arch/powerpc/platforms/xen/setup.cMon Oct 16 09:31:03 2006 -0400
+++ b/arch/powerpc/platforms/xen/setup.cTue Oct 17 17:01:57 2006 -0400
@@ -1,6 +1,5 @@
 
 #define DEBUG
-#undef XENPPC_USE_IDLE
 #define CONFIG_SHARE_MPIC
 
 #include linux/module.h
@@ -169,21 +168,6 @@ static void xen_power_save(void)
HYPERVISOR_sched_op(SCHEDOP_block, NULL);
 }
 
-#ifdef XENPPC_USE_IDLE
-static void xen_idle(void)
-{
-   while (1) {
-   local_irq_disable();
-   if (!need_resched()) {
-   xen_power_save();
-   }
-   local_irq_enable();
-
-   schedule();
-   }
-}
-#endif
-
 #ifdef CONFIG_SMP
 
 int __init smp_xen_probe(void)
@@ -303,11 +287,7 @@ define_machine(xen) {
.get_rtc_time   = 0,
.calibrate_decr = generic_calibrate_decr,
.progress   = xen_progress,
-#ifdef XENPPC_USE_IDLE
-   .idle_loop  = xen_idle,
-#else
.power_save = xen_power_save,
-#endif
 #ifdef CONFIG_KEXEC
.machine_kexec  = xen_machine_kexec,
.machine_kexec_prepare  = xen_machine_kexec_prepare,

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


[XenPPC] [linux-ppc-2.6] [LINUX][XEN][POWERPC] remove mpic pointer hack.

2006-10-17 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 968ced1469e8cbf36d00f437ac084bf064f6df00
# Parent  ad4044d0582162bf98e21bbe6a9c5c3d400e659f
[LINUX][XEN][POWERPC] remove mpic pointer hack.

Since we now allocate the mpic in this file we can get it here rather
than use the hack to get it.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 arch/powerpc/platforms/xen/evtchn.c |   22 --
 1 files changed, 8 insertions(+), 14 deletions(-)

diff -r ad4044d05821 -r 968ced1469e8 arch/powerpc/platforms/xen/evtchn.c
--- a/arch/powerpc/platforms/xen/evtchn.c   Tue Oct 17 17:01:57 2006 -0400
+++ b/arch/powerpc/platforms/xen/evtchn.c   Tue Oct 17 17:03:31 2006 -0400
@@ -30,7 +30,7 @@
  */
 
 
-struct hw_interrupt_type *xen_pirq;
+static struct hw_interrupt_type *xen_pirq;
 static struct hw_interrupt_type hc_irq;
 
 static unsigned int xen_startup_irq(unsigned int irq)
@@ -60,7 +60,8 @@ static void xen_ack_irq(unsigned int irq
 static void xen_ack_irq(unsigned int irq)
 {
xen_pirq-ack(irq);
-   if (hc_irq.ack) hc_irq.ack(irq);
+   if (hc_irq.ack)
+   hc_irq.ack(irq);
 }
 static void xen_end_irq(unsigned int irq)
 {
@@ -68,14 +69,8 @@ static void xen_end_irq(unsigned int irq
hc_irq.end(irq);
 }
 
-/* Get the mpic structure from the irq number */
-static inline struct mpic *mpic_from_irq(unsigned int irq)
-{
-   return container_of(irq_desc[irq].chip, struct mpic, hc_irq);
-}
-
 /* borrowed from platform/maple/setup.c */
-static __init void xen_share_maple_init_IRQ(void)
+static __init struct mpic *xen_share_maple_init_IRQ(void)
 {
struct device_node *root;
unsigned int *opprop;
@@ -112,6 +107,8 @@ static __init void xen_share_maple_init_
mpic_init(mpic);
 
DBG( - %s\n, __func__);
+
+   return mpic;
 }
 
 static void xen_share_pic(void)
@@ -119,10 +116,7 @@ static void xen_share_pic(void)
struct mpic *mpic;
 
xen_pirq = irq_desc[0].chip;
-   xen_share_maple_init_IRQ();
-
-   /* FIXME: 0 may not be valid */
-   mpic = mpic_from_irq(0);
+   mpic = xen_share_maple_init_IRQ();
 
hc_irq.startup = mpic-hc_irq.startup;
mpic-hc_irq.startup = xen_startup_irq;
@@ -150,7 +144,7 @@ void xen_maple_init_IRQ(void)
if (!(xen_start_info-flags  SIF_INITDOMAIN))
return;
 
-   printk(Sharing PIC with Xen);
+   printk(Sharing PIC with Xen\n);
xen_share_pic();
 }
 

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


[XenPPC] [linux-ppc-2.6] [LINUX][XEN][POWERPC] avoid reseting the MPIC when sharing

2006-10-13 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID f0be2cc05103e19788416719e2b9ec38b38bd26e
# Parent  d2b37a151f5b27924e5aa59b4701ae8a7a623b25
[LINUX][XEN][POWERPC] avoid reseting the MPIC when sharing

This patch copies the function used by maple/setup.c to allocate the
MPIC, but we disable the flag that tells the MPIC code to reset it.
It is highly possible that this might solve our MPIC spurious
interrupt problem in Xen.

Inspired-by: Amos Waterland [EMAIL PROTECTED]
Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 arch/powerpc/platforms/xen/evtchn.c |   43 ++--
 1 files changed, 41 insertions(+), 2 deletions(-)

diff -r d2b37a151f5b -r f0be2cc05103 arch/powerpc/platforms/xen/evtchn.c
--- a/arch/powerpc/platforms/xen/evtchn.c   Tue Oct 10 09:57:12 2006 -0400
+++ b/arch/powerpc/platforms/xen/evtchn.c   Fri Oct 13 12:36:39 2006 -0400
@@ -32,7 +32,6 @@
 
 struct hw_interrupt_type *xen_pirq;
 static struct hw_interrupt_type hc_irq;
-extern struct machdep_calls mach_maple_md;
 
 static unsigned int xen_startup_irq(unsigned int irq)
 {
@@ -75,12 +74,52 @@ static inline struct mpic *mpic_from_irq
return container_of(irq_desc[irq].chip, struct mpic, hc_irq);
 }
 
+/* borrowed from platform/maple/setup.c */
+static __init void xen_share_maple_init_IRQ(void)
+{
+   struct device_node *root;
+   unsigned int *opprop;
+   unsigned long opic_addr;
+   struct mpic *mpic;
+   unsigned char senses[128];
+   int n;
+
+   DBG( - %s\n, __func__);
+
+   /* XXX: Non standard, replace that with a proper openpic/mpic node
+* in the device-tree. Find the Open PIC if present */
+   root = of_find_node_by_path(/);
+   opprop = (unsigned int *) get_property(root,
+   platform-open-pic, NULL);
+   if (opprop == 0)
+   panic(OpenPIC not found !\n);
+
+   n = prom_n_addr_cells(root);
+   for (opic_addr = 0; n  0; --n)
+   opic_addr = (opic_addr  32) + *opprop++;
+   of_node_put(root);
+
+   /* Obtain sense values from device-tree */
+   prom_get_irq_senses(senses, 0, 128);
+
+   /* XEN: the only change is we want to avoid the reset */
+
+   mpic = mpic_alloc(opic_addr,
+ MPIC_PRIMARY | MPIC_BIG_ENDIAN |
+ MPIC_BROKEN_U3 /* | MPIC_WANTS_RESET */,
+ 0, 0, 128, 128, senses, 128, Xen-U3-MPIC);
+   BUG_ON(mpic == NULL);
+   mpic_init(mpic);
+
+   DBG( - %s\n, __func__);
+}
+
 static void xen_share_pic(void)
 {
struct mpic *mpic;
 
xen_pirq = irq_desc[0].chip;
-   mach_maple_md.init_IRQ();
+   xen_share_maple_init_IRQ();
 
/* FIXME: 0 may not be valid */
mpic = mpic_from_irq(0);

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


[XenPPC] [linux-ppc-2.6] [LINUX][XEN][POWERPC] implement HYPERVISOR_multicall()

2006-10-10 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 2765c83b576d5af048d381c481e33f597c2be258
# Parent  23cc5f7d71e01bc9908026b0f53e310ece230f60
[LINUX][XEN][POWERPC] implement HYPERVISOR_multicall()

Sadly, the xencomm thing makes performing the multicall loop in Xen
prohibitive, so for now we blow it out here.  I think some level of
atomicity is expected from the multicall so we precheck all the ops
and the turn off interrupts while we make all the calls.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 arch/powerpc/platforms/xen/hcall.c |   34 --
 1 files changed, 32 insertions(+), 2 deletions(-)

diff -r 23cc5f7d71e0 -r 2765c83b576d arch/powerpc/platforms/xen/hcall.c
--- a/arch/powerpc/platforms/xen/hcall.cMon Oct 09 17:20:44 2006 -0400
+++ b/arch/powerpc/platforms/xen/hcall.cMon Oct 09 19:57:42 2006 -0400
@@ -189,10 +189,40 @@ HYPERVISOR_poll(
 }
 EXPORT_SYMBOL(HYPERVISOR_poll);
 
+typedef ulong (mf_t)(ulong arg0, ...);
+
+static mf_t *multicall_funcs[] = {
+   [__HYPERVISOR_grant_table_op] = (mf_t *)HYPERVISOR_grant_table_op,
+};
+
 int HYPERVISOR_multicall(void *call_list, int nr_calls)
 {
-   BUG();
-   return -ENOSYS;
+   /* we blow out the multicall because the xencomm stuff is jsut
+* too tricky */
+   multicall_entry_t *mcl = (multicall_entry_t *)call_list;
+   multicall_entry_t *c;
+   int i;
+   mf_t *mf;
+   int res;
+   ulong flags;
+
+   /* let make sure all the calls are supported */
+   for (i = 0; i  nr_calls; i++) {
+   mf = multicall_funcs[mcl[i].op];
+   BUG_ON(mf == NULL);
+   }
+   /* disable interrupts until we are done all calls */
+   local_irq_save(flags);
+   for (i = 0; i  nr_calls; i++) {
+   /* lookup supported multicalls */
+   c = mcl[i];
+   mf = multicall_funcs[c-op];
+   res = mf(c-args[0], c-args[1], c-args[2],
+c-args[3], c-args[4], c-args[5]);
+   c-result = res;
+   }
+   local_irq_restore(flags);
+   return 0;
 }
 EXPORT_SYMBOL(HYPERVISOR_multicall);
 

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


[XenPPC] [linux-ppc-2.6] [LINUX][XEN][POWERPC] More accurate Grant Table Ops

2006-10-10 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID f18ec562c11cabed94d448a12754660c63497fac
# Parent  2765c83b576d5af048d381c481e33f597c2be258
[LINUX][XEN][POWERPC] More accurate Grant Table Ops

This patch add the following:
 - More DBG() points of interest
 - If we run out of Bolted PTEs simply report it and let the natural
   page fault occur
 - Use the page counters to track PTE redundancies
 - BUG() if GNTTABOP_transfer is ever used
 - Add GNTTABOP_copy

The use of page counters may have SMP ramifications since the Linear
map inits the refcount to 1 and there is no atomic methods to inc/dec
and see if counter == 1.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 arch/powerpc/platforms/xen/gnttab.c |  109 +++-
 1 files changed, 82 insertions(+), 27 deletions(-)

diff -r 2765c83b576d -r f18ec562c11c arch/powerpc/platforms/xen/gnttab.c
--- a/arch/powerpc/platforms/xen/gnttab.c   Mon Oct 09 19:57:42 2006 -0400
+++ b/arch/powerpc/platforms/xen/gnttab.c   Tue Oct 10 09:48:33 2006 -0400
@@ -39,6 +39,8 @@ static long map_to_linear(ulong paddr)
mode = _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_COHERENT | PP_RWXX;
vaddr = (ulong)__va(paddr);
 
+   DBG(%s: 0x%lx: 0x%x\n,
+   __func__, paddr, page_count(virt_to_page(vaddr)));
{
unsigned long vpn, hash, hpteg;
unsigned long vsid = get_kernel_vsid(vaddr);
@@ -57,25 +59,13 @@ static long map_to_linear(ulong paddr)
BUG_ON(!ppc_md.hpte_insert);
slot = ppc_md.hpte_insert(hpteg, va, paddr,
  tmp_mode, HPTE_V_BOLTED, psize);
-   BUG_ON(slot  0);
+   if (slot  0)
+   printk(KERN_EMERG
+  %s: no more bolted entries 
+  HTAB[0x%lx]: 0x%lx\n,
+  __func__, hpteg, paddr);
}
return slot;
-}
-
-static void gnttab_post_map_grant_ref(
-   struct gnttab_map_grant_ref *map, int count)
-{
-   int i;
-   long slot;
-
-   for (i = 0 ; i  count; i++) {
-   ulong pa = map[i].dev_bus_addr;
-   BUG_ON(pa  foreign_map_base || pa = foreign_map_end);
-
-   slot = map_to_linear(pa);
-   /* store the slot somewhere */
-   map[i].host_addr = (ulong)__va(pa);
-   }
 }
 
 static unsigned long get_hpte_vsid(ulong slot)
@@ -128,29 +118,89 @@ static long find_hpte_slot(unsigned long
return -1;
 } 
 
+static long find_map_slot(ulong ea)
+{
+   int psize = MMU_PAGE_4K;
+   ulong vsid;
+   ulong va;
+
+   vsid = get_kernel_vsid(ea);
+   va = (vsid  28) | (ea  0x0fff);
+   
+   return find_hpte_slot(va, psize);
+}
+
+
 static void gnttab_pre_unmap_grant_ref(
struct gnttab_unmap_grant_ref *unmap, int count)
 {
long slot;
-   ulong vsid;
-   ulong va;
-   int psize = MMU_PAGE_4K;
int i;
ulong ea;
unsigned long dummy1, dummy2;
 
for (i = 0 ; i  count; i++) {
+   struct page *page;
+
ea = unmap[i].host_addr;
-   vsid = get_kernel_vsid(ea);
-   va = (vsid  28) | (ea  0x0fff);
-
-   slot = find_hpte_slot(va, psize);
-   BUG_ON(slot  0);
-
+   page = virt_to_page(ea);
+
+   /* Unfortunately, there is no put_page_testone() like
+* put_page_testzero(). The Linear Map starts all
+* pages with a count of 1, so there may be SMP issues
+* here. */
+
+   put_page(page);
+   if (page_count(page)  1) {
+   DBG(%s: skip: 0x%lx\n, __func__, ea);
+   continue;
+   }
+   slot = find_map_slot(ea);
+   if (slot  0) {
+   printk(KERN_EMERG %s: PTE not found: 0x%lx\n,
+  __func__, ea);
+   continue;
+   }
+
+   DBG(%s: 0x%lx: 0x%x\n,
+  __func__, ea, page_count(virt_to_page(ea)));
plpar_pte_remove(0, slot, 0, dummy1, dummy2);
 
DBG(%s: remove_pages(0x%lx, 0x%lx)\n,
__func__, unmap[i].host_addr, unmap[i].dev_bus_addr);
+   }
+}
+
+static void gnttab_post_map_grant_ref(
+   struct gnttab_map_grant_ref *map, int count)
+{
+   int i;
+   long slot;
+
+   for (i = 0 ; i  count; i++) {
+   ulong pa = map[i].dev_bus_addr;
+   struct page *page;
+
+   BUG_ON(pa  foreign_map_base || pa = foreign_map_end);
+
+   /* ??? store the slot somewhere ??? */
+   map[i].host_addr = (ulong)__va(pa);
+   page = virt_to_page(map[i].host_addr);
+
+   if (page_count(page) == 1) {
+#ifdef DEBUG   
+  

[XenPPC] [linux-ppc-2.6] [LINUX][XEN][POWERPC] Enable PowerPC use of netback

2006-10-10 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID d2b37a151f5b27924e5aa59b4701ae8a7a623b25
# Parent  f18ec562c11cabed94d448a12754660c63497fac
[LINUX][XEN][POWERPC] Enable PowerPC use of netback

This patch uses ifdefs heavilty simply to identify areas of change so
that arch independent interfaces can be introduced later as we update
with upstream changes.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 drivers/xen/netback/netback.c |   72 +++---
 1 files changed, 60 insertions(+), 12 deletions(-)

diff -r f18ec562c11c -r d2b37a151f5b drivers/xen/netback/netback.c
--- a/drivers/xen/netback/netback.c Tue Oct 10 09:48:33 2006 -0400
+++ b/drivers/xen/netback/netback.c Tue Oct 10 09:57:12 2006 -0400
@@ -71,9 +71,35 @@ static struct sk_buff_head rx_queue;
 static struct sk_buff_head rx_queue;
 
 static unsigned long mmap_vstart;
+#ifdef CONFIG_PPC_XEN
+
+
+static ulong mmap_vaddrs[MAX_PENDING_REQS];
+#define MMAP_VADDR(_req) (mmap_vaddrs[(_req)])
+
+static inline void PPC_map_vaddrs(int idx, gnttab_map_grant_ref_t *mop)
+{
+   struct page *page;
+   ulong virt = mop-host_addr;
+
+   page = virt_to_page(virt);
+   get_page(page);
+
+#if 0
+   SetPageForeign(page, netif_page_release);
+#else
+   (void)netif_page_release;
+#endif
+   mmap_vaddrs[idx] = virt;
+}
+#define _mmap_vaddrs(i,op) do { mmap_vaddrs[(i)] = mop-host_addr;
+#else
 #define MMAP_VADDR(_req) (mmap_vstart + ((_req) * PAGE_SIZE))
-
+#endif
+
+#ifndef CONFIG_PPC_XEN
 static void *rx_mmap_area;
+#endif
 
 #define PKT_PROT_LEN 64
 
@@ -939,9 +965,13 @@ static int netbk_tx_check_mop(struct sk_
pending_ring[MASK_PEND_IDX(pending_prod++)] = pending_idx;
netif_put(netif);
} else {
+#ifdef CONFIG_PPC_XEN
+   PPC_map_vaddrs(pending_idx, mop);
+#else
set_phys_to_machine(
__pa(MMAP_VADDR(pending_idx))  PAGE_SHIFT,
FOREIGN_FRAME(mop-dev_bus_addr  PAGE_SHIFT));
+#endif
grant_tx_handle[pending_idx] = mop-handle;
}
 
@@ -956,9 +986,13 @@ static int netbk_tx_check_mop(struct sk_
/* Check error status: if okay then remember grant handle. */
newerr = (++mop)-status;
if (likely(!newerr)) {
+#ifdef CONFIG_PPC_XEN
+   PPC_map_vaddrs(pending_idx, mop);
+#else
set_phys_to_machine(
__pa(MMAP_VADDR(pending_idx))PAGE_SHIFT,
FOREIGN_FRAME(mop-dev_bus_addrPAGE_SHIFT));
+#endif
grant_tx_handle[pending_idx] = mop-handle;
/* Had a previous error? Invalidate this fragment. */
if (unlikely(err))
@@ -1317,17 +1351,20 @@ static void netif_page_release(struct pa
 {
u16 pending_idx = page - virt_to_page(mmap_vstart);
 
+#ifdef CONFIG_PPC_XEN  /* Ready for next use. */
+   BUG();
+#endif 
+   init_page_count(page);
+   netif_idx_release(pending_idx);
+}
+
+#ifndef CONFIG_PPC_XEN
+static void netif_rx_page_release(struct page *page)
+{
/* Ready for next use. */
init_page_count(page);
-
-   netif_idx_release(pending_idx);
-}
-
-static void netif_rx_page_release(struct page *page)
-{
-   /* Ready for next use. */
-   init_page_count(page);
-}
+}
+#endif
 
 irqreturn_t netif_be_int(int irq, void *dev_id, struct pt_regs *regs)
 {
@@ -1437,6 +1474,10 @@ static int __init netback_init(void)
if (!is_running_on_xen())
return -ENODEV;
 
+#ifdef CONFIG_PPC_XEN
+   if (!(xen_start_info-flags  SIF_INITDOMAIN))
+   return -ENODEV;
+#endif
/* We can increase reservation by this much in net_rx_action(). */
balloon_update_driver_allowance(NET_RX_RING_SIZE);
 
@@ -1446,7 +1487,11 @@ static int __init netback_init(void)
init_timer(net_timer);
net_timer.data = 0;
net_timer.function = net_alarm;
-
+
+#ifdef CONFIG_PPC_XEN
+   (void)page;
+   mmap_vstart = foreign_alloc_empty_page_range(MAX_PENDING_REQS);
+#else
page = balloon_alloc_empty_page_range(MAX_PENDING_REQS);
if (page == NULL)
return -ENOMEM;
@@ -1458,7 +1503,9 @@ static int __init netback_init(void)
init_page_count(page);
SetPageForeign(page, netif_page_release);
}
-
+#endif
+
+#ifndef CONFIG_PPC_XEN
page = balloon_alloc_empty_page_range(NET_RX_RING_SIZE);
BUG_ON(page == NULL);
rx_mmap_area = pfn_to_kaddr(page_to_pfn(page));
@@ -1468,6 +1515,7 @@ static int __init netback_init(void)
init_page_count(page);
SetPageForeign(page, netif_rx_page_release);
}
+#endif
 
pending_cons = 0;
pending_prod = MAX_PENDING_REQS;

___
Xen-ppc-devel mailing list

[XenPPC] [linux-ppc-2.6] [LINUX][XEN][POWERPC] make sure set_phys_to_machine() asserts out memory model

2006-10-10 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 23cc5f7d71e01bc9908026b0f53e310ece230f60
# Parent  b9e38b262f6479dfa7260fea8efb0dcdc1e6e256
[LINUX][XEN][POWERPC] make sure set_phys_to_machine() asserts out memory model

Currently we run with mfn == pfn, we need to BUG() if any caller
assumes otherwise.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 include/asm-powerpc/xen/asm/hypervisor.h |   11 ++-
 1 files changed, 10 insertions(+), 1 deletion(-)

diff -r b9e38b262f64 -r 23cc5f7d71e0 include/asm-powerpc/xen/asm/hypervisor.h
--- a/include/asm-powerpc/xen/asm/hypervisor.h  Sun Oct 08 14:22:12 2006 -0400
+++ b/include/asm-powerpc/xen/asm/hypervisor.h  Mon Oct 09 17:20:44 2006 -0400
@@ -224,7 +224,16 @@ MULTI_update_va_mapping_otherdomain(
 #endif
 }
 
-#define set_phys_to_machine(_x,_y) do {} while (0)
+#define INVALID_P2M_ENTRY (~0UL)
+#define FOREIGN_FRAME(m) (m)
+static inline void set_phys_to_machine(unsigned long pfn, unsigned long mfn)
+{
+   if (pfn != mfn  mfn != INVALID_P2M_ENTRY)
+   printk(KERN_EMERG %s: pfn: 0x%lx mfn: 0x%lx\n,
+  __func__, pfn, mfn);
+   
+   return;
+}
 #define pfn_pte_ma(pfn, prot)  __pte(((pfn)  PAGE_SHIFT) | pgprot_val(prot))
 
 typedef unsigned long maddr_t;

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


[XenPPC] [linux-ppc-2.6] implement is_initial_domain()

2006-10-08 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID de401e010c25cc59af09ac4522a200b65e4faf5f
# Parent  933613959bf6a8e48a43e1cd93d4afae4a660ec8
implement is_initial_domain()

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 include/asm-powerpc/xen/asm/hypervisor.h |6 ++
 1 files changed, 6 insertions(+)

diff -r 933613959bf6 -r de401e010c25 include/asm-powerpc/xen/asm/hypervisor.h
--- a/include/asm-powerpc/xen/asm/hypervisor.h  Wed Oct 04 11:20:16 2006 -0400
+++ b/include/asm-powerpc/xen/asm/hypervisor.h  Wed Oct 04 14:12:00 2006 -0400
@@ -44,6 +44,12 @@ extern shared_info_t *HYPERVISOR_shared_
 
 /* arch/xen/i386/kernel/setup.c */
 extern start_info_t *xen_start_info;
+
+#ifdef CONFIG_XEN_PRIVILEGED_GUEST
+#define is_initial_xendomain() (!!(xen_start_info-flags  SIF_INITDOMAIN))
+#else
+#define is_initial_xendomain() 0
+#endif
 
 /* arch/xen/kernel/evtchn.c */
 /* Force a proper event-channel callback from Xen. */

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


[XenPPC] [linux-ppc-2.6] [LINUX][XEN][POWERPC] use is_initial_xendomain()

2006-10-08 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID c2f25eb27f246a16df21367fad993ee91732f680
# Parent  de401e010c25cc59af09ac4522a200b65e4faf5f
[LINUX][XEN][POWERPC] use is_initial_xendomain()

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 arch/powerpc/platforms/xen/setup.c |7 ++-
 1 files changed, 2 insertions(+), 5 deletions(-)

diff -r de401e010c25 -r c2f25eb27f24 arch/powerpc/platforms/xen/setup.c
--- a/arch/powerpc/platforms/xen/setup.cWed Oct 04 14:12:00 2006 -0400
+++ b/arch/powerpc/platforms/xen/setup.cSat Oct 07 17:57:56 2006 -0400
@@ -34,7 +34,6 @@ EXPORT_SYMBOL(HYPERVISOR_shared_info);
 
 /* Raw start-of-day parameters from the hypervisor. */
 start_info_t *xen_start_info;
-static int is_dom0;
 
 extern struct machdep_calls mach_maple_md;
 extern void maple_pci_init(void);
@@ -111,9 +110,7 @@ static void __init xen_init_early(void)
DBG(console_mfn%llx\n, xen_start_info-console.domU.mfn);
DBG(console_evtchn %x\n, xen_start_info-console.domU.evtchn);
 
-   is_dom0 = !!(xen_start_info-flags  SIF_INITDOMAIN);
-   
-   if (is_dom0) {
+   if (is_initial_xendomain()) {
ppc_md.pcibios_fixup= mach_maple_md.pcibios_fixup;
ppc_md.pci_get_legacy_ide_irq   = 
mach_maple_md.pci_get_legacy_ide_irq;
ppc_md.get_boot_time= mach_maple_md.get_boot_time;
@@ -225,7 +222,7 @@ void __init xen_setup_arch(void)
 #endif
 
/* Lookup PCI hosts */
-   if (is_dom0)
+   if (is_initial_xendomain())
maple_pci_init();
 
 #ifdef CONFIG_DUMMY_CONSOLE

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


[XenPPC] [linux-ppc-2.6] [LINUX][XEN][POWERPC] Use PowerPC specific util.c routines

2006-10-08 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID fe1a31c06cbe548d3eb59b4e0fc16fc102a16344
# Parent  28adc79fe774f9811e7f98f225327d777664be6a
[LINUX][XEN][POWERPC] Use PowerPC specific util.c routines

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 arch/powerpc/platforms/xen/util.c |   49 ++
 drivers/xen/Kconfig   |1 
 2 files changed, 50 insertions(+)

diff -r 28adc79fe774 -r fe1a31c06cbe drivers/xen/Kconfig
--- a/drivers/xen/Kconfig   Sun Oct 08 12:21:35 2006 -0400
+++ b/drivers/xen/Kconfig   Sun Oct 08 12:23:50 2006 -0400
@@ -221,6 +221,7 @@ config NO_IDLE_HZ
 
 config XEN_UTIL
bool
+   depends on !PPC_XEN
default y
 
 config XEN_BALLOON
diff -r 28adc79fe774 -r fe1a31c06cbe arch/powerpc/platforms/xen/util.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/arch/powerpc/platforms/xen/util.c Sun Oct 08 12:23:50 2006 -0400
@@ -0,0 +1,49 @@
+#include linux/config.h
+#include linux/mm.h
+#include linux/module.h
+#include linux/slab.h
+#include linux/vmalloc.h
+#include asm/uaccess.h
+#include xen/driver_util.h
+
+
+struct vm_struct *alloc_vm_area(unsigned long size)
+{
+   struct vm_struct *area;
+
+   area = kmalloc(sizeof(*area), GFP_KERNEL);
+   if (area != NULL) {
+   area-flags = VM_MAP;//XXX
+   area-addr = (void *)0xdeadcab4beeff00dULL;
+   area-size = size;
+   area-pages = NULL; //XXX
+   area-nr_pages = size  PAGE_SHIFT;
+   area-phys_addr = 0;
+   }
+   return area;
+}
+EXPORT_SYMBOL_GPL(alloc_vm_area);
+
+void free_vm_area(struct vm_struct *area)
+{
+   kfree(area);
+}
+EXPORT_SYMBOL_GPL(free_vm_area);
+
+void lock_vm_area(struct vm_struct *area)
+{
+   preempt_disable();
+}
+
+void unlock_vm_area(struct vm_struct *area)
+{
+   preempt_enable();
+}
+EXPORT_SYMBOL_GPL(unlock_vm_area);
+
+void update_vm_area(struct vm_struct *area, struct gnttab_map_grant_ref *op)
+{
+   area-phys_addr = op-dev_bus_addr;
+   area-addr = __va(op-dev_bus_addr);
+}
+EXPORT_SYMBOL_GPL(update_vm_area);

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


[XenPPC] [linux-ppc-2.6] [LINUX][XEN] Use the arch supplied update_vm_area() function

2006-10-08 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 30abfbe6e047859c7ef8884e27594bd41ea45028
# Parent  11ee20d418ea813709da4c86dbc4ae28efb17f36
[LINUX][XEN] Use the arch supplied update_vm_area() function

Some architectures need to update the vm_area after the GNTTAB_map
takes place.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 drivers/xen/blkback/interface.c|1 +
 drivers/xen/netback/interface.c|2 ++
 drivers/xen/tpmback/interface.c|1 +
 drivers/xen/xenbus/xenbus_backend_client.c |1 +
 include/xen/driver_util.h  |7 +++
 5 files changed, 12 insertions(+)

diff -r 11ee20d418ea -r 30abfbe6e047 drivers/xen/blkback/interface.c
--- a/drivers/xen/blkback/interface.c   Sun Oct 08 12:28:37 2006 -0400
+++ b/drivers/xen/blkback/interface.c   Sun Oct 08 12:34:23 2006 -0400
@@ -64,6 +64,7 @@ static int map_frontend_page(blkif_t *bl
 
lock_vm_area(blkif-blk_ring_area);
ret = HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, op, 1);
+   update_vm_area(blkif-blk_ring_area, op);
unlock_vm_area(blkif-blk_ring_area);
BUG_ON(ret);
 
diff -r 11ee20d418ea -r 30abfbe6e047 drivers/xen/netback/interface.c
--- a/drivers/xen/netback/interface.c   Sun Oct 08 12:28:37 2006 -0400
+++ b/drivers/xen/netback/interface.c   Sun Oct 08 12:34:23 2006 -0400
@@ -190,6 +190,7 @@ static int map_frontend_pages(
 
lock_vm_area(netif-tx_comms_area);
ret = HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, op, 1);
+   update_vm_area(netif-tx_comms_area, op);
unlock_vm_area(netif-tx_comms_area);
BUG_ON(ret);
 
@@ -206,6 +207,7 @@ static int map_frontend_pages(
 
lock_vm_area(netif-rx_comms_area);
ret = HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, op, 1);
+   update_vm_area(netif-rx_comms_area, op);
unlock_vm_area(netif-rx_comms_area);
BUG_ON(ret);
 
diff -r 11ee20d418ea -r 30abfbe6e047 drivers/xen/tpmback/interface.c
--- a/drivers/xen/tpmback/interface.c   Sun Oct 08 12:28:37 2006 -0400
+++ b/drivers/xen/tpmback/interface.c   Sun Oct 08 12:34:23 2006 -0400
@@ -82,6 +82,7 @@ static int map_frontend_page(tpmif_t *tp
 
lock_vm_area(tpmif-tx_area);
ret = HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, op, 1);
+   update_vm_area(tpmif-tx_area, op);
unlock_vm_area(tpmif-tx_area);
BUG_ON(ret);
 
diff -r 11ee20d418ea -r 30abfbe6e047 drivers/xen/xenbus/xenbus_backend_client.c
--- a/drivers/xen/xenbus/xenbus_backend_client.cSun Oct 08 12:28:37 
2006 -0400
+++ b/drivers/xen/xenbus/xenbus_backend_client.cSun Oct 08 12:34:23 
2006 -0400
@@ -50,6 +50,7 @@ struct vm_struct *xenbus_map_ring_valloc

lock_vm_area(area);
BUG_ON(HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, op, 1));
+   update_vm_area(area, op);
unlock_vm_area(area);
 
if (op.status != GNTST_okay) {
diff -r 11ee20d418ea -r 30abfbe6e047 include/xen/driver_util.h
--- a/include/xen/driver_util.h Sun Oct 08 12:28:37 2006 -0400
+++ b/include/xen/driver_util.h Sun Oct 08 12:34:23 2006 -0400
@@ -4,10 +4,17 @@
 
 #include linux/config.h
 #include linux/vmalloc.h
+#include xen/interface/xen.h
+#include xen/interface/grant_table.h
 
 /* Allocate/destroy a 'vmalloc' VM area. */
 extern struct vm_struct *alloc_vm_area(unsigned long size);
 extern void free_vm_area(struct vm_struct *area);
+#ifdef CONFIG_PPC_XEN
+extern void update_vm_area(struct vm_struct *area, struct gnttab_map_grant_ref 
*op);
+#else
+#define update_vm_area(a,o)
+#endif
 
 /* Lock an area so that PTEs are accessible in the current address space. */
 extern void lock_vm_area(struct vm_struct *area);

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


[XenPPC] [linux-ppc-2.6] Keepin up with Xen changes

2006-10-08 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID fb97509af21b244a68637810768820adb13759ee
# Parent  6f1645140d990840f8035a5455b76b83317db14f
Keepin up with Xen changes

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 include/xen/balloon.h |1 +
 1 files changed, 1 insertion(+)

diff -r 6f1645140d99 -r fb97509af21b include/xen/balloon.h
--- a/include/xen/balloon.h Sun Oct 08 12:42:04 2006 -0400
+++ b/include/xen/balloon.h Sun Oct 08 12:44:47 2006 -0400
@@ -52,6 +52,7 @@ balloon_dealloc_empty_page_range(
 balloon_dealloc_empty_page_range(
struct page *page, unsigned long nr_pages);
 
+void balloon_release_driver_page(struct page *page);
 /*
  * Prevent the balloon driver from changing the memory reservation during
  * a driver critical region.

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


[XenPPC] [linux-ppc-2.6] [LINUX][XEN][POWERPC] Xen specific interfaces for grant tables

2006-10-08 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 985be3a2501b2d29c0848746080a8cff7931165a
# Parent  fb97509af21b244a68637810768820adb13759ee
[LINUX][XEN][POWERPC] Xen specific interfaces for grant tables

These interfaces allow for the use of grant tables for XenPPC to
support BLOCK VIO. They use the Foriegn Map work to allow driver
domains to map granted pages and use the in the block IO layer.  It
ever works with the IOMMU routines.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 arch/powerpc/platforms/xen/Makefile |   13 +
 arch/powerpc/platforms/xen/gnttab.c |  297 
 arch/powerpc/platforms/xen/hcall.c  |   45 -
 arch/powerpc/platforms/xen/setup.h  |2 
 4 files changed, 311 insertions(+), 46 deletions(-)

diff -r fb97509af21b -r 985be3a2501b arch/powerpc/platforms/xen/Makefile
--- a/arch/powerpc/platforms/xen/Makefile   Sun Oct 08 12:44:47 2006 -0400
+++ b/arch/powerpc/platforms/xen/Makefile   Sun Oct 08 12:48:24 2006 -0400
@@ -1,4 +1,11 @@ obj-y  += setup.o evtchn.o hcall.o udbg_x
-obj-y  += setup.o evtchn.o hcall.o udbg_xen.o xen_guest.o reboot.o xencomm.o
+obj-y  += evtchn.o
+obj-y  += gnttab.o
+obj-y  += hcall.o
+obj-y  += reboot.o
+obj-y  += setup.o
+obj-y  += udbg_xen.o
+obj-y  += xen_guest.o
+obj-y  += xencomm.o
 
 # we need the latest __XEN_INTERFACE_VERSION__ (see xen-compat.h)
 CFLAGS_hcall.o += -D__XEN_TOOLS__
@@ -6,3 +13,7 @@ ifndef CONFIG_XEN_BALLOON
 ifndef CONFIG_XEN_BALLOON
 obj-y += balloon.o
 endif
+
+ifndef CONFIG_XEN_UTIL
+obj-y  += util.o
+endif
diff -r fb97509af21b -r 985be3a2501b arch/powerpc/platforms/xen/hcall.c
--- a/arch/powerpc/platforms/xen/hcall.cSun Oct 08 12:44:47 2006 -0400
+++ b/arch/powerpc/platforms/xen/hcall.cSun Oct 08 12:48:24 2006 -0400
@@ -41,8 +41,6 @@
 #include asm/hvcall.h
 #include setup.h
 
-#define xen_guest_handle(hnd)  ((hnd).p)
-
 /* Xencomm notes:
  *
  * For kernel memory, we assume that virtually contiguous pages are also
@@ -137,49 +135,6 @@ int HYPERVISOR_physdev_op(int cmd, void 
cmd, desc);
 }
 EXPORT_SYMBOL(HYPERVISOR_physdev_op);
-
-int HYPERVISOR_grant_table_op(unsigned int cmd, void *op, unsigned int count)
-{
-   void *desc;
-   void *frame_list;
-   int argsize;
-
-   switch (cmd) {
-   case GNTTABOP_map_grant_ref:
-   argsize = sizeof(struct gnttab_map_grant_ref);
-   break;
-   case GNTTABOP_unmap_grant_ref:
-   argsize = sizeof(struct gnttab_unmap_grant_ref);
-   break;
-   case GNTTABOP_setup_table: {
-   struct gnttab_setup_table setup;
-
-   memcpy(setup, op, sizeof(setup));
-   argsize = sizeof(setup);
-
-   frame_list = 
xencomm_create_inline(xen_guest_handle(setup.frame_list));
-
-   set_xen_guest_handle(setup.frame_list, frame_list);
-   memcpy(op, setup, sizeof(setup));
-   }
-   break;
-   case GNTTABOP_dump_table:
-   argsize = sizeof(struct gnttab_dump_table);
-   break;
-   case GNTTABOP_transfer:
-   argsize = sizeof(struct gnttab_transfer);
-   break;
-   default:
-   printk(KERN_ERR %s: unknown grant table op %d\n, __func__, 
cmd);
-   return -ENOSYS;
-   }
-
-   desc = xencomm_create_inline(op);
-
-   return plpar_hcall_norets(XEN_MARK(__HYPERVISOR_grant_table_op), cmd,
-   desc, count);
-}
-EXPORT_SYMBOL(HYPERVISOR_grant_table_op);
 
 int HYPERVISOR_sched_op(int cmd, void *arg)
 {
diff -r fb97509af21b -r 985be3a2501b arch/powerpc/platforms/xen/setup.h
--- a/arch/powerpc/platforms/xen/setup.hSun Oct 08 12:44:47 2006 -0400
+++ b/arch/powerpc/platforms/xen/setup.hSun Oct 08 12:48:24 2006 -0400
@@ -19,3 +19,5 @@ static inline u64 jiffies_to_ns(unsigned
 {
return j * (10UL / HZ);
 }
+
+#define xen_guest_handle(hnd)  ((hnd).p)
diff -r fb97509af21b -r 985be3a2501b arch/powerpc/platforms/xen/gnttab.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/arch/powerpc/platforms/xen/gnttab.c   Sun Oct 08 12:48:24 2006 -0400
@@ -0,0 +1,297 @@
+
+#include linux/config.h
+#include linux/vmalloc.h
+#include linux/memory_hotplug.h
+#include xen/gnttab.h
+#include asm/hypervisor.h
+#include xen/interface/grant_table.h
+#include asm/pgtable.h
+#include asm/sections.h
+#include asm/io.h
+#include asm/machdep.h
+#include asm/prom.h
+#include asm/cacheflush.h
+#include setup.h
+#include ../pseries/plpar_wrappers.h
+
+#undef DEBUG
+
+#ifdef DEBUG
+#define DBG(fmt...) printk(KERN_EMERG fmt)
+#else
+#define DBG(fmt...)
+#endif
+
+static ulong foreign_map_base;
+static ulong foreign_map_end;
+
+static long map_to_linear(ulong paddr)
+{
+   unsigned long vaddr;
+   int psize;
+   unsigned long mode;
+   int slot;
+   uint shift;
+   unsigned long tmp_mode;
+
+   psize = 

[XenPPC] [linux-ppc-2.6] [LINUX][XEN] User init_page_count(p) not set_page_count(p, 1)

2006-10-08 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 1a66de3462c1290b6612a5c2b329b303d7b51cd3
# Parent  985be3a2501b2d29c0848746080a8cff7931165a
[LINUX][XEN] User init_page_count(p) not set_page_count(p,1)

set_page_count() as been removed from use ourside mm/

See:
  
http://kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7835e98b2e3c66dba79cb0ff8ebb90a2fe030c29

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 drivers/xen/netback/netback.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff -r 985be3a2501b -r 1a66de3462c1 drivers/xen/netback/netback.c
--- a/drivers/xen/netback/netback.c Sun Oct 08 12:48:24 2006 -0400
+++ b/drivers/xen/netback/netback.c Sun Oct 08 13:10:56 2006 -0400
@@ -1318,7 +1318,7 @@ static void netif_page_release(struct pa
u16 pending_idx = page - virt_to_page(mmap_vstart);
 
/* Ready for next use. */
-   set_page_count(page, 1);
+   init_page_count(page);
 
netif_idx_release(pending_idx);
 }
@@ -1326,7 +1326,7 @@ static void netif_rx_page_release(struct
 static void netif_rx_page_release(struct page *page)
 {
/* Ready for next use. */
-   set_page_count(page, 1);
+   init_page_count(page);
 }
 
 irqreturn_t netif_be_int(int irq, void *dev_id, struct pt_regs *regs)
@@ -1455,7 +1455,7 @@ static int __init netback_init(void)
 
for (i = 0; i  MAX_PENDING_REQS; i++) {
page = virt_to_page(MMAP_VADDR(i));
-   set_page_count(page, 1);
+   init_page_count(page);
SetPageForeign(page, netif_page_release);
}
 
@@ -1465,7 +1465,7 @@ static int __init netback_init(void)
 
for (i = 0; i  NET_RX_RING_SIZE; i++) {
page = virt_to_page(rx_mmap_area + (i * PAGE_SIZE));
-   set_page_count(page, 1);
+   init_page_count(page);
SetPageForeign(page, netif_rx_page_release);
}
 

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


[XenPPC] [linux-ppc-2.6] backport blkback

2006-10-08 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 4a5cbd892ace94d6b70ade541febfcd927bc460c
# Parent  1a66de3462c1290b6612a5c2b329b303d7b51cd3
backport blkback

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 drivers/xen/blkback/blkback.c |   25 -
 1 files changed, 8 insertions(+), 17 deletions(-)

diff -r 1a66de3462c1 -r 4a5cbd892ace drivers/xen/blkback/blkback.c
--- a/drivers/xen/blkback/blkback.c Sun Oct 08 13:10:56 2006 -0400
+++ b/drivers/xen/blkback/blkback.c Sun Oct 08 13:50:43 2006 -0400
@@ -341,7 +341,7 @@ static void dispatch_rw_block_io(blkif_t
 blkif_request_t *req,
 pending_req_t *pending_req)
 {
-   extern void ll_rw_block(int rw, int nr, struct buffer_head * bhs[]); 
+   extern void ll_rw_block(int rw, int nr, struct buffer_head * bhs[]);
int operation = (req-operation == BLKIF_OP_WRITE) ? WRITE : READ;
struct gnttab_map_grant_ref map[BLKIF_MAX_SEGMENTS_PER_REQUEST];
struct phys_req preq;
@@ -398,14 +398,9 @@ static void dispatch_rw_block_io(blkif_t
}
 
pending_handle(pending_req, i) = map[i].handle;
-#ifdef CONFIG_XEN_IA64_DOM0_NON_VP
-   pending_vaddrs[vaddr_pagenr(pending_req, i)] =
-   (unsigned long)gnttab_map_vaddr(map[i]);
-#else
set_phys_to_machine(__pa(vaddr(
pending_req, i))  PAGE_SHIFT,
FOREIGN_FRAME(map[i].dev_bus_addr  PAGE_SHIFT));
-#endif
seg[i].buf  = map[i].dev_bus_addr | 
(req-seg[i].first_sect  9);
}
@@ -414,7 +409,7 @@ static void dispatch_rw_block_io(blkif_t
DPRINTK(access denied: %s of [%llu,%llu] on dev=%04x\n, 
operation == READ ? read : write,
preq.sector_number,
-   preq.sector_number + preq.nr_sects, preq.dev); 
+   preq.sector_number + preq.nr_sects, preq.dev);
goto fail_flush;
}
 
@@ -518,6 +513,12 @@ static int __init blkif_init(void)
return -ENODEV;
 
mmap_pages= blkif_reqs * BLKIF_MAX_SEGMENTS_PER_REQUEST;
+
+   page = balloon_alloc_empty_page_range(mmap_pages);
+   if (page == NULL)
+   return -ENOMEM;
+   mmap_vstart = (unsigned long)pfn_to_kaddr(page_to_pfn(page));
+
pending_reqs  = kmalloc(sizeof(pending_reqs[0]) *
blkif_reqs, GFP_KERNEL);
pending_grant_handles = kmalloc(sizeof(pending_grant_handles[0]) *
@@ -534,16 +535,6 @@ static int __init blkif_init(void)
 
blkif_interface_init();

-#ifdef CONFIG_XEN_IA64_DOM0_NON_VP
-   extern unsigned long alloc_empty_foreign_map_page_range(
-   unsigned long pages);
-   mmap_vstart = (unsigned long)
-   alloc_empty_foreign_map_page_range(mmap_pages);
-#else /* ! ia64 */
-   page = balloon_alloc_empty_page_range(mmap_pages);
-   BUG_ON(page == NULL);
-   mmap_vstart = (unsigned long)pfn_to_kaddr(page_to_pfn(page));
-#endif
printk(%s: reqs=%d, pages=%d, mmap_vstart=0x%lx\n,
   __FUNCTION__, blkif_reqs, mmap_pages, mmap_vstart);
BUG_ON(mmap_vstart == 0);

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


[XenPPC] [linux-ppc-2.6] [LINUX][XEN][POWERPC] Alernate interface to get passed missing balloon support.

2006-10-08 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 116bf9210b61b0c487ce9e4b77693c47691513b2
# Parent  a49fcec03e363fc838760b4f461175b043327286
[LINUX][XEN][POWERPC] Alernate interface to get passed missing balloon support.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 arch/powerpc/platforms/xen/gnttab.c |2 +-
 include/xen/driver_util.h   |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff -r a49fcec03e36 -r 116bf9210b61 arch/powerpc/platforms/xen/gnttab.c
--- a/arch/powerpc/platforms/xen/gnttab.c   Sun Oct 08 13:52:39 2006 -0400
+++ b/arch/powerpc/platforms/xen/gnttab.c   Sun Oct 08 13:54:00 2006 -0400
@@ -204,7 +204,7 @@ int HYPERVISOR_grant_table_op(unsigned i
 }
 EXPORT_SYMBOL(HYPERVISOR_grant_table_op);
 
-unsigned long alloc_empty_foreign_map_page_range(unsigned long pages)
+ulong foreign_alloc_empty_page_range(unsigned long nr_pages)
 {
return (ulong)__va(foreign_map_base);
 }
diff -r a49fcec03e36 -r 116bf9210b61 include/xen/driver_util.h
--- a/include/xen/driver_util.h Sun Oct 08 13:52:39 2006 -0400
+++ b/include/xen/driver_util.h Sun Oct 08 13:54:00 2006 -0400
@@ -19,5 +19,5 @@ extern void update_vm_area(struct vm_str
 /* Lock an area so that PTEs are accessible in the current address space. */
 extern void lock_vm_area(struct vm_struct *area);
 extern void unlock_vm_area(struct vm_struct *area);
-
+extern ulong foreign_alloc_empty_page_range(unsigned long nr_pages);
 #endif /* __ASM_XEN_DRIVER_UTIL_H__ */

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


[XenPPC] [linux-ppc-2.6] merge

2006-10-08 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 71efe9fd549ebf3bf6d1d3b6d7bda4f7cb8171ba
# Parent  116bf9210b61b0c487ce9e4b77693c47691513b2
# Parent  f7363a56e7c7bf0acd2a48a0e056184afc5ee23f
merge
---
 arch/powerpc/platforms/xen/hcall.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -r 116bf9210b61 -r 71efe9fd549e arch/powerpc/platforms/xen/hcall.c
--- a/arch/powerpc/platforms/xen/hcall.cSun Oct 08 13:54:00 2006 -0400
+++ b/arch/powerpc/platforms/xen/hcall.cSun Oct 08 13:55:59 2006 -0400
@@ -469,7 +469,7 @@ int HYPERVISOR_memory_op(unsigned int cm
cmd, NULL);
break;
default:
-   printk(KERN_ERR %s: unknown grant table op %d\n, __func__, 
cmd);
+   printk(KERN_ERR %s: unknown memory op %d\n, __func__, cmd);
ret = -ENOSYS;
}
xencomm_free(op_desc);

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


[XenPPC] [linux-ppc-2.6] [LINUX][XEN][POWERPC] New default configuration

2006-10-08 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID b9e38b262f6479dfa7260fea8efb0dcdc1e6e256
# Parent  71efe9fd549ebf3bf6d1d3b6d7bda4f7cb8171ba
[LINUX][XEN][POWERPC] New default configuration

 - Config MEMORY_HOTPLUG so we can add to the Linear Mapping
 - Use PowerPC specific Xen Util Routines

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 arch/powerpc/configs/xen_maple_defconfig |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff -r 71efe9fd549e -r b9e38b262f64 arch/powerpc/configs/xen_maple_defconfig
--- a/arch/powerpc/configs/xen_maple_defconfig  Sun Oct 08 13:55:59 2006 -0400
+++ b/arch/powerpc/configs/xen_maple_defconfig  Sun Oct 08 14:22:12 2006 -0400
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.17
-# Mon Aug 28 15:57:27 2006
+# Sat Oct  7 08:37:53 2006
 #
 CONFIG_PPC64=y
 CONFIG_64BIT=y
@@ -176,9 +176,10 @@ CONFIG_HAVE_MEMORY_PRESENT=y
 CONFIG_HAVE_MEMORY_PRESENT=y
 # CONFIG_SPARSEMEM_STATIC is not set
 CONFIG_SPARSEMEM_EXTREME=y
-# CONFIG_MEMORY_HOTPLUG is not set
+CONFIG_MEMORY_HOTPLUG=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_RESOURCES_64BIT=y
+CONFIG_ARCH_MEMORY_PROBE=y
 # CONFIG_PPC_64K_PAGES is not set
 # CONFIG_SCHED_SMT is not set
 CONFIG_PROC_DEVICETREE=y
@@ -1176,7 +1177,6 @@ CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
 CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
 CONFIG_HAVE_IRQ_IGNORE_UNHANDLED=y
 CONFIG_NO_IDLE_HZ=y
-CONFIG_XEN_UTIL=y
 CONFIG_XEN_DEVMEM=y
 CONFIG_XEN_SKBUFF=y
 CONFIG_XEN_REBOOT=y

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


[XenPPC] [linux-ppc-2.6] [POWERPC][LINUX][XEN] fix typo in HYPERVISOR_memory_op() message.

2006-10-06 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Node ID f7363a56e7c7bf0acd2a48a0e056184afc5ee23f
# Parent  933613959bf6a8e48a43e1cd93d4afae4a660ec8
[POWERPC][LINUX][XEN] fix typo in HYPERVISOR_memory_op() message.
Signed-off-by: Tony Breeds [EMAIL PROTECTED]
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 arch/powerpc/platforms/xen/hcall.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -r 933613959bf6 -r f7363a56e7c7 arch/powerpc/platforms/xen/hcall.c
--- a/arch/powerpc/platforms/xen/hcall.cWed Oct 04 11:20:16 2006 -0400
+++ b/arch/powerpc/platforms/xen/hcall.cFri Oct 06 12:30:31 2006 -0500
@@ -514,7 +514,7 @@ int HYPERVISOR_memory_op(unsigned int cm
cmd, NULL);
break;
default:
-   printk(KERN_ERR %s: unknown grant table op %d\n, __func__, 
cmd);
+   printk(KERN_ERR %s: unknown memory op %d\n, __func__, cmd);
ret = -ENOSYS;
}
xencomm_free(op_desc);

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


[XenPPC] [linux-ppc-2.6] [LINUX][POWERPC] Use Xen property to decide if domain can control power

2006-09-28 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID c52ba3176a285683f00beaa2e82d2ed39bcedae8
# Parent  cae64f65891af6e6f596f96245b7d09b6569078e
[LINUX][POWERPC] Use Xen property to decide if domain can control power

If Xen is not able to control the machine reboot/halt controls it will
create a /xen/power-control property indicating to the domain that it
has been given the capability to try.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 arch/powerpc/platforms/xen/setup.c |9 +
 1 files changed, 5 insertions(+), 4 deletions(-)

diff -r cae64f65891a -r c52ba3176a28 arch/powerpc/platforms/xen/setup.c
--- a/arch/powerpc/platforms/xen/setup.cMon Sep 18 12:46:10 2006 -0400
+++ b/arch/powerpc/platforms/xen/setup.cThu Sep 28 12:26:59 2006 -0400
@@ -114,8 +114,6 @@ static void __init xen_init_early(void)
is_dom0 = !!(xen_start_info-flags  SIF_INITDOMAIN);

if (is_dom0) {
-   xen_reboot_init(mach_maple_md);
-
ppc_md.pcibios_fixup= mach_maple_md.pcibios_fixup;
ppc_md.pci_get_legacy_ide_irq   = 
mach_maple_md.pci_get_legacy_ide_irq;
ppc_md.get_boot_time= mach_maple_md.get_boot_time;
@@ -123,9 +121,12 @@ static void __init xen_init_early(void)
ppc_md.get_rtc_time = mach_maple_md.get_rtc_time;
 
add_preferred_console(ttyS, 0, NULL);
-   } else {
+   }
+
+   if (get_property(xen, power-control, NULL))
+   xen_reboot_init(mach_maple_md);
+   else
xen_reboot_init(NULL);
-   }
 
/* get the domain features */
setup_xen_features();

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


[XenPPC] [linux-ppc-2.6] [LINUX][POWERPC] Update domctl and sysctl definitions.

2006-09-18 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User [EMAIL PROTECTED]
# Node ID 10243a857f5d0babad227219c79e45b9131fb9f3
# Parent  4a1f58739bc25b80eae92af80b9ef309cb25468c
[LINUX][POWERPC] Update domctl and sysctl definitions.
- changes the interface versions.
- added KERN_WARNING messages to help debug version mismatches.
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 arch/powerpc/platforms/xen/hcall.c |   15 ---
 include/xen/interface/domctl.h |   22 +++---
 include/xen/interface/sysctl.h |   20 ++--
 3 files changed, 33 insertions(+), 24 deletions(-)

diff -r 4a1f58739bc2 -r 10243a857f5d arch/powerpc/platforms/xen/hcall.c
--- a/arch/powerpc/platforms/xen/hcall.cTue Sep 12 15:53:01 2006 -0500
+++ b/arch/powerpc/platforms/xen/hcall.cMon Sep 18 11:12:12 2006 -0500
@@ -237,8 +237,11 @@ static int xenppc_privcmd_domctl(privcmd
if (copy_from_user(kern_op, user_op, sizeof(xen_domctl_t)))
return -EFAULT;
 
-   if (kern_op.interface_version != XEN_DOMCTL_INTERFACE_VERSION)
+   if (kern_op.interface_version != XEN_DOMCTL_INTERFACE_VERSION) {
+   printk(KERN_WARNING %s: %s %x != %x\n, __func__, 
current-comm,
+   kern_op.interface_version, 
XEN_DOMCTL_INTERFACE_VERSION);
return -EACCES;
+   }
 
ret = xencomm_create(kern_op, sizeof(xen_domctl_t), op_desc, 
GFP_KERNEL);
if (ret)
@@ -348,8 +351,11 @@ static int xenppc_privcmd_sysctl(privcmd
if (copy_from_user(kern_op, user_op, sizeof(xen_sysctl_t)))
return -EFAULT;
 
-   if (kern_op.interface_version != XEN_SYSCTL_INTERFACE_VERSION)
+   if (kern_op.interface_version != XEN_SYSCTL_INTERFACE_VERSION) {
+   printk(KERN_WARNING %s: %s %x != %x\n, __func__, 
current-comm,
+   kern_op.interface_version, 
XEN_SYSCTL_INTERFACE_VERSION);
return -EACCES;
+   }
 
ret = xencomm_create(kern_op, sizeof(xen_sysctl_t), op_desc, 
GFP_KERNEL);
if (ret)
@@ -413,8 +419,11 @@ static int xenppc_privcmd_platform_op(pr
if (copy_from_user(kern_op, user_op, sizeof(xen_platform_op_t)))
return -EFAULT;
 
-   if (kern_op.interface_version != XENPF_INTERFACE_VERSION)
+   if (kern_op.interface_version != XENPF_INTERFACE_VERSION) {
+   printk(KERN_WARNING %s: %s %x != %x\n, __func__, 
current-comm,
+   kern_op.interface_version, 
XENPF_INTERFACE_VERSION);
return -EACCES;
+   }
 
ret = xencomm_create(kern_op, sizeof(xen_platform_op_t), op_desc,
GFP_KERNEL);
diff -r 4a1f58739bc2 -r 10243a857f5d include/xen/interface/domctl.h
--- a/include/xen/interface/domctl.hTue Sep 12 15:53:01 2006 -0500
+++ b/include/xen/interface/domctl.hMon Sep 18 11:12:12 2006 -0500
@@ -10,14 +10,16 @@
 #ifndef __XEN_PUBLIC_DOMCTL_H__
 #define __XEN_PUBLIC_DOMCTL_H__
 
+#if !defined(__XEN__)  !defined(__XEN_TOOLS__)
+#error domctl operations are intended for use by node control tools only
+#endif
+
 #include xen.h
 
-#define XEN_DOMCTL_INTERFACE_VERSION 0x0002
-
-#define uint64_t uint64_aligned_t
+#define XEN_DOMCTL_INTERFACE_VERSION 0x0003
 
 struct xenctl_cpumap {
-XEN_GUEST_HANDLE_64(uint8_t) bitmap;
+XEN_GUEST_HANDLE(uint8_t) bitmap;
 uint32_t nr_cpus;
 };
 
@@ -72,7 +74,7 @@ struct xen_domctl_getmemlist {
 uint64_t max_pfns;
 /* Start index in guest's page list. */
 uint64_t start_pfn;
-XEN_GUEST_HANDLE_64(xen_pfn_t) buffer;
+XEN_GUEST_HANDLE(xen_pfn_t) buffer;
 /* OUT variables. */
 uint64_t num_pfns;
 };
@@ -109,7 +111,7 @@ struct xen_domctl_getpageframeinfo2 {
 /* IN variables. */
 uint64_t num;
 /* IN/OUT variables. */
-XEN_GUEST_HANDLE_64(ulong) array;
+XEN_GUEST_HANDLE(ulong) array;
 };
 typedef struct xen_domctl_getpageframeinfo2 xen_domctl_getpageframeinfo2_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_getpageframeinfo2_t);
@@ -183,7 +185,7 @@ struct xen_domctl_shadow_op {
 uint32_t   mb;   /* Shadow memory allocation in MB */
 
 /* OP_PEEK / OP_CLEAN */
-XEN_GUEST_HANDLE_64(ulong) dirty_bitmap;
+XEN_GUEST_HANDLE(ulong) dirty_bitmap;
 uint64_t   pages;/* Size of buffer. Updated with actual size. */
 struct xen_domctl_shadow_op_stats stats;
 };
@@ -203,8 +205,8 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_max_m
 #define XEN_DOMCTL_setvcpucontext12
 #define XEN_DOMCTL_getvcpucontext13
 struct xen_domctl_vcpucontext {
-uint32_t  vcpu; /* IN */
-XEN_GUEST_HANDLE_64(vcpu_guest_context_t) ctxt; /* IN/OUT */
+uint32_t  vcpu;  /* IN */
+XEN_GUEST_HANDLE(vcpu_guest_context_t) ctxt; /* IN/OUT */
 };
 typedef struct xen_domctl_vcpucontext xen_domctl_vcpucontext_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_vcpucontext_t);
@@ -385,8 +387,6 @@ typedef struct 

[XenPPC] [linux-ppc-2.6] [LINUX][POWERPC] Use inline xencomm handles (and remove mini descriptors)

2006-09-12 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Node ID 22563db8938def924303f869cd150173b1cc62a4
# Parent  e574e8dd4c487af78c62a7892a4978ea7db74d15
[LINUX][POWERPC] Use inline xencomm handles (and remove mini descriptors)
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 arch/powerpc/platforms/xen/Makefile  |2 
 arch/powerpc/platforms/xen/hcall.c   |  206 +++
 drivers/xen/core/xencomm.c   |  101 ++---
 include/xen/interface/arch-powerpc.h |3 
 include/xen/interface/xencomm.h  |6 -
 include/xen/xencomm.h|   24 ++--
 6 files changed, 129 insertions(+), 213 deletions(-)

diff -r e574e8dd4c48 -r 22563db8938d arch/powerpc/platforms/xen/Makefile
--- a/arch/powerpc/platforms/xen/Makefile   Tue Sep 12 13:10:55 2006 -0500
+++ b/arch/powerpc/platforms/xen/Makefile   Tue Sep 12 13:14:59 2006 -0500
@@ -1,4 +1,4 @@ obj-y   += setup.o evtchn.o hcall.o udbg_x
-obj-y  += setup.o evtchn.o hcall.o udbg_xen.o xen_guest.o reboot.o
+obj-y  += setup.o evtchn.o hcall.o udbg_xen.o xen_guest.o reboot.o xencomm.o
 
 # we need the latest __XEN_INTERFACE_VERSION__ (see xen-compat.h)
 CFLAGS_hcall.o += -D__XEN_TOOLS__
diff -r e574e8dd4c48 -r 22563db8938d arch/powerpc/platforms/xen/hcall.c
--- a/arch/powerpc/platforms/xen/hcall.cTue Sep 12 13:10:55 2006 -0500
+++ b/arch/powerpc/platforms/xen/hcall.cTue Sep 12 13:14:59 2006 -0500
@@ -1,3 +1,23 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *
+ * Copyright (C) IBM Corp. 2006
+ *
+ * Authors: Hollis Blanchard [EMAIL PROTECTED]
+ */
+
 #include linux/types.h
 #include linux/errno.h
 #include linux/kernel.h
@@ -24,9 +44,9 @@
 
 /* Xencomm notes:
  *
- * Some hypercalls are made before the memory subsystem is up, so instead of
- * calling xencomm_create(), we allocate XENCOMM_MINI_AREA bytes from the stack
- * to hold the xencomm descriptor.
+ * For kernel memory, we assume that virtually contiguous pages are also
+ * physically contiguous. This allows us to avoid creating descriptors for
+ * kernel hypercalls, such as console and event channel operations.
  *
  * In general, we need a xencomm descriptor to cover the top-level data
  * structure (e.g. the domctl op), plus another for every embedded pointer to
@@ -35,44 +55,24 @@
 
 int HYPERVISOR_console_io(int cmd, int count, char *str)
 {
-   char xc_area[XENCOMM_MINI_AREA];
-   struct xencomm_desc *desc;
-   int rc;
-
-   rc = xencomm_create_mini(xc_area, XENCOMM_MINI_AREA, str, count,
-   desc);
-   if (rc)
-   return rc;
-
-   rc = plpar_hcall_norets(XEN_MARK(__HYPERVISOR_console_io),
- cmd, count, __pa(desc));
-
-   return rc;
+   void *desc = xencomm_create_inline(str);
+
+   return plpar_hcall_norets(XEN_MARK(__HYPERVISOR_console_io),
+ cmd, count, desc);
 }
 EXPORT_SYMBOL(HYPERVISOR_console_io);
 
 int HYPERVISOR_event_channel_op(int cmd, void *op)
 {
-   char xc_area[XENCOMM_MINI_AREA];
-   struct xencomm_desc *desc;
-   int rc;
-
-   rc = xencomm_create_mini(xc_area, XENCOMM_MINI_AREA,
-op, sizeof(evtchn_op_t), desc);
-   if (rc)
-   return rc;
-
-   rc = plpar_hcall_norets(XEN_MARK(__HYPERVISOR_event_channel_op),
-   cmd, __pa(desc));
-   return rc;
+   void *desc = xencomm_create_inline(op);
+
+   return plpar_hcall_norets(XEN_MARK(__HYPERVISOR_event_channel_op),
+   cmd, desc);
 }
 EXPORT_SYMBOL(HYPERVISOR_event_channel_op);
 
-int HYPERVISOR_xen_version(int cmd, void *arg)
-{
-   /* these calls are small and could be called before the
-* allocator is ready */
-   char xc_area[XENCOMM_MINI_AREA];
+int HYPERVISOR_xen_version_userspace(int cmd, void *arg)
+{
struct xencomm_desc *desc;
const unsigned long hcall = __HYPERVISOR_xen_version;
int argsize;
@@ -107,39 +107,40 @@ int HYPERVISOR_xen_version(int cmd, void
printk(KERN_ERR %s: unknown version cmd %d\n, __func__, cmd);
return -ENOSYS;
}
-   rc = xencomm_create_mini(xc_area, XENCOMM_MINI_AREA,
-  

[XenPPC] [linux-ppc-2.6] [LINUX][POWERPC] basic .hgignore improvements

2006-09-12 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Node ID e574e8dd4c487af78c62a7892a4978ea7db74d15
# Parent  0c4c6144a492946963ddb3c9a2825237d20c7624
[LINUX][POWERPC] basic .hgignore improvements
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 .hgignore |9 +++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff -r 0c4c6144a492 -r e574e8dd4c48 .hgignore
--- a/.hgignore Fri Sep 08 15:57:31 2006 -0500
+++ b/.hgignore Tue Sep 12 13:10:55 2006 -0500
@@ -1,2 +1,7 @@
-.*~$
-cscope\..*$
+^.*~$
+^cscope\..*$
+^.*\.cmd$
+^.*\.o$
+^System\.map$
+^\.tmp.*$
+^include/config.*$

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


[XenPPC] [linux-ppc-2.6] [LINUX][POWERPC] Add missing xencomm file.

2006-09-12 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Node ID 4a1f58739bc25b80eae92af80b9ef309cb25468c
# Parent  7de0dc82cc65d7a0e047e3826395edd15f31a339
[LINUX][POWERPC] Add missing xencomm file.
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 arch/powerpc/platforms/xen/xencomm.c |   54 +++
 1 files changed, 54 insertions(+)

diff -r 7de0dc82cc65 -r 4a1f58739bc2 arch/powerpc/platforms/xen/xencomm.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/arch/powerpc/platforms/xen/xencomm.c  Tue Sep 12 15:53:01 2006 -0500
@@ -0,0 +1,54 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *
+ * Copyright (C) IBM Corp. 2006
+ *
+ * Authors: Hollis Blanchard [EMAIL PROTECTED]
+ */
+
+#include linux/types.h
+#include linux/sched.h
+#include linux/mm.h
+#include asm/page.h
+#include asm/current.h
+#include xen/interface/arch-powerpc.h
+#include xen/xencomm.h
+
+/* translate virtual address to physical address */
+unsigned long xencomm_vtop(unsigned long vaddr)
+{
+   struct page *page;
+   struct vm_area_struct *vma;
+
+   /* NULL is NULL */
+   if (vaddr == 0)
+   return 0;
+
+   if (is_kernel_addr(vaddr))
+   return __pa(vaddr);
+
+   /* XXX double-check (lack of) locking */
+   vma = find_extend_vma(current-mm, vaddr);
+   BUG_ON(!vma);
+   if (!vma)
+   return ~0UL;
+
+   page = follow_page(vma, vaddr, 0);
+   BUG_ON(!page);
+   if (!page)
+   return ~0UL;
+
+   return (page_to_pfn(page)  PAGE_SHIFT) | (vaddr  ~PAGE_MASK);
+}

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


[XenPPC] [linux-ppc-2.6] [LINUX][POWERPC] Fix allocation error for xencomm mini descriptors.

2006-09-08 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Node ID cc44870e435343e40564f210e16d1141a314e593
# Parent  efefb3db340a70a34fd59435a260ebf4e6b8662d
[LINUX][POWERPC] Fix allocation error for xencomm mini descriptors.

Previous code worked correctly only if the allocated structure fit in the same
page as the base address. If the structure did not fit, the computation for the
allocation was incorrect. Noticed by Kiyokuni KAWACHIYA [EMAIL PROTECTED].

Signed-off-by: Maria Butrico [EMAIL PROTECTED]
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 drivers/xen/core/xencomm.c |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff -r efefb3db340a -r cc44870e4353 drivers/xen/core/xencomm.c
--- a/drivers/xen/core/xencomm.cWed Sep 06 15:39:46 2006 -0500
+++ b/drivers/xen/core/xencomm.cFri Sep 08 10:17:30 2006 -0500
@@ -150,18 +150,18 @@ static void *xencomm_alloc_mini(void *ar
 static void *xencomm_alloc_mini(void *area, int arealen)
 {
unsigned long base = (unsigned long)area;
-   unsigned int pageoffset;
+   unsigned int left_in_page;
 
-   pageoffset = base % PAGE_SIZE;
+   left_in_page = PAGE_SIZE - base % PAGE_SIZE;
 
/* we probably fit right at the front of area */
-   if ((PAGE_SIZE - pageoffset) = sizeof(struct xencomm_mini)) {
+   if (left_in_page = sizeof(struct xencomm_mini)) {
return area;
}
 
/* if not, see if area is big enough to advance to the next page */
-   if ((arealen - pageoffset) = sizeof(struct xencomm_mini))
-   return (void *)(base + pageoffset);
+   if ((arealen - left_in_page) = sizeof(struct xencomm_mini))
+   return (void *)(base + left_in_page);
 
/* area was too small */
return NULL;

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


[XenPPC] [linux-ppc-2.6] [LINUX][POWERPC] Fix up changeset e5b6c025d4d2.

2006-09-06 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Node ID 038152eb27568b983bb9601b3395c2aee4932d51
# Parent  0d95131b439ee28d514f637b30f6034b8b5fb8a6
[LINUX][POWERPC] Fix up changeset e5b6c025d4d2.
- rename console_mfn due to overly aggressive #define
- define __XEN_TOOLS__ in hcall.c to work around interface version checking
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 include/xen/interface/arch-ppc64.h|  120 --
 include/xen/interface/dom0_ops.h  |  102 
 arch/powerpc/platforms/xen/Makefile   |3 
 arch/powerpc/platforms/xen/udbg_xen.c |   10 
 include/xen/interface/arch-powerpc.h  |  118 ++
 include/xen/interface/domctl.h|  400 ++
 include/xen/interface/elfnote.h   |  133 +++
 include/xen/interface/hvm/e820.h  |   32 ++
 include/xen/interface/hvm/params.h|   24 ++
 include/xen/interface/platform.h  |  125 ++
 include/xen/interface/sysctl.h|  151 
 11 files changed, 991 insertions(+), 227 deletions(-)

diff -r 0d95131b439e -r 038152eb2756 arch/powerpc/platforms/xen/Makefile
--- a/arch/powerpc/platforms/xen/Makefile   Tue Sep 05 18:00:40 2006 -0500
+++ b/arch/powerpc/platforms/xen/Makefile   Wed Sep 06 09:08:21 2006 -0500
@@ -1,4 +1,7 @@ obj-y   += setup.o evtchn.o hcall.o udbg_x
 obj-y  += setup.o evtchn.o hcall.o udbg_xen.o xen_guest.o reboot.o
+
+# we need the latest __XEN_INTERFACE_VERSION__ (see xen-compat.h)
+CFLAGS_hcall.o += -D__XEN_TOOLS__
 
 ifndef CONFIG_XEN_BALLOON
 obj-y += balloon.o
diff -r 0d95131b439e -r 038152eb2756 arch/powerpc/platforms/xen/udbg_xen.c
--- a/arch/powerpc/platforms/xen/udbg_xen.c Tue Sep 05 18:00:40 2006 -0500
+++ b/arch/powerpc/platforms/xen/udbg_xen.c Wed Sep 06 09:08:21 2006 -0500
@@ -129,20 +129,20 @@ static int udbg_getc_domu_xen(void)
 
 void udbg_init_xen(void)
 {
-   ulong console_mfn = 0;
+   ulong __console_mfn = 0;
 
if (xen_start_info) {
/* we can find out where everything is */
if (!(xen_start_info-flags  SIF_INITDOMAIN))
-   console_mfn = xen_start_info-console.domU.mfn;
+   __console_mfn = xen_start_info-console.domU.mfn;
} else {
/* VERY early printf */
 #ifdef CONFIG_PPC_EARLY_DEBUG_XEN_DOMU
-   console_mfn = 0x3ffdUL;
+   __console_mfn = 0x3ffdUL;
 #endif
}
 
-   if (console_mfn == 0) {
+   if (__console_mfn == 0) {
udbg_putc = udbg_putc_dom0_xen;
udbg_getc = udbg_getc_dom0_xen;
udbg_getc_poll = udbg_getc_poll_dom0_xen;
@@ -150,6 +150,6 @@ void udbg_init_xen(void)
udbg_putc = udbg_putc_domu_xen;
udbg_getc = udbg_getc_domu_xen;
udbg_getc_poll = udbg_getc_poll_domu_xen;
-   intf = (struct xencons_interface *)mfn_to_virt(console_mfn);
+   intf = (struct xencons_interface *)mfn_to_virt(__console_mfn);
}
 }
diff -r 0d95131b439e -r 038152eb2756 include/xen/interface/arch-powerpc.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/include/xen/interface/arch-powerpc.h  Wed Sep 06 09:08:21 2006 -0500
@@ -0,0 +1,118 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ * Copyright (C) IBM Corp. 2005, 2006
+ *
+ * Authors: Hollis Blanchard [EMAIL PROTECTED]
+ */
+
+#ifndef __XEN_PUBLIC_ARCH_PPC_64_H__
+#define __XEN_PUBLIC_ARCH_PPC_64_H__
+
+#define __DEFINE_XEN_GUEST_HANDLE(name, type) \
+typedef struct { \
+int __pad[(sizeof (long long) - sizeof (void *)) / sizeof (int)]; \
+type *p; \
+} __attribute__((__aligned__(8))) __guest_handle_ ## name
+
+#define DEFINE_XEN_GUEST_HANDLE(name) __DEFINE_XEN_GUEST_HANDLE(name, name)
+#define XEN_GUEST_HANDLE(name)__guest_handle_ ## name
+#define XEN_GUEST_HANDLE_64(name) __guest_handle_ ## name
+#define set_xen_guest_handle(hnd, val) \
+do { \
+if (sizeof ((hnd).__pad)) \
+(hnd).__pad[0] = 0; \
+(hnd).p = val; \
+} while (0)
+
+#ifdef __XEN_TOOLS__
+#define get_xen_guest_handle(val, hnd)  do { val = (hnd).p; } while (0)
+#endif
+
+#ifndef __ASSEMBLY__
+typedef uint64_t uint64_aligned_t;
+
+/* Guest handles for primitive C types. */

[XenPPC] [linux-ppc-2.6] [POWERPC][LINUX] add DOM0_ALLOC_REAL_MODE_AREA support

2006-08-28 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Node ID 199b457c43256143561ea7943d40ce72713c73b0
# Parent  0d5ea02d3a16266ea8b69ae1930d15a61f408f94
[POWERPC][LINUX] add DOM0_ALLOC_REAL_MODE_AREA support
- no xencomm munging needed
- update dom0_ops.h
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 arch/powerpc/platforms/xen/hcall.c |1 +
 include/xen/interface/dom0_ops.h   |9 +
 2 files changed, 10 insertions(+)

diff -r 0d5ea02d3a16 -r 199b457c4325 arch/powerpc/platforms/xen/hcall.c
--- a/arch/powerpc/platforms/xen/hcall.cMon Aug 28 16:35:15 2006 -0400
+++ b/arch/powerpc/platforms/xen/hcall.cMon Aug 28 18:43:52 2006 -0500
@@ -364,6 +364,7 @@ static int xenppc_privcmd_dom0_op(privcm
case DOM0_MAX_VCPUS:
case DOM0_SETDOMAINHANDLE:
case DOM0_SETDEBUGGING:
+   case DOM0_ALLOC_REAL_MODE_AREA:
/* no munging needed */
break;
 
diff -r 0d5ea02d3a16 -r 199b457c4325 include/xen/interface/dom0_ops.h
--- a/include/xen/interface/dom0_ops.h  Mon Aug 28 16:35:15 2006 -0400
+++ b/include/xen/interface/dom0_ops.h  Mon Aug 28 18:43:52 2006 -0500
@@ -534,6 +534,14 @@ struct dom0_settimeoffset {
 };
 typedef struct dom0_settimeoffset dom0_settimeoffset_t;
 DEFINE_XEN_GUEST_HANDLE(dom0_settimeoffset_t);
+
+#define DOM0_ALLOC_REAL_MODE_AREA 51
+struct dom0_alloc_real_mode_area {
+   domid_t  domain;
+   uint32_t order;
+};
+typedef struct dom0_alloc_real_mode_area dom0_alloc_real_mode_area_t;
+DEFINE_XEN_GUEST_HANDLE(dom0_alloc_real_mode_area_t);
 
 struct dom0_op {
 uint32_t cmd;
@@ -578,6 +586,7 @@ struct dom0_op {
 struct dom0_hypercall_inithypercall_init;
 struct dom0_domain_setup  domain_setup;
 struct dom0_settimeoffset settimeoffset;
+struct dom0_alloc_real_mode_area alloc_real_mode_area;
 uint8_t   pad[128];
 } u;
 };

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


[XenPPC] [linux-ppc-2.6] [LINUX] support DOM0_SHADOW_CONTROL dom0 hcall

2006-08-23 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Node ID 49765c9a9eb4554f884c4c730438cf872fae9d9c
# Parent  8f36901a3c1599e6c326b1a6f6b017dd5f285b0a
[LINUX] support DOM0_SHADOW_CONTROL dom0 hcall
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 arch/powerpc/platforms/xen/hcall.c |   10 +-
 1 files changed, 9 insertions(+), 1 deletion(-)

diff -r 8f36901a3c15 -r 49765c9a9eb4 arch/powerpc/platforms/xen/hcall.c
--- a/arch/powerpc/platforms/xen/hcall.cFri Aug 11 12:49:08 2006 -0400
+++ b/arch/powerpc/platforms/xen/hcall.cWed Aug 23 13:19:06 2006 -0500
@@ -286,6 +286,14 @@ static int xenppc_privcmd_dom0_op(privcm
kern_op.u.readconsole.count,
desc, GFP_KERNEL);
set_xen_guest_handle(kern_op.u.readconsole.buffer,
+(void *)__pa(desc));
+   break;
+   case DOM0_SHADOW_CONTROL:
+   ret = xencomm_create(
+   xen_guest_handle(kern_op.u.shadow_control.dirty_bitmap),
+   kern_op.u.shadow_control.pages * sizeof(unsigned long),
+   desc, GFP_KERNEL);
+   set_xen_guest_handle(kern_op.u.shadow_control.dirty_bitmap,
 (void *)__pa(desc));
break;
case DOM0_GETPAGEFRAMEINFO2:
@@ -509,7 +517,7 @@ int arch_privcmd_hypercall(privcmd_hyper
printk(%s: unknown hcall (%ld)\n, __func__, hypercall-op);
/* fallthru */
/* below are the hcalls we know will fail and its ok */
-case __HYPERVISOR_acm_op:
+   case __HYPERVISOR_acm_op:
return plpar_hcall_norets(XEN_MARK(hypercall-op),
hypercall-arg[0],
hypercall-arg[1],

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


[XenPPC] [linux-ppc-2.6] [POWERPC] get the UDB delay correct

2006-08-10 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 584e21f08d0c092170a6879892b43efe860e2a9c
# Parent  8a5663668eed06e69bf09f67a5d37f6e1d4bbc80
[POWERPC] get the UDB delay correct

This patch makes sure that an absolute time is used to set the timer.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 arch/powerpc/platforms/xen/setup.c|5 -
 arch/powerpc/platforms/xen/setup.h|   10 ++
 arch/powerpc/platforms/xen/udbg_xen.c |   10 +++---
 3 files changed, 17 insertions(+), 8 deletions(-)

diff -r 8a5663668eed -r 584e21f08d0c arch/powerpc/platforms/xen/setup.c
--- a/arch/powerpc/platforms/xen/setup.cThu Aug 10 15:43:50 2006 -0400
+++ b/arch/powerpc/platforms/xen/setup.cThu Aug 10 16:36:39 2006 -0400
@@ -155,11 +155,6 @@ static u64 jiffies_to_ns(unsigned long j
 static u64 jiffies_to_ns(unsigned long j) 
 {
return j * (10UL / HZ);
-}
-
-static u64 tb_to_ns(u64 tb)
-{
-   return tb * (10UL / tb_ticks_per_sec);
 }
 
 static void xen_idle(void)
diff -r 8a5663668eed -r 584e21f08d0c arch/powerpc/platforms/xen/setup.h
--- a/arch/powerpc/platforms/xen/setup.hThu Aug 10 15:43:50 2006 -0400
+++ b/arch/powerpc/platforms/xen/setup.hThu Aug 10 16:36:39 2006 -0400
@@ -1,6 +1,16 @@
+
+#include asm/machdep.h
 
 extern void evtchn_init_IRQ(void);
 extern void xen_init_IRQ(void);
 extern void xen_reboot_init(struct machdep_calls *);
 extern void xen_maple_init_IRQ(void);
 extern int xen_get_irq(struct pt_regs *regs);
+
+static inline u64 tb_to_ns(u64 tb)
+{
+   if (likely(tb_ticks_per_sec)) {
+   return tb * (10UL / tb_ticks_per_sec);
+   }
+   return 0;
+}
diff -r 8a5663668eed -r 584e21f08d0c arch/powerpc/platforms/xen/udbg_xen.c
--- a/arch/powerpc/platforms/xen/udbg_xen.c Thu Aug 10 15:43:50 2006 -0400
+++ b/arch/powerpc/platforms/xen/udbg_xen.c Thu Aug 10 16:36:39 2006 -0400
@@ -4,6 +4,7 @@
 #include xen/evtchn.h
 #include asm/udbg.h
 #include asm/hypervisor.h
+#include setup.h
 
 static void udbg_putc_dom0_xen(char c)
 {
@@ -52,9 +53,12 @@ static int udbg_getc_dom0_xen(void)
for (;;) {
ch = udbg_getc_poll_dom0_xen();
if (ch == -1) {
-   /* nano seconds */
-   HYPERVISOR_set_timer_op(1);
-   HYPERVISOR_sched_op(SCHEDOP_block, NULL);
+   u64 now_ns = tb_to_ns(get_tb());
+   if (now_ns  0) {
+   u64 offset_ns = 1; /* 100ms */
+   HYPERVISOR_set_timer_op(now_ns + offset_ns);
+   HYPERVISOR_sched_op(SCHEDOP_block, NULL);
+   }
} else {
return ch;
}

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


[XenPPC] [linux-ppc-2.6] [POWEPRC] change the .s to a .S

2006-08-09 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 2d3056825cda857be6fca8f949f3c79d5226b6d8
# Parent  8e6d4f43d13f5d1fce90823cbd35f9541cac4721
[POWEPRC] change the .s to a .S

The rule to build .s instead of .S may not be available in all directories.
Sad but true.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 arch/powerpc/platforms/xen/xen_guest.s |7 ---
 arch/powerpc/platforms/xen/xen_guest.S |7 +++
 2 files changed, 7 insertions(+), 7 deletions(-)

diff -r 8e6d4f43d13f -r 2d3056825cda arch/powerpc/platforms/xen/xen_guest.S
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/arch/powerpc/platforms/xen/xen_guest.SWed Aug 09 18:18:08 2006 -0400
@@ -0,0 +1,7 @@
+   .section __xen_guest
+   .ascii  GUEST_OS=linux
+   .ascii  ,GUEST_VER=xen-3.0
+   .ascii  ,XEN_VER=xen-3.0
+   .ascii  ,VIRT_BASE=0xC000
+   .ascii  ,LOADER=generic
+   .byte   0
diff -r 8e6d4f43d13f -r 2d3056825cda arch/powerpc/platforms/xen/xen_guest.s
--- a/arch/powerpc/platforms/xen/xen_guest.sWed Aug 09 18:15:53 2006 -0400
+++ /dev/null   Thu Jan 01 00:00:00 1970 +
@@ -1,7 +0,0 @@
-   .section __xen_guest
-   .ascii  GUEST_OS=linux
-   .ascii  ,GUEST_VER=xen-3.0
-   .ascii  ,XEN_VER=xen-3.0
-   .ascii  ,VIRT_BASE=0xC000
-   .ascii  ,LOADER=generic
-   .byte   0

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


[XenPPC] [linux-ppc-2.6] [POWEPRC] new default config

2006-08-08 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID e4a11039ee9ec7b0b728981fc7b0a6c0c972b0e4
# Parent  dbc5fdc3a38251f8a11eb442c6e9139b36e02e54
[POWEPRC] new default config
---
 arch/powerpc/configs/xen_maple_defconfig |   18 --
 1 files changed, 16 insertions(+), 2 deletions(-)

diff -r dbc5fdc3a382 -r e4a11039ee9e arch/powerpc/configs/xen_maple_defconfig
--- a/arch/powerpc/configs/xen_maple_defconfig  Mon Aug 07 18:27:04 2006 -0400
+++ b/arch/powerpc/configs/xen_maple_defconfig  Tue Aug 08 09:36:48 2006 -0400
@@ -1,13 +1,14 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.17
-# Wed Jul 26 14:58:48 2006
+# Tue Aug  8 09:35:08 2006
 #
 CONFIG_PPC64=y
 CONFIG_64BIT=y
 CONFIG_PPC_MERGE=y
 CONFIG_MMU=y
 CONFIG_GENERIC_HARDIRQS=y
+CONFIG_IRQ_PER_CPU=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
@@ -34,6 +35,7 @@ CONFIG_VIRT_CPU_ACCOUNTING=y
 CONFIG_VIRT_CPU_ACCOUNTING=y
 CONFIG_SMP=y
 CONFIG_NR_CPUS=32
+CONFIG_DEFCONFIG_LIST=/lib/modules/$UNAME_RELEASE/.config
 
 #
 # Code maturity level options
@@ -68,6 +70,7 @@ CONFIG_BUG=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
+CONFIG_RT_MUTEXES=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_SHMEM=y
@@ -118,6 +121,7 @@ CONFIG_PPC_MAPLE=y
 # CONFIG_PPC_CELL is not set
 # CONFIG_PPC_CELL_NATIVE is not set
 # CONFIG_PPC_IBM_CELL_BLADE is not set
+# CONFIG_UDBG_RTAS_CONSOLE is not set
 CONFIG_PPC_XEN=y
 CONFIG_XICS=y
 CONFIG_U3_DART=y
@@ -151,6 +155,7 @@ CONFIG_FORCE_MAX_ZONEORDER=13
 CONFIG_FORCE_MAX_ZONEORDER=13
 CONFIG_IOMMU_VMERGE=y
 # CONFIG_HOTPLUG_CPU is not set
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
 CONFIG_KEXEC=y
 # CONFIG_CRASH_DUMP is not set
 CONFIG_IRQ_ALL_CPUS=y
@@ -173,6 +178,7 @@ CONFIG_SPARSEMEM_EXTREME=y
 CONFIG_SPARSEMEM_EXTREME=y
 # CONFIG_MEMORY_HOTPLUG is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_RESOURCES_64BIT=y
 # CONFIG_PPC_64K_PAGES is not set
 # CONFIG_SCHED_SMT is not set
 CONFIG_PROC_DEVICETREE=y
@@ -699,6 +705,7 @@ CONFIG_VT=y
 CONFIG_VT=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
 
 #
@@ -727,6 +734,7 @@ CONFIG_HVC_CONSOLE=y
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
+CONFIG_HW_RANDOM=y
 CONFIG_GEN_RTC=y
 # CONFIG_GEN_RTC_X is not set
 # CONFIG_DTLK is not set
@@ -809,7 +817,6 @@ CONFIG_I2C_AMD8111=y
 #
 # Dallas's 1-wire bus
 #
-# CONFIG_W1 is not set
 
 #
 # Hardware Monitoring support
@@ -836,6 +843,7 @@ CONFIG_VIDEO_V4L2=y
 #
 # Graphics support
 #
+CONFIG_FIRMWARE_EDID=y
 # CONFIG_FB is not set
 
 #
@@ -1049,6 +1057,7 @@ CONFIG_INFINIBAND_IPOIB_DEBUG=y
 CONFIG_INFINIBAND_IPOIB_DEBUG=y
 CONFIG_INFINIBAND_IPOIB_DEBUG_DATA=y
 CONFIG_INFINIBAND_SRP=y
+# CONFIG_INFINIBAND_ISER is not set
 
 #
 # EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
@@ -1169,6 +1178,7 @@ CONFIG_RPCSEC_GSS_KRB5=y
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 # CONFIG_SMB_FS is not set
 # CONFIG_CIFS is not set
+# CONFIG_CIFS_DEBUG2 is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
@@ -1247,6 +1257,7 @@ CONFIG_CRC32=y
 CONFIG_CRC32=y
 # CONFIG_LIBCRC32C is not set
 CONFIG_ZLIB_INFLATE=y
+CONFIG_PLIST=y
 
 #
 # Instrumentation Support
@@ -1259,12 +1270,15 @@ CONFIG_ZLIB_INFLATE=y
 #
 # CONFIG_PRINTK_TIME is not set
 CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
 CONFIG_DEBUG_KERNEL=y
 CONFIG_LOG_BUF_SHIFT=17
 CONFIG_DETECT_SOFTLOCKUP=y
 # CONFIG_SCHEDSTATS is not set
 CONFIG_DEBUG_SLAB=y
 CONFIG_DEBUG_MUTEXES=y
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
 # CONFIG_DEBUG_SPINLOCK is not set
 CONFIG_DEBUG_SPINLOCK_SLEEP=y
 # CONFIG_DEBUG_KOBJECT is not set

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


[XenPPC] [linux-ppc-2.6] [powerpc] Use new method to detect NULL xencomm handle

2006-07-27 Thread Xen patchbot-linux-ppc-2 . 6
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 17aa29a18b080bd96286b29e7b5918701a330eff
# Parent  e30fba67c38de4e6a769f0b57bb8613d79a23f16
[powerpc] Use new method to detect NULL xencomm handle

old method wasted cycles and could give false positive.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 arch/powerpc/platforms/xen/hcall.c |5 +---
 drivers/xen/core/xencomm.c |   45 +++--
 2 files changed, 26 insertions(+), 24 deletions(-)

diff -r e30fba67c38d -r 17aa29a18b08 arch/powerpc/platforms/xen/hcall.c
--- a/arch/powerpc/platforms/xen/hcall.cWed Jul 26 15:00:06 2006 -0400
+++ b/arch/powerpc/platforms/xen/hcall.cThu Jul 27 18:57:20 2006 -0400
@@ -93,9 +93,8 @@ int HYPERVISOR_xen_version(int cmd, void
argsize = sizeof(xen_platform_parameters_t);
break;
case XENVER_pagesize:
-   argsize = sizeof(void *);
-   break;
-
+   argsize = (arg == NULL) ? 0 : sizeof(void *);
+   break;
default:
printk(%s: unknown version cmd %d\n, __func__, cmd);
return -ENOSYS;
diff -r e30fba67c38d -r 17aa29a18b08 drivers/xen/core/xencomm.c
--- a/drivers/xen/core/xencomm.cWed Jul 26 15:00:06 2006 -0400
+++ b/drivers/xen/core/xencomm.cThu Jul 27 18:57:20 2006 -0400
@@ -59,33 +59,36 @@ static int __xencomm_init(struct xencomm
unsigned long recorded = 0;
int i = 0;
 
+   BUG_ON((buffer == NULL)  (bytes  0));
+
/* record the physical pages used */
-   if (buffer) {
-   while ((recorded  bytes)  (i  desc-nr_addrs)) {
-   unsigned long vaddr = (unsigned long)buffer + recorded;
-   unsigned long paddr;
-   int offset;
-   int chunksz;
+   if (buffer == NULL)
+   desc-nr_addrs = 0;
 
-   offset = vaddr % PAGE_SIZE; /* handle partial pages */
-   chunksz = min(PAGE_SIZE - offset, bytes - recorded);
+   while ((recorded  bytes)  (i  desc-nr_addrs)) {
+   unsigned long vaddr = (unsigned long)buffer + recorded;
+   unsigned long paddr;
+   int offset;
+   int chunksz;
 
-   paddr = to_phys(vaddr);
-   if (paddr == ~0UL) {
-   printk(%s: couldn't translate vaddr %lx\n,
-  __func__, vaddr);
-   return -EINVAL;
-   }
+   offset = vaddr % PAGE_SIZE; /* handle partial pages */
+   chunksz = min(PAGE_SIZE - offset, bytes - recorded);
 
-   desc-address[i++] = paddr;
-   recorded += chunksz;
+   paddr = to_phys(vaddr);
+   if (paddr == ~0UL) {
+   printk(%s: couldn't translate vaddr %lx\n,
+  __func__, vaddr);
+   return -EINVAL;
}
 
-   if (recorded  bytes) {
-   printk(%s: could only translate %ld of %ld bytes\n,
-  __func__, recorded, bytes);
-   return -ENOSPC;
-   }
+   desc-address[i++] = paddr;
+   recorded += chunksz;
+   }
+
+   if (recorded  bytes) {
+   printk(%s: could only translate %ld of %ld bytes\n,
+  __func__, recorded, bytes);
+   return -ENOSPC;
}
 
/* mark remaining addresses invalid (just for safety) */

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