All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <20080326165304.GF20663@sgi.com>

diff --git a/a/1.txt b/N1/1.bin
similarity index 100%
rename from a/1.txt
rename to N1/1.bin
diff --git a/a/content_digest b/N1/content_digest
index 92296b8..e58292b 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -1,1577 +1,1579 @@
  "ref\020080326163823.GA25653@sgi.com\0"
  "From\0Dean Nelson <dcn@sgi.com>\0"
  "Subject\0[Patch 5/5] run drivers/misc/xp through scripts/checkpatch.pl -v2\0"
- "Date\0Wed, 26 Mar 2008 16:53:04 +0000\0"
+ "Date\0Wed, 26 Mar 2008 11:53:04 -0500\0"
  "To\0jes@sgi.com"
   tony.luck@intel.com
   linux-kernel@vger.kernel.org
  " linux-ia64@vger.kernel.org\0"
  "\00:1\0"
+ "fn\0checkpatch.pl\0"
  "b\0"
- "Addressed issues raised by scripts/checkpatch.pl. Removed unnecessary curly\n"
- "braces.  Eliminated uses of volatiles and use of kernel_thread() and\n"
- "daemonize().\n"
- "\n"
- "Signed-off-by: Dean Nelson <dcn@sgi.com>\n"
- "\n"
- "---\n"
- "\n"
- "There are still a few false positives from checkpatch.pl concerning\n"
- "WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable\n"
- "\n"
- " drivers/misc/xp/xp_main.c       |   68 ++++------\n"
- " drivers/misc/xp/xp_sn2.c        |   23 +--\n"
- " drivers/misc/xp/xp_uv.c         |    2\n"
- " drivers/misc/xp/xpc.h           |  116 ++++++++---------\n"
- " drivers/misc/xp/xpc_channel.c   |  243 +++++++++++++++---------------------\n"
- " drivers/misc/xp/xpc_main.c      |  239 ++++++++++++-----------------------\n"
- " drivers/misc/xp/xpc_partition.c |   78 ++++-------\n"
- " drivers/misc/xp/xpnet.c         |   15 --\n"
- " 8 files changed, 324 insertions(+), 460 deletions(-)\n"
- "\n"
- "Index: linux-2.6/drivers/misc/xp/xpnet.c\n"
- "===================================================================\n"
- "--- linux-2.6.orig/drivers/misc/xp/xpnet.c\t2008-03-25 07:10:15.693148179 -0500\n"
- "+++ linux-2.6/drivers/misc/xp/xpnet.c\t2008-03-25 07:10:17.729402225 -0500\n"
- "@@ -84,8 +84,8 @@ struct xpnet_message {\n"
- " #define XPNET_VERSION_MAJOR(_v)\t\t((_v) >> 4)\n"
- " #define XPNET_VERSION_MINOR(_v)\t\t((_v) & 0xf)\n"
- " \n"
- "-#define\tXPNET_VERSION _XPNET_VERSION(1,0)\t/* version 1.0 */\n"
- "-#define\tXPNET_VERSION_EMBED _XPNET_VERSION(1,1)\t/* version 1.1 */\n"
- "+#define\tXPNET_VERSION _XPNET_VERSION(1, 0)\t/* version 1.0 */\n"
- "+#define\tXPNET_VERSION_EMBED _XPNET_VERSION(1, 1)\t/* version 1.1 */\n"
- " #define XPNET_MAGIC\t0x88786984\t/* \"XNET\" */\n"
- " \n"
- " #define XPNET_VALID_MSG(_m)\t\t\t\t\t\t     \\\n"
- "@@ -571,9 +571,8 @@ xpnet_init(void)\n"
- " \tshort partid;\n"
- " \tint result = -ENOMEM;\n"
- " \n"
- "-\tif (!is_shub() && !is_uv()) {\n"
- "+\tif (!is_shub() && !is_uv())\n"
- " \t\treturn -ENODEV;\n"
- "-\t}\n"
- " \n"
- " \tdev_info(xpnet, \"registering network device %s\\n\", XPNET_DEVICE_NAME);\n"
- " \n"
- "@@ -583,9 +582,8 @@ xpnet_init(void)\n"
- " \t */\n"
- " \txpnet_device = alloc_netdev(sizeof(struct xpnet_dev_private),\n"
- " \t\t\t\t    XPNET_DEVICE_NAME, ether_setup);\n"
- "-\tif (xpnet_device == NULL) {\n"
- "+\tif (xpnet_device == NULL)\n"
- " \t\treturn -ENOMEM;\n"
- "-\t}\n"
- " \n"
- " \tnetif_carrier_off(xpnet_device);\n"
- " \n"
- "@@ -603,7 +601,7 @@ xpnet_init(void)\n"
- " \t * MAC addresses.  We chose the first octet of the MAC to be unlikely\n"
- " \t * to collide with any vendor's officially issued MAC.\n"
- " \t */\n"
- "-\txpnet_device->dev_addr[0] = 0x02;\t/* locally administered, no OUI */\n"
- "+\txpnet_device->dev_addr[0] = 0x02;     /* locally administered, no OUI */\n"
- " \n"
- " \tpartid = xp_partition_id;\n"
- " \n"
- "@@ -624,9 +622,8 @@ xpnet_init(void)\n"
- " \txpnet_device->features = NETIF_F_NO_CSUM;\n"
- " \n"
- " \tresult = register_netdev(xpnet_device);\n"
- "-\tif (result != 0) {\n"
- "+\tif (result != 0)\n"
- " \t\tfree_netdev(xpnet_device);\n"
- "-\t}\n"
- " \n"
- " \treturn result;\n"
- " }\n"
- "Index: linux-2.6/drivers/misc/xp/xpc_partition.c\n"
- "===================================================================\n"
- "--- linux-2.6.orig/drivers/misc/xp/xpc_partition.c\t2008-03-25 07:10:15.693148179 -0500\n"
- "+++ linux-2.6/drivers/misc/xp/xpc_partition.c\t2008-03-25 07:10:17.737403223 -0500\n"
- "@@ -64,19 +64,19 @@ xpc_kmalloc_cacheline_aligned(size_t siz\n"
- " {\n"
- " \t/* see if kmalloc will give us cachline aligned memory by default */\n"
- " \t*base = kmalloc(size, flags);\n"
- "-\tif (*base == NULL) {\n"
- "+\tif (*base == NULL)\n"
- " \t\treturn NULL;\n"
- "-\t}\n"
- "-\tif ((u64)*base == L1_CACHE_ALIGN((u64)*base)) {\n"
- "+\n"
- "+\tif ((u64)*base == L1_CACHE_ALIGN((u64)*base))\n"
- " \t\treturn *base;\n"
- "-\t}\n"
- "+\n"
- " \tkfree(*base);\n"
- " \n"
- " \t/* nope, we'll have to do it ourselves */\n"
- " \t*base = kmalloc(size + L1_CACHE_BYTES, flags);\n"
- "-\tif (*base == NULL) {\n"
- "+\tif (*base == NULL)\n"
- " \t\treturn NULL;\n"
- "-\t}\n"
- "+\n"
- " \treturn (void *)L1_CACHE_ALIGN((u64)*base);\n"
- " }\n"
- " \n"
- "@@ -103,9 +103,8 @@ xpc_get_rsvd_page_pa(int nasid)\n"
- " \t\t\t\"x, address=0x%016\" U64_ELL \"x len=0x%016lx\\n\", ret,\n"
- " \t\t\tcookie, rp_pa, len);\n"
- " \n"
- "-\t\tif (ret != xpNeedMoreInfo) {\n"
- "+\t\tif (ret != xpNeedMoreInfo)\n"
- " \t\t\tbreak;\n"
- "-\t\t}\n"
- " \n"
- " \t\tif (L1_CACHE_ALIGN(len) > buf_len) {\n"
- " \t\t\tkfree(buf_base);\n"
- "@@ -130,9 +129,9 @@ xpc_get_rsvd_page_pa(int nasid)\n"
- " \n"
- " \tkfree(buf_base);\n"
- " \n"
- "-\tif (ret != xpSuccess) {\n"
- "+\tif (ret != xpSuccess)\n"
- " \t\trp_pa = 0;\n"
- "-\t}\n"
- "+\n"
- " \tdev_dbg(xpc_part, \"reserved page at phys address 0x%016\" U64_ELL \"x\\n\",\n"
- " \t\trp_pa);\n"
- " \treturn rp_pa;\n"
- "@@ -195,7 +194,8 @@ xpc_rsvd_page_init(void)\n"
- " \t * that saved copy on subsequent loads of XPC. This AMO page is never\n"
- " \t * freed, and its memory protections are never restricted.\n"
- " \t */\n"
- "-\tif ((amos_page = xpc_vars->amos_page) == NULL) {\n"
- "+\tamos_page = xpc_vars->amos_page;\n"
- "+\tif (amos_page == NULL) {\n"
- " \t\tn_amos = xpc_number_of_amos(XP_NPARTITIONS);\n"
- " \t\tamos_page = xp_alloc_amos(n_amos);\n"
- " \t\tif (amos_page == NULL) {\n"
- "@@ -236,9 +236,8 @@ xpc_rsvd_page_init(void)\n"
- " \n"
- " \t/* initialize the activate IRQ related AMO variables */\n"
- " \tactivate_irq_amos = xpc_activate_irq_amos(XP_NPARTITIONS);\n"
- "-\tfor (i = 0; i < xp_nasid_mask_words(); i++) {\n"
- "+\tfor (i = 0; i < xp_nasid_mask_words(); i++)\n"
- " \t\t(void)xpc_IPI_init(activate_irq_amos + i);\n"
- "-\t}\n"
- " \n"
- " \t/* initialize the engaged remote partitions related AMO variables */\n"
- " \tengaged_partitions_amos = xpc_engaged_partitions_amos(XP_NPARTITIONS);\n"
- "@@ -276,13 +275,11 @@ xpc_check_remote_hb(void)\n"
- " \n"
- " \tfor (partid = XP_MIN_PARTID; partid <= XP_MAX_PARTID; partid++) {\n"
- " \n"
- "-\t\tif (xpc_exiting) {\n"
- "+\t\tif (xpc_exiting)\n"
- " \t\t\tbreak;\n"
- "-\t\t}\n"
- " \n"
- "-\t\tif (partid == xp_partition_id) {\n"
- "+\t\tif (partid == xp_partition_id)\n"
- " \t\t\tcontinue;\n"
- "-\t\t}\n"
- " \n"
- " \t\tpart = &xpc_partitions[partid];\n"
- " \n"
- "@@ -335,23 +332,20 @@ xpc_get_remote_rp(int nasid, u64 *discov\n"
- " \t/* get the reserved page's physical address */\n"
- " \n"
- " \t*remote_rp_pa = xpc_get_rsvd_page_pa(nasid);\n"
- "-\tif (*remote_rp_pa == 0) {\n"
- "+\tif (*remote_rp_pa == 0)\n"
- " \t\treturn xpNoRsvdPageAddr;\n"
- "-\t}\n"
- " \n"
- " \t/* pull over the reserved page header and part_nasids mask */\n"
- " \tret = xp_remote_memcpy(remote_rp, (void *)*remote_rp_pa,\n"
- " \t\t\t       XPC_RP_HEADER_SIZE + xp_sizeof_nasid_mask);\n"
- "-\tif (ret != xpSuccess) {\n"
- "+\tif (ret != xpSuccess)\n"
- " \t\treturn ret;\n"
- "-\t}\n"
- " \n"
- " \tif (discovered_nasids != NULL) {\n"
- " \t\tu64 *remote_part_nasids = XPC_RP_PART_NASIDS(remote_rp);\n"
- " \n"
- "-\t\tfor (i = 0; i < xp_nasid_mask_words(); i++) {\n"
- "+\t\tfor (i = 0; i < xp_nasid_mask_words(); i++)\n"
- " \t\t\tdiscovered_nasids[i] |= remote_part_nasids[i];\n"
- "-\t\t}\n"
- " \t}\n"
- " \n"
- " \tif (XPC_VERSION_MAJOR(remote_rp->version) !=\n"
- "@@ -373,16 +367,14 @@ xpc_get_remote_vars(u64 remote_vars_pa, \n"
- " {\n"
- " \tenum xp_retval ret;\n"
- " \n"
- "-\tif (remote_vars_pa == 0) {\n"
- "+\tif (remote_vars_pa == 0)\n"
- " \t\treturn xpVarsNotSet;\n"
- "-\t}\n"
- " \n"
- " \t/* pull over the cross partition variables */\n"
- " \tret = xp_remote_memcpy(remote_vars, (void *)remote_vars_pa,\n"
- " \t\t\t       XPC_RP_VARS_SIZE);\n"
- "-\tif (ret != xpSuccess) {\n"
- "+\tif (ret != xpSuccess)\n"
- " \t\treturn ret;\n"
- "-\t}\n"
- " \n"
- " \tif (XPC_VERSION_MAJOR(remote_vars->version) !=\n"
- " \t    XPC_VERSION_MAJOR(XPC_V_VERSION)) {\n"
- "@@ -391,8 +383,9 @@ xpc_get_remote_vars(u64 remote_vars_pa, \n"
- " \n"
- " \t/* check that the partid is for another partition */\n"
- " \tif (remote_vars->partid < XP_MIN_PARTID ||\n"
- "-\t    remote_vars->partid > XP_MAX_PARTID)\n"
- "+\t    remote_vars->partid > XP_MAX_PARTID) {\n"
- " \t\treturn xpInvalidPartid;\n"
- "+\t}\n"
- " \tif (remote_vars->partid == xp_partition_id)\n"
- " \t\treturn xpLocalPartid;\n"
- " \n"
- "@@ -494,9 +487,8 @@ xpc_identify_act_IRQ_req(int nasid)\n"
- " \n"
- " \tremote_vars_pa = remote_rp->vars_pa;\n"
- " \tremote_rp_version = remote_rp->version;\n"
- "-\tif (XPC_SUPPORTS_RP_STAMP(remote_rp_version)) {\n"
- "+\tif (XPC_SUPPORTS_RP_STAMP(remote_rp_version))\n"
- " \t\tremote_rp_stamp = remote_rp->stamp;\n"
- "-\t}\n"
- " \n"
- " \t/* pull over the cross partition variables */\n"
- " \n"
- "@@ -656,9 +648,8 @@ xpc_identify_act_IRQ_sender(void)\n"
- " \t/* scan through activation AMO variables looking for non-zero entries */\n"
- " \tfor (w_index = 0; w_index < xp_nasid_mask_words(); w_index++) {\n"
- " \n"
- "-\t\tif (xpc_exiting) {\n"
- "+\t\tif (xpc_exiting)\n"
- " \t\t\tbreak;\n"
- "-\t\t}\n"
- " \n"
- " \t\tret = xp_get_amo(amo_va, XP_AMO_CLEAR, &nasid_mask);\n"
- " \t\tBUG_ON(ret != xpSuccess);\t/* should never happen */\n"
- "@@ -733,13 +724,11 @@ xpc_partition_disengaged(struct xpc_part\n"
- " \n"
- " \t\tDBUG_ON(part->act_state != XPC_P_AS_DEACTIVATING &&\n"
- " \t\t\tpart->act_state != XPC_P_AS_INACTIVE);\n"
- "-\t\tif (part->act_state != XPC_P_AS_INACTIVE) {\n"
- "+\t\tif (part->act_state != XPC_P_AS_INACTIVE)\n"
- " \t\t\txpc_wakeup_channel_mgr(part);\n"
- "-\t\t}\n"
- " \n"
- "-\t\tif (XPC_SUPPORTS_DISENGAGE_REQUEST(part->remote_vars_version)) {\n"
- "+\t\tif (XPC_SUPPORTS_DISENGAGE_REQUEST(part->remote_vars_version))\n"
- " \t\t\txpc_cancel_partition_disengage_request(part);\n"
- "-\t\t}\n"
- " \t}\n"
- " \treturn disengaged;\n"
- " }\n"
- "@@ -912,9 +901,9 @@ xpc_discovery(void)\n"
- " \tremote_rp = xpc_kmalloc_cacheline_aligned(XPC_RP_HEADER_SIZE +\n"
- " \t\t\t\t\t\t  xp_sizeof_nasid_mask,\n"
- " \t\t\t\t\t\t  GFP_KERNEL, &remote_rp_base);\n"
- "-\tif (remote_rp == NULL) {\n"
- "+\tif (remote_rp == NULL)\n"
- " \t\treturn;\n"
- "-\t}\n"
- "+\n"
- " \tremote_vars = (struct xpc_vars *)remote_rp;\n"
- " \n"
- " \tdiscovered_nasids = kzalloc(sizeof(u64) * xp_nasid_mask_words(),\n"
- "@@ -947,18 +936,16 @@ xpc_discovery(void)\n"
- " \n"
- " \tfor (region = 0; region < max_regions; region++) {\n"
- " \n"
- "-\t\tif ((volatile int)xpc_exiting) {\n"
- "+\t\tif (xpc_exiting)\n"
- " \t\t\tbreak;\n"
- "-\t\t}\n"
- " \n"
- " \t\tdev_dbg(xpc_part, \"searching region %d\\n\", region);\n"
- " \n"
- " \t\tfor (nasid = (region * region_size * 2);\n"
- " \t\t     nasid < ((region + 1) * region_size * 2); nasid += 2) {\n"
- " \n"
- "-\t\t\tif ((volatile int)xpc_exiting) {\n"
- "+\t\t\tif (xpc_exiting)\n"
- " \t\t\t\tbreak;\n"
- "-\t\t\t}\n"
- " \n"
- " \t\t\tdev_dbg(xpc_part, \"checking nasid %d\\n\", nasid);\n"
- " \n"
- "@@ -1027,8 +1014,8 @@ xpc_discovery(void)\n"
- " \t\t\tret = xpc_register_remote_amos(part);\n"
- " \t\t\tif (ret != xpSuccess) {\n"
- " \t\t\t\tdev_warn(xpc_part, \"xpc_discovery() failed to \"\n"
- "-\t\t\t\t\t \"register remote AMOs for partition %d,\"\n"
- "-\t\t\t\t\t \"ret=%d\\n\", partid, ret);\n"
- "+\t\t\t\t\t \"register remote AMOs for partition %d\"\n"
- "+\t\t\t\t\t \", ret=%d\\n\", partid, ret);\n"
- " \n"
- " \t\t\t\tXPC_SET_REASON(part, xpPhysAddrRegFailed,\n"
- " \t\t\t\t\t       __LINE__);\n"
- "@@ -1072,9 +1059,8 @@ xpc_initiate_partid_to_nasids(short part\n"
- " \tu64 part_nasid_pa;\n"
- " \n"
- " \tpart = &xpc_partitions[partid];\n"
- "-\tif (part->remote_rp_pa == 0) {\n"
- "+\tif (part->remote_rp_pa == 0)\n"
- " \t\treturn xpPartitionDown;\n"
- "-\t}\n"
- " \n"
- " \tmemset(nasid_mask, 0, xp_sizeof_nasid_mask);\n"
- " \n"
- "Index: linux-2.6/drivers/misc/xp/xpc_channel.c\n"
- "===================================================================\n"
- "--- linux-2.6.orig/drivers/misc/xp/xpc_channel.c\t2008-03-25 07:10:15.693148179 -0500\n"
- "+++ linux-2.6/drivers/misc/xp/xpc_channel.c\t2008-03-25 13:34:50.777575812 -0500\n"
- "@@ -24,7 +24,7 @@\n"
- " #include \"xpc.h\"\n"
- " \n"
- " #ifdef CONFIG_X86_64\n"
- "-#define cmpxchg_rel(ptr,o,n)\tcmpxchg(ptr,o,n)\n"
- "+#define cmpxchg_rel(ptr, o, n)\tcmpxchg(ptr, o, n)\n"
- " #endif\n"
- " \n"
- " /*\n"
- "@@ -35,19 +35,19 @@ xpc_kzalloc_cacheline_aligned(size_t siz\n"
- " {\n"
- " \t/* see if kzalloc will give us cachline aligned memory by default */\n"
- " \t*base = kzalloc(size, flags);\n"
- "-\tif (*base == NULL) {\n"
- "+\tif (*base == NULL)\n"
- " \t\treturn NULL;\n"
- "-\t}\n"
- "-\tif ((u64)*base == L1_CACHE_ALIGN((u64)*base)) {\n"
- "+\n"
- "+\tif ((u64)*base == L1_CACHE_ALIGN((u64)*base))\n"
- " \t\treturn *base;\n"
- "-\t}\n"
- "+\n"
- " \tkfree(*base);\n"
- " \n"
- " \t/* nope, we'll have to do it ourselves */\n"
- " \t*base = kzalloc(size + L1_CACHE_BYTES, flags);\n"
- "-\tif (*base == NULL) {\n"
- "+\tif (*base == NULL)\n"
- " \t\treturn NULL;\n"
- "-\t}\n"
- "+\n"
- " \treturn (void *)L1_CACHE_ALIGN((u64)*base);\n"
- " }\n"
- " \n"
- "@@ -98,6 +98,7 @@ xpc_setup_infrastructure(struct xpc_part\n"
- " \tint ret, cpuid;\n"
- " \tstruct timer_list *timer;\n"
- " \tshort partid = XPC_PARTID(part);\n"
- "+\tenum xp_retval retval;\n"
- " \n"
- " \t/*\n"
- " \t * Zero out MOST of the entry for this partition. Only the fields\n"
- "@@ -127,11 +128,10 @@ xpc_setup_infrastructure(struct xpc_part\n"
- " \t\t\t\t\t\t\tGFP_KERNEL,\n"
- " \t\t\t\t\t\t\t&part->local_GPs_base);\n"
- " \tif (part->local_GPs == NULL) {\n"
- "-\t\tkfree(part->channels);\n"
- "-\t\tpart->channels = NULL;\n"
- " \t\tdev_err(xpc_chan, \"can't get memory for local get/put \"\n"
- " \t\t\t\"values\\n\");\n"
- "-\t\treturn xpNoMemory;\n"
- "+\t\tretval = xpNoMemory;\n"
- "+\t\tgoto out_1;\n"
- " \t}\n"
- " \n"
- " \tpart->remote_GPs = xpc_kzalloc_cacheline_aligned(XPC_GP_SIZE,\n"
- "@@ -141,11 +141,8 @@ xpc_setup_infrastructure(struct xpc_part\n"
- " \tif (part->remote_GPs == NULL) {\n"
- " \t\tdev_err(xpc_chan, \"can't get memory for remote get/put \"\n"
- " \t\t\t\"values\\n\");\n"
- "-\t\tkfree(part->local_GPs_base);\n"
- "-\t\tpart->local_GPs = NULL;\n"
- "-\t\tkfree(part->channels);\n"
- "-\t\tpart->channels = NULL;\n"
- "-\t\treturn xpNoMemory;\n"
- "+\t\tretval = xpNoMemory;\n"
- "+\t\tgoto out_2;\n"
- " \t}\n"
- " \n"
- " \t/* allocate all the required open and close args */\n"
- "@@ -155,13 +152,8 @@ xpc_setup_infrastructure(struct xpc_part\n"
- " \t\t\t\t\t  &part->local_openclose_args_base);\n"
- " \tif (part->local_openclose_args == NULL) {\n"
- " \t\tdev_err(xpc_chan, \"can't get memory for local connect args\\n\");\n"
- "-\t\tkfree(part->remote_GPs_base);\n"
- "-\t\tpart->remote_GPs = NULL;\n"
- "-\t\tkfree(part->local_GPs_base);\n"
- "-\t\tpart->local_GPs = NULL;\n"
- "-\t\tkfree(part->channels);\n"
- "-\t\tpart->channels = NULL;\n"
- "-\t\treturn xpNoMemory;\n"
- "+\t\tretval = xpNoMemory;\n"
- "+\t\tgoto out_3;\n"
- " \t}\n"
- " \n"
- " \tpart->remote_openclose_args =\n"
- "@@ -169,15 +161,8 @@ xpc_setup_infrastructure(struct xpc_part\n"
- " \t\t\t\t\t  &part->remote_openclose_args_base);\n"
- " \tif (part->remote_openclose_args == NULL) {\n"
- " \t\tdev_err(xpc_chan, \"can't get memory for remote connect args\\n\");\n"
- "-\t\tkfree(part->local_openclose_args_base);\n"
- "-\t\tpart->local_openclose_args = NULL;\n"
- "-\t\tkfree(part->remote_GPs_base);\n"
- "-\t\tpart->remote_GPs = NULL;\n"
- "-\t\tkfree(part->local_GPs_base);\n"
- "-\t\tpart->local_GPs = NULL;\n"
- "-\t\tkfree(part->channels);\n"
- "-\t\tpart->channels = NULL;\n"
- "-\t\treturn xpNoMemory;\n"
- "+\t\tretval = xpNoMemory;\n"
- "+\t\tgoto out_4;\n"
- " \t}\n"
- " \n"
- " \txpc_initialize_channels(part, partid);\n"
- "@@ -201,17 +186,8 @@ xpc_setup_infrastructure(struct xpc_part\n"
- " \tif (ret != 0) {\n"
- " \t\tdev_err(xpc_chan, \"can't register NOTIFY IRQ handler, \"\n"
- " \t\t\t\"errno=%d\\n\", -ret);\n"
- "-\t\tkfree(part->remote_openclose_args_base);\n"
- "-\t\tpart->remote_openclose_args = NULL;\n"
- "-\t\tkfree(part->local_openclose_args_base);\n"
- "-\t\tpart->local_openclose_args = NULL;\n"
- "-\t\tkfree(part->remote_GPs_base);\n"
- "-\t\tpart->remote_GPs = NULL;\n"
- "-\t\tkfree(part->local_GPs_base);\n"
- "-\t\tpart->local_GPs = NULL;\n"
- "-\t\tkfree(part->channels);\n"
- "-\t\tpart->channels = NULL;\n"
- "-\t\treturn xpLackOfResources;\n"
- "+\t\tretval = xpLackOfResources;\n"
- "+\t\tgoto out_5;\n"
- " \t}\n"
- " \n"
- " \t/* Setup a timer to check for dropped IPIs */\n"
- "@@ -246,6 +222,25 @@ xpc_setup_infrastructure(struct xpc_part\n"
- " \txpc_vars_part[partid].magic = XPC_VP_MAGIC1;\n"
- " \n"
- " \treturn xpSuccess;\n"
- "+\n"
- "+\t/* setup of infrastructure failed */\n"
- "+out_5:\n"
- "+\tkfree(part->remote_openclose_args_base);\n"
- "+\tpart->remote_openclose_args = NULL;\n"
- "+out_4:\n"
- "+\tkfree(part->local_openclose_args_base);\n"
- "+\tpart->local_openclose_args = NULL;\n"
- "+out_3:\n"
- "+\tkfree(part->remote_GPs_base);\n"
- "+\tpart->remote_GPs = NULL;\n"
- "+out_2:\n"
- "+\tkfree(part->local_GPs_base);\n"
- "+\tpart->local_GPs = NULL;\n"
- "+out_1:\n"
- "+\tkfree(part->channels);\n"
- "+\tpart->channels = NULL;\n"
- "+\n"
- "+\treturn retval;\n"
- " }\n"
- " \n"
- " /*\n"
- "@@ -266,9 +261,8 @@ xpc_pull_remote_cachelines(struct xpc_pa\n"
- " \tDBUG_ON((u64)dst != L1_CACHE_ALIGN((u64)dst));\n"
- " \tDBUG_ON(cnt != L1_CACHE_ALIGN(cnt));\n"
- " \n"
- "-\tif (part->act_state == XPC_P_AS_DEACTIVATING) {\n"
- "+\tif (part->act_state == XPC_P_AS_DEACTIVATING)\n"
- " \t\treturn part->reason;\n"
- "-\t}\n"
- " \n"
- " \tret = xp_remote_memcpy(dst, src, cnt);\n"
- " \tif (ret != xpSuccess) {\n"
- "@@ -358,18 +352,16 @@ xpc_pull_remote_vars_part(struct xpc_par\n"
- " \t\tpart->remote_IPI_nasid = pulled_entry->IPI_nasid;\n"
- " \t\tpart->remote_IPI_phys_cpuid = pulled_entry->IPI_phys_cpuid;\n"
- " \n"
- "-\t\tif (part->nchannels > pulled_entry->nchannels) {\n"
- "+\t\tif (part->nchannels > pulled_entry->nchannels)\n"
- " \t\t\tpart->nchannels = pulled_entry->nchannels;\n"
- "-\t\t}\n"
- " \n"
- " \t\t/* let the other side know that we've pulled their variables */\n"
- " \n"
- " \t\txpc_vars_part[partid].magic = XPC_VP_MAGIC2;\n"
- " \t}\n"
- " \n"
- "-\tif (pulled_entry->magic == XPC_VP_MAGIC1) {\n"
- "+\tif (pulled_entry->magic == XPC_VP_MAGIC1)\n"
- " \t\treturn xpRetry;\n"
- "-\t}\n"
- " \n"
- " \treturn xpSuccess;\n"
- " }\n"
- "@@ -389,9 +381,10 @@ xpc_get_IPI_flags(struct xpc_partition *\n"
- " \t */\n"
- " \n"
- " \tspin_lock_irqsave(&part->IPI_lock, irq_flags);\n"
- "-\tif ((IPI_amo = part->local_IPI_amo) != 0) {\n"
- "+\tIPI_amo = part->local_IPI_amo;\n"
- "+\tif (IPI_amo != 0)\n"
- " \t\tpart->local_IPI_amo = 0;\n"
- "-\t}\n"
- "+\n"
- " \tspin_unlock_irqrestore(&part->IPI_lock, irq_flags);\n"
- " \n"
- " \tif (XPC_ANY_OPENCLOSE_IPI_FLAGS_SET(IPI_amo)) {\n"
- "@@ -445,11 +438,9 @@ xpc_allocate_local_msgqueue(struct xpc_c\n"
- " \t\tnbytes = nentries * ch->msg_size;\n"
- " \t\tch->local_msgqueue = xpc_kzalloc_cacheline_aligned(nbytes,\n"
- " \t\t\t\t\t\t\t\t   GFP_KERNEL,\n"
- "-\t\t\t\t\t\t\t\t   &ch->\n"
- "-\t\t\t\t\t\t\t\t   local_msgqueue_base);\n"
- "-\t\tif (ch->local_msgqueue == NULL) {\n"
- "+\t\t\t\t\t\t      &ch->local_msgqueue_base);\n"
- "+\t\tif (ch->local_msgqueue == NULL)\n"
- " \t\t\tcontinue;\n"
- "-\t\t}\n"
- " \n"
- " \t\tnbytes = nentries * sizeof(struct xpc_notify);\n"
- " \t\tch->notify_queue = kzalloc(nbytes, GFP_KERNEL);\n"
- "@@ -493,11 +484,9 @@ xpc_allocate_remote_msgqueue(struct xpc_\n"
- " \t\tnbytes = nentries * ch->msg_size;\n"
- " \t\tch->remote_msgqueue = xpc_kzalloc_cacheline_aligned(nbytes,\n"
- " \t\t\t\t\t\t\t\t    GFP_KERNEL,\n"
- "-\t\t\t\t\t\t\t\t    &ch->\n"
- "-\t\t\t\t\t\t\t\t    remote_msgqueue_base);\n"
- "-\t\tif (ch->remote_msgqueue == NULL) {\n"
- "+\t\t\t\t\t\t     &ch->remote_msgqueue_base);\n"
- "+\t\tif (ch->remote_msgqueue == NULL)\n"
- " \t\t\tcontinue;\n"
- "-\t\t}\n"
- " \n"
- " \t\tspin_lock_irqsave(&ch->lock, irq_flags);\n"
- " \t\tif (nentries < ch->remote_nentries) {\n"
- "@@ -529,11 +518,12 @@ xpc_allocate_msgqueues(struct xpc_channe\n"
- " \n"
- " \tDBUG_ON(ch->flags & XPC_C_SETUP);\n"
- " \n"
- "-\tif ((ret = xpc_allocate_local_msgqueue(ch)) != xpSuccess) {\n"
- "+\tret = xpc_allocate_local_msgqueue(ch);\n"
- "+\tif (ret != xpSuccess)\n"
- " \t\treturn ret;\n"
- "-\t}\n"
- " \n"
- "-\tif ((ret = xpc_allocate_remote_msgqueue(ch)) != xpSuccess) {\n"
- "+\tret = xpc_allocate_remote_msgqueue(ch);\n"
- "+\tif (ret != xpSuccess) {\n"
- " \t\tkfree(ch->local_msgqueue_base);\n"
- " \t\tch->local_msgqueue = NULL;\n"
- " \t\tkfree(ch->notify_queue);\n"
- "@@ -573,12 +563,11 @@ xpc_process_connect(struct xpc_channel *\n"
- " \t\tret = xpc_allocate_msgqueues(ch);\n"
- " \t\tspin_lock_irqsave(&ch->lock, *irq_flags);\n"
- " \n"
- "-\t\tif (ret != xpSuccess) {\n"
- "+\t\tif (ret != xpSuccess)\n"
- " \t\t\tXPC_DISCONNECT_CHANNEL(ch, ret, irq_flags);\n"
- "-\t\t}\n"
- "-\t\tif (ch->flags & (XPC_C_CONNECTED | XPC_C_DISCONNECTING)) {\n"
- "+\n"
- "+\t\tif (ch->flags & (XPC_C_CONNECTED | XPC_C_DISCONNECTING))\n"
- " \t\t\treturn;\n"
- "-\t\t}\n"
- " \n"
- " \t\tDBUG_ON(!(ch->flags & XPC_C_SETUP));\n"
- " \t\tDBUG_ON(ch->local_msgqueue == NULL);\n"
- "@@ -590,9 +579,8 @@ xpc_process_connect(struct xpc_channel *\n"
- " \t\txpc_IPI_send_openreply(ch, irq_flags);\n"
- " \t}\n"
- " \n"
- "-\tif (!(ch->flags & XPC_C_ROPENREPLY)) {\n"
- "+\tif (!(ch->flags & XPC_C_ROPENREPLY))\n"
- " \t\treturn;\n"
- "-\t}\n"
- " \n"
- " \tDBUG_ON(ch->remote_msgqueue_pa == 0);\n"
- " \n"
- "@@ -711,9 +699,8 @@ xpc_process_disconnect(struct xpc_channe\n"
- " \n"
- " \tDBUG_ON(!spin_is_locked(&ch->lock));\n"
- " \n"
- "-\tif (!(ch->flags & XPC_C_DISCONNECTING)) {\n"
- "+\tif (!(ch->flags & XPC_C_DISCONNECTING))\n"
- " \t\treturn;\n"
- "-\t}\n"
- " \n"
- " \tDBUG_ON(!(ch->flags & XPC_C_CLOSEREQUEST));\n"
- " \n"
- "@@ -728,26 +715,23 @@ xpc_process_disconnect(struct xpc_channe\n"
- " \n"
- " \tif (part->act_state == XPC_P_AS_DEACTIVATING) {\n"
- " \t\t/* can't proceed until the other side disengages from us */\n"
- "-\t\tif (xpc_partition_engaged(ch->partid)) {\n"
- "+\t\tif (xpc_partition_engaged(ch->partid))\n"
- " \t\t\treturn;\n"
- "-\t\t}\n"
- " \n"
- " \t} else {\n"
- " \n"
- " \t\t/* as long as the other side is up do the full protocol */\n"
- " \n"
- "-\t\tif (!(ch->flags & XPC_C_RCLOSEREQUEST)) {\n"
- "+\t\tif (!(ch->flags & XPC_C_RCLOSEREQUEST))\n"
- " \t\t\treturn;\n"
- "-\t\t}\n"
- " \n"
- " \t\tif (!(ch->flags & XPC_C_CLOSEREPLY)) {\n"
- " \t\t\tch->flags |= XPC_C_CLOSEREPLY;\n"
- " \t\t\txpc_IPI_send_closereply(ch, irq_flags);\n"
- " \t\t}\n"
- " \n"
- "-\t\tif (!(ch->flags & XPC_C_RCLOSEREPLY)) {\n"
- "+\t\tif (!(ch->flags & XPC_C_RCLOSEREPLY))\n"
- " \t\t\treturn;\n"
- "-\t\t}\n"
- " \t}\n"
- " \n"
- " \t/* wake those waiting for notify completion */\n"
- "@@ -807,9 +791,10 @@ xpc_process_openclose_IPI(struct xpc_par\n"
- " \n"
- " \tspin_lock_irqsave(&ch->lock, irq_flags);\n"
- " \n"
- "-      again:\n"
- "+again:\n"
- " \n"
- "-\tif ((ch->flags & XPC_C_DISCONNECTED) && (ch->flags & XPC_C_WDISCONNECT)) {\n"
- "+\tif ((ch->flags & XPC_C_DISCONNECTED) &&\n"
- "+\t    (ch->flags & XPC_C_WDISCONNECT)) {\n"
- " \t\t/*\n"
- " \t\t * Delay processing IPI flags until thread waiting disconnect\n"
- " \t\t * has had a chance to see that the channel is disconnected.\n"
- "@@ -882,11 +867,10 @@ xpc_process_openclose_IPI(struct xpc_par\n"
- " \n"
- " \t\tif (!(ch->flags & XPC_C_DISCONNECTING)) {\n"
- " \t\t\treason = args->reason;\n"
- "-\t\t\tif (reason <= xpSuccess || reason > xpUnknownReason) {\n"
- "+\t\t\tif (reason <= xpSuccess || reason > xpUnknownReason)\n"
- " \t\t\t\treason = xpUnknownReason;\n"
- "-\t\t\t} else if (reason == xpUnregistering) {\n"
- "+\t\t\telse if (reason == xpUnregistering)\n"
- " \t\t\t\treason = xpOtherUnregistering;\n"
- "-\t\t\t}\n"
- " \n"
- " \t\t\tXPC_DISCONNECT_CHANNEL(ch, reason, &irq_flags);\n"
- " \n"
- "@@ -1060,9 +1044,8 @@ xpc_connect_channel(struct xpc_channel *\n"
- " \tunsigned long irq_flags;\n"
- " \tstruct xpc_registration *registration = &xpc_registrations[ch->number];\n"
- " \n"
- "-\tif (mutex_trylock(&registration->mutex) == 0) {\n"
- "+\tif (mutex_trylock(&registration->mutex) == 0)\n"
- " \t\treturn xpRetry;\n"
- "-\t}\n"
- " \n"
- " \tif (!XPC_CHANNEL_REGISTERED(ch->number)) {\n"
- " \t\tmutex_unlock(&registration->mutex);\n"
- "@@ -1151,7 +1134,7 @@ xpc_clear_local_msgqueue_flags(struct xp\n"
- " \t\t\t\t\t (get % ch->local_nentries) *\n"
- " \t\t\t\t\t ch->msg_size);\n"
- " \t\tmsg->flags = 0;\n"
- "-\t} while (++get < (volatile s64)ch->remote_GP.get);\n"
- "+\t} while (++get < ch->remote_GP.get);\n"
- " }\n"
- " \n"
- " /*\n"
- "@@ -1169,7 +1152,7 @@ xpc_clear_remote_msgqueue_flags(struct x\n"
- " \t\t\t\t\t (put % ch->remote_nentries) *\n"
- " \t\t\t\t\t ch->msg_size);\n"
- " \t\tmsg->flags = 0;\n"
- "-\t} while (++put < (volatile s64)ch->remote_GP.put);\n"
- "+\t} while (++put < ch->remote_GP.put);\n"
- " }\n"
- " \n"
- " static void\n"
- "@@ -1236,9 +1219,8 @@ xpc_process_msg_IPI(struct xpc_partition\n"
- " \t\t * If anyone was waiting for message queue entries to become\n"
- " \t\t * available, wake them up.\n"
- " \t\t */\n"
- "-\t\tif (atomic_read(&ch->n_on_msg_allocate_wq) > 0) {\n"
- "+\t\tif (atomic_read(&ch->n_on_msg_allocate_wq) > 0)\n"
- " \t\t\twake_up(&ch->msg_allocate_wq);\n"
- "-\t\t}\n"
- " \t}\n"
- " \n"
- " \t/*\n"
- "@@ -1265,9 +1247,8 @@ xpc_process_msg_IPI(struct xpc_partition\n"
- " \t\t\t\t\"delivered=%d, partid=%d, channel=%d\\n\",\n"
- " \t\t\t\tnmsgs_sent, ch->partid, ch->number);\n"
- " \n"
- "-\t\t\tif (ch->flags & XPC_C_CONNECTEDCALLOUT_MADE) {\n"
- "+\t\t\tif (ch->flags & XPC_C_CONNECTEDCALLOUT_MADE)\n"
- " \t\t\t\txpc_activate_kthreads(ch, nmsgs_sent);\n"
- "-\t\t\t}\n"
- " \t\t}\n"
- " \t}\n"
- " \n"
- "@@ -1302,9 +1283,8 @@ xpc_process_channel_activity(struct xpc_\n"
- " \n"
- " \t\tIPI_flags = XPC_GET_IPI_FLAGS(IPI_amo, ch_number);\n"
- " \n"
- "-\t\tif (XPC_ANY_OPENCLOSE_IPI_FLAGS_SET(IPI_flags)) {\n"
- "+\t\tif (XPC_ANY_OPENCLOSE_IPI_FLAGS_SET(IPI_flags))\n"
- " \t\t\txpc_process_openclose_IPI(part, ch_number, IPI_flags);\n"
- "-\t\t}\n"
- " \n"
- " \t\tch_flags = ch->flags;\t/* need an atomic snapshot of flags */\n"
- " \n"
- "@@ -1315,9 +1295,8 @@ xpc_process_channel_activity(struct xpc_\n"
- " \t\t\tcontinue;\n"
- " \t\t}\n"
- " \n"
- "-\t\tif (part->act_state == XPC_P_AS_DEACTIVATING) {\n"
- "+\t\tif (part->act_state == XPC_P_AS_DEACTIVATING)\n"
- " \t\t\tcontinue;\n"
- "-\t\t}\n"
- " \n"
- " \t\tif (!(ch_flags & XPC_C_CONNECTED)) {\n"
- " \t\t\tif (!(ch_flags & XPC_C_OPENREQUEST)) {\n"
- "@@ -1337,9 +1316,8 @@ xpc_process_channel_activity(struct xpc_\n"
- " \t\t * from the other partition.\n"
- " \t\t */\n"
- " \n"
- "-\t\tif (XPC_ANY_MSG_IPI_FLAGS_SET(IPI_flags)) {\n"
- "+\t\tif (XPC_ANY_MSG_IPI_FLAGS_SET(IPI_flags))\n"
- " \t\t\txpc_process_msg_IPI(part, ch_number);\n"
- "-\t\t}\n"
- " \t}\n"
- " }\n"
- " \n"
- "@@ -1552,9 +1530,9 @@ xpc_disconnect_channel(const int line, s\n"
- " \n"
- " \tDBUG_ON(!spin_is_locked(&ch->lock));\n"
- " \n"
- "-\tif (ch->flags & (XPC_C_DISCONNECTING | XPC_C_DISCONNECTED)) {\n"
- "+\tif (ch->flags & (XPC_C_DISCONNECTING | XPC_C_DISCONNECTED))\n"
- " \t\treturn;\n"
- "-\t}\n"
- "+\n"
- " \tDBUG_ON(!(ch->flags & (XPC_C_CONNECTING | XPC_C_CONNECTED)));\n"
- " \n"
- " \tdev_dbg(xpc_chan, \"reason=%d, line=%d, partid=%d, channel=%d\\n\",\n"
- "@@ -1570,9 +1548,8 @@ xpc_disconnect_channel(const int line, s\n"
- " \n"
- " \txpc_IPI_send_closerequest(ch, irq_flags);\n"
- " \n"
- "-\tif (channel_was_connected) {\n"
- "+\tif (channel_was_connected)\n"
- " \t\tch->flags |= XPC_C_WASCONNECTED;\n"
- "-\t}\n"
- " \n"
- " \tspin_unlock_irqrestore(&ch->lock, *irq_flags);\n"
- " \n"
- "@@ -1587,9 +1564,8 @@ xpc_disconnect_channel(const int line, s\n"
- " \t}\n"
- " \n"
- " \t/* wake those waiting to allocate an entry from the local msg queue */\n"
- "-\tif (atomic_read(&ch->n_on_msg_allocate_wq) > 0) {\n"
- "+\tif (atomic_read(&ch->n_on_msg_allocate_wq) > 0)\n"
- " \t\twake_up(&ch->msg_allocate_wq);\n"
- "-\t}\n"
- " \n"
- " \tspin_lock_irqsave(&ch->lock, *irq_flags);\n"
- " }\n"
- "@@ -1677,9 +1653,9 @@ xpc_allocate_msg(struct xpc_channel *ch,\n"
- " \n"
- " \twhile (1) {\n"
- " \n"
- "-\t\tput = (volatile s64)ch->w_local_GP.put;\n"
- "-\t\tif (put - (volatile s64)ch->w_remote_GP.get <\n"
- "-\t\t    ch->local_nentries) {\n"
- "+\t\tput = ch->w_local_GP.put;\n"
- "+\t\trmb();\t/* guarantee that .put loads before .get */\n"
- "+\t\tif (put - ch->w_remote_GP.get < ch->local_nentries) {\n"
- " \n"
- " \t\t\t/* There are available message entries. We need to try\n"
- " \t\t\t * to secure one for ourselves. We'll do this by trying\n"
- "@@ -1703,9 +1679,8 @@ xpc_allocate_msg(struct xpc_channel *ch,\n"
- " \t\t * that will cause the IPI handler to fetch the latest\n"
- " \t\t * GP values as if an IPI was sent by the other side.\n"
- " \t\t */\n"
- "-\t\tif (ret == xpTimeout) {\n"
- "+\t\tif (ret == xpTimeout)\n"
- " \t\t\txpc_IPI_send_local_msgrequest(ch);\n"
- "-\t\t}\n"
- " \n"
- " \t\tif (flags & XPC_NOWAIT) {\n"
- " \t\t\txpc_msgqueue_deref(ch);\n"
- "@@ -1764,9 +1739,8 @@ xpc_initiate_allocate(short partid, int \n"
- " \t\tret = xpc_allocate_msg(&part->channels[ch_number], flags, &msg);\n"
- " \t\txpc_part_deref(part);\n"
- " \n"
- "-\t\tif (msg != NULL) {\n"
- "+\t\tif (msg != NULL)\n"
- " \t\t\t*payload = &msg->payload;\n"
- "-\t\t}\n"
- " \t}\n"
- " \n"
- " \treturn ret;\n"
- "@@ -1787,17 +1761,15 @@ xpc_send_msgs(struct xpc_channel *ch, s6\n"
- " \twhile (1) {\n"
- " \n"
- " \t\twhile (1) {\n"
- "-\t\t\tif (put == (volatile s64)ch->w_local_GP.put) {\n"
- "+\t\t\tif (put == ch->w_local_GP.put)\n"
- " \t\t\t\tbreak;\n"
- "-\t\t\t}\n"
- " \n"
- " \t\t\tmsg = (struct xpc_msg *)((u64)ch->local_msgqueue +\n"
- " \t\t\t\t\t\t (put % ch->local_nentries) *\n"
- " \t\t\t\t\t\t ch->msg_size);\n"
- " \n"
- "-\t\t\tif (!(msg->flags & XPC_M_READY)) {\n"
- "+\t\t\tif (!(msg->flags & XPC_M_READY))\n"
- " \t\t\t\tbreak;\n"
- "-\t\t\t}\n"
- " \n"
- " \t\t\tput++;\n"
- " \t\t}\n"
- "@@ -1810,7 +1782,7 @@ xpc_send_msgs(struct xpc_channel *ch, s6\n"
- " \t\tif (cmpxchg_rel(&ch->local_GP->put, initial_put, put) !=\n"
- " \t\t    initial_put) {\n"
- " \t\t\t/* someone else beat us to it */\n"
- "-\t\t\tDBUG_ON((volatile s64)ch->local_GP->put < initial_put);\n"
- "+\t\t\tDBUG_ON(ch->local_GP->put < initial_put);\n"
- " \t\t\tbreak;\n"
- " \t\t}\n"
- " \n"
- "@@ -1829,9 +1801,8 @@ xpc_send_msgs(struct xpc_channel *ch, s6\n"
- " \t\tinitial_put = put;\n"
- " \t}\n"
- " \n"
- "-\tif (send_IPI) {\n"
- "+\tif (send_IPI)\n"
- " \t\txpc_IPI_send_msgrequest(ch);\n"
- "-\t}\n"
- " }\n"
- " \n"
- " /*\n"
- "@@ -1905,9 +1876,8 @@ xpc_send_msg(struct xpc_channel *ch, str\n"
- " \t/* see if the message is next in line to be sent, if so send it */\n"
- " \n"
- " \tput = ch->local_GP->put;\n"
- "-\tif (put == msg_number) {\n"
- "+\tif (put == msg_number)\n"
- " \t\txpc_send_msgs(ch, put);\n"
- "-\t}\n"
- " \n"
- " \t/* drop the reference grabbed in xpc_allocate_msg() */\n"
- " \txpc_msgqueue_deref(ch);\n"
- "@@ -2024,10 +1994,8 @@ xpc_pull_remote_msg(struct xpc_channel *\n"
- " \n"
- " \t\tmsg_index = ch->next_msg_to_pull % ch->remote_nentries;\n"
- " \n"
- "-\t\tDBUG_ON(ch->next_msg_to_pull >=\n"
- "-\t\t\t(volatile s64)ch->w_remote_GP.put);\n"
- "-\t\tnmsgs = (volatile s64)ch->w_remote_GP.put -\n"
- "-\t\t    ch->next_msg_to_pull;\n"
- "+\t\tDBUG_ON(ch->next_msg_to_pull >= ch->w_remote_GP.put);\n"
- "+\t\tnmsgs = ch->w_remote_GP.put - ch->next_msg_to_pull;\n"
- " \t\tif (msg_index + nmsgs > ch->remote_nentries) {\n"
- " \t\t\t/* ignore the ones that wrap the msg queue for now */\n"
- " \t\t\tnmsgs = ch->remote_nentries - msg_index;\n"
- "@@ -2038,10 +2006,9 @@ xpc_pull_remote_msg(struct xpc_channel *\n"
- " \t\tremote_msg = (struct xpc_msg *)(ch->remote_msgqueue_pa +\n"
- " \t\t\t\t\t\tmsg_offset);\n"
- " \n"
- "-\t\tif ((ret = xpc_pull_remote_cachelines(part, msg, remote_msg,\n"
- "-\t\t\t\t\t\t      nmsgs * ch->msg_size)) !=\n"
- "-\t\t    xpSuccess) {\n"
- "-\n"
- "+\t\tret = xpc_pull_remote_cachelines(part, msg, remote_msg, nmsgs *\n"
- "+\t\t\t\t\t\t ch->msg_size);\n"
- "+\t\tif (ret != xpSuccess) {\n"
- " \t\t\tdev_dbg(xpc_chan, \"failed to pull %d msgs starting with\"\n"
- " \t\t\t\t\" msg %\" U64_ELL \"d from partition %d, \"\n"
- " \t\t\t\t\"channel=%d, ret=%d\\n\", nmsgs,\n"
- "@@ -2054,8 +2021,6 @@ xpc_pull_remote_msg(struct xpc_channel *\n"
- " \t\t\treturn NULL;\n"
- " \t\t}\n"
- " \n"
- "-\t\tmb();\t\t/* >>> this may not be needed, we're not sure */\n"
- "-\n"
- " \t\tch->next_msg_to_pull += nmsgs;\n"
- " \t}\n"
- " \n"
- "@@ -2078,14 +2043,13 @@ xpc_get_deliverable_msg(struct xpc_chann\n"
- " \ts64 get;\n"
- " \n"
- " \tdo {\n"
- "-\t\tif ((volatile u32)ch->flags & XPC_C_DISCONNECTING) {\n"
- "+\t\tif (ch->flags & XPC_C_DISCONNECTING)\n"
- " \t\t\tbreak;\n"
- "-\t\t}\n"
- " \n"
- "-\t\tget = (volatile s64)ch->w_local_GP.get;\n"
- "-\t\tif (get == (volatile s64)ch->w_remote_GP.put) {\n"
- "+\t\tget = ch->w_local_GP.get;\n"
- "+\t\trmb();\t/* guarantee that .get loads before .put */\n"
- "+\t\tif (get == ch->w_remote_GP.put)\n"
- " \t\t\tbreak;\n"
- "-\t\t}\n"
- " \n"
- " \t\t/* There are messages waiting to be pulled and delivered.\n"
- " \t\t * We need to try to secure one for ourselves. We'll do this\n"
- "@@ -2125,7 +2089,8 @@ xpc_deliver_msg(struct xpc_channel *ch)\n"
- " {\n"
- " \tstruct xpc_msg *msg;\n"
- " \n"
- "-\tif ((msg = xpc_get_deliverable_msg(ch)) != NULL) {\n"
- "+\tmsg = xpc_get_deliverable_msg(ch);\n"
- "+\tif (msg != NULL) {\n"
- " \n"
- " \t\t/*\n"
- " \t\t * This ref is taken to protect the payload itself from being\n"
- "@@ -2171,17 +2136,15 @@ xpc_acknowledge_msgs(struct xpc_channel \n"
- " \twhile (1) {\n"
- " \n"
- " \t\twhile (1) {\n"
- "-\t\t\tif (get == (volatile s64)ch->w_local_GP.get) {\n"
- "+\t\t\tif (get == ch->w_local_GP.get)\n"
- " \t\t\t\tbreak;\n"
- "-\t\t\t}\n"
- " \n"
- " \t\t\tmsg = (struct xpc_msg *)((u64)ch->remote_msgqueue +\n"
- " \t\t\t\t\t\t (get % ch->remote_nentries) *\n"
- " \t\t\t\t\t\t ch->msg_size);\n"
- " \n"
- "-\t\t\tif (!(msg->flags & XPC_M_DONE)) {\n"
- "+\t\t\tif (!(msg->flags & XPC_M_DONE))\n"
- " \t\t\t\tbreak;\n"
- "-\t\t\t}\n"
- " \n"
- " \t\t\tmsg_flags |= msg->flags;\n"
- " \t\t\tget++;\n"
- "@@ -2195,7 +2158,7 @@ xpc_acknowledge_msgs(struct xpc_channel \n"
- " \t\tif (cmpxchg_rel(&ch->local_GP->get, initial_get, get) !=\n"
- " \t\t    initial_get) {\n"
- " \t\t\t/* someone else beat us to it */\n"
- "-\t\t\tDBUG_ON((volatile s64)ch->local_GP->get <= initial_get);\n"
- "+\t\t\tDBUG_ON(ch->local_GP->get <= initial_get);\n"
- " \t\t\tbreak;\n"
- " \t\t}\n"
- " \n"
- "@@ -2214,9 +2177,8 @@ xpc_acknowledge_msgs(struct xpc_channel \n"
- " \t\tinitial_get = get;\n"
- " \t}\n"
- " \n"
- "-\tif (send_IPI) {\n"
- "+\tif (send_IPI)\n"
- " \t\txpc_IPI_send_msgrequest(ch);\n"
- "-\t}\n"
- " }\n"
- " \n"
- " /*\n"
- "@@ -2270,9 +2232,8 @@ xpc_initiate_received(short partid, int \n"
- " \t * been delivered.\n"
- " \t */\n"
- " \tget = ch->local_GP->get;\n"
- "-\tif (get == msg_number) {\n"
- "+\tif (get == msg_number)\n"
- " \t\txpc_acknowledge_msgs(ch, get, msg->flags);\n"
- "-\t}\n"
- " \n"
- " \t/* the call to xpc_msgqueue_ref() was done by xpc_deliver_msg()  */\n"
- " \txpc_msgqueue_deref(ch);\n"
- "Index: linux-2.6/drivers/misc/xp/xpc.h\n"
- "===================================================================\n"
- "--- linux-2.6.orig/drivers/misc/xp/xpc.h\t2008-03-25 07:10:15.693148179 -0500\n"
- "+++ linux-2.6/drivers/misc/xp/xpc.h\t2008-03-25 07:10:17.809412207 -0500\n"
- "@@ -109,16 +109,16 @@ struct xpc_rsvd_page {\n"
- " \tu8 SAL_partid;\t\t/* SAL: partition ID */\n"
- " \tu8 version;\n"
- " \tu8 pad[6];\n"
- "-\tvolatile u64 vars_pa;\t/* physical address of struct xpc_vars */\n"
- "+\tu64 vars_pa;\t\t/* physical address of struct xpc_vars */\n"
- " \tstruct timespec stamp;\t/* time when reserved page was setup by XPC */\n"
- " \tu64 pad2[9];\t\t/* align to last u64 in cacheline */\n"
- " \tu64 SAL_nasids_size;\t/* SAL: size of each nasid mask in bytes */\n"
- " };\n"
- " \n"
- "-#define XPC_RP_VERSION _XPC_VERSION(2,0)\t/* version 2.0 of the reserved page */\n"
- "+#define XPC_RP_VERSION _XPC_VERSION(2, 0) /* version 2.0 of the reserved page */\n"
- " \n"
- " #define XPC_SUPPORTS_RP_STAMP(_version) \\\n"
- "-\t\t\t(_version >= _XPC_VERSION(1,1))\n"
- "+\t\t\t(_version >= _XPC_VERSION(1, 1))\n"
- " \n"
- " /*\n"
- "  * compare stamps - the return value is:\n"
- "@@ -132,9 +132,10 @@ xpc_compare_stamps(struct timespec *stam\n"
- " {\n"
- " \tint ret;\n"
- " \n"
- "-\tif ((ret = stamp1->tv_sec - stamp2->tv_sec) == 0) {\n"
- "+\tret = stamp1->tv_sec - stamp2->tv_sec;\n"
- "+\tif (ret == 0)\n"
- " \t\tret = stamp1->tv_nsec - stamp2->tv_nsec;\n"
- "-\t}\n"
- "+\n"
- " \treturn ret;\n"
- " }\n"
- " \n"
- "@@ -166,10 +167,10 @@ struct xpc_vars {\n"
- " \tu64 heartbeating_to_mask[BITS_TO_LONGS(XP_MAX_NPARTITIONS)];\n"
- " };\n"
- " \n"
- "-#define XPC_V_VERSION _XPC_VERSION(4,0)\t/* version 4.0 of the cross vars */\n"
- "+#define XPC_V_VERSION _XPC_VERSION(4, 0)    /* version 4.0 of the cross vars */\n"
- " \n"
- " #define XPC_SUPPORTS_DISENGAGE_REQUEST(_version) \\\n"
- "-\t\t\t(_version >= _XPC_VERSION(3,1))\n"
- "+\t\t\t(_version >= _XPC_VERSION(3, 1))\n"
- " \n"
- " static inline int\n"
- " xpc_hb_allowed(short partid, struct xpc_vars *vars)\n"
- "@@ -267,7 +268,7 @@ xpc_number_of_amos(int npartitions)\n"
- "  * occupies half a cacheline.\n"
- "  */\n"
- " struct xpc_vars_part {\n"
- "-\tvolatile u64 magic;\n"
- "+\tu64 magic;\n"
- " \n"
- " \tu64 openclose_args_pa;\t/* physical address of open and close args */\n"
- " \tu64 GPs_pa;\t\t/* physical address of Get/Put values */\n"
- "@@ -290,8 +291,8 @@ struct xpc_vars_part {\n"
- "  * MAGIC2 indicates that this partition has pulled the remote partititions\n"
- "  * per partition variables that pertain to this partition.\n"
- "  */\n"
- "-#define XPC_VP_MAGIC1\t0x0053524156435058L\t/* 'XPCVARS\\0'L (little endian) */\n"
- "-#define XPC_VP_MAGIC2\t0x0073726176435058L\t/* 'XPCvars\\0'L (little endian) */\n"
- "+#define XPC_VP_MAGIC1\t0x0053524156435058L   /* 'XPCVARS\\0'L (little endian) */\n"
- "+#define XPC_VP_MAGIC2\t0x0073726176435058L   /* 'XPCvars\\0'L (little endian) */\n"
- " \n"
- " /* the reserved page sizes and offsets */\n"
- " \n"
- "@@ -301,9 +302,10 @@ struct xpc_vars_part {\n"
- " #define XPC_RP_PART_NASIDS(_rp) (u64 *)((u8 *)(_rp) + XPC_RP_HEADER_SIZE)\n"
- " #define XPC_RP_MACH_NASIDS(_rp) (XPC_RP_PART_NASIDS(_rp) + \\\n"
- " \t\t\t\t xp_nasid_mask_words())\n"
- "-#define XPC_RP_VARS(_rp)\t(struct xpc_vars *)(XPC_RP_MACH_NASIDS(_rp) + \\\n"
- "-\t\t\t\t xp_nasid_mask_words())\n"
- "-#define XPC_RP_VARS_PART(_rp)\t(struct xpc_vars_part *)((u8 *)XPC_RP_VARS(_rp) + XPC_RP_VARS_SIZE)\n"
- "+#define XPC_RP_VARS(_rp)\t((struct xpc_vars *)(XPC_RP_MACH_NASIDS(_rp) + \\\n"
- "+\t\t\t\txp_nasid_mask_words()))\n"
- "+#define XPC_RP_VARS_PART(_rp)\t((struct xpc_vars_part *) \\\n"
- "+\t\t\t\t((u8 *)XPC_RP_VARS(_rp) + XPC_RP_VARS_SIZE))\n"
- " \n"
- " /*\n"
- "  * Functions registered by add_timer() or called by kernel_thread() only\n"
- "@@ -322,8 +324,8 @@ struct xpc_vars_part {\n"
- "  * Define a Get/Put value pair (pointers) used with a message queue.\n"
- "  */\n"
- " struct xpc_gp {\n"
- "-\tvolatile s64 get;\t/* Get value */\n"
- "-\tvolatile s64 put;\t/* Put value */\n"
- "+\ts64 get;\t\t/* Get value */\n"
- "+\ts64 put;\t\t/* Put value */\n"
- " };\n"
- " \n"
- " #define XPC_GP_SIZE \\\n"
- "@@ -360,7 +362,7 @@ struct xpc_openclose_args {\n"
- "  * and consumed by the intended recipient.\n"
- "  */\n"
- " struct xpc_notify {\n"
- "-\tvolatile u8 type;\t/* type of notification */\n"
- "+\tu8 type;\t\t/* type of notification */\n"
- " \n"
- " \t/* the following two fields are only used if type == XPC_N_CALL */\n"
- " \txpc_notify_func func;\t/* user's notify function */\n"
- "@@ -466,10 +468,10 @@ struct xpc_channel {\n"
- " \tvoid *local_msgqueue_base;\t/* base address of kmalloc'd space */\n"
- " \tstruct xpc_msg *local_msgqueue;\t/* local message queue */\n"
- " \tvoid *remote_msgqueue_base;\t/* base address of kmalloc'd space */\n"
- "-\tstruct xpc_msg *remote_msgqueue;\t/* cached copy of remote partition's */\n"
- "-\t/* local message queue */\n"
- "+\tstruct xpc_msg *remote_msgqueue; /* cached copy of remote partition's */\n"
- "+\t\t\t\t\t /* local message queue */\n"
- " \tu64 remote_msgqueue_pa;\t/* phys addr of remote partition's */\n"
- "-\t/* local message queue */\n"
- "+\t\t\t\t/* local message queue */\n"
- " \n"
- " \tatomic_t references;\t/* #of external references to queues */\n"
- " \n"
- "@@ -477,21 +479,21 @@ struct xpc_channel {\n"
- " \twait_queue_head_t msg_allocate_wq;\t/* msg allocation wait queue */\n"
- " \n"
- " \tu8 delayed_IPI_flags;\t/* IPI flags received, but delayed */\n"
- "-\t/* action until channel disconnected */\n"
- "+\t\t\t\t/* action until channel disconnected */\n"
- " \n"
- " \t/* queue of msg senders who want to be notified when msg received */\n"
- " \n"
- " \tatomic_t n_to_notify;\t/* #of msg senders to notify */\n"
- "-\tstruct xpc_notify *notify_queue;\t/* notify queue for messages sent */\n"
- "+\tstruct xpc_notify *notify_queue;    /* notify queue for messages sent */\n"
- " \n"
- " \txpc_channel_func func;\t/* user's channel function */\n"
- " \tvoid *key;\t\t/* pointer to user's key */\n"
- " \n"
- " \tstruct mutex msg_to_pull_mutex;\t/* next msg to pull serialization */\n"
- "-\tstruct completion wdisconnect_wait;\t/* wait for channel disconnect */\n"
- "+\tstruct completion wdisconnect_wait;    /* wait for channel disconnect */\n"
- " \n"
- "-\tstruct xpc_openclose_args *local_openclose_args;\t/* args passed on */\n"
- "-\t/* opening or closing of channel */\n"
- "+\tstruct xpc_openclose_args *local_openclose_args;    /* args passed on */\n"
- "+\t\t\t\t\t     /* opening or closing of channel */\n"
- " \n"
- " \t/* various flavors of local and remote Get/Put values */\n"
- " \n"
- "@@ -519,28 +521,28 @@ struct xpc_channel {\n"
- " \n"
- " #define\tXPC_C_ROPENREPLY\t0x00000002\t/* remote open channel reply */\n"
- " #define\tXPC_C_OPENREPLY\t\t0x00000004\t/* local open channel reply */\n"
- "-#define\tXPC_C_ROPENREQUEST\t0x00000008\t/* remote open channel request */\n"
- "+#define\tXPC_C_ROPENREQUEST\t0x00000008     /* remote open channel request */\n"
- " #define\tXPC_C_OPENREQUEST\t0x00000010\t/* local open channel request */\n"
- " \n"
- "-#define\tXPC_C_SETUP\t\t0x00000020\t/* channel's msgqueues are alloc'd */\n"
- "-#define\tXPC_C_CONNECTEDCALLOUT\t0x00000040\t/* connected callout initiated */\n"
- "+#define\tXPC_C_SETUP\t\t0x00000020 /* channel's msgqueues are alloc'd */\n"
- "+#define\tXPC_C_CONNECTEDCALLOUT\t0x00000040     /* connected callout initiated */\n"
- " #define\tXPC_C_CONNECTEDCALLOUT_MADE \\\n"
- "-\t\t\t\t0x00000080\t/* connected callout completed */\n"
- "+\t\t\t\t0x00000080     /* connected callout completed */\n"
- " #define\tXPC_C_CONNECTED\t\t0x00000100\t/* local channel is connected */\n"
- " #define\tXPC_C_CONNECTING\t0x00000200\t/* channel is being connected */\n"
- " \n"
- " #define\tXPC_C_RCLOSEREPLY\t0x00000400\t/* remote close channel reply */\n"
- " #define\tXPC_C_CLOSEREPLY\t0x00000800\t/* local close channel reply */\n"
- "-#define\tXPC_C_RCLOSEREQUEST\t0x00001000\t/* remote close channel request */\n"
- "-#define\tXPC_C_CLOSEREQUEST\t0x00002000\t/* local close channel request */\n"
- "+#define\tXPC_C_RCLOSEREQUEST\t0x00001000    /* remote close channel request */\n"
- "+#define\tXPC_C_CLOSEREQUEST\t0x00002000     /* local close channel request */\n"
- " \n"
- " #define\tXPC_C_DISCONNECTED\t0x00004000\t/* channel is disconnected */\n"
- "-#define\tXPC_C_DISCONNECTING\t0x00008000\t/* channel is being disconnected */\n"
- "+#define\tXPC_C_DISCONNECTING\t0x00008000   /* channel is being disconnected */\n"
- " #define\tXPC_C_DISCONNECTINGCALLOUT \\\n"
- "-\t\t\t\t0x00010000\t/* disconnecting callout initiated */\n"
- "+\t\t\t\t0x00010000 /* disconnecting callout initiated */\n"
- " #define\tXPC_C_DISCONNECTINGCALLOUT_MADE \\\n"
- "-\t\t\t\t0x00020000\t/* disconnecting callout completed */\n"
- "-#define\tXPC_C_WDISCONNECT\t0x00040000\t/* waiting for channel disconnect */\n"
- "+\t\t\t\t0x00020000 /* disconnecting callout completed */\n"
- "+#define\tXPC_C_WDISCONNECT\t0x00040000  /* waiting for channel disconnect */\n"
- " \n"
- " /*\n"
- "  * Manages channels on a partition basis. There is one of these structures\n"
- "@@ -554,7 +556,7 @@ struct xpc_partition {\n"
- " \tu8 remote_rp_version;\t/* version# of partition's rsvd pg */\n"
- " \tshort remote_npartitions;\t/* value of XPC_NPARTITIONS */\n"
- " \tu32 flags;\t\t/* general flags */\n"
- "-\tstruct timespec remote_rp_stamp;\t/* time when rsvd pg was initialized */\n"
- "+\tstruct timespec remote_rp_stamp; /* time when rsvd pg was initialized */\n"
- " \tu64 remote_rp_pa;\t/* phys addr of partition's rsvd pg */\n"
- " \tu64 remote_vars_pa;\t/* phys addr of partition's vars */\n"
- " \tu64 remote_vars_part_pa;\t/* phys addr of partition's vars part */\n"
- "@@ -564,7 +566,7 @@ struct xpc_partition {\n"
- " \tint remote_act_phys_cpuid;\t/* active part's act/deact phys cpuid */\n"
- " \tu32 act_IRQ_rcvd;\t/* IRQs since activation */\n"
- " \tspinlock_t lock;\t/* protect updating of act_state and */\n"
- "-\t/* the general flags */\n"
- "+\t\t\t\t/* the general flags */\n"
- " \tu8 act_state;\t\t/* from XPC HB viewpoint */\n"
- " \tu8 remote_vars_version;\t/* version# of partition's vars */\n"
- " \tenum xp_retval reason;\t/* reason partition is deactivating */\n"
- "@@ -576,7 +578,7 @@ struct xpc_partition {\n"
- " \n"
- " \t/* XPC infrastructure referencing and teardown control */\n"
- " \n"
- "-\tvolatile u8 setup_state;\t/* infrastructure setup state */\n"
- "+\tu8 setup_state;\t\t/* infrastructure setup state */\n"
- " \twait_queue_head_t teardown_wq;\t/* kthread waiting to teardown infra */\n"
- " \tatomic_t references;\t/* #of references to infrastructure */\n"
- " \n"
- "@@ -588,25 +590,25 @@ struct xpc_partition {\n"
- " \t */\n"
- " \n"
- " \tu8 nchannels;\t\t/* #of defined channels supported */\n"
- "-\tatomic_t nchannels_active;\t/* #of channels that are not DISCONNECTED */\n"
- "-\tatomic_t nchannels_engaged;\t/* #of channels engaged with remote part */\n"
- "+\tatomic_t nchannels_active;  /* #of channels that are not DISCONNECTED */\n"
- "+\tatomic_t nchannels_engaged;  /* #of channels engaged with remote part */\n"
- " \tstruct xpc_channel *channels;\t/* array of channel structures */\n"
- " \n"
- " \tvoid *local_GPs_base;\t/* base address of kmalloc'd space */\n"
- " \tstruct xpc_gp *local_GPs;\t/* local Get/Put values */\n"
- " \tvoid *remote_GPs_base;\t/* base address of kmalloc'd space */\n"
- "-\tstruct xpc_gp *remote_GPs;\t/* copy of remote partition's local Get/Put */\n"
- "-\t/* values */\n"
- "+\tstruct xpc_gp *remote_GPs;/* copy of remote partition's local Get/Put */\n"
- "+\t\t\t\t  /* values */\n"
- " \tu64 remote_GPs_pa;\t/* phys address of remote partition's local */\n"
- "-\t/* Get/Put values */\n"
- "+\t\t\t\t/* Get/Put values */\n"
- " \n"
- " \t/* fields used to pass args when opening or closing a channel */\n"
- " \n"
- "-\tvoid *local_openclose_args_base;\t/* base address of kmalloc'd space */\n"
- "-\tstruct xpc_openclose_args *local_openclose_args;\t/* local's args */\n"
- "-\tvoid *remote_openclose_args_base;\t/* base address of kmalloc'd space */\n"
- "-\tstruct xpc_openclose_args *remote_openclose_args;\t/* copy of remote's */\n"
- "-\t/* args */\n"
- "+\tvoid *local_openclose_args_base;   /* base address of kmalloc'd space */\n"
- "+\tstruct xpc_openclose_args *local_openclose_args;      /* local's args */\n"
- "+\tvoid *remote_openclose_args_base;  /* base address of kmalloc'd space */\n"
- "+\tstruct xpc_openclose_args *remote_openclose_args; /* copy of remote's */\n"
- "+\t\t\t\t\t\t\t  /* args */\n"
- " \tu64 remote_openclose_args_pa;\t/* phys addr of remote's args */\n"
- " \n"
- " \t/* IPI sending, receiving and handling related fields */\n"
- "@@ -631,7 +633,7 @@ struct xpc_partition {\n"
- " \n"
- " /* struct xpc_partition flags */\n"
- " \n"
- "-#define\tXPC_P_RAMOSREGISTERED\t0x00000001\t/* remote AMOs were registered */\n"
- "+#define\tXPC_P_RAMOSREGISTERED\t0x00000001    /* remote AMOs were registered */\n"
- " \n"
- " /* struct xpc_partition act_state values (for XPC HB) */\n"
- " \n"
- "@@ -725,9 +727,8 @@ extern void xpc_teardown_infrastructure(\n"
- " static inline void\n"
- " xpc_wakeup_channel_mgr(struct xpc_partition *part)\n"
- " {\n"
- "-\tif (atomic_inc_return(&part->channel_mgr_requests) == 1) {\n"
- "+\tif (atomic_inc_return(&part->channel_mgr_requests) == 1)\n"
- " \t\twake_up(&part->channel_mgr_wq);\n"
- "-\t}\n"
- " }\n"
- " \n"
- " /*\n"
- "@@ -746,9 +747,8 @@ xpc_msgqueue_deref(struct xpc_channel *c\n"
- " \ts32 refs = atomic_dec_return(&ch->references);\n"
- " \n"
- " \tDBUG_ON(refs < 0);\n"
- "-\tif (refs == 0) {\n"
- "+\tif (refs == 0)\n"
- " \t\txpc_wakeup_channel_mgr(&xpc_partitions[ch->partid]);\n"
- "-\t}\n"
- " }\n"
- " \n"
- " #define XPC_DISCONNECT_CHANNEL(_ch, _reason, _irqflgs) \\\n"
- "@@ -764,9 +764,8 @@ xpc_part_deref(struct xpc_partition *par\n"
- " \ts32 refs = atomic_dec_return(&part->references);\n"
- " \n"
- " \tDBUG_ON(refs < 0);\n"
- "-\tif (refs == 0 && part->setup_state == XPC_P_SS_WTEARDOWN) {\n"
- "+\tif (refs == 0 && part->setup_state == XPC_P_SS_WTEARDOWN)\n"
- " \t\twake_up(&part->teardown_wq);\n"
- "-\t}\n"
- " }\n"
- " \n"
- " static inline int\n"
- "@@ -776,9 +775,9 @@ xpc_part_ref(struct xpc_partition *part)\n"
- " \n"
- " \tatomic_inc(&part->references);\n"
- " \tsetup = (part->setup_state == XPC_P_SS_SETUP);\n"
- "-\tif (!setup) {\n"
- "+\tif (!setup)\n"
- " \t\txpc_part_deref(part);\n"
- "-\t}\n"
- "+\n"
- " \treturn setup;\n"
- " }\n"
- " \n"
- "@@ -955,7 +954,7 @@ xpc_activate_IRQ_send(u64 amos_page_pa, \n"
- " \t\t\t\t\tBIT_MASK(from_nasid / 2),\n"
- " \t\t\t\t\tremote_amo, to_nasid,\n"
- " \t\t\t\t\tto_phys_cpuid, SGI_XPC_ACTIVATE);\n"
- "-\tBUG_ON(!remote_amo && ret != xpSuccess);\t/* should never happen */\n"
- "+\tBUG_ON(!remote_amo && ret != xpSuccess);      /* should never happen */\n"
- " }\n"
- " \n"
- " static inline void\n"
- "@@ -1150,9 +1149,8 @@ xpc_check_for_channel_activity(struct xp\n"
- " \n"
- " \tret = xp_get_amo(part->local_IPI_amo_va, XP_AMO_CLEAR, &IPI_amo);\n"
- " \tBUG_ON(ret != xpSuccess);\t/* should never happen */\n"
- "-\tif (IPI_amo == 0) {\n"
- "+\tif (IPI_amo == 0)\n"
- " \t\treturn;\n"
- "-\t}\n"
- " \n"
- " \tspin_lock_irqsave(&part->IPI_lock, irq_flags);\n"
- " \tpart->local_IPI_amo |= IPI_amo;\n"
- "Index: linux-2.6/drivers/misc/xp/xp_sn2.c\n"
- "===================================================================\n"
- "--- linux-2.6.orig/drivers/misc/xp/xp_sn2.c\t2008-03-25 07:10:15.693148179 -0500\n"
- "+++ linux-2.6/drivers/misc/xp/xp_sn2.c\t2008-03-25 07:10:17.829414703 -0500\n"
- "@@ -22,8 +22,6 @@\n"
- " #include <asm/sn/sn_sal.h>\n"
- " #include \"xp.h\"\n"
- " \n"
- "-extern struct device *xp;\n"
- "-\n"
- " /*\n"
- "  * Register a nofault code region which performs a cross-partition PIO read.\n"
- "  * If the PIO read times out, the MCA handler will consume the error and\n"
- "@@ -187,10 +185,10 @@ xp_set_amo_sn2(u64 *amo_va, int op, u64 \n"
- " \t\t * it until the heartbeat times out.\n"
- " \t\t */\n"
- " \t\tif (xp_nofault_PIOR((u64 *)GLOBAL_MMR_ADDR(NASID_GET(amo_va),\n"
- "-\t\t\t\t\t\t\t   xp_nofault_PIOR_target))\n"
- "-\t\t    != 0)\n"
- "+\t\t\t\t\t\t\txp_nofault_PIOR_target))\n"
- "+\t\t    != 0) {\n"
- " \t\t\tret = xpPioReadError;\n"
- "-\n"
- "+\t\t}\n"
- " \t\tlocal_irq_restore(irq_flags);\n"
- " \t}\n"
- " \n"
- "@@ -226,10 +224,10 @@ xp_set_amo_with_interrupt_sn2(u64 *amo_v\n"
- " \t\t * it until the heartbeat times out.\n"
- " \t\t */\n"
- " \t\tif (xp_nofault_PIOR((u64 *)GLOBAL_MMR_ADDR(NASID_GET(amo_va),\n"
- "-\t\t\t\t\t\t\t   xp_nofault_PIOR_target))\n"
- "-\t\t    != 0)\n"
- "+\t\t\t\t\t\t\txp_nofault_PIOR_target))\n"
- "+\t\t    != 0) {\n"
- " \t\t\tret = xpPioReadError;\n"
- "-\n"
- "+\t\t}\n"
- " \t\tlocal_irq_restore(irq_flags);\n"
- " \t}\n"
- " \n"
- "@@ -323,10 +321,10 @@ xp_change_memprotect_shub_wars_1_1_sn2(i\n"
- " \t\t\t/* save current protection values */\n"
- " \t\t\txpc_prot_vec[node] =\n"
- " \t\t\t    (u64)HUB_L((u64 *)GLOBAL_MMR_ADDR(nasid,\n"
- "-\t\t\t\t\t\t\t      SH1_MD_DQLP_MMR_DIR_PRIVEC0));\n"
- "+\t\t\t\t\t\t  SH1_MD_DQLP_MMR_DIR_PRIVEC0));\n"
- " \t\t\t/* open up everything */\n"
- " \t\t\tHUB_S((u64 *)GLOBAL_MMR_ADDR(nasid,\n"
- "-\t\t\t\t\t\t     SH1_MD_DQLP_MMR_DIR_PRIVEC0),\n"
- "+\t\t\t\t\t\t   SH1_MD_DQLP_MMR_DIR_PRIVEC0),\n"
- " \t\t\t      -1UL);\n"
- " \t\t\tHUB_S((u64 *)\n"
- " \t\t\t      GLOBAL_MMR_ADDR(nasid,\n"
- "@@ -338,15 +336,16 @@ xp_change_memprotect_shub_wars_1_1_sn2(i\n"
- " \t\t\tnasid = cnodeid_to_nasid(node);\n"
- " \t\t\t/* restore original protection values */\n"
- " \t\t\tHUB_S((u64 *)GLOBAL_MMR_ADDR(nasid,\n"
- "-\t\t\t\t\t\t     SH1_MD_DQLP_MMR_DIR_PRIVEC0),\n"
- "+\t\t\t\t\t\t   SH1_MD_DQLP_MMR_DIR_PRIVEC0),\n"
- " \t\t\t      xpc_prot_vec[node]);\n"
- " \t\t\tHUB_S((u64 *)\n"
- " \t\t\t      GLOBAL_MMR_ADDR(nasid,\n"
- " \t\t\t\t\t      SH1_MD_DQRP_MMR_DIR_PRIVEC0),\n"
- " \t\t\t      xpc_prot_vec[node]);\n"
- " \t\t}\n"
- "-\t} else\n"
- "+\t} else {\n"
- " \t\tBUG();\n"
- "+\t}\n"
- " }\n"
- " \n"
- " /* SH_IPI_ACCESS shub register value on startup */\n"
- "Index: linux-2.6/drivers/misc/xp/xp_main.c\n"
- "===================================================================\n"
- "--- linux-2.6.orig/drivers/misc/xp/xp_main.c\t2008-03-25 07:10:15.697148678 -0500\n"
- "+++ linux-2.6/drivers/misc/xp/xp_main.c\t2008-03-25 07:10:17.845416699 -0500\n"
- "@@ -38,38 +38,58 @@ struct device *xp = &xp_dbg_subname;\n"
- " u64 xp_nofault_PIOR_target;\n"
- " \n"
- " short xp_partition_id;\n"
- "+EXPORT_SYMBOL_GPL(xp_partition_id);\n"
- " u8 xp_region_size;\n"
- "+EXPORT_SYMBOL_GPL(xp_region_size);\n"
- " unsigned long xp_rtc_cycles_per_second;\n"
- "+EXPORT_SYMBOL_GPL(xp_rtc_cycles_per_second);\n"
- " \n"
- " enum xp_retval (*xp_remote_memcpy) (void *dst, const void *src, size_t len);\n"
- "+EXPORT_SYMBOL_GPL(xp_remote_memcpy);\n"
- " \n"
- " enum xp_retval (*xp_register_remote_amos) (u64 paddr, size_t len);\n"
- "+EXPORT_SYMBOL_GPL(xp_register_remote_amos);\n"
- " enum xp_retval (*xp_unregister_remote_amos) (u64 paddr, size_t len);\n"
- "+EXPORT_SYMBOL_GPL(xp_unregister_remote_amos);\n"
- " \n"
- " int xp_sizeof_nasid_mask;\n"
- "+EXPORT_SYMBOL_GPL(xp_sizeof_nasid_mask);\n"
- " int xp_sizeof_amo;\n"
- "+EXPORT_SYMBOL_GPL(xp_sizeof_amo);\n"
- " \n"
- " u64 *(*xp_alloc_amos) (int n_amos);\n"
- "+EXPORT_SYMBOL_GPL(xp_alloc_amos);\n"
- " void (*xp_free_amos) (u64 *amos_page, int n_amos);\n"
- "+EXPORT_SYMBOL_GPL(xp_free_amos);\n"
- " \n"
- " enum xp_retval (*xp_set_amo) (u64 *amo_va, int op, u64 operand, int remote);\n"
- "+EXPORT_SYMBOL_GPL(xp_set_amo);\n"
- " enum xp_retval (*xp_set_amo_with_interrupt) (u64 *amo_va, int op, u64 operand,\n"
- " \t\t\t\t\t     int remote, int nasid,\n"
- " \t\t\t\t\t     int phys_cpuid, int vector);\n"
- "+EXPORT_SYMBOL_GPL(xp_set_amo_with_interrupt);\n"
- " \n"
- " enum xp_retval (*xp_get_amo) (u64 *amo_va, int op, u64 *amo_value_addr);\n"
- "+EXPORT_SYMBOL_GPL(xp_get_amo);\n"
- " \n"
- " enum xp_retval (*xp_get_partition_rsvd_page_pa) (u64 buf, u64 *cookie,\n"
- " \t\t\t\t\t\t u64 *paddr, size_t *len);\n"
- "+EXPORT_SYMBOL_GPL(xp_get_partition_rsvd_page_pa);\n"
- " \n"
- " enum xp_retval (*xp_change_memprotect) (u64 paddr, size_t len, int request,\n"
- " \t\t\t\t\tu64 *nasid_array);\n"
- "+EXPORT_SYMBOL_GPL(xp_change_memprotect);\n"
- " void (*xp_change_memprotect_shub_wars_1_1) (int request);\n"
- "+EXPORT_SYMBOL_GPL(xp_change_memprotect_shub_wars_1_1);\n"
- " void (*xp_allow_IPI_ops) (void);\n"
- "+EXPORT_SYMBOL_GPL(xp_allow_IPI_ops);\n"
- " void (*xp_disallow_IPI_ops) (void);\n"
- "+EXPORT_SYMBOL_GPL(xp_disallow_IPI_ops);\n"
- " \n"
- " int (*xp_cpu_to_nasid) (int cpuid);\n"
- "+EXPORT_SYMBOL_GPL(xp_cpu_to_nasid);\n"
- " int (*xp_node_to_nasid) (int nid);\n"
- "+EXPORT_SYMBOL_GPL(xp_node_to_nasid);\n"
- " \n"
- " /*\n"
- "  * Initialize the XPC interface to indicate that XPC isn't loaded.\n"
- "@@ -90,6 +110,7 @@ struct xpc_interface xpc_interface = {\n"
- " \t(void (*)(short, int, void *))xpc_notloaded,\n"
- " \t(enum xp_retval(*)(short, void *))xpc_notloaded\n"
- " };\n"
- "+EXPORT_SYMBOL_GPL(xpc_interface);\n"
- " \n"
- " /*\n"
- "  * XPC calls this when it (the XPC module) has been loaded.\n"
- "@@ -112,6 +133,7 @@ xpc_set_interface(void (*connect) (int),\n"
- " \txpc_interface.received = received;\n"
- " \txpc_interface.partid_to_nasids = partid_to_nasids;\n"
- " }\n"
- "+EXPORT_SYMBOL_GPL(xpc_set_interface);\n"
- " \n"
- " /*\n"
- "  * XPC calls this when it (the XPC module) is being unloaded.\n"
- "@@ -133,12 +155,14 @@ xpc_clear_interface(void)\n"
- " \txpc_interface.partid_to_nasids = (enum xp_retval(*)(short, void *))\n"
- " \t    xpc_notloaded;\n"
- " }\n"
- "+EXPORT_SYMBOL_GPL(xpc_clear_interface);\n"
- " \n"
- " /*\n"
- "  * xpc_registrations[] keeps track of xpc_connect()'s done by the kernel-level\n"
- "  * users of XPC.\n"
- "  */\n"
- " struct xpc_registration xpc_registrations[XPC_NCHANNELS];\n"
- "+EXPORT_SYMBOL_GPL(xpc_registrations);\n"
- " \n"
- " /*\n"
- "  * Register for automatic establishment of a channel connection whenever\n"
- "@@ -177,9 +201,8 @@ xpc_connect(int ch_number, xpc_channel_f\n"
- " \n"
- " \tregistration = &xpc_registrations[ch_number];\n"
- " \n"
- "-\tif (mutex_lock_interruptible(&registration->mutex) != 0) {\n"
- "+\tif (mutex_lock_interruptible(&registration->mutex) != 0)\n"
- " \t\treturn xpInterrupted;\n"
- "-\t}\n"
- " \n"
- " \t/* if XPC_CHANNEL_REGISTERED(ch_number) */\n"
- " \tif (registration->func != NULL) {\n"
- "@@ -201,6 +224,7 @@ xpc_connect(int ch_number, xpc_channel_f\n"
- " \n"
- " \treturn xpSuccess;\n"
- " }\n"
- "+EXPORT_SYMBOL_GPL(xpc_connect);\n"
- " \n"
- " /*\n"
- "  * Remove the registration for automatic connection of the specified channel\n"
- "@@ -251,9 +275,7 @@ xpc_disconnect(int ch_number)\n"
- " \n"
- " \treturn;\n"
- " }\n"
- "-\n"
- "-extern enum xp_retval xp_init_sn2(void);\n"
- "-extern enum xp_retval xp_init_uv(void);\n"
- "+EXPORT_SYMBOL_GPL(xpc_disconnect);\n"
- " \n"
- " int __init\n"
- " xp_init(void)\n"
- "@@ -268,23 +290,18 @@ xp_init(void)\n"
- " \telse\n"
- " \t\tret = xpUnsupported;\n"
- " \n"
- "-\tif (ret != xpSuccess) {\n"
- "+\tif (ret != xpSuccess)\n"
- " \t\treturn -ENODEV;\n"
- "-\t}\n"
- " \n"
- " \t/* initialize the connection registration mutex */\n"
- "-\tfor (ch_number = 0; ch_number < XPC_NCHANNELS; ch_number++) {\n"
- "+\tfor (ch_number = 0; ch_number < XPC_NCHANNELS; ch_number++)\n"
- " \t\tmutex_init(&xpc_registrations[ch_number].mutex);\n"
- "-\t}\n"
- " \n"
- " \treturn 0;\n"
- " }\n"
- " \n"
- " module_init(xp_init);\n"
- " \n"
- "-extern void xp_exit_sn2(void);\n"
- "-extern void xp_exit_uv(void);\n"
- "-\n"
- " void __exit\n"
- " xp_exit(void)\n"
- " {\n"
- "@@ -299,30 +316,3 @@ module_exit(xp_exit);\n"
- " MODULE_AUTHOR(\"Silicon Graphics, Inc.\");\n"
- " MODULE_DESCRIPTION(\"Cross Partition (XP) base\");\n"
- " MODULE_LICENSE(\"GPL\");\n"
- "-\n"
- "-EXPORT_SYMBOL(xp_partition_id);\n"
- "-EXPORT_SYMBOL(xp_region_size);\n"
- "-EXPORT_SYMBOL(xp_rtc_cycles_per_second);\n"
- "-EXPORT_SYMBOL(xp_remote_memcpy);\n"
- "-EXPORT_SYMBOL(xp_register_remote_amos);\n"
- "-EXPORT_SYMBOL(xp_unregister_remote_amos);\n"
- "-EXPORT_SYMBOL(xp_sizeof_nasid_mask);\n"
- "-EXPORT_SYMBOL(xp_sizeof_amo);\n"
- "-EXPORT_SYMBOL(xp_alloc_amos);\n"
- "-EXPORT_SYMBOL(xp_free_amos);\n"
- "-EXPORT_SYMBOL(xp_set_amo);\n"
- "-EXPORT_SYMBOL(xp_set_amo_with_interrupt);\n"
- "-EXPORT_SYMBOL(xp_get_amo);\n"
- "-EXPORT_SYMBOL(xp_get_partition_rsvd_page_pa);\n"
- "-EXPORT_SYMBOL(xp_change_memprotect);\n"
- "-EXPORT_SYMBOL(xp_change_memprotect_shub_wars_1_1);\n"
- "-EXPORT_SYMBOL(xp_allow_IPI_ops);\n"
- "-EXPORT_SYMBOL(xp_disallow_IPI_ops);\n"
- "-EXPORT_SYMBOL(xp_cpu_to_nasid);\n"
- "-EXPORT_SYMBOL(xp_node_to_nasid);\n"
- "-EXPORT_SYMBOL(xpc_registrations);\n"
- "-EXPORT_SYMBOL(xpc_interface);\n"
- "-EXPORT_SYMBOL(xpc_clear_interface);\n"
- "-EXPORT_SYMBOL(xpc_set_interface);\n"
- "-EXPORT_SYMBOL(xpc_connect);\n"
- "-EXPORT_SYMBOL(xpc_disconnect);\n"
- "Index: linux-2.6/drivers/misc/xp/xp_uv.c\n"
- "===================================================================\n"
- "--- linux-2.6.orig/drivers/misc/xp/xp_uv.c\t2008-03-25 07:10:15.697148678 -0500\n"
- "+++ linux-2.6/drivers/misc/xp/xp_uv.c\t2008-03-25 07:10:17.861418696 -0500\n"
- "@@ -18,8 +18,6 @@\n"
- " #include <linux/device.h>\n"
- " #include \"xp.h\"\n"
- " \n"
- "-extern struct device *xp;\n"
- "-\n"
- " static enum xp_retval\n"
- " xp_register_nofault_code_uv(void)\n"
-  {
+ "Addressed issues raised by scripts/checkpatch.pl. Removed unnecessary curly\r\n"
+ "braces.  Eliminated uses of volatiles and use of kernel_thread() and\r\n"
+ "daemonize().\r\n"
+ "\r\n"
+ "Signed-off-by: Dean Nelson <dcn@sgi.com>\r\n"
+ "\r\n"
+ "---\r\n"
+ "\r\n"
+ "There are still a few false positives from checkpatch.pl concerning\r\n"
+ "WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable\r\n"
+ "\r\n"
+ " drivers/misc/xp/xp_main.c       |   68 ++++------\r\n"
+ " drivers/misc/xp/xp_sn2.c        |   23 +--\r\n"
+ " drivers/misc/xp/xp_uv.c         |    2\r\n"
+ " drivers/misc/xp/xpc.h           |  116 ++++++++---------\r\n"
+ " drivers/misc/xp/xpc_channel.c   |  243 +++++++++++++++---------------------\r\n"
+ " drivers/misc/xp/xpc_main.c      |  239 ++++++++++++-----------------------\r\n"
+ " drivers/misc/xp/xpc_partition.c |   78 ++++-------\r\n"
+ " drivers/misc/xp/xpnet.c         |   15 --\r\n"
+ " 8 files changed, 324 insertions(+), 460 deletions(-)\r\n"
+ "\r\n"
+ "Index: linux-2.6/drivers/misc/xp/xpnet.c\r\n"
+ "===================================================================\r\n"
+ "--- linux-2.6.orig/drivers/misc/xp/xpnet.c\t2008-03-25 07:10:15.693148179 -0500\r\n"
+ "+++ linux-2.6/drivers/misc/xp/xpnet.c\t2008-03-25 07:10:17.729402225 -0500\r\n"
+ "@@ -84,8 +84,8 @@ struct xpnet_message {\r\n"
+ " #define XPNET_VERSION_MAJOR(_v)\t\t((_v) >> 4)\r\n"
+ " #define XPNET_VERSION_MINOR(_v)\t\t((_v) & 0xf)\r\n"
+ " \r\n"
+ "-#define\tXPNET_VERSION _XPNET_VERSION(1,0)\t/* version 1.0 */\r\n"
+ "-#define\tXPNET_VERSION_EMBED _XPNET_VERSION(1,1)\t/* version 1.1 */\r\n"
+ "+#define\tXPNET_VERSION _XPNET_VERSION(1, 0)\t/* version 1.0 */\r\n"
+ "+#define\tXPNET_VERSION_EMBED _XPNET_VERSION(1, 1)\t/* version 1.1 */\r\n"
+ " #define XPNET_MAGIC\t0x88786984\t/* \"XNET\" */\r\n"
+ " \r\n"
+ " #define XPNET_VALID_MSG(_m)\t\t\t\t\t\t     \\\r\n"
+ "@@ -571,9 +571,8 @@ xpnet_init(void)\r\n"
+ " \tshort partid;\r\n"
+ " \tint result = -ENOMEM;\r\n"
+ " \r\n"
+ "-\tif (!is_shub() && !is_uv()) {\r\n"
+ "+\tif (!is_shub() && !is_uv())\r\n"
+ " \t\treturn -ENODEV;\r\n"
+ "-\t}\r\n"
+ " \r\n"
+ " \tdev_info(xpnet, \"registering network device %s\\n\", XPNET_DEVICE_NAME);\r\n"
+ " \r\n"
+ "@@ -583,9 +582,8 @@ xpnet_init(void)\r\n"
+ " \t */\r\n"
+ " \txpnet_device = alloc_netdev(sizeof(struct xpnet_dev_private),\r\n"
+ " \t\t\t\t    XPNET_DEVICE_NAME, ether_setup);\r\n"
+ "-\tif (xpnet_device == NULL) {\r\n"
+ "+\tif (xpnet_device == NULL)\r\n"
+ " \t\treturn -ENOMEM;\r\n"
+ "-\t}\r\n"
+ " \r\n"
+ " \tnetif_carrier_off(xpnet_device);\r\n"
+ " \r\n"
+ "@@ -603,7 +601,7 @@ xpnet_init(void)\r\n"
+ " \t * MAC addresses.  We chose the first octet of the MAC to be unlikely\r\n"
+ " \t * to collide with any vendor's officially issued MAC.\r\n"
+ " \t */\r\n"
+ "-\txpnet_device->dev_addr[0] = 0x02;\t/* locally administered, no OUI */\r\n"
+ "+\txpnet_device->dev_addr[0] = 0x02;     /* locally administered, no OUI */\r\n"
+ " \r\n"
+ " \tpartid = xp_partition_id;\r\n"
+ " \r\n"
+ "@@ -624,9 +622,8 @@ xpnet_init(void)\r\n"
+ " \txpnet_device->features = NETIF_F_NO_CSUM;\r\n"
+ " \r\n"
+ " \tresult = register_netdev(xpnet_device);\r\n"
+ "-\tif (result != 0) {\r\n"
+ "+\tif (result != 0)\r\n"
+ " \t\tfree_netdev(xpnet_device);\r\n"
+ "-\t}\r\n"
+ " \r\n"
+ " \treturn result;\r\n"
+ " }\r\n"
+ "Index: linux-2.6/drivers/misc/xp/xpc_partition.c\r\n"
+ "===================================================================\r\n"
+ "--- linux-2.6.orig/drivers/misc/xp/xpc_partition.c\t2008-03-25 07:10:15.693148179 -0500\r\n"
+ "+++ linux-2.6/drivers/misc/xp/xpc_partition.c\t2008-03-25 07:10:17.737403223 -0500\r\n"
+ "@@ -64,19 +64,19 @@ xpc_kmalloc_cacheline_aligned(size_t siz\r\n"
+ " {\r\n"
+ " \t/* see if kmalloc will give us cachline aligned memory by default */\r\n"
+ " \t*base = kmalloc(size, flags);\r\n"
+ "-\tif (*base == NULL) {\r\n"
+ "+\tif (*base == NULL)\r\n"
+ " \t\treturn NULL;\r\n"
+ "-\t}\r\n"
+ "-\tif ((u64)*base == L1_CACHE_ALIGN((u64)*base)) {\r\n"
+ "+\r\n"
+ "+\tif ((u64)*base == L1_CACHE_ALIGN((u64)*base))\r\n"
+ " \t\treturn *base;\r\n"
+ "-\t}\r\n"
+ "+\r\n"
+ " \tkfree(*base);\r\n"
+ " \r\n"
+ " \t/* nope, we'll have to do it ourselves */\r\n"
+ " \t*base = kmalloc(size + L1_CACHE_BYTES, flags);\r\n"
+ "-\tif (*base == NULL) {\r\n"
+ "+\tif (*base == NULL)\r\n"
+ " \t\treturn NULL;\r\n"
+ "-\t}\r\n"
+ "+\r\n"
+ " \treturn (void *)L1_CACHE_ALIGN((u64)*base);\r\n"
+ " }\r\n"
+ " \r\n"
+ "@@ -103,9 +103,8 @@ xpc_get_rsvd_page_pa(int nasid)\r\n"
+ " \t\t\t\"x, address=0x%016\" U64_ELL \"x len=0x%016lx\\n\", ret,\r\n"
+ " \t\t\tcookie, rp_pa, len);\r\n"
+ " \r\n"
+ "-\t\tif (ret != xpNeedMoreInfo) {\r\n"
+ "+\t\tif (ret != xpNeedMoreInfo)\r\n"
+ " \t\t\tbreak;\r\n"
+ "-\t\t}\r\n"
+ " \r\n"
+ " \t\tif (L1_CACHE_ALIGN(len) > buf_len) {\r\n"
+ " \t\t\tkfree(buf_base);\r\n"
+ "@@ -130,9 +129,9 @@ xpc_get_rsvd_page_pa(int nasid)\r\n"
+ " \r\n"
+ " \tkfree(buf_base);\r\n"
+ " \r\n"
+ "-\tif (ret != xpSuccess) {\r\n"
+ "+\tif (ret != xpSuccess)\r\n"
+ " \t\trp_pa = 0;\r\n"
+ "-\t}\r\n"
+ "+\r\n"
+ " \tdev_dbg(xpc_part, \"reserved page at phys address 0x%016\" U64_ELL \"x\\n\",\r\n"
+ " \t\trp_pa);\r\n"
+ " \treturn rp_pa;\r\n"
+ "@@ -195,7 +194,8 @@ xpc_rsvd_page_init(void)\r\n"
+ " \t * that saved copy on subsequent loads of XPC. This AMO page is never\r\n"
+ " \t * freed, and its memory protections are never restricted.\r\n"
+ " \t */\r\n"
+ "-\tif ((amos_page = xpc_vars->amos_page) == NULL) {\r\n"
+ "+\tamos_page = xpc_vars->amos_page;\r\n"
+ "+\tif (amos_page == NULL) {\r\n"
+ " \t\tn_amos = xpc_number_of_amos(XP_NPARTITIONS);\r\n"
+ " \t\tamos_page = xp_alloc_amos(n_amos);\r\n"
+ " \t\tif (amos_page == NULL) {\r\n"
+ "@@ -236,9 +236,8 @@ xpc_rsvd_page_init(void)\r\n"
+ " \r\n"
+ " \t/* initialize the activate IRQ related AMO variables */\r\n"
+ " \tactivate_irq_amos = xpc_activate_irq_amos(XP_NPARTITIONS);\r\n"
+ "-\tfor (i = 0; i < xp_nasid_mask_words(); i++) {\r\n"
+ "+\tfor (i = 0; i < xp_nasid_mask_words(); i++)\r\n"
+ " \t\t(void)xpc_IPI_init(activate_irq_amos + i);\r\n"
+ "-\t}\r\n"
+ " \r\n"
+ " \t/* initialize the engaged remote partitions related AMO variables */\r\n"
+ " \tengaged_partitions_amos = xpc_engaged_partitions_amos(XP_NPARTITIONS);\r\n"
+ "@@ -276,13 +275,11 @@ xpc_check_remote_hb(void)\r\n"
+ " \r\n"
+ " \tfor (partid = XP_MIN_PARTID; partid <= XP_MAX_PARTID; partid++) {\r\n"
+ " \r\n"
+ "-\t\tif (xpc_exiting) {\r\n"
+ "+\t\tif (xpc_exiting)\r\n"
+ " \t\t\tbreak;\r\n"
+ "-\t\t}\r\n"
+ " \r\n"
+ "-\t\tif (partid == xp_partition_id) {\r\n"
+ "+\t\tif (partid == xp_partition_id)\r\n"
+ " \t\t\tcontinue;\r\n"
+ "-\t\t}\r\n"
+ " \r\n"
+ " \t\tpart = &xpc_partitions[partid];\r\n"
+ " \r\n"
+ "@@ -335,23 +332,20 @@ xpc_get_remote_rp(int nasid, u64 *discov\r\n"
+ " \t/* get the reserved page's physical address */\r\n"
+ " \r\n"
+ " \t*remote_rp_pa = xpc_get_rsvd_page_pa(nasid);\r\n"
+ "-\tif (*remote_rp_pa == 0) {\r\n"
+ "+\tif (*remote_rp_pa == 0)\r\n"
+ " \t\treturn xpNoRsvdPageAddr;\r\n"
+ "-\t}\r\n"
+ " \r\n"
+ " \t/* pull over the reserved page header and part_nasids mask */\r\n"
+ " \tret = xp_remote_memcpy(remote_rp, (void *)*remote_rp_pa,\r\n"
+ " \t\t\t       XPC_RP_HEADER_SIZE + xp_sizeof_nasid_mask);\r\n"
+ "-\tif (ret != xpSuccess) {\r\n"
+ "+\tif (ret != xpSuccess)\r\n"
+ " \t\treturn ret;\r\n"
+ "-\t}\r\n"
+ " \r\n"
+ " \tif (discovered_nasids != NULL) {\r\n"
+ " \t\tu64 *remote_part_nasids = XPC_RP_PART_NASIDS(remote_rp);\r\n"
+ " \r\n"
+ "-\t\tfor (i = 0; i < xp_nasid_mask_words(); i++) {\r\n"
+ "+\t\tfor (i = 0; i < xp_nasid_mask_words(); i++)\r\n"
+ " \t\t\tdiscovered_nasids[i] |= remote_part_nasids[i];\r\n"
+ "-\t\t}\r\n"
+ " \t}\r\n"
+ " \r\n"
+ " \tif (XPC_VERSION_MAJOR(remote_rp->version) !=\r\n"
+ "@@ -373,16 +367,14 @@ xpc_get_remote_vars(u64 remote_vars_pa, \r\n"
+ " {\r\n"
+ " \tenum xp_retval ret;\r\n"
+ " \r\n"
+ "-\tif (remote_vars_pa == 0) {\r\n"
+ "+\tif (remote_vars_pa == 0)\r\n"
+ " \t\treturn xpVarsNotSet;\r\n"
+ "-\t}\r\n"
+ " \r\n"
+ " \t/* pull over the cross partition variables */\r\n"
+ " \tret = xp_remote_memcpy(remote_vars, (void *)remote_vars_pa,\r\n"
+ " \t\t\t       XPC_RP_VARS_SIZE);\r\n"
+ "-\tif (ret != xpSuccess) {\r\n"
+ "+\tif (ret != xpSuccess)\r\n"
+ " \t\treturn ret;\r\n"
+ "-\t}\r\n"
+ " \r\n"
+ " \tif (XPC_VERSION_MAJOR(remote_vars->version) !=\r\n"
+ " \t    XPC_VERSION_MAJOR(XPC_V_VERSION)) {\r\n"
+ "@@ -391,8 +383,9 @@ xpc_get_remote_vars(u64 remote_vars_pa, \r\n"
+ " \r\n"
+ " \t/* check that the partid is for another partition */\r\n"
+ " \tif (remote_vars->partid < XP_MIN_PARTID ||\r\n"
+ "-\t    remote_vars->partid > XP_MAX_PARTID)\r\n"
+ "+\t    remote_vars->partid > XP_MAX_PARTID) {\r\n"
+ " \t\treturn xpInvalidPartid;\r\n"
+ "+\t}\r\n"
+ " \tif (remote_vars->partid == xp_partition_id)\r\n"
+ " \t\treturn xpLocalPartid;\r\n"
+ " \r\n"
+ "@@ -494,9 +487,8 @@ xpc_identify_act_IRQ_req(int nasid)\r\n"
+ " \r\n"
+ " \tremote_vars_pa = remote_rp->vars_pa;\r\n"
+ " \tremote_rp_version = remote_rp->version;\r\n"
+ "-\tif (XPC_SUPPORTS_RP_STAMP(remote_rp_version)) {\r\n"
+ "+\tif (XPC_SUPPORTS_RP_STAMP(remote_rp_version))\r\n"
+ " \t\tremote_rp_stamp = remote_rp->stamp;\r\n"
+ "-\t}\r\n"
+ " \r\n"
+ " \t/* pull over the cross partition variables */\r\n"
+ " \r\n"
+ "@@ -656,9 +648,8 @@ xpc_identify_act_IRQ_sender(void)\r\n"
+ " \t/* scan through activation AMO variables looking for non-zero entries */\r\n"
+ " \tfor (w_index = 0; w_index < xp_nasid_mask_words(); w_index++) {\r\n"
+ " \r\n"
+ "-\t\tif (xpc_exiting) {\r\n"
+ "+\t\tif (xpc_exiting)\r\n"
+ " \t\t\tbreak;\r\n"
+ "-\t\t}\r\n"
+ " \r\n"
+ " \t\tret = xp_get_amo(amo_va, XP_AMO_CLEAR, &nasid_mask);\r\n"
+ " \t\tBUG_ON(ret != xpSuccess);\t/* should never happen */\r\n"
+ "@@ -733,13 +724,11 @@ xpc_partition_disengaged(struct xpc_part\r\n"
+ " \r\n"
+ " \t\tDBUG_ON(part->act_state != XPC_P_AS_DEACTIVATING &&\r\n"
+ " \t\t\tpart->act_state != XPC_P_AS_INACTIVE);\r\n"
+ "-\t\tif (part->act_state != XPC_P_AS_INACTIVE) {\r\n"
+ "+\t\tif (part->act_state != XPC_P_AS_INACTIVE)\r\n"
+ " \t\t\txpc_wakeup_channel_mgr(part);\r\n"
+ "-\t\t}\r\n"
+ " \r\n"
+ "-\t\tif (XPC_SUPPORTS_DISENGAGE_REQUEST(part->remote_vars_version)) {\r\n"
+ "+\t\tif (XPC_SUPPORTS_DISENGAGE_REQUEST(part->remote_vars_version))\r\n"
+ " \t\t\txpc_cancel_partition_disengage_request(part);\r\n"
+ "-\t\t}\r\n"
+ " \t}\r\n"
+ " \treturn disengaged;\r\n"
+ " }\r\n"
+ "@@ -912,9 +901,9 @@ xpc_discovery(void)\r\n"
+ " \tremote_rp = xpc_kmalloc_cacheline_aligned(XPC_RP_HEADER_SIZE +\r\n"
+ " \t\t\t\t\t\t  xp_sizeof_nasid_mask,\r\n"
+ " \t\t\t\t\t\t  GFP_KERNEL, &remote_rp_base);\r\n"
+ "-\tif (remote_rp == NULL) {\r\n"
+ "+\tif (remote_rp == NULL)\r\n"
+ " \t\treturn;\r\n"
+ "-\t}\r\n"
+ "+\r\n"
+ " \tremote_vars = (struct xpc_vars *)remote_rp;\r\n"
+ " \r\n"
+ " \tdiscovered_nasids = kzalloc(sizeof(u64) * xp_nasid_mask_words(),\r\n"
+ "@@ -947,18 +936,16 @@ xpc_discovery(void)\r\n"
+ " \r\n"
+ " \tfor (region = 0; region < max_regions; region++) {\r\n"
+ " \r\n"
+ "-\t\tif ((volatile int)xpc_exiting) {\r\n"
+ "+\t\tif (xpc_exiting)\r\n"
+ " \t\t\tbreak;\r\n"
+ "-\t\t}\r\n"
+ " \r\n"
+ " \t\tdev_dbg(xpc_part, \"searching region %d\\n\", region);\r\n"
+ " \r\n"
+ " \t\tfor (nasid = (region * region_size * 2);\r\n"
+ " \t\t     nasid < ((region + 1) * region_size * 2); nasid += 2) {\r\n"
+ " \r\n"
+ "-\t\t\tif ((volatile int)xpc_exiting) {\r\n"
+ "+\t\t\tif (xpc_exiting)\r\n"
+ " \t\t\t\tbreak;\r\n"
+ "-\t\t\t}\r\n"
+ " \r\n"
+ " \t\t\tdev_dbg(xpc_part, \"checking nasid %d\\n\", nasid);\r\n"
+ " \r\n"
+ "@@ -1027,8 +1014,8 @@ xpc_discovery(void)\r\n"
+ " \t\t\tret = xpc_register_remote_amos(part);\r\n"
+ " \t\t\tif (ret != xpSuccess) {\r\n"
+ " \t\t\t\tdev_warn(xpc_part, \"xpc_discovery() failed to \"\r\n"
+ "-\t\t\t\t\t \"register remote AMOs for partition %d,\"\r\n"
+ "-\t\t\t\t\t \"ret=%d\\n\", partid, ret);\r\n"
+ "+\t\t\t\t\t \"register remote AMOs for partition %d\"\r\n"
+ "+\t\t\t\t\t \", ret=%d\\n\", partid, ret);\r\n"
+ " \r\n"
+ " \t\t\t\tXPC_SET_REASON(part, xpPhysAddrRegFailed,\r\n"
+ " \t\t\t\t\t       __LINE__);\r\n"
+ "@@ -1072,9 +1059,8 @@ xpc_initiate_partid_to_nasids(short part\r\n"
+ " \tu64 part_nasid_pa;\r\n"
+ " \r\n"
+ " \tpart = &xpc_partitions[partid];\r\n"
+ "-\tif (part->remote_rp_pa == 0) {\r\n"
+ "+\tif (part->remote_rp_pa == 0)\r\n"
+ " \t\treturn xpPartitionDown;\r\n"
+ "-\t}\r\n"
+ " \r\n"
+ " \tmemset(nasid_mask, 0, xp_sizeof_nasid_mask);\r\n"
+ " \r\n"
+ "Index: linux-2.6/drivers/misc/xp/xpc_channel.c\r\n"
+ "===================================================================\r\n"
+ "--- linux-2.6.orig/drivers/misc/xp/xpc_channel.c\t2008-03-25 07:10:15.693148179 -0500\r\n"
+ "+++ linux-2.6/drivers/misc/xp/xpc_channel.c\t2008-03-25 13:34:50.777575812 -0500\r\n"
+ "@@ -24,7 +24,7 @@\r\n"
+ " #include \"xpc.h\"\r\n"
+ " \r\n"
+ " #ifdef CONFIG_X86_64\r\n"
+ "-#define cmpxchg_rel(ptr,o,n)\tcmpxchg(ptr,o,n)\r\n"
+ "+#define cmpxchg_rel(ptr, o, n)\tcmpxchg(ptr, o, n)\r\n"
+ " #endif\r\n"
+ " \r\n"
+ " /*\r\n"
+ "@@ -35,19 +35,19 @@ xpc_kzalloc_cacheline_aligned(size_t siz\r\n"
+ " {\r\n"
+ " \t/* see if kzalloc will give us cachline aligned memory by default */\r\n"
+ " \t*base = kzalloc(size, flags);\r\n"
+ "-\tif (*base == NULL) {\r\n"
+ "+\tif (*base == NULL)\r\n"
+ " \t\treturn NULL;\r\n"
+ "-\t}\r\n"
+ "-\tif ((u64)*base == L1_CACHE_ALIGN((u64)*base)) {\r\n"
+ "+\r\n"
+ "+\tif ((u64)*base == L1_CACHE_ALIGN((u64)*base))\r\n"
+ " \t\treturn *base;\r\n"
+ "-\t}\r\n"
+ "+\r\n"
+ " \tkfree(*base);\r\n"
+ " \r\n"
+ " \t/* nope, we'll have to do it ourselves */\r\n"
+ " \t*base = kzalloc(size + L1_CACHE_BYTES, flags);\r\n"
+ "-\tif (*base == NULL) {\r\n"
+ "+\tif (*base == NULL)\r\n"
+ " \t\treturn NULL;\r\n"
+ "-\t}\r\n"
+ "+\r\n"
+ " \treturn (void *)L1_CACHE_ALIGN((u64)*base);\r\n"
+ " }\r\n"
+ " \r\n"
+ "@@ -98,6 +98,7 @@ xpc_setup_infrastructure(struct xpc_part\r\n"
+ " \tint ret, cpuid;\r\n"
+ " \tstruct timer_list *timer;\r\n"
+ " \tshort partid = XPC_PARTID(part);\r\n"
+ "+\tenum xp_retval retval;\r\n"
+ " \r\n"
+ " \t/*\r\n"
+ " \t * Zero out MOST of the entry for this partition. Only the fields\r\n"
+ "@@ -127,11 +128,10 @@ xpc_setup_infrastructure(struct xpc_part\r\n"
+ " \t\t\t\t\t\t\tGFP_KERNEL,\r\n"
+ " \t\t\t\t\t\t\t&part->local_GPs_base);\r\n"
+ " \tif (part->local_GPs == NULL) {\r\n"
+ "-\t\tkfree(part->channels);\r\n"
+ "-\t\tpart->channels = NULL;\r\n"
+ " \t\tdev_err(xpc_chan, \"can't get memory for local get/put \"\r\n"
+ " \t\t\t\"values\\n\");\r\n"
+ "-\t\treturn xpNoMemory;\r\n"
+ "+\t\tretval = xpNoMemory;\r\n"
+ "+\t\tgoto out_1;\r\n"
+ " \t}\r\n"
+ " \r\n"
+ " \tpart->remote_GPs = xpc_kzalloc_cacheline_aligned(XPC_GP_SIZE,\r\n"
+ "@@ -141,11 +141,8 @@ xpc_setup_infrastructure(struct xpc_part\r\n"
+ " \tif (part->remote_GPs == NULL) {\r\n"
+ " \t\tdev_err(xpc_chan, \"can't get memory for remote get/put \"\r\n"
+ " \t\t\t\"values\\n\");\r\n"
+ "-\t\tkfree(part->local_GPs_base);\r\n"
+ "-\t\tpart->local_GPs = NULL;\r\n"
+ "-\t\tkfree(part->channels);\r\n"
+ "-\t\tpart->channels = NULL;\r\n"
+ "-\t\treturn xpNoMemory;\r\n"
+ "+\t\tretval = xpNoMemory;\r\n"
+ "+\t\tgoto out_2;\r\n"
+ " \t}\r\n"
+ " \r\n"
+ " \t/* allocate all the required open and close args */\r\n"
+ "@@ -155,13 +152,8 @@ xpc_setup_infrastructure(struct xpc_part\r\n"
+ " \t\t\t\t\t  &part->local_openclose_args_base);\r\n"
+ " \tif (part->local_openclose_args == NULL) {\r\n"
+ " \t\tdev_err(xpc_chan, \"can't get memory for local connect args\\n\");\r\n"
+ "-\t\tkfree(part->remote_GPs_base);\r\n"
+ "-\t\tpart->remote_GPs = NULL;\r\n"
+ "-\t\tkfree(part->local_GPs_base);\r\n"
+ "-\t\tpart->local_GPs = NULL;\r\n"
+ "-\t\tkfree(part->channels);\r\n"
+ "-\t\tpart->channels = NULL;\r\n"
+ "-\t\treturn xpNoMemory;\r\n"
+ "+\t\tretval = xpNoMemory;\r\n"
+ "+\t\tgoto out_3;\r\n"
+ " \t}\r\n"
+ " \r\n"
+ " \tpart->remote_openclose_args =\r\n"
+ "@@ -169,15 +161,8 @@ xpc_setup_infrastructure(struct xpc_part\r\n"
+ " \t\t\t\t\t  &part->remote_openclose_args_base);\r\n"
+ " \tif (part->remote_openclose_args == NULL) {\r\n"
+ " \t\tdev_err(xpc_chan, \"can't get memory for remote connect args\\n\");\r\n"
+ "-\t\tkfree(part->local_openclose_args_base);\r\n"
+ "-\t\tpart->local_openclose_args = NULL;\r\n"
+ "-\t\tkfree(part->remote_GPs_base);\r\n"
+ "-\t\tpart->remote_GPs = NULL;\r\n"
+ "-\t\tkfree(part->local_GPs_base);\r\n"
+ "-\t\tpart->local_GPs = NULL;\r\n"
+ "-\t\tkfree(part->channels);\r\n"
+ "-\t\tpart->channels = NULL;\r\n"
+ "-\t\treturn xpNoMemory;\r\n"
+ "+\t\tretval = xpNoMemory;\r\n"
+ "+\t\tgoto out_4;\r\n"
+ " \t}\r\n"
+ " \r\n"
+ " \txpc_initialize_channels(part, partid);\r\n"
+ "@@ -201,17 +186,8 @@ xpc_setup_infrastructure(struct xpc_part\r\n"
+ " \tif (ret != 0) {\r\n"
+ " \t\tdev_err(xpc_chan, \"can't register NOTIFY IRQ handler, \"\r\n"
+ " \t\t\t\"errno=%d\\n\", -ret);\r\n"
+ "-\t\tkfree(part->remote_openclose_args_base);\r\n"
+ "-\t\tpart->remote_openclose_args = NULL;\r\n"
+ "-\t\tkfree(part->local_openclose_args_base);\r\n"
+ "-\t\tpart->local_openclose_args = NULL;\r\n"
+ "-\t\tkfree(part->remote_GPs_base);\r\n"
+ "-\t\tpart->remote_GPs = NULL;\r\n"
+ "-\t\tkfree(part->local_GPs_base);\r\n"
+ "-\t\tpart->local_GPs = NULL;\r\n"
+ "-\t\tkfree(part->channels);\r\n"
+ "-\t\tpart->channels = NULL;\r\n"
+ "-\t\treturn xpLackOfResources;\r\n"
+ "+\t\tretval = xpLackOfResources;\r\n"
+ "+\t\tgoto out_5;\r\n"
+ " \t}\r\n"
+ " \r\n"
+ " \t/* Setup a timer to check for dropped IPIs */\r\n"
+ "@@ -246,6 +222,25 @@ xpc_setup_infrastructure(struct xpc_part\r\n"
+ " \txpc_vars_part[partid].magic = XPC_VP_MAGIC1;\r\n"
+ " \r\n"
+ " \treturn xpSuccess;\r\n"
+ "+\r\n"
+ "+\t/* setup of infrastructure failed */\r\n"
+ "+out_5:\r\n"
+ "+\tkfree(part->remote_openclose_args_base);\r\n"
+ "+\tpart->remote_openclose_args = NULL;\r\n"
+ "+out_4:\r\n"
+ "+\tkfree(part->local_openclose_args_base);\r\n"
+ "+\tpart->local_openclose_args = NULL;\r\n"
+ "+out_3:\r\n"
+ "+\tkfree(part->remote_GPs_base);\r\n"
+ "+\tpart->remote_GPs = NULL;\r\n"
+ "+out_2:\r\n"
+ "+\tkfree(part->local_GPs_base);\r\n"
+ "+\tpart->local_GPs = NULL;\r\n"
+ "+out_1:\r\n"
+ "+\tkfree(part->channels);\r\n"
+ "+\tpart->channels = NULL;\r\n"
+ "+\r\n"
+ "+\treturn retval;\r\n"
+ " }\r\n"
+ " \r\n"
+ " /*\r\n"
+ "@@ -266,9 +261,8 @@ xpc_pull_remote_cachelines(struct xpc_pa\r\n"
+ " \tDBUG_ON((u64)dst != L1_CACHE_ALIGN((u64)dst));\r\n"
+ " \tDBUG_ON(cnt != L1_CACHE_ALIGN(cnt));\r\n"
+ " \r\n"
+ "-\tif (part->act_state == XPC_P_AS_DEACTIVATING) {\r\n"
+ "+\tif (part->act_state == XPC_P_AS_DEACTIVATING)\r\n"
+ " \t\treturn part->reason;\r\n"
+ "-\t}\r\n"
+ " \r\n"
+ " \tret = xp_remote_memcpy(dst, src, cnt);\r\n"
+ " \tif (ret != xpSuccess) {\r\n"
+ "@@ -358,18 +352,16 @@ xpc_pull_remote_vars_part(struct xpc_par\r\n"
+ " \t\tpart->remote_IPI_nasid = pulled_entry->IPI_nasid;\r\n"
+ " \t\tpart->remote_IPI_phys_cpuid = pulled_entry->IPI_phys_cpuid;\r\n"
+ " \r\n"
+ "-\t\tif (part->nchannels > pulled_entry->nchannels) {\r\n"
+ "+\t\tif (part->nchannels > pulled_entry->nchannels)\r\n"
+ " \t\t\tpart->nchannels = pulled_entry->nchannels;\r\n"
+ "-\t\t}\r\n"
+ " \r\n"
+ " \t\t/* let the other side know that we've pulled their variables */\r\n"
+ " \r\n"
+ " \t\txpc_vars_part[partid].magic = XPC_VP_MAGIC2;\r\n"
+ " \t}\r\n"
+ " \r\n"
+ "-\tif (pulled_entry->magic == XPC_VP_MAGIC1) {\r\n"
+ "+\tif (pulled_entry->magic == XPC_VP_MAGIC1)\r\n"
+ " \t\treturn xpRetry;\r\n"
+ "-\t}\r\n"
+ " \r\n"
+ " \treturn xpSuccess;\r\n"
+ " }\r\n"
+ "@@ -389,9 +381,10 @@ xpc_get_IPI_flags(struct xpc_partition *\r\n"
+ " \t */\r\n"
+ " \r\n"
+ " \tspin_lock_irqsave(&part->IPI_lock, irq_flags);\r\n"
+ "-\tif ((IPI_amo = part->local_IPI_amo) != 0) {\r\n"
+ "+\tIPI_amo = part->local_IPI_amo;\r\n"
+ "+\tif (IPI_amo != 0)\r\n"
+ " \t\tpart->local_IPI_amo = 0;\r\n"
+ "-\t}\r\n"
+ "+\r\n"
+ " \tspin_unlock_irqrestore(&part->IPI_lock, irq_flags);\r\n"
+ " \r\n"
+ " \tif (XPC_ANY_OPENCLOSE_IPI_FLAGS_SET(IPI_amo)) {\r\n"
+ "@@ -445,11 +438,9 @@ xpc_allocate_local_msgqueue(struct xpc_c\r\n"
+ " \t\tnbytes = nentries * ch->msg_size;\r\n"
+ " \t\tch->local_msgqueue = xpc_kzalloc_cacheline_aligned(nbytes,\r\n"
+ " \t\t\t\t\t\t\t\t   GFP_KERNEL,\r\n"
+ "-\t\t\t\t\t\t\t\t   &ch->\r\n"
+ "-\t\t\t\t\t\t\t\t   local_msgqueue_base);\r\n"
+ "-\t\tif (ch->local_msgqueue == NULL) {\r\n"
+ "+\t\t\t\t\t\t      &ch->local_msgqueue_base);\r\n"
+ "+\t\tif (ch->local_msgqueue == NULL)\r\n"
+ " \t\t\tcontinue;\r\n"
+ "-\t\t}\r\n"
+ " \r\n"
+ " \t\tnbytes = nentries * sizeof(struct xpc_notify);\r\n"
+ " \t\tch->notify_queue = kzalloc(nbytes, GFP_KERNEL);\r\n"
+ "@@ -493,11 +484,9 @@ xpc_allocate_remote_msgqueue(struct xpc_\r\n"
+ " \t\tnbytes = nentries * ch->msg_size;\r\n"
+ " \t\tch->remote_msgqueue = xpc_kzalloc_cacheline_aligned(nbytes,\r\n"
+ " \t\t\t\t\t\t\t\t    GFP_KERNEL,\r\n"
+ "-\t\t\t\t\t\t\t\t    &ch->\r\n"
+ "-\t\t\t\t\t\t\t\t    remote_msgqueue_base);\r\n"
+ "-\t\tif (ch->remote_msgqueue == NULL) {\r\n"
+ "+\t\t\t\t\t\t     &ch->remote_msgqueue_base);\r\n"
+ "+\t\tif (ch->remote_msgqueue == NULL)\r\n"
+ " \t\t\tcontinue;\r\n"
+ "-\t\t}\r\n"
+ " \r\n"
+ " \t\tspin_lock_irqsave(&ch->lock, irq_flags);\r\n"
+ " \t\tif (nentries < ch->remote_nentries) {\r\n"
+ "@@ -529,11 +518,12 @@ xpc_allocate_msgqueues(struct xpc_channe\r\n"
+ " \r\n"
+ " \tDBUG_ON(ch->flags & XPC_C_SETUP);\r\n"
+ " \r\n"
+ "-\tif ((ret = xpc_allocate_local_msgqueue(ch)) != xpSuccess) {\r\n"
+ "+\tret = xpc_allocate_local_msgqueue(ch);\r\n"
+ "+\tif (ret != xpSuccess)\r\n"
+ " \t\treturn ret;\r\n"
+ "-\t}\r\n"
+ " \r\n"
+ "-\tif ((ret = xpc_allocate_remote_msgqueue(ch)) != xpSuccess) {\r\n"
+ "+\tret = xpc_allocate_remote_msgqueue(ch);\r\n"
+ "+\tif (ret != xpSuccess) {\r\n"
+ " \t\tkfree(ch->local_msgqueue_base);\r\n"
+ " \t\tch->local_msgqueue = NULL;\r\n"
+ " \t\tkfree(ch->notify_queue);\r\n"
+ "@@ -573,12 +563,11 @@ xpc_process_connect(struct xpc_channel *\r\n"
+ " \t\tret = xpc_allocate_msgqueues(ch);\r\n"
+ " \t\tspin_lock_irqsave(&ch->lock, *irq_flags);\r\n"
+ " \r\n"
+ "-\t\tif (ret != xpSuccess) {\r\n"
+ "+\t\tif (ret != xpSuccess)\r\n"
+ " \t\t\tXPC_DISCONNECT_CHANNEL(ch, ret, irq_flags);\r\n"
+ "-\t\t}\r\n"
+ "-\t\tif (ch->flags & (XPC_C_CONNECTED | XPC_C_DISCONNECTING)) {\r\n"
+ "+\r\n"
+ "+\t\tif (ch->flags & (XPC_C_CONNECTED | XPC_C_DISCONNECTING))\r\n"
+ " \t\t\treturn;\r\n"
+ "-\t\t}\r\n"
+ " \r\n"
+ " \t\tDBUG_ON(!(ch->flags & XPC_C_SETUP));\r\n"
+ " \t\tDBUG_ON(ch->local_msgqueue == NULL);\r\n"
+ "@@ -590,9 +579,8 @@ xpc_process_connect(struct xpc_channel *\r\n"
+ " \t\txpc_IPI_send_openreply(ch, irq_flags);\r\n"
+ " \t}\r\n"
+ " \r\n"
+ "-\tif (!(ch->flags & XPC_C_ROPENREPLY)) {\r\n"
+ "+\tif (!(ch->flags & XPC_C_ROPENREPLY))\r\n"
+ " \t\treturn;\r\n"
+ "-\t}\r\n"
+ " \r\n"
+ " \tDBUG_ON(ch->remote_msgqueue_pa == 0);\r\n"
+ " \r\n"
+ "@@ -711,9 +699,8 @@ xpc_process_disconnect(struct xpc_channe\r\n"
+ " \r\n"
+ " \tDBUG_ON(!spin_is_locked(&ch->lock));\r\n"
+ " \r\n"
+ "-\tif (!(ch->flags & XPC_C_DISCONNECTING)) {\r\n"
+ "+\tif (!(ch->flags & XPC_C_DISCONNECTING))\r\n"
+ " \t\treturn;\r\n"
+ "-\t}\r\n"
+ " \r\n"
+ " \tDBUG_ON(!(ch->flags & XPC_C_CLOSEREQUEST));\r\n"
+ " \r\n"
+ "@@ -728,26 +715,23 @@ xpc_process_disconnect(struct xpc_channe\r\n"
+ " \r\n"
+ " \tif (part->act_state == XPC_P_AS_DEACTIVATING) {\r\n"
+ " \t\t/* can't proceed until the other side disengages from us */\r\n"
+ "-\t\tif (xpc_partition_engaged(ch->partid)) {\r\n"
+ "+\t\tif (xpc_partition_engaged(ch->partid))\r\n"
+ " \t\t\treturn;\r\n"
+ "-\t\t}\r\n"
+ " \r\n"
+ " \t} else {\r\n"
+ " \r\n"
+ " \t\t/* as long as the other side is up do the full protocol */\r\n"
+ " \r\n"
+ "-\t\tif (!(ch->flags & XPC_C_RCLOSEREQUEST)) {\r\n"
+ "+\t\tif (!(ch->flags & XPC_C_RCLOSEREQUEST))\r\n"
+ " \t\t\treturn;\r\n"
+ "-\t\t}\r\n"
+ " \r\n"
+ " \t\tif (!(ch->flags & XPC_C_CLOSEREPLY)) {\r\n"
+ " \t\t\tch->flags |= XPC_C_CLOSEREPLY;\r\n"
+ " \t\t\txpc_IPI_send_closereply(ch, irq_flags);\r\n"
+ " \t\t}\r\n"
+ " \r\n"
+ "-\t\tif (!(ch->flags & XPC_C_RCLOSEREPLY)) {\r\n"
+ "+\t\tif (!(ch->flags & XPC_C_RCLOSEREPLY))\r\n"
+ " \t\t\treturn;\r\n"
+ "-\t\t}\r\n"
+ " \t}\r\n"
+ " \r\n"
+ " \t/* wake those waiting for notify completion */\r\n"
+ "@@ -807,9 +791,10 @@ xpc_process_openclose_IPI(struct xpc_par\r\n"
+ " \r\n"
+ " \tspin_lock_irqsave(&ch->lock, irq_flags);\r\n"
+ " \r\n"
+ "-      again:\r\n"
+ "+again:\r\n"
+ " \r\n"
+ "-\tif ((ch->flags & XPC_C_DISCONNECTED) && (ch->flags & XPC_C_WDISCONNECT)) {\r\n"
+ "+\tif ((ch->flags & XPC_C_DISCONNECTED) &&\r\n"
+ "+\t    (ch->flags & XPC_C_WDISCONNECT)) {\r\n"
+ " \t\t/*\r\n"
+ " \t\t * Delay processing IPI flags until thread waiting disconnect\r\n"
+ " \t\t * has had a chance to see that the channel is disconnected.\r\n"
+ "@@ -882,11 +867,10 @@ xpc_process_openclose_IPI(struct xpc_par\r\n"
+ " \r\n"
+ " \t\tif (!(ch->flags & XPC_C_DISCONNECTING)) {\r\n"
+ " \t\t\treason = args->reason;\r\n"
+ "-\t\t\tif (reason <= xpSuccess || reason > xpUnknownReason) {\r\n"
+ "+\t\t\tif (reason <= xpSuccess || reason > xpUnknownReason)\r\n"
+ " \t\t\t\treason = xpUnknownReason;\r\n"
+ "-\t\t\t} else if (reason == xpUnregistering) {\r\n"
+ "+\t\t\telse if (reason == xpUnregistering)\r\n"
+ " \t\t\t\treason = xpOtherUnregistering;\r\n"
+ "-\t\t\t}\r\n"
+ " \r\n"
+ " \t\t\tXPC_DISCONNECT_CHANNEL(ch, reason, &irq_flags);\r\n"
+ " \r\n"
+ "@@ -1060,9 +1044,8 @@ xpc_connect_channel(struct xpc_channel *\r\n"
+ " \tunsigned long irq_flags;\r\n"
+ " \tstruct xpc_registration *registration = &xpc_registrations[ch->number];\r\n"
+ " \r\n"
+ "-\tif (mutex_trylock(&registration->mutex) == 0) {\r\n"
+ "+\tif (mutex_trylock(&registration->mutex) == 0)\r\n"
+ " \t\treturn xpRetry;\r\n"
+ "-\t}\r\n"
+ " \r\n"
+ " \tif (!XPC_CHANNEL_REGISTERED(ch->number)) {\r\n"
+ " \t\tmutex_unlock(&registration->mutex);\r\n"
+ "@@ -1151,7 +1134,7 @@ xpc_clear_local_msgqueue_flags(struct xp\r\n"
+ " \t\t\t\t\t (get % ch->local_nentries) *\r\n"
+ " \t\t\t\t\t ch->msg_size);\r\n"
+ " \t\tmsg->flags = 0;\r\n"
+ "-\t} while (++get < (volatile s64)ch->remote_GP.get);\r\n"
+ "+\t} while (++get < ch->remote_GP.get);\r\n"
+ " }\r\n"
+ " \r\n"
+ " /*\r\n"
+ "@@ -1169,7 +1152,7 @@ xpc_clear_remote_msgqueue_flags(struct x\r\n"
+ " \t\t\t\t\t (put % ch->remote_nentries) *\r\n"
+ " \t\t\t\t\t ch->msg_size);\r\n"
+ " \t\tmsg->flags = 0;\r\n"
+ "-\t} while (++put < (volatile s64)ch->remote_GP.put);\r\n"
+ "+\t} while (++put < ch->remote_GP.put);\r\n"
+ " }\r\n"
+ " \r\n"
+ " static void\r\n"
+ "@@ -1236,9 +1219,8 @@ xpc_process_msg_IPI(struct xpc_partition\r\n"
+ " \t\t * If anyone was waiting for message queue entries to become\r\n"
+ " \t\t * available, wake them up.\r\n"
+ " \t\t */\r\n"
+ "-\t\tif (atomic_read(&ch->n_on_msg_allocate_wq) > 0) {\r\n"
+ "+\t\tif (atomic_read(&ch->n_on_msg_allocate_wq) > 0)\r\n"
+ " \t\t\twake_up(&ch->msg_allocate_wq);\r\n"
+ "-\t\t}\r\n"
+ " \t}\r\n"
+ " \r\n"
+ " \t/*\r\n"
+ "@@ -1265,9 +1247,8 @@ xpc_process_msg_IPI(struct xpc_partition\r\n"
+ " \t\t\t\t\"delivered=%d, partid=%d, channel=%d\\n\",\r\n"
+ " \t\t\t\tnmsgs_sent, ch->partid, ch->number);\r\n"
+ " \r\n"
+ "-\t\t\tif (ch->flags & XPC_C_CONNECTEDCALLOUT_MADE) {\r\n"
+ "+\t\t\tif (ch->flags & XPC_C_CONNECTEDCALLOUT_MADE)\r\n"
+ " \t\t\t\txpc_activate_kthreads(ch, nmsgs_sent);\r\n"
+ "-\t\t\t}\r\n"
+ " \t\t}\r\n"
+ " \t}\r\n"
+ " \r\n"
+ "@@ -1302,9 +1283,8 @@ xpc_process_channel_activity(struct xpc_\r\n"
+ " \r\n"
+ " \t\tIPI_flags = XPC_GET_IPI_FLAGS(IPI_amo, ch_number);\r\n"
+ " \r\n"
+ "-\t\tif (XPC_ANY_OPENCLOSE_IPI_FLAGS_SET(IPI_flags)) {\r\n"
+ "+\t\tif (XPC_ANY_OPENCLOSE_IPI_FLAGS_SET(IPI_flags))\r\n"
+ " \t\t\txpc_process_openclose_IPI(part, ch_number, IPI_flags);\r\n"
+ "-\t\t}\r\n"
+ " \r\n"
+ " \t\tch_flags = ch->flags;\t/* need an atomic snapshot of flags */\r\n"
+ " \r\n"
+ "@@ -1315,9 +1295,8 @@ xpc_process_channel_activity(struct xpc_\r\n"
+ " \t\t\tcontinue;\r\n"
+ " \t\t}\r\n"
+ " \r\n"
+ "-\t\tif (part->act_state == XPC_P_AS_DEACTIVATING) {\r\n"
+ "+\t\tif (part->act_state == XPC_P_AS_DEACTIVATING)\r\n"
+ " \t\t\tcontinue;\r\n"
+ "-\t\t}\r\n"
+ " \r\n"
+ " \t\tif (!(ch_flags & XPC_C_CONNECTED)) {\r\n"
+ " \t\t\tif (!(ch_flags & XPC_C_OPENREQUEST)) {\r\n"
+ "@@ -1337,9 +1316,8 @@ xpc_process_channel_activity(struct xpc_\r\n"
+ " \t\t * from the other partition.\r\n"
+ " \t\t */\r\n"
+ " \r\n"
+ "-\t\tif (XPC_ANY_MSG_IPI_FLAGS_SET(IPI_flags)) {\r\n"
+ "+\t\tif (XPC_ANY_MSG_IPI_FLAGS_SET(IPI_flags))\r\n"
+ " \t\t\txpc_process_msg_IPI(part, ch_number);\r\n"
+ "-\t\t}\r\n"
+ " \t}\r\n"
+ " }\r\n"
+ " \r\n"
+ "@@ -1552,9 +1530,9 @@ xpc_disconnect_channel(const int line, s\r\n"
+ " \r\n"
+ " \tDBUG_ON(!spin_is_locked(&ch->lock));\r\n"
+ " \r\n"
+ "-\tif (ch->flags & (XPC_C_DISCONNECTING | XPC_C_DISCONNECTED)) {\r\n"
+ "+\tif (ch->flags & (XPC_C_DISCONNECTING | XPC_C_DISCONNECTED))\r\n"
+ " \t\treturn;\r\n"
+ "-\t}\r\n"
+ "+\r\n"
+ " \tDBUG_ON(!(ch->flags & (XPC_C_CONNECTING | XPC_C_CONNECTED)));\r\n"
+ " \r\n"
+ " \tdev_dbg(xpc_chan, \"reason=%d, line=%d, partid=%d, channel=%d\\n\",\r\n"
+ "@@ -1570,9 +1548,8 @@ xpc_disconnect_channel(const int line, s\r\n"
+ " \r\n"
+ " \txpc_IPI_send_closerequest(ch, irq_flags);\r\n"
+ " \r\n"
+ "-\tif (channel_was_connected) {\r\n"
+ "+\tif (channel_was_connected)\r\n"
+ " \t\tch->flags |= XPC_C_WASCONNECTED;\r\n"
+ "-\t}\r\n"
+ " \r\n"
+ " \tspin_unlock_irqrestore(&ch->lock, *irq_flags);\r\n"
+ " \r\n"
+ "@@ -1587,9 +1564,8 @@ xpc_disconnect_channel(const int line, s\r\n"
+ " \t}\r\n"
+ " \r\n"
+ " \t/* wake those waiting to allocate an entry from the local msg queue */\r\n"
+ "-\tif (atomic_read(&ch->n_on_msg_allocate_wq) > 0) {\r\n"
+ "+\tif (atomic_read(&ch->n_on_msg_allocate_wq) > 0)\r\n"
+ " \t\twake_up(&ch->msg_allocate_wq);\r\n"
+ "-\t}\r\n"
+ " \r\n"
+ " \tspin_lock_irqsave(&ch->lock, *irq_flags);\r\n"
+ " }\r\n"
+ "@@ -1677,9 +1653,9 @@ xpc_allocate_msg(struct xpc_channel *ch,\r\n"
+ " \r\n"
+ " \twhile (1) {\r\n"
+ " \r\n"
+ "-\t\tput = (volatile s64)ch->w_local_GP.put;\r\n"
+ "-\t\tif (put - (volatile s64)ch->w_remote_GP.get <\r\n"
+ "-\t\t    ch->local_nentries) {\r\n"
+ "+\t\tput = ch->w_local_GP.put;\r\n"
+ "+\t\trmb();\t/* guarantee that .put loads before .get */\r\n"
+ "+\t\tif (put - ch->w_remote_GP.get < ch->local_nentries) {\r\n"
+ " \r\n"
+ " \t\t\t/* There are available message entries. We need to try\r\n"
+ " \t\t\t * to secure one for ourselves. We'll do this by trying\r\n"
+ "@@ -1703,9 +1679,8 @@ xpc_allocate_msg(struct xpc_channel *ch,\r\n"
+ " \t\t * that will cause the IPI handler to fetch the latest\r\n"
+ " \t\t * GP values as if an IPI was sent by the other side.\r\n"
+ " \t\t */\r\n"
+ "-\t\tif (ret == xpTimeout) {\r\n"
+ "+\t\tif (ret == xpTimeout)\r\n"
+ " \t\t\txpc_IPI_send_local_msgrequest(ch);\r\n"
+ "-\t\t}\r\n"
+ " \r\n"
+ " \t\tif (flags & XPC_NOWAIT) {\r\n"
+ " \t\t\txpc_msgqueue_deref(ch);\r\n"
+ "@@ -1764,9 +1739,8 @@ xpc_initiate_allocate(short partid, int \r\n"
+ " \t\tret = xpc_allocate_msg(&part->channels[ch_number], flags, &msg);\r\n"
+ " \t\txpc_part_deref(part);\r\n"
+ " \r\n"
+ "-\t\tif (msg != NULL) {\r\n"
+ "+\t\tif (msg != NULL)\r\n"
+ " \t\t\t*payload = &msg->payload;\r\n"
+ "-\t\t}\r\n"
+ " \t}\r\n"
+ " \r\n"
+ " \treturn ret;\r\n"
+ "@@ -1787,17 +1761,15 @@ xpc_send_msgs(struct xpc_channel *ch, s6\r\n"
+ " \twhile (1) {\r\n"
+ " \r\n"
+ " \t\twhile (1) {\r\n"
+ "-\t\t\tif (put == (volatile s64)ch->w_local_GP.put) {\r\n"
+ "+\t\t\tif (put == ch->w_local_GP.put)\r\n"
+ " \t\t\t\tbreak;\r\n"
+ "-\t\t\t}\r\n"
+ " \r\n"
+ " \t\t\tmsg = (struct xpc_msg *)((u64)ch->local_msgqueue +\r\n"
+ " \t\t\t\t\t\t (put % ch->local_nentries) *\r\n"
+ " \t\t\t\t\t\t ch->msg_size);\r\n"
+ " \r\n"
+ "-\t\t\tif (!(msg->flags & XPC_M_READY)) {\r\n"
+ "+\t\t\tif (!(msg->flags & XPC_M_READY))\r\n"
+ " \t\t\t\tbreak;\r\n"
+ "-\t\t\t}\r\n"
+ " \r\n"
+ " \t\t\tput++;\r\n"
+ " \t\t}\r\n"
+ "@@ -1810,7 +1782,7 @@ xpc_send_msgs(struct xpc_channel *ch, s6\r\n"
+ " \t\tif (cmpxchg_rel(&ch->local_GP->put, initial_put, put) !=\r\n"
+ " \t\t    initial_put) {\r\n"
+ " \t\t\t/* someone else beat us to it */\r\n"
+ "-\t\t\tDBUG_ON((volatile s64)ch->local_GP->put < initial_put);\r\n"
+ "+\t\t\tDBUG_ON(ch->local_GP->put < initial_put);\r\n"
+ " \t\t\tbreak;\r\n"
+ " \t\t}\r\n"
+ " \r\n"
+ "@@ -1829,9 +1801,8 @@ xpc_send_msgs(struct xpc_channel *ch, s6\r\n"
+ " \t\tinitial_put = put;\r\n"
+ " \t}\r\n"
+ " \r\n"
+ "-\tif (send_IPI) {\r\n"
+ "+\tif (send_IPI)\r\n"
+ " \t\txpc_IPI_send_msgrequest(ch);\r\n"
+ "-\t}\r\n"
+ " }\r\n"
+ " \r\n"
+ " /*\r\n"
+ "@@ -1905,9 +1876,8 @@ xpc_send_msg(struct xpc_channel *ch, str\r\n"
+ " \t/* see if the message is next in line to be sent, if so send it */\r\n"
+ " \r\n"
+ " \tput = ch->local_GP->put;\r\n"
+ "-\tif (put == msg_number) {\r\n"
+ "+\tif (put == msg_number)\r\n"
+ " \t\txpc_send_msgs(ch, put);\r\n"
+ "-\t}\r\n"
+ " \r\n"
+ " \t/* drop the reference grabbed in xpc_allocate_msg() */\r\n"
+ " \txpc_msgqueue_deref(ch);\r\n"
+ "@@ -2024,10 +1994,8 @@ xpc_pull_remote_msg(struct xpc_channel *\r\n"
+ " \r\n"
+ " \t\tmsg_index = ch->next_msg_to_pull % ch->remote_nentries;\r\n"
+ " \r\n"
+ "-\t\tDBUG_ON(ch->next_msg_to_pull >=\r\n"
+ "-\t\t\t(volatile s64)ch->w_remote_GP.put);\r\n"
+ "-\t\tnmsgs = (volatile s64)ch->w_remote_GP.put -\r\n"
+ "-\t\t    ch->next_msg_to_pull;\r\n"
+ "+\t\tDBUG_ON(ch->next_msg_to_pull >= ch->w_remote_GP.put);\r\n"
+ "+\t\tnmsgs = ch->w_remote_GP.put - ch->next_msg_to_pull;\r\n"
+ " \t\tif (msg_index + nmsgs > ch->remote_nentries) {\r\n"
+ " \t\t\t/* ignore the ones that wrap the msg queue for now */\r\n"
+ " \t\t\tnmsgs = ch->remote_nentries - msg_index;\r\n"
+ "@@ -2038,10 +2006,9 @@ xpc_pull_remote_msg(struct xpc_channel *\r\n"
+ " \t\tremote_msg = (struct xpc_msg *)(ch->remote_msgqueue_pa +\r\n"
+ " \t\t\t\t\t\tmsg_offset);\r\n"
+ " \r\n"
+ "-\t\tif ((ret = xpc_pull_remote_cachelines(part, msg, remote_msg,\r\n"
+ "-\t\t\t\t\t\t      nmsgs * ch->msg_size)) !=\r\n"
+ "-\t\t    xpSuccess) {\r\n"
+ "-\r\n"
+ "+\t\tret = xpc_pull_remote_cachelines(part, msg, remote_msg, nmsgs *\r\n"
+ "+\t\t\t\t\t\t ch->msg_size);\r\n"
+ "+\t\tif (ret != xpSuccess) {\r\n"
+ " \t\t\tdev_dbg(xpc_chan, \"failed to pull %d msgs starting with\"\r\n"
+ " \t\t\t\t\" msg %\" U64_ELL \"d from partition %d, \"\r\n"
+ " \t\t\t\t\"channel=%d, ret=%d\\n\", nmsgs,\r\n"
+ "@@ -2054,8 +2021,6 @@ xpc_pull_remote_msg(struct xpc_channel *\r\n"
+ " \t\t\treturn NULL;\r\n"
+ " \t\t}\r\n"
+ " \r\n"
+ "-\t\tmb();\t\t/* >>> this may not be needed, we're not sure */\r\n"
+ "-\r\n"
+ " \t\tch->next_msg_to_pull += nmsgs;\r\n"
+ " \t}\r\n"
+ " \r\n"
+ "@@ -2078,14 +2043,13 @@ xpc_get_deliverable_msg(struct xpc_chann\r\n"
+ " \ts64 get;\r\n"
+ " \r\n"
+ " \tdo {\r\n"
+ "-\t\tif ((volatile u32)ch->flags & XPC_C_DISCONNECTING) {\r\n"
+ "+\t\tif (ch->flags & XPC_C_DISCONNECTING)\r\n"
+ " \t\t\tbreak;\r\n"
+ "-\t\t}\r\n"
+ " \r\n"
+ "-\t\tget = (volatile s64)ch->w_local_GP.get;\r\n"
+ "-\t\tif (get == (volatile s64)ch->w_remote_GP.put) {\r\n"
+ "+\t\tget = ch->w_local_GP.get;\r\n"
+ "+\t\trmb();\t/* guarantee that .get loads before .put */\r\n"
+ "+\t\tif (get == ch->w_remote_GP.put)\r\n"
+ " \t\t\tbreak;\r\n"
+ "-\t\t}\r\n"
+ " \r\n"
+ " \t\t/* There are messages waiting to be pulled and delivered.\r\n"
+ " \t\t * We need to try to secure one for ourselves. We'll do this\r\n"
+ "@@ -2125,7 +2089,8 @@ xpc_deliver_msg(struct xpc_channel *ch)\r\n"
+ " {\r\n"
+ " \tstruct xpc_msg *msg;\r\n"
+ " \r\n"
+ "-\tif ((msg = xpc_get_deliverable_msg(ch)) != NULL) {\r\n"
+ "+\tmsg = xpc_get_deliverable_msg(ch);\r\n"
+ "+\tif (msg != NULL) {\r\n"
+ " \r\n"
+ " \t\t/*\r\n"
+ " \t\t * This ref is taken to protect the payload itself from being\r\n"
+ "@@ -2171,17 +2136,15 @@ xpc_acknowledge_msgs(struct xpc_channel \r\n"
+ " \twhile (1) {\r\n"
+ " \r\n"
+ " \t\twhile (1) {\r\n"
+ "-\t\t\tif (get == (volatile s64)ch->w_local_GP.get) {\r\n"
+ "+\t\t\tif (get == ch->w_local_GP.get)\r\n"
+ " \t\t\t\tbreak;\r\n"
+ "-\t\t\t}\r\n"
+ " \r\n"
+ " \t\t\tmsg = (struct xpc_msg *)((u64)ch->remote_msgqueue +\r\n"
+ " \t\t\t\t\t\t (get % ch->remote_nentries) *\r\n"
+ " \t\t\t\t\t\t ch->msg_size);\r\n"
+ " \r\n"
+ "-\t\t\tif (!(msg->flags & XPC_M_DONE)) {\r\n"
+ "+\t\t\tif (!(msg->flags & XPC_M_DONE))\r\n"
+ " \t\t\t\tbreak;\r\n"
+ "-\t\t\t}\r\n"
+ " \r\n"
+ " \t\t\tmsg_flags |= msg->flags;\r\n"
+ " \t\t\tget++;\r\n"
+ "@@ -2195,7 +2158,7 @@ xpc_acknowledge_msgs(struct xpc_channel \r\n"
+ " \t\tif (cmpxchg_rel(&ch->local_GP->get, initial_get, get) !=\r\n"
+ " \t\t    initial_get) {\r\n"
+ " \t\t\t/* someone else beat us to it */\r\n"
+ "-\t\t\tDBUG_ON((volatile s64)ch->local_GP->get <= initial_get);\r\n"
+ "+\t\t\tDBUG_ON(ch->local_GP->get <= initial_get);\r\n"
+ " \t\t\tbreak;\r\n"
+ " \t\t}\r\n"
+ " \r\n"
+ "@@ -2214,9 +2177,8 @@ xpc_acknowledge_msgs(struct xpc_channel \r\n"
+ " \t\tinitial_get = get;\r\n"
+ " \t}\r\n"
+ " \r\n"
+ "-\tif (send_IPI) {\r\n"
+ "+\tif (send_IPI)\r\n"
+ " \t\txpc_IPI_send_msgrequest(ch);\r\n"
+ "-\t}\r\n"
+ " }\r\n"
+ " \r\n"
+ " /*\r\n"
+ "@@ -2270,9 +2232,8 @@ xpc_initiate_received(short partid, int \r\n"
+ " \t * been delivered.\r\n"
+ " \t */\r\n"
+ " \tget = ch->local_GP->get;\r\n"
+ "-\tif (get == msg_number) {\r\n"
+ "+\tif (get == msg_number)\r\n"
+ " \t\txpc_acknowledge_msgs(ch, get, msg->flags);\r\n"
+ "-\t}\r\n"
+ " \r\n"
+ " \t/* the call to xpc_msgqueue_ref() was done by xpc_deliver_msg()  */\r\n"
+ " \txpc_msgqueue_deref(ch);\r\n"
+ "Index: linux-2.6/drivers/misc/xp/xpc.h\r\n"
+ "===================================================================\r\n"
+ "--- linux-2.6.orig/drivers/misc/xp/xpc.h\t2008-03-25 07:10:15.693148179 -0500\r\n"
+ "+++ linux-2.6/drivers/misc/xp/xpc.h\t2008-03-25 07:10:17.809412207 -0500\r\n"
+ "@@ -109,16 +109,16 @@ struct xpc_rsvd_page {\r\n"
+ " \tu8 SAL_partid;\t\t/* SAL: partition ID */\r\n"
+ " \tu8 version;\r\n"
+ " \tu8 pad[6];\r\n"
+ "-\tvolatile u64 vars_pa;\t/* physical address of struct xpc_vars */\r\n"
+ "+\tu64 vars_pa;\t\t/* physical address of struct xpc_vars */\r\n"
+ " \tstruct timespec stamp;\t/* time when reserved page was setup by XPC */\r\n"
+ " \tu64 pad2[9];\t\t/* align to last u64 in cacheline */\r\n"
+ " \tu64 SAL_nasids_size;\t/* SAL: size of each nasid mask in bytes */\r\n"
+ " };\r\n"
+ " \r\n"
+ "-#define XPC_RP_VERSION _XPC_VERSION(2,0)\t/* version 2.0 of the reserved page */\r\n"
+ "+#define XPC_RP_VERSION _XPC_VERSION(2, 0) /* version 2.0 of the reserved page */\r\n"
+ " \r\n"
+ " #define XPC_SUPPORTS_RP_STAMP(_version) \\\r\n"
+ "-\t\t\t(_version >= _XPC_VERSION(1,1))\r\n"
+ "+\t\t\t(_version >= _XPC_VERSION(1, 1))\r\n"
+ " \r\n"
+ " /*\r\n"
+ "  * compare stamps - the return value is:\r\n"
+ "@@ -132,9 +132,10 @@ xpc_compare_stamps(struct timespec *stam\r\n"
+ " {\r\n"
+ " \tint ret;\r\n"
+ " \r\n"
+ "-\tif ((ret = stamp1->tv_sec - stamp2->tv_sec) == 0) {\r\n"
+ "+\tret = stamp1->tv_sec - stamp2->tv_sec;\r\n"
+ "+\tif (ret == 0)\r\n"
+ " \t\tret = stamp1->tv_nsec - stamp2->tv_nsec;\r\n"
+ "-\t}\r\n"
+ "+\r\n"
+ " \treturn ret;\r\n"
+ " }\r\n"
+ " \r\n"
+ "@@ -166,10 +167,10 @@ struct xpc_vars {\r\n"
+ " \tu64 heartbeating_to_mask[BITS_TO_LONGS(XP_MAX_NPARTITIONS)];\r\n"
+ " };\r\n"
+ " \r\n"
+ "-#define XPC_V_VERSION _XPC_VERSION(4,0)\t/* version 4.0 of the cross vars */\r\n"
+ "+#define XPC_V_VERSION _XPC_VERSION(4, 0)    /* version 4.0 of the cross vars */\r\n"
+ " \r\n"
+ " #define XPC_SUPPORTS_DISENGAGE_REQUEST(_version) \\\r\n"
+ "-\t\t\t(_version >= _XPC_VERSION(3,1))\r\n"
+ "+\t\t\t(_version >= _XPC_VERSION(3, 1))\r\n"
+ " \r\n"
+ " static inline int\r\n"
+ " xpc_hb_allowed(short partid, struct xpc_vars *vars)\r\n"
+ "@@ -267,7 +268,7 @@ xpc_number_of_amos(int npartitions)\r\n"
+ "  * occupies half a cacheline.\r\n"
+ "  */\r\n"
+ " struct xpc_vars_part {\r\n"
+ "-\tvolatile u64 magic;\r\n"
+ "+\tu64 magic;\r\n"
+ " \r\n"
+ " \tu64 openclose_args_pa;\t/* physical address of open and close args */\r\n"
+ " \tu64 GPs_pa;\t\t/* physical address of Get/Put values */\r\n"
+ "@@ -290,8 +291,8 @@ struct xpc_vars_part {\r\n"
+ "  * MAGIC2 indicates that this partition has pulled the remote partititions\r\n"
+ "  * per partition variables that pertain to this partition.\r\n"
+ "  */\r\n"
+ "-#define XPC_VP_MAGIC1\t0x0053524156435058L\t/* 'XPCVARS\\0'L (little endian) */\r\n"
+ "-#define XPC_VP_MAGIC2\t0x0073726176435058L\t/* 'XPCvars\\0'L (little endian) */\r\n"
+ "+#define XPC_VP_MAGIC1\t0x0053524156435058L   /* 'XPCVARS\\0'L (little endian) */\r\n"
+ "+#define XPC_VP_MAGIC2\t0x0073726176435058L   /* 'XPCvars\\0'L (little endian) */\r\n"
+ " \r\n"
+ " /* the reserved page sizes and offsets */\r\n"
+ " \r\n"
+ "@@ -301,9 +302,10 @@ struct xpc_vars_part {\r\n"
+ " #define XPC_RP_PART_NASIDS(_rp) (u64 *)((u8 *)(_rp) + XPC_RP_HEADER_SIZE)\r\n"
+ " #define XPC_RP_MACH_NASIDS(_rp) (XPC_RP_PART_NASIDS(_rp) + \\\r\n"
+ " \t\t\t\t xp_nasid_mask_words())\r\n"
+ "-#define XPC_RP_VARS(_rp)\t(struct xpc_vars *)(XPC_RP_MACH_NASIDS(_rp) + \\\r\n"
+ "-\t\t\t\t xp_nasid_mask_words())\r\n"
+ "-#define XPC_RP_VARS_PART(_rp)\t(struct xpc_vars_part *)((u8 *)XPC_RP_VARS(_rp) + XPC_RP_VARS_SIZE)\r\n"
+ "+#define XPC_RP_VARS(_rp)\t((struct xpc_vars *)(XPC_RP_MACH_NASIDS(_rp) + \\\r\n"
+ "+\t\t\t\txp_nasid_mask_words()))\r\n"
+ "+#define XPC_RP_VARS_PART(_rp)\t((struct xpc_vars_part *) \\\r\n"
+ "+\t\t\t\t((u8 *)XPC_RP_VARS(_rp) + XPC_RP_VARS_SIZE))\r\n"
+ " \r\n"
+ " /*\r\n"
+ "  * Functions registered by add_timer() or called by kernel_thread() only\r\n"
+ "@@ -322,8 +324,8 @@ struct xpc_vars_part {\r\n"
+ "  * Define a Get/Put value pair (pointers) used with a message queue.\r\n"
+ "  */\r\n"
+ " struct xpc_gp {\r\n"
+ "-\tvolatile s64 get;\t/* Get value */\r\n"
+ "-\tvolatile s64 put;\t/* Put value */\r\n"
+ "+\ts64 get;\t\t/* Get value */\r\n"
+ "+\ts64 put;\t\t/* Put value */\r\n"
+ " };\r\n"
+ " \r\n"
+ " #define XPC_GP_SIZE \\\r\n"
+ "@@ -360,7 +362,7 @@ struct xpc_openclose_args {\r\n"
+ "  * and consumed by the intended recipient.\r\n"
+ "  */\r\n"
+ " struct xpc_notify {\r\n"
+ "-\tvolatile u8 type;\t/* type of notification */\r\n"
+ "+\tu8 type;\t\t/* type of notification */\r\n"
+ " \r\n"
+ " \t/* the following two fields are only used if type == XPC_N_CALL */\r\n"
+ " \txpc_notify_func func;\t/* user's notify function */\r\n"
+ "@@ -466,10 +468,10 @@ struct xpc_channel {\r\n"
+ " \tvoid *local_msgqueue_base;\t/* base address of kmalloc'd space */\r\n"
+ " \tstruct xpc_msg *local_msgqueue;\t/* local message queue */\r\n"
+ " \tvoid *remote_msgqueue_base;\t/* base address of kmalloc'd space */\r\n"
+ "-\tstruct xpc_msg *remote_msgqueue;\t/* cached copy of remote partition's */\r\n"
+ "-\t/* local message queue */\r\n"
+ "+\tstruct xpc_msg *remote_msgqueue; /* cached copy of remote partition's */\r\n"
+ "+\t\t\t\t\t /* local message queue */\r\n"
+ " \tu64 remote_msgqueue_pa;\t/* phys addr of remote partition's */\r\n"
+ "-\t/* local message queue */\r\n"
+ "+\t\t\t\t/* local message queue */\r\n"
+ " \r\n"
+ " \tatomic_t references;\t/* #of external references to queues */\r\n"
+ " \r\n"
+ "@@ -477,21 +479,21 @@ struct xpc_channel {\r\n"
+ " \twait_queue_head_t msg_allocate_wq;\t/* msg allocation wait queue */\r\n"
+ " \r\n"
+ " \tu8 delayed_IPI_flags;\t/* IPI flags received, but delayed */\r\n"
+ "-\t/* action until channel disconnected */\r\n"
+ "+\t\t\t\t/* action until channel disconnected */\r\n"
+ " \r\n"
+ " \t/* queue of msg senders who want to be notified when msg received */\r\n"
+ " \r\n"
+ " \tatomic_t n_to_notify;\t/* #of msg senders to notify */\r\n"
+ "-\tstruct xpc_notify *notify_queue;\t/* notify queue for messages sent */\r\n"
+ "+\tstruct xpc_notify *notify_queue;    /* notify queue for messages sent */\r\n"
+ " \r\n"
+ " \txpc_channel_func func;\t/* user's channel function */\r\n"
+ " \tvoid *key;\t\t/* pointer to user's key */\r\n"
+ " \r\n"
+ " \tstruct mutex msg_to_pull_mutex;\t/* next msg to pull serialization */\r\n"
+ "-\tstruct completion wdisconnect_wait;\t/* wait for channel disconnect */\r\n"
+ "+\tstruct completion wdisconnect_wait;    /* wait for channel disconnect */\r\n"
+ " \r\n"
+ "-\tstruct xpc_openclose_args *local_openclose_args;\t/* args passed on */\r\n"
+ "-\t/* opening or closing of channel */\r\n"
+ "+\tstruct xpc_openclose_args *local_openclose_args;    /* args passed on */\r\n"
+ "+\t\t\t\t\t     /* opening or closing of channel */\r\n"
+ " \r\n"
+ " \t/* various flavors of local and remote Get/Put values */\r\n"
+ " \r\n"
+ "@@ -519,28 +521,28 @@ struct xpc_channel {\r\n"
+ " \r\n"
+ " #define\tXPC_C_ROPENREPLY\t0x00000002\t/* remote open channel reply */\r\n"
+ " #define\tXPC_C_OPENREPLY\t\t0x00000004\t/* local open channel reply */\r\n"
+ "-#define\tXPC_C_ROPENREQUEST\t0x00000008\t/* remote open channel request */\r\n"
+ "+#define\tXPC_C_ROPENREQUEST\t0x00000008     /* remote open channel request */\r\n"
+ " #define\tXPC_C_OPENREQUEST\t0x00000010\t/* local open channel request */\r\n"
+ " \r\n"
+ "-#define\tXPC_C_SETUP\t\t0x00000020\t/* channel's msgqueues are alloc'd */\r\n"
+ "-#define\tXPC_C_CONNECTEDCALLOUT\t0x00000040\t/* connected callout initiated */\r\n"
+ "+#define\tXPC_C_SETUP\t\t0x00000020 /* channel's msgqueues are alloc'd */\r\n"
+ "+#define\tXPC_C_CONNECTEDCALLOUT\t0x00000040     /* connected callout initiated */\r\n"
+ " #define\tXPC_C_CONNECTEDCALLOUT_MADE \\\r\n"
+ "-\t\t\t\t0x00000080\t/* connected callout completed */\r\n"
+ "+\t\t\t\t0x00000080     /* connected callout completed */\r\n"
+ " #define\tXPC_C_CONNECTED\t\t0x00000100\t/* local channel is connected */\r\n"
+ " #define\tXPC_C_CONNECTING\t0x00000200\t/* channel is being connected */\r\n"
+ " \r\n"
+ " #define\tXPC_C_RCLOSEREPLY\t0x00000400\t/* remote close channel reply */\r\n"
+ " #define\tXPC_C_CLOSEREPLY\t0x00000800\t/* local close channel reply */\r\n"
+ "-#define\tXPC_C_RCLOSEREQUEST\t0x00001000\t/* remote close channel request */\r\n"
+ "-#define\tXPC_C_CLOSEREQUEST\t0x00002000\t/* local close channel request */\r\n"
+ "+#define\tXPC_C_RCLOSEREQUEST\t0x00001000    /* remote close channel request */\r\n"
+ "+#define\tXPC_C_CLOSEREQUEST\t0x00002000     /* local close channel request */\r\n"
+ " \r\n"
+ " #define\tXPC_C_DISCONNECTED\t0x00004000\t/* channel is disconnected */\r\n"
+ "-#define\tXPC_C_DISCONNECTING\t0x00008000\t/* channel is being disconnected */\r\n"
+ "+#define\tXPC_C_DISCONNECTING\t0x00008000   /* channel is being disconnected */\r\n"
+ " #define\tXPC_C_DISCONNECTINGCALLOUT \\\r\n"
+ "-\t\t\t\t0x00010000\t/* disconnecting callout initiated */\r\n"
+ "+\t\t\t\t0x00010000 /* disconnecting callout initiated */\r\n"
+ " #define\tXPC_C_DISCONNECTINGCALLOUT_MADE \\\r\n"
+ "-\t\t\t\t0x00020000\t/* disconnecting callout completed */\r\n"
+ "-#define\tXPC_C_WDISCONNECT\t0x00040000\t/* waiting for channel disconnect */\r\n"
+ "+\t\t\t\t0x00020000 /* disconnecting callout completed */\r\n"
+ "+#define\tXPC_C_WDISCONNECT\t0x00040000  /* waiting for channel disconnect */\r\n"
+ " \r\n"
+ " /*\r\n"
+ "  * Manages channels on a partition basis. There is one of these structures\r\n"
+ "@@ -554,7 +556,7 @@ struct xpc_partition {\r\n"
+ " \tu8 remote_rp_version;\t/* version# of partition's rsvd pg */\r\n"
+ " \tshort remote_npartitions;\t/* value of XPC_NPARTITIONS */\r\n"
+ " \tu32 flags;\t\t/* general flags */\r\n"
+ "-\tstruct timespec remote_rp_stamp;\t/* time when rsvd pg was initialized */\r\n"
+ "+\tstruct timespec remote_rp_stamp; /* time when rsvd pg was initialized */\r\n"
+ " \tu64 remote_rp_pa;\t/* phys addr of partition's rsvd pg */\r\n"
+ " \tu64 remote_vars_pa;\t/* phys addr of partition's vars */\r\n"
+ " \tu64 remote_vars_part_pa;\t/* phys addr of partition's vars part */\r\n"
+ "@@ -564,7 +566,7 @@ struct xpc_partition {\r\n"
+ " \tint remote_act_phys_cpuid;\t/* active part's act/deact phys cpuid */\r\n"
+ " \tu32 act_IRQ_rcvd;\t/* IRQs since activation */\r\n"
+ " \tspinlock_t lock;\t/* protect updating of act_state and */\r\n"
+ "-\t/* the general flags */\r\n"
+ "+\t\t\t\t/* the general flags */\r\n"
+ " \tu8 act_state;\t\t/* from XPC HB viewpoint */\r\n"
+ " \tu8 remote_vars_version;\t/* version# of partition's vars */\r\n"
+ " \tenum xp_retval reason;\t/* reason partition is deactivating */\r\n"
+ "@@ -576,7 +578,7 @@ struct xpc_partition {\r\n"
+ " \r\n"
+ " \t/* XPC infrastructure referencing and teardown control */\r\n"
+ " \r\n"
+ "-\tvolatile u8 setup_state;\t/* infrastructure setup state */\r\n"
+ "+\tu8 setup_state;\t\t/* infrastructure setup state */\r\n"
+ " \twait_queue_head_t teardown_wq;\t/* kthread waiting to teardown infra */\r\n"
+ " \tatomic_t references;\t/* #of references to infrastructure */\r\n"
+ " \r\n"
+ "@@ -588,25 +590,25 @@ struct xpc_partition {\r\n"
+ " \t */\r\n"
+ " \r\n"
+ " \tu8 nchannels;\t\t/* #of defined channels supported */\r\n"
+ "-\tatomic_t nchannels_active;\t/* #of channels that are not DISCONNECTED */\r\n"
+ "-\tatomic_t nchannels_engaged;\t/* #of channels engaged with remote part */\r\n"
+ "+\tatomic_t nchannels_active;  /* #of channels that are not DISCONNECTED */\r\n"
+ "+\tatomic_t nchannels_engaged;  /* #of channels engaged with remote part */\r\n"
+ " \tstruct xpc_channel *channels;\t/* array of channel structures */\r\n"
+ " \r\n"
+ " \tvoid *local_GPs_base;\t/* base address of kmalloc'd space */\r\n"
+ " \tstruct xpc_gp *local_GPs;\t/* local Get/Put values */\r\n"
+ " \tvoid *remote_GPs_base;\t/* base address of kmalloc'd space */\r\n"
+ "-\tstruct xpc_gp *remote_GPs;\t/* copy of remote partition's local Get/Put */\r\n"
+ "-\t/* values */\r\n"
+ "+\tstruct xpc_gp *remote_GPs;/* copy of remote partition's local Get/Put */\r\n"
+ "+\t\t\t\t  /* values */\r\n"
+ " \tu64 remote_GPs_pa;\t/* phys address of remote partition's local */\r\n"
+ "-\t/* Get/Put values */\r\n"
+ "+\t\t\t\t/* Get/Put values */\r\n"
+ " \r\n"
+ " \t/* fields used to pass args when opening or closing a channel */\r\n"
+ " \r\n"
+ "-\tvoid *local_openclose_args_base;\t/* base address of kmalloc'd space */\r\n"
+ "-\tstruct xpc_openclose_args *local_openclose_args;\t/* local's args */\r\n"
+ "-\tvoid *remote_openclose_args_base;\t/* base address of kmalloc'd space */\r\n"
+ "-\tstruct xpc_openclose_args *remote_openclose_args;\t/* copy of remote's */\r\n"
+ "-\t/* args */\r\n"
+ "+\tvoid *local_openclose_args_base;   /* base address of kmalloc'd space */\r\n"
+ "+\tstruct xpc_openclose_args *local_openclose_args;      /* local's args */\r\n"
+ "+\tvoid *remote_openclose_args_base;  /* base address of kmalloc'd space */\r\n"
+ "+\tstruct xpc_openclose_args *remote_openclose_args; /* copy of remote's */\r\n"
+ "+\t\t\t\t\t\t\t  /* args */\r\n"
+ " \tu64 remote_openclose_args_pa;\t/* phys addr of remote's args */\r\n"
+ " \r\n"
+ " \t/* IPI sending, receiving and handling related fields */\r\n"
+ "@@ -631,7 +633,7 @@ struct xpc_partition {\r\n"
+ " \r\n"
+ " /* struct xpc_partition flags */\r\n"
+ " \r\n"
+ "-#define\tXPC_P_RAMOSREGISTERED\t0x00000001\t/* remote AMOs were registered */\r\n"
+ "+#define\tXPC_P_RAMOSREGISTERED\t0x00000001    /* remote AMOs were registered */\r\n"
+ " \r\n"
+ " /* struct xpc_partition act_state values (for XPC HB) */\r\n"
+ " \r\n"
+ "@@ -725,9 +727,8 @@ extern void xpc_teardown_infrastructure(\r\n"
+ " static inline void\r\n"
+ " xpc_wakeup_channel_mgr(struct xpc_partition *part)\r\n"
+ " {\r\n"
+ "-\tif (atomic_inc_return(&part->channel_mgr_requests) == 1) {\r\n"
+ "+\tif (atomic_inc_return(&part->channel_mgr_requests) == 1)\r\n"
+ " \t\twake_up(&part->channel_mgr_wq);\r\n"
+ "-\t}\r\n"
+ " }\r\n"
+ " \r\n"
+ " /*\r\n"
+ "@@ -746,9 +747,8 @@ xpc_msgqueue_deref(struct xpc_channel *c\r\n"
+ " \ts32 refs = atomic_dec_return(&ch->references);\r\n"
+ " \r\n"
+ " \tDBUG_ON(refs < 0);\r\n"
+ "-\tif (refs == 0) {\r\n"
+ "+\tif (refs == 0)\r\n"
+ " \t\txpc_wakeup_channel_mgr(&xpc_partitions[ch->partid]);\r\n"
+ "-\t}\r\n"
+ " }\r\n"
+ " \r\n"
+ " #define XPC_DISCONNECT_CHANNEL(_ch, _reason, _irqflgs) \\\r\n"
+ "@@ -764,9 +764,8 @@ xpc_part_deref(struct xpc_partition *par\r\n"
+ " \ts32 refs = atomic_dec_return(&part->references);\r\n"
+ " \r\n"
+ " \tDBUG_ON(refs < 0);\r\n"
+ "-\tif (refs == 0 && part->setup_state == XPC_P_SS_WTEARDOWN) {\r\n"
+ "+\tif (refs == 0 && part->setup_state == XPC_P_SS_WTEARDOWN)\r\n"
+ " \t\twake_up(&part->teardown_wq);\r\n"
+ "-\t}\r\n"
+ " }\r\n"
+ " \r\n"
+ " static inline int\r\n"
+ "@@ -776,9 +775,9 @@ xpc_part_ref(struct xpc_partition *part)\r\n"
+ " \r\n"
+ " \tatomic_inc(&part->references);\r\n"
+ " \tsetup = (part->setup_state == XPC_P_SS_SETUP);\r\n"
+ "-\tif (!setup) {\r\n"
+ "+\tif (!setup)\r\n"
+ " \t\txpc_part_deref(part);\r\n"
+ "-\t}\r\n"
+ "+\r\n"
+ " \treturn setup;\r\n"
+ " }\r\n"
+ " \r\n"
+ "@@ -955,7 +954,7 @@ xpc_activate_IRQ_send(u64 amos_page_pa, \r\n"
+ " \t\t\t\t\tBIT_MASK(from_nasid / 2),\r\n"
+ " \t\t\t\t\tremote_amo, to_nasid,\r\n"
+ " \t\t\t\t\tto_phys_cpuid, SGI_XPC_ACTIVATE);\r\n"
+ "-\tBUG_ON(!remote_amo && ret != xpSuccess);\t/* should never happen */\r\n"
+ "+\tBUG_ON(!remote_amo && ret != xpSuccess);      /* should never happen */\r\n"
+ " }\r\n"
+ " \r\n"
+ " static inline void\r\n"
+ "@@ -1150,9 +1149,8 @@ xpc_check_for_channel_activity(struct xp\r\n"
+ " \r\n"
+ " \tret = xp_get_amo(part->local_IPI_amo_va, XP_AMO_CLEAR, &IPI_amo);\r\n"
+ " \tBUG_ON(ret != xpSuccess);\t/* should never happen */\r\n"
+ "-\tif (IPI_amo == 0) {\r\n"
+ "+\tif (IPI_amo == 0)\r\n"
+ " \t\treturn;\r\n"
+ "-\t}\r\n"
+ " \r\n"
+ " \tspin_lock_irqsave(&part->IPI_lock, irq_flags);\r\n"
+ " \tpart->local_IPI_amo |= IPI_amo;\r\n"
+ "Index: linux-2.6/drivers/misc/xp/xp_sn2.c\r\n"
+ "===================================================================\r\n"
+ "--- linux-2.6.orig/drivers/misc/xp/xp_sn2.c\t2008-03-25 07:10:15.693148179 -0500\r\n"
+ "+++ linux-2.6/drivers/misc/xp/xp_sn2.c\t2008-03-25 07:10:17.829414703 -0500\r\n"
+ "@@ -22,8 +22,6 @@\r\n"
+ " #include <asm/sn/sn_sal.h>\r\n"
+ " #include \"xp.h\"\r\n"
+ " \r\n"
+ "-extern struct device *xp;\r\n"
+ "-\r\n"
+ " /*\r\n"
+ "  * Register a nofault code region which performs a cross-partition PIO read.\r\n"
+ "  * If the PIO read times out, the MCA handler will consume the error and\r\n"
+ "@@ -187,10 +185,10 @@ xp_set_amo_sn2(u64 *amo_va, int op, u64 \r\n"
+ " \t\t * it until the heartbeat times out.\r\n"
+ " \t\t */\r\n"
+ " \t\tif (xp_nofault_PIOR((u64 *)GLOBAL_MMR_ADDR(NASID_GET(amo_va),\r\n"
+ "-\t\t\t\t\t\t\t   xp_nofault_PIOR_target))\r\n"
+ "-\t\t    != 0)\r\n"
+ "+\t\t\t\t\t\t\txp_nofault_PIOR_target))\r\n"
+ "+\t\t    != 0) {\r\n"
+ " \t\t\tret = xpPioReadError;\r\n"
+ "-\r\n"
+ "+\t\t}\r\n"
+ " \t\tlocal_irq_restore(irq_flags);\r\n"
+ " \t}\r\n"
+ " \r\n"
+ "@@ -226,10 +224,10 @@ xp_set_amo_with_interrupt_sn2(u64 *amo_v\r\n"
+ " \t\t * it until the heartbeat times out.\r\n"
+ " \t\t */\r\n"
+ " \t\tif (xp_nofault_PIOR((u64 *)GLOBAL_MMR_ADDR(NASID_GET(amo_va),\r\n"
+ "-\t\t\t\t\t\t\t   xp_nofault_PIOR_target))\r\n"
+ "-\t\t    != 0)\r\n"
+ "+\t\t\t\t\t\t\txp_nofault_PIOR_target))\r\n"
+ "+\t\t    != 0) {\r\n"
+ " \t\t\tret = xpPioReadError;\r\n"
+ "-\r\n"
+ "+\t\t}\r\n"
+ " \t\tlocal_irq_restore(irq_flags);\r\n"
+ " \t}\r\n"
+ " \r\n"
+ "@@ -323,10 +321,10 @@ xp_change_memprotect_shub_wars_1_1_sn2(i\r\n"
+ " \t\t\t/* save current protection values */\r\n"
+ " \t\t\txpc_prot_vec[node] =\r\n"
+ " \t\t\t    (u64)HUB_L((u64 *)GLOBAL_MMR_ADDR(nasid,\r\n"
+ "-\t\t\t\t\t\t\t      SH1_MD_DQLP_MMR_DIR_PRIVEC0));\r\n"
+ "+\t\t\t\t\t\t  SH1_MD_DQLP_MMR_DIR_PRIVEC0));\r\n"
+ " \t\t\t/* open up everything */\r\n"
+ " \t\t\tHUB_S((u64 *)GLOBAL_MMR_ADDR(nasid,\r\n"
+ "-\t\t\t\t\t\t     SH1_MD_DQLP_MMR_DIR_PRIVEC0),\r\n"
+ "+\t\t\t\t\t\t   SH1_MD_DQLP_MMR_DIR_PRIVEC0),\r\n"
+ " \t\t\t      -1UL);\r\n"
+ " \t\t\tHUB_S((u64 *)\r\n"
+ " \t\t\t      GLOBAL_MMR_ADDR(nasid,\r\n"
+ "@@ -338,15 +336,16 @@ xp_change_memprotect_shub_wars_1_1_sn2(i\r\n"
+ " \t\t\tnasid = cnodeid_to_nasid(node);\r\n"
+ " \t\t\t/* restore original protection values */\r\n"
+ " \t\t\tHUB_S((u64 *)GLOBAL_MMR_ADDR(nasid,\r\n"
+ "-\t\t\t\t\t\t     SH1_MD_DQLP_MMR_DIR_PRIVEC0),\r\n"
+ "+\t\t\t\t\t\t   SH1_MD_DQLP_MMR_DIR_PRIVEC0),\r\n"
+ " \t\t\t      xpc_prot_vec[node]);\r\n"
+ " \t\t\tHUB_S((u64 *)\r\n"
+ " \t\t\t      GLOBAL_MMR_ADDR(nasid,\r\n"
+ " \t\t\t\t\t      SH1_MD_DQRP_MMR_DIR_PRIVEC0),\r\n"
+ " \t\t\t      xpc_prot_vec[node]);\r\n"
+ " \t\t}\r\n"
+ "-\t} else\r\n"
+ "+\t} else {\r\n"
+ " \t\tBUG();\r\n"
+ "+\t}\r\n"
+ " }\r\n"
+ " \r\n"
+ " /* SH_IPI_ACCESS shub register value on startup */\r\n"
+ "Index: linux-2.6/drivers/misc/xp/xp_main.c\r\n"
+ "===================================================================\r\n"
+ "--- linux-2.6.orig/drivers/misc/xp/xp_main.c\t2008-03-25 07:10:15.697148678 -0500\r\n"
+ "+++ linux-2.6/drivers/misc/xp/xp_main.c\t2008-03-25 07:10:17.845416699 -0500\r\n"
+ "@@ -38,38 +38,58 @@ struct device *xp = &xp_dbg_subname;\r\n"
+ " u64 xp_nofault_PIOR_target;\r\n"
+ " \r\n"
+ " short xp_partition_id;\r\n"
+ "+EXPORT_SYMBOL_GPL(xp_partition_id);\r\n"
+ " u8 xp_region_size;\r\n"
+ "+EXPORT_SYMBOL_GPL(xp_region_size);\r\n"
+ " unsigned long xp_rtc_cycles_per_second;\r\n"
+ "+EXPORT_SYMBOL_GPL(xp_rtc_cycles_per_second);\r\n"
+ " \r\n"
+ " enum xp_retval (*xp_remote_memcpy) (void *dst, const void *src, size_t len);\r\n"
+ "+EXPORT_SYMBOL_GPL(xp_remote_memcpy);\r\n"
+ " \r\n"
+ " enum xp_retval (*xp_register_remote_amos) (u64 paddr, size_t len);\r\n"
+ "+EXPORT_SYMBOL_GPL(xp_register_remote_amos);\r\n"
+ " enum xp_retval (*xp_unregister_remote_amos) (u64 paddr, size_t len);\r\n"
+ "+EXPORT_SYMBOL_GPL(xp_unregister_remote_amos);\r\n"
+ " \r\n"
+ " int xp_sizeof_nasid_mask;\r\n"
+ "+EXPORT_SYMBOL_GPL(xp_sizeof_nasid_mask);\r\n"
+ " int xp_sizeof_amo;\r\n"
+ "+EXPORT_SYMBOL_GPL(xp_sizeof_amo);\r\n"
+ " \r\n"
+ " u64 *(*xp_alloc_amos) (int n_amos);\r\n"
+ "+EXPORT_SYMBOL_GPL(xp_alloc_amos);\r\n"
+ " void (*xp_free_amos) (u64 *amos_page, int n_amos);\r\n"
+ "+EXPORT_SYMBOL_GPL(xp_free_amos);\r\n"
+ " \r\n"
+ " enum xp_retval (*xp_set_amo) (u64 *amo_va, int op, u64 operand, int remote);\r\n"
+ "+EXPORT_SYMBOL_GPL(xp_set_amo);\r\n"
+ " enum xp_retval (*xp_set_amo_with_interrupt) (u64 *amo_va, int op, u64 operand,\r\n"
+ " \t\t\t\t\t     int remote, int nasid,\r\n"
+ " \t\t\t\t\t     int phys_cpuid, int vector);\r\n"
+ "+EXPORT_SYMBOL_GPL(xp_set_amo_with_interrupt);\r\n"
+ " \r\n"
+ " enum xp_retval (*xp_get_amo) (u64 *amo_va, int op, u64 *amo_value_addr);\r\n"
+ "+EXPORT_SYMBOL_GPL(xp_get_amo);\r\n"
+ " \r\n"
+ " enum xp_retval (*xp_get_partition_rsvd_page_pa) (u64 buf, u64 *cookie,\r\n"
+ " \t\t\t\t\t\t u64 *paddr, size_t *len);\r\n"
+ "+EXPORT_SYMBOL_GPL(xp_get_partition_rsvd_page_pa);\r\n"
+ " \r\n"
+ " enum xp_retval (*xp_change_memprotect) (u64 paddr, size_t len, int request,\r\n"
+ " \t\t\t\t\tu64 *nasid_array);\r\n"
+ "+EXPORT_SYMBOL_GPL(xp_change_memprotect);\r\n"
+ " void (*xp_change_memprotect_shub_wars_1_1) (int request);\r\n"
+ "+EXPORT_SYMBOL_GPL(xp_change_memprotect_shub_wars_1_1);\r\n"
+ " void (*xp_allow_IPI_ops) (void);\r\n"
+ "+EXPORT_SYMBOL_GPL(xp_allow_IPI_ops);\r\n"
+ " void (*xp_disallow_IPI_ops) (void);\r\n"
+ "+EXPORT_SYMBOL_GPL(xp_disallow_IPI_ops);\r\n"
+ " \r\n"
+ " int (*xp_cpu_to_nasid) (int cpuid);\r\n"
+ "+EXPORT_SYMBOL_GPL(xp_cpu_to_nasid);\r\n"
+ " int (*xp_node_to_nasid) (int nid);\r\n"
+ "+EXPORT_SYMBOL_GPL(xp_node_to_nasid);\r\n"
+ " \r\n"
+ " /*\r\n"
+ "  * Initialize the XPC interface to indicate that XPC isn't loaded.\r\n"
+ "@@ -90,6 +110,7 @@ struct xpc_interface xpc_interface = {\r\n"
+ " \t(void (*)(short, int, void *))xpc_notloaded,\r\n"
+ " \t(enum xp_retval(*)(short, void *))xpc_notloaded\r\n"
+ " };\r\n"
+ "+EXPORT_SYMBOL_GPL(xpc_interface);\r\n"
+ " \r\n"
+ " /*\r\n"
+ "  * XPC calls this when it (the XPC module) has been loaded.\r\n"
+ "@@ -112,6 +133,7 @@ xpc_set_interface(void (*connect) (int),\r\n"
+ " \txpc_interface.received = received;\r\n"
+ " \txpc_interface.partid_to_nasids = partid_to_nasids;\r\n"
+ " }\r\n"
+ "+EXPORT_SYMBOL_GPL(xpc_set_interface);\r\n"
+ " \r\n"
+ " /*\r\n"
+ "  * XPC calls this when it (the XPC module) is being unloaded.\r\n"
+ "@@ -133,12 +155,14 @@ xpc_clear_interface(void)\r\n"
+ " \txpc_interface.partid_to_nasids = (enum xp_retval(*)(short, void *))\r\n"
+ " \t    xpc_notloaded;\r\n"
+ " }\r\n"
+ "+EXPORT_SYMBOL_GPL(xpc_clear_interface);\r\n"
+ " \r\n"
+ " /*\r\n"
+ "  * xpc_registrations[] keeps track of xpc_connect()'s done by the kernel-level\r\n"
+ "  * users of XPC.\r\n"
+ "  */\r\n"
+ " struct xpc_registration xpc_registrations[XPC_NCHANNELS];\r\n"
+ "+EXPORT_SYMBOL_GPL(xpc_registrations);\r\n"
+ " \r\n"
+ " /*\r\n"
+ "  * Register for automatic establishment of a channel connection whenever\r\n"
+ "@@ -177,9 +201,8 @@ xpc_connect(int ch_number, xpc_channel_f\r\n"
+ " \r\n"
+ " \tregistration = &xpc_registrations[ch_number];\r\n"
+ " \r\n"
+ "-\tif (mutex_lock_interruptible(&registration->mutex) != 0) {\r\n"
+ "+\tif (mutex_lock_interruptible(&registration->mutex) != 0)\r\n"
+ " \t\treturn xpInterrupted;\r\n"
+ "-\t}\r\n"
+ " \r\n"
+ " \t/* if XPC_CHANNEL_REGISTERED(ch_number) */\r\n"
+ " \tif (registration->func != NULL) {\r\n"
+ "@@ -201,6 +224,7 @@ xpc_connect(int ch_number, xpc_channel_f\r\n"
+ " \r\n"
+ " \treturn xpSuccess;\r\n"
+ " }\r\n"
+ "+EXPORT_SYMBOL_GPL(xpc_connect);\r\n"
+ " \r\n"
+ " /*\r\n"
+ "  * Remove the registration for automatic connection of the specified channel\r\n"
+ "@@ -251,9 +275,7 @@ xpc_disconnect(int ch_number)\r\n"
+ " \r\n"
+ " \treturn;\r\n"
+ " }\r\n"
+ "-\r\n"
+ "-extern enum xp_retval xp_init_sn2(void);\r\n"
+ "-extern enum xp_retval xp_init_uv(void);\r\n"
+ "+EXPORT_SYMBOL_GPL(xpc_disconnect);\r\n"
+ " \r\n"
+ " int __init\r\n"
+ " xp_init(void)\r\n"
+ "@@ -268,23 +290,18 @@ xp_init(void)\r\n"
+ " \telse\r\n"
+ " \t\tret = xpUnsupported;\r\n"
+ " \r\n"
+ "-\tif (ret != xpSuccess) {\r\n"
+ "+\tif (ret != xpSuccess)\r\n"
+ " \t\treturn -ENODEV;\r\n"
+ "-\t}\r\n"
+ " \r\n"
+ " \t/* initialize the connection registration mutex */\r\n"
+ "-\tfor (ch_number = 0; ch_number < XPC_NCHANNELS; ch_number++) {\r\n"
+ "+\tfor (ch_number = 0; ch_number < XPC_NCHANNELS; ch_number++)\r\n"
+ " \t\tmutex_init(&xpc_registrations[ch_number].mutex);\r\n"
+ "-\t}\r\n"
+ " \r\n"
+ " \treturn 0;\r\n"
+ " }\r\n"
+ " \r\n"
+ " module_init(xp_init);\r\n"
+ " \r\n"
+ "-extern void xp_exit_sn2(void);\r\n"
+ "-extern void xp_exit_uv(void);\r\n"
+ "-\r\n"
+ " void __exit\r\n"
+ " xp_exit(void)\r\n"
+ " {\r\n"
+ "@@ -299,30 +316,3 @@ module_exit(xp_exit);\r\n"
+ " MODULE_AUTHOR(\"Silicon Graphics, Inc.\");\r\n"
+ " MODULE_DESCRIPTION(\"Cross Partition (XP) base\");\r\n"
+ " MODULE_LICENSE(\"GPL\");\r\n"
+ "-\r\n"
+ "-EXPORT_SYMBOL(xp_partition_id);\r\n"
+ "-EXPORT_SYMBOL(xp_region_size);\r\n"
+ "-EXPORT_SYMBOL(xp_rtc_cycles_per_second);\r\n"
+ "-EXPORT_SYMBOL(xp_remote_memcpy);\r\n"
+ "-EXPORT_SYMBOL(xp_register_remote_amos);\r\n"
+ "-EXPORT_SYMBOL(xp_unregister_remote_amos);\r\n"
+ "-EXPORT_SYMBOL(xp_sizeof_nasid_mask);\r\n"
+ "-EXPORT_SYMBOL(xp_sizeof_amo);\r\n"
+ "-EXPORT_SYMBOL(xp_alloc_amos);\r\n"
+ "-EXPORT_SYMBOL(xp_free_amos);\r\n"
+ "-EXPORT_SYMBOL(xp_set_amo);\r\n"
+ "-EXPORT_SYMBOL(xp_set_amo_with_interrupt);\r\n"
+ "-EXPORT_SYMBOL(xp_get_amo);\r\n"
+ "-EXPORT_SYMBOL(xp_get_partition_rsvd_page_pa);\r\n"
+ "-EXPORT_SYMBOL(xp_change_memprotect);\r\n"
+ "-EXPORT_SYMBOL(xp_change_memprotect_shub_wars_1_1);\r\n"
+ "-EXPORT_SYMBOL(xp_allow_IPI_ops);\r\n"
+ "-EXPORT_SYMBOL(xp_disallow_IPI_ops);\r\n"
+ "-EXPORT_SYMBOL(xp_cpu_to_nasid);\r\n"
+ "-EXPORT_SYMBOL(xp_node_to_nasid);\r\n"
+ "-EXPORT_SYMBOL(xpc_registrations);\r\n"
+ "-EXPORT_SYMBOL(xpc_interface);\r\n"
+ "-EXPORT_SYMBOL(xpc_clear_interface);\r\n"
+ "-EXPORT_SYMBOL(xpc_set_interface);\r\n"
+ "-EXPORT_SYMBOL(xpc_connect);\r\n"
+ "-EXPORT_SYMBOL(xpc_disconnect);\r\n"
+ "Index: linux-2.6/drivers/misc/xp/xp_uv.c\r\n"
+ "===================================================================\r\n"
+ "--- linux-2.6.orig/drivers/misc/xp/xp_uv.c\t2008-03-25 07:10:15.697148678 -0500\r\n"
+ "+++ linux-2.6/drivers/misc/xp/xp_uv.c\t2008-03-25 07:10:17.861418696 -0500\r\n"
+ "@@ -18,8 +18,6 @@\r\n"
+ " #include <linux/device.h>\r\n"
+ " #include \"xp.h\"\r\n"
+ " \r\n"
+ "-extern struct device *xp;\r\n"
+ "-\r\n"
+ " static enum xp_retval\r\n"
+ " xp_register_nofault_code_uv(void)\r\n"
+ " {\r\n"
+ "\r\n"
 
-5d419ae95dbeb5baeb3419097c40cf93e7a5b38bff927ab223e5130af8f8bad9
+f3582e19f5b52286d927ab4678b9435f9371da6e53119a2cd20320ecde98daab

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.