Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 252836
b: refs/heads/master
c: cab0d85
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed May 29, 2011
1 parent fcfc97c commit 891f4c2
Show file tree
Hide file tree
Showing 101 changed files with 2,205 additions and 966 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: 3c5cffb66d8ea94832650fcb55194715b0229088
refs/heads/master: cab0d85c8dfcad4d799f9c294571440c6f1db091
5 changes: 5 additions & 0 deletions trunk/Documentation/acpi/method-customizing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,8 @@ Note: We can use a kernel with multiple custom ACPI method running,
But each individual write to debugfs can implement a SINGLE
method override. i.e. if we want to insert/override multiple
ACPI methods, we need to redo step c) ~ g) for multiple times.

Note: Be aware that root can mis-use this driver to modify arbitrary
memory and gain additional rights, if root's privileges got
restricted (for example if root is not allowed to load additional
modules after boot).
36 changes: 36 additions & 0 deletions trunk/Documentation/feature-removal-schedule.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,42 @@ be removed from this file.

---------------------------

What: x86 floppy disable_hlt
When: 2012
Why: ancient workaround of dubious utility clutters the
code used by everybody else.
Who: Len Brown <len.brown@intel.com>

---------------------------

What: CONFIG_APM_CPU_IDLE, and its ability to call APM BIOS in idle
When: 2012
Why: This optional sub-feature of APM is of dubious reliability,
and ancient APM laptops are likely better served by calling HLT.
Deleting CONFIG_APM_CPU_IDLE allows x86 to stop exporting
the pm_idle function pointer to modules.
Who: Len Brown <len.brown@intel.com>

----------------------------

What: x86_32 "no-hlt" cmdline param
When: 2012
Why: remove a branch from idle path, simplify code used by everybody.
This option disabled the use of HLT in idle and machine_halt()
for hardware that was flakey 15-years ago. Today we have
"idle=poll" that removed HLT from idle, and so if such a machine
is still running the upstream kernel, "idle=poll" is likely sufficient.
Who: Len Brown <len.brown@intel.com>

----------------------------

What: x86 "idle=mwait" cmdline param
When: 2012
Why: simplify x86 idle code
Who: Len Brown <len.brown@intel.com>

----------------------------

What: PRISM54
When: 2.6.34

Expand Down
1 change: 1 addition & 0 deletions trunk/arch/tile/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ config TILE
select GENERIC_IRQ_PROBE
select GENERIC_PENDING_IRQ if SMP
select GENERIC_IRQ_SHOW
select SYS_HYPERVISOR

# FIXME: investigate whether we need/want these options.
# select HAVE_IOREMAP_PROT
Expand Down
15 changes: 12 additions & 3 deletions trunk/arch/tile/include/asm/hardwall.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,25 @@
#define HARDWALL_DEACTIVATE \
_IO(HARDWALL_IOCTL_BASE, _HARDWALL_DEACTIVATE)

#define _HARDWALL_GET_ID 4
#define HARDWALL_GET_ID \
_IO(HARDWALL_IOCTL_BASE, _HARDWALL_GET_ID)

#ifndef __KERNEL__

/* This is the canonical name expected by userspace. */
#define HARDWALL_FILE "/dev/hardwall"

#else

/* Hook for /proc/tile/hardwall. */
struct seq_file;
int proc_tile_hardwall_show(struct seq_file *sf, void *v);
/* /proc hooks for hardwall. */
struct proc_dir_entry;
#ifdef CONFIG_HARDWALL
void proc_tile_hardwall_init(struct proc_dir_entry *root);
int proc_pid_hardwall(struct task_struct *task, char *buffer);
#else
static inline void proc_tile_hardwall_init(struct proc_dir_entry *root) {}
#endif

#endif

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/tile/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
extra-y := vmlinux.lds head_$(BITS).o
obj-y := backtrace.o entry.o init_task.o irq.o messaging.o \
pci-dma.o proc.o process.o ptrace.o reboot.o \
setup.o signal.o single_step.o stack.o sys.o time.o traps.o \
setup.o signal.o single_step.o stack.o sys.o sysfs.o time.o traps.o \
intvec_$(BITS).o regs_$(BITS).o tile-desc_$(BITS).o

obj-$(CONFIG_HARDWALL) += hardwall.o
Expand Down
90 changes: 66 additions & 24 deletions trunk/arch/tile/kernel/hardwall.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,25 @@
struct hardwall_info {
struct list_head list; /* "rectangles" list */
struct list_head task_head; /* head of tasks in this hardwall */
struct cpumask cpumask; /* cpus in the rectangle */
int ulhc_x; /* upper left hand corner x coord */
int ulhc_y; /* upper left hand corner y coord */
int width; /* rectangle width */
int height; /* rectangle height */
int id; /* integer id for this hardwall */
int teardown_in_progress; /* are we tearing this one down? */
};

/* Currently allocated hardwall rectangles */
static LIST_HEAD(rectangles);

/* /proc/tile/hardwall */
static struct proc_dir_entry *hardwall_proc_dir;

/* Functions to manage files in /proc/tile/hardwall. */
static void hardwall_add_proc(struct hardwall_info *rect);
static void hardwall_remove_proc(struct hardwall_info *rect);

/*
* Guard changes to the hardwall data structures.
* This could be finer grained (e.g. one lock for the list of hardwall
Expand Down Expand Up @@ -105,6 +114,8 @@ static int setup_rectangle(struct hardwall_info *r, struct cpumask *mask)
r->ulhc_y = cpu_y(ulhc);
r->width = cpu_x(lrhc) - r->ulhc_x + 1;
r->height = cpu_y(lrhc) - r->ulhc_y + 1;
cpumask_copy(&r->cpumask, mask);
r->id = ulhc; /* The ulhc cpu id can be the hardwall id. */

/* Width and height must be positive */
if (r->width <= 0 || r->height <= 0)
Expand Down Expand Up @@ -388,6 +399,9 @@ static struct hardwall_info *hardwall_create(
/* Set up appropriate hardwalling on all affected cpus. */
hardwall_setup(rect);

/* Create a /proc/tile/hardwall entry. */
hardwall_add_proc(rect);

return rect;
}

Expand Down Expand Up @@ -645,6 +659,9 @@ static void hardwall_destroy(struct hardwall_info *rect)
/* Restart switch and disable firewall. */
on_each_cpu_mask(&mask, restart_udn_switch, NULL, 1);

/* Remove the /proc/tile/hardwall entry. */
hardwall_remove_proc(rect);

/* Now free the rectangle from the list. */
spin_lock_irqsave(&hardwall_lock, flags);
BUG_ON(!list_empty(&rect->task_head));
Expand All @@ -654,35 +671,57 @@ static void hardwall_destroy(struct hardwall_info *rect)
}


/*
* Dump hardwall state via /proc; initialized in arch/tile/sys/proc.c.
*/
int proc_tile_hardwall_show(struct seq_file *sf, void *v)
static int hardwall_proc_show(struct seq_file *sf, void *v)
{
struct hardwall_info *r;
struct hardwall_info *rect = sf->private;
char buf[256];

if (udn_disabled) {
seq_printf(sf, "%dx%d 0,0 pids:\n", smp_width, smp_height);
return 0;
}

spin_lock_irq(&hardwall_lock);
list_for_each_entry(r, &rectangles, list) {
struct task_struct *p;
seq_printf(sf, "%dx%d %d,%d pids:",
r->width, r->height, r->ulhc_x, r->ulhc_y);
list_for_each_entry(p, &r->task_head, thread.hardwall_list) {
unsigned int cpu = cpumask_first(&p->cpus_allowed);
unsigned int x = cpu % smp_width;
unsigned int y = cpu / smp_width;
seq_printf(sf, " %d@%d,%d", p->pid, x, y);
}
seq_printf(sf, "\n");
}
spin_unlock_irq(&hardwall_lock);
int rc = cpulist_scnprintf(buf, sizeof(buf), &rect->cpumask);
buf[rc++] = '\n';
seq_write(sf, buf, rc);
return 0;
}

static int hardwall_proc_open(struct inode *inode,
struct file *file)
{
return single_open(file, hardwall_proc_show, PDE(inode)->data);
}

static const struct file_operations hardwall_proc_fops = {
.open = hardwall_proc_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};

static void hardwall_add_proc(struct hardwall_info *rect)
{
char buf[64];
snprintf(buf, sizeof(buf), "%d", rect->id);
proc_create_data(buf, 0444, hardwall_proc_dir,
&hardwall_proc_fops, rect);
}

static void hardwall_remove_proc(struct hardwall_info *rect)
{
char buf[64];
snprintf(buf, sizeof(buf), "%d", rect->id);
remove_proc_entry(buf, hardwall_proc_dir);
}

int proc_pid_hardwall(struct task_struct *task, char *buffer)
{
struct hardwall_info *rect = task->thread.hardwall;
return rect ? sprintf(buffer, "%d\n", rect->id) : 0;
}

void proc_tile_hardwall_init(struct proc_dir_entry *root)
{
if (!udn_disabled)
hardwall_proc_dir = proc_mkdir("hardwall", root);
}


/*
* Character device support via ioctl/close.
Expand Down Expand Up @@ -716,6 +755,9 @@ static long hardwall_ioctl(struct file *file, unsigned int a, unsigned long b)
return -EINVAL;
return hardwall_deactivate(current);

case _HARDWALL_GET_ID:
return rect ? rect->id : -EINVAL;

default:
return -EINVAL;
}
Expand Down
73 changes: 73 additions & 0 deletions trunk/arch/tile/kernel/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <asm/processor.h>
#include <asm/sections.h>
#include <asm/homecache.h>
#include <asm/hardwall.h>
#include <arch/chip.h>


Expand Down Expand Up @@ -88,3 +89,75 @@ const struct seq_operations cpuinfo_op = {
.stop = c_stop,
.show = show_cpuinfo,
};

/*
* Support /proc/tile directory
*/

static int __init proc_tile_init(void)
{
struct proc_dir_entry *root = proc_mkdir("tile", NULL);
if (root == NULL)
return 0;

proc_tile_hardwall_init(root);

return 0;
}

arch_initcall(proc_tile_init);

/*
* Support /proc/sys/tile directory
*/

#ifndef __tilegx__ /* FIXME: GX: no support for unaligned access yet */
static ctl_table unaligned_subtable[] = {
{
.procname = "enabled",
.data = &unaligned_fixup,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec
},
{
.procname = "printk",
.data = &unaligned_printk,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec
},
{
.procname = "count",
.data = &unaligned_fixup_count,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec
},
{}
};

static ctl_table unaligned_table[] = {
{
.procname = "unaligned_fixup",
.mode = 0555,
.child = unaligned_subtable
},
{}
};
#endif

static struct ctl_path tile_path[] = {
{ .procname = "tile" },
{ }
};

static int __init proc_sys_tile_init(void)
{
#ifndef __tilegx__ /* FIXME: GX: no support for unaligned access yet */
register_sysctl_paths(tile_path, unaligned_table);
#endif
return 0;
}

arch_initcall(proc_sys_tile_init);
Loading

0 comments on commit 891f4c2

Please sign in to comment.