Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 63463
b: refs/heads/master
c: 07cc0c9
h: refs/heads/master
i:
  63461: 6e26727
  63459: 678875d
  63455: 9e23bfe
v: v3
  • Loading branch information
Ralf Baechle committed Jul 31, 2007
1 parent b8494d1 commit cf269f9
Show file tree
Hide file tree
Showing 8 changed files with 204 additions and 170 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c3a005f4b6a7752608e75d016ef8d07c55285e48
refs/heads/master: 07cc0c9e65d3e262f871ea357dd77b41950b1ca5
24 changes: 12 additions & 12 deletions trunk/arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1377,17 +1377,6 @@ config MIPS_MT_SMTC
This is a kernel model which is known a SMTC or lately has been
marketesed into SMVP.

config MIPS_VPE_LOADER
bool "VPE loader support."
depends on SYS_SUPPORTS_MULTITHREADING
select CPU_MIPSR2_IRQ_VI
select CPU_MIPSR2_IRQ_EI
select CPU_MIPSR2_SRS
select MIPS_MT
help
Includes a loader for loading an elf relocatable object
onto another VPE and running it.

endchoice

config MIPS_MT
Expand All @@ -1398,8 +1387,19 @@ config SYS_SUPPORTS_MULTITHREADING

config MIPS_MT_FPAFF
bool "Dynamic FPU affinity for FP-intensive threads"
depends on MIPS_MT
default y
depends on MIPS_MT_SMP || MIPS_MT_SMTC

config MIPS_VPE_LOADER
bool "VPE loader support."
depends on SYS_SUPPORTS_MULTITHREADING
select CPU_MIPSR2_IRQ_VI
select CPU_MIPSR2_IRQ_EI
select CPU_MIPSR2_SRS
select MIPS_MT
help
Includes a loader for loading an elf relocatable object
onto another VPE and running it.

config MIPS_MT_SMTC_INSTANT_REPLAY
bool "Low-latency Dispatch of Deferred SMTC IPIs"
Expand Down
19 changes: 9 additions & 10 deletions trunk/arch/mips/kernel/kspd.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static int sp_stopping = 0;
#define MTSP_O_EXCL 0x0800
#define MTSP_O_BINARY 0x8000

#define SP_VPE 1
extern int tclimit;

struct apsp_table {
int sp;
Expand Down Expand Up @@ -225,8 +225,8 @@ void sp_work_handle_request(void)
/* Run the syscall at the priviledge of the user who loaded the
SP program */

if (vpe_getuid(SP_VPE))
sp_setfsuidgid( vpe_getuid(SP_VPE), vpe_getgid(SP_VPE));
if (vpe_getuid(tclimit))
sp_setfsuidgid(vpe_getuid(tclimit), vpe_getgid(tclimit));

switch (sc.cmd) {
/* needs the flags argument translating from SDE kit to
Expand All @@ -245,7 +245,7 @@ void sp_work_handle_request(void)

case MTSP_SYSCALL_EXIT:
list_for_each_entry(n, &kspd_notifylist, list)
n->kspd_sp_exit(SP_VPE);
n->kspd_sp_exit(tclimit);
sp_stopping = 1;

printk(KERN_DEBUG "KSPD got exit syscall from SP exitcode %d\n",
Expand All @@ -255,7 +255,7 @@ void sp_work_handle_request(void)
case MTSP_SYSCALL_OPEN:
generic.arg1 = translate_open_flags(generic.arg1);

vcwd = vpe_getcwd(SP_VPE);
vcwd = vpe_getcwd(tclimit);

/* change to the cwd of the process that loaded the SP program */
old_fs = get_fs();
Expand Down Expand Up @@ -283,7 +283,7 @@ void sp_work_handle_request(void)
break;
} /* switch */

if (vpe_getuid(SP_VPE))
if (vpe_getuid(tclimit))
sp_setfsuidgid( 0, 0);

old_fs = get_fs();
Expand Down Expand Up @@ -364,10 +364,9 @@ static void startwork(int vpe)
}

INIT_WORK(&work, sp_work);
queue_work(workqueue, &work);
} else
queue_work(workqueue, &work);
}

queue_work(workqueue, &work);
}

static void stopwork(int vpe)
Expand All @@ -389,7 +388,7 @@ static int kspd_module_init(void)

notify.start = startwork;
notify.stop = stopwork;
vpe_notify(SP_VPE, &notify);
vpe_notify(tclimit, &notify);

return 0;
}
Expand Down
22 changes: 22 additions & 0 deletions trunk/arch/mips/kernel/mips-mt.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,28 @@
#include <asm/r4kcache.h>
#include <asm/cacheflush.h>

int vpelimit;

static int __init maxvpes(char *str)
{
get_option(&str, &vpelimit);

return 1;
}

__setup("maxvpes=", maxvpes);

int tclimit;

static int __init maxtcs(char *str)
{
get_option(&str, &tclimit);

return 1;
}

__setup("maxtcs=", maxtcs);

/*
* Dump new MIPS MT state for the core. Does not leave TCs halted.
* Takes an argument which taken to be a pre-call MVPControl value.
Expand Down
22 changes: 17 additions & 5 deletions trunk/arch/mips/kernel/rtlx.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,11 @@
#include <asm/atomic.h>
#include <asm/cpu.h>
#include <asm/processor.h>
#include <asm/mips_mt.h>
#include <asm/system.h>
#include <asm/vpe.h>
#include <asm/rtlx.h>

#define RTLX_TARG_VPE 1

static struct rtlx_info *rtlx;
static int major;
static char module_name[] = "rtlx";
Expand Down Expand Up @@ -165,10 +164,10 @@ int rtlx_open(int index, int can_sleep)
}

if (rtlx == NULL) {
if( (p = vpe_get_shared(RTLX_TARG_VPE)) == NULL) {
if( (p = vpe_get_shared(tclimit)) == NULL) {
if (can_sleep) {
__wait_event_interruptible(channel_wqs[index].lx_queue,
(p = vpe_get_shared(RTLX_TARG_VPE)),
(p = vpe_get_shared(tclimit)),
ret);
if (ret)
goto out_fail;
Expand Down Expand Up @@ -477,6 +476,19 @@ static int rtlx_module_init(void)
struct device *dev;
int i, err;

if (!cpu_has_mipsmt) {
printk("VPE loader: not a MIPS MT capable processor\n");
return -ENODEV;
}

if (tclimit == 0) {
printk(KERN_WARNING "No TCs reserved for AP/SP, not "
"initializing RTLX.\nPass maxtcs=<n> argument as kernel "
"argument\n");

return -ENODEV;
}

major = register_chrdev(0, module_name, &rtlx_fops);
if (major < 0) {
printk(register_chrdev_failed);
Expand All @@ -501,7 +513,7 @@ static int rtlx_module_init(void)
/* set up notifiers */
notify.start = starting;
notify.stop = stopping;
vpe_notify(RTLX_TARG_VPE, &notify);
vpe_notify(tclimit, &notify);

if (cpu_has_vint)
set_vi_handler(MIPS_CPU_RTLX_IRQ, rtlx_dispatch);
Expand Down
16 changes: 0 additions & 16 deletions trunk/arch/mips/kernel/smtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,25 +86,11 @@ unsigned int smtc_status = 0;

/* Boot command line configuration overrides */

static int vpelimit = 0;
static int tclimit = 0;
static int ipibuffers = 0;
static int nostlb = 0;
static int asidmask = 0;
unsigned long smtc_asid_mask = 0xff;

static int __init maxvpes(char *str)
{
get_option(&str, &vpelimit);
return 1;
}

static int __init maxtcs(char *str)
{
get_option(&str, &tclimit);
return 1;
}

static int __init ipibufs(char *str)
{
get_option(&str, &ipibuffers);
Expand Down Expand Up @@ -137,8 +123,6 @@ static int __init asidmask_set(char *str)
return 1;
}

__setup("maxvpes=", maxvpes);
__setup("maxtcs=", maxtcs);
__setup("ipibufs=", ipibufs);
__setup("nostlb", stlb_disable);
__setup("asidmask=", asidmask_set);
Expand Down
Loading

0 comments on commit cf269f9

Please sign in to comment.