Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 261f3b49 authored by Dean Nelson's avatar Dean Nelson Committed by Linus Torvalds
Browse files

sgi-xp: enable building of XPC/XPNET on x86_64



Get XPC/XPNET to build on x86_64.  Trying to modprobe them up on a non-UV
or sn2 system will result in a -ENODEV.

Signed-off-by: default avatarDean Nelson <dcn@sgi.com>
Cc: Jack Steiner <steiner@sgi.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 81fe7883
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -426,7 +426,7 @@ config ENCLOSURE_SERVICES

config SGI_XP
	tristate "Support communication between SGI SSIs"
	depends on IA64_GENERIC || IA64_SGI_SN2
	depends on IA64_GENERIC || IA64_SGI_SN2 || IA64_SGI_UV || (X86_64 && SMP)
	select IA64_UNCACHED_ALLOCATOR if IA64_GENERIC || IA64_SGI_SN2
	select GENERIC_ALLOCATOR if IA64_GENERIC || IA64_SGI_SN2
	---help---
+10 −4
Original line number Diff line number Diff line
@@ -3,11 +3,17 @@
#

obj-$(CONFIG_SGI_XP)		+= xp.o
xp-y				:= xp_main.o xp_uv.o
xp-$(CONFIG_IA64)		+= xp_sn2.o xp_nofault.o
xp-y				:= xp_main.o
xp-$(CONFIG_IA64_SGI_SN2)	+= xp_sn2.o xp_nofault.o
xp-$(CONFIG_IA64_GENERIC)	+= xp_sn2.o xp_nofault.o xp_uv.o
xp-$(CONFIG_IA64_SGI_UV)	+= xp_uv.o
xp-$(CONFIG_X86_64)		+= xp_uv.o

obj-$(CONFIG_SGI_XP)		+= xpc.o
xpc-y				:= xpc_main.o xpc_uv.o xpc_channel.o xpc_partition.o
xpc-$(CONFIG_IA64)		+= xpc_sn2.o
xpc-y				:= xpc_main.o xpc_channel.o xpc_partition.o
xpc-$(CONFIG_IA64_SGI_SN2)	+= xpc_sn2.o
xpc-$(CONFIG_IA64_GENERIC)	+= xpc_sn2.o xpc_uv.o
xpc-$(CONFIG_IA64_SGI_UV) 	+= xpc_uv.o
xpc-$(CONFIG_X86_64)		+= xpc_uv.o

obj-$(CONFIG_SGI_XP)		+= xpnet.o
+21 −11
Original line number Diff line number Diff line
@@ -13,18 +13,17 @@
#ifndef _DRIVERS_MISC_SGIXP_XP_H
#define _DRIVERS_MISC_SGIXP_XP_H

#include <linux/cache.h>
#include <linux/hardirq.h>
#include <linux/mutex.h>
#include <asm/sn/types.h>

#ifdef CONFIG_IA64
#include <asm/sn/arch.h>
#include <asm/system.h>
#include <asm/sn/arch.h>	/* defines is_shub1() and is_shub2() */
#define is_shub()	ia64_platform_is("sn2")
#define is_uv()		ia64_platform_is("uv")
#endif

#ifdef USE_DBUG_ON
#define DBUG_ON(condition)	BUG_ON(condition)
#else
#define DBUG_ON(condition)
#ifdef CONFIG_X86_64
#include <asm/genapic.h>
#define is_uv()		is_uv_system()
#endif

#ifndef is_shub1
@@ -36,13 +35,19 @@
#endif

#ifndef is_shub
#define is_shub()	(is_shub1() || is_shub2())
#define is_shub()	0
#endif

#ifndef is_uv
#define is_uv()		0
#endif

#ifdef USE_DBUG_ON
#define DBUG_ON(condition)	BUG_ON(condition)
#else
#define DBUG_ON(condition)
#endif

/*
 * Define the maximum number of partitions the system can possibly support.
 * It is based on the maximum number of hardware partitionable regions. The
@@ -200,7 +205,9 @@ enum xp_retval {
	xpPayloadTooBig,	/* 55: payload too large for message slot */

	xpUnsupported,		/* 56: unsupported functionality or resource */
	xpUnknownReason		/* 57: unknown reason - must be last in enum */
	xpNeedMoreInfo,		/* 57: more info is needed by SAL */

	xpUnknownReason		/* 58: unknown reason - must be last in enum */
};

/*
@@ -339,8 +346,11 @@ xpc_partid_to_nasids(short partid, void *nasids)
}

extern short xp_max_npartitions;
extern short xp_partition_id;
extern u8 xp_region_size;

extern enum xp_retval (*xp_remote_memcpy) (void *, const void *, size_t);
extern int (*xp_cpu_to_nasid) (int);

extern u64 xp_nofault_PIOR_target;
extern int xp_nofault_PIOR(void *);
+9 −1
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@
 *
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/device.h>
#include "xp.h"
@@ -36,9 +35,18 @@ struct device *xp = &xp_dbg_subname;
short xp_max_npartitions;
EXPORT_SYMBOL_GPL(xp_max_npartitions);

short xp_partition_id;
EXPORT_SYMBOL_GPL(xp_partition_id);

u8 xp_region_size;
EXPORT_SYMBOL_GPL(xp_region_size);

enum xp_retval (*xp_remote_memcpy) (void *dst, const void *src, size_t len);
EXPORT_SYMBOL_GPL(xp_remote_memcpy);

int (*xp_cpu_to_nasid) (int cpuid);
EXPORT_SYMBOL_GPL(xp_cpu_to_nasid);

/*
 * xpc_registrations[] keeps track of xpc_connect()'s done by the kernel-level
 * users of XPC.
+10 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@
 *      Architecture specific implementation of common functions.
 */

#include <linux/module.h>
#include <linux/device.h>
#include <asm/sn/bte.h>
#include <asm/sn/sn_sal.h>
@@ -116,14 +117,23 @@ xp_remote_memcpy_sn2(void *vdst, const void *psrc, size_t len)
	return xpBteCopyError;
}

static int
xp_cpu_to_nasid_sn2(int cpuid)
{
	return cpuid_to_nasid(cpuid);
}

enum xp_retval
xp_init_sn2(void)
{
	BUG_ON(!is_shub());

	xp_max_npartitions = XP_MAX_NPARTITIONS_SN2;
	xp_partition_id = sn_partition_id;
	xp_region_size = sn_region_size;

	xp_remote_memcpy = xp_remote_memcpy_sn2;
	xp_cpu_to_nasid = xp_cpu_to_nasid_sn2;

	return xp_register_nofault_code_sn2();
}
Loading