Merge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6
* 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6: [PATCH] x86-64: Use stricter in process stack check for unwinder [PATCH] i386: Fix compilation with UP genericarch [PATCH] x86-64: Fix warning in io_apic.c [PATCH] x86-64: work around gcc4 issue with -Os in Dwarf2 stack unwind [PATCH] x86_64: Align data segment to PAGE_SIZE boundary
This commit is contained in:
commit
707badb80b
4 changed files with 18 additions and 7 deletions
|
@ -754,10 +754,8 @@ void __setup_vector_irq(int cpu)
|
||||||
{
|
{
|
||||||
/* Initialize vector_irq on a new cpu */
|
/* Initialize vector_irq on a new cpu */
|
||||||
/* This function must be called with vector_lock held */
|
/* This function must be called with vector_lock held */
|
||||||
unsigned long flags;
|
|
||||||
int irq, vector;
|
int irq, vector;
|
||||||
|
|
||||||
|
|
||||||
/* Mark the inuse vectors */
|
/* Mark the inuse vectors */
|
||||||
for (irq = 0; irq < NR_IRQ_VECTORS; ++irq) {
|
for (irq = 0; irq < NR_IRQ_VECTORS; ++irq) {
|
||||||
if (!cpu_isset(cpu, irq_domain[irq]))
|
if (!cpu_isset(cpu, irq_domain[irq]))
|
||||||
|
|
|
@ -242,12 +242,19 @@ static int dump_trace_unwind(struct unwind_frame_info *info, void *context)
|
||||||
* severe exception (double fault, nmi, stack fault, debug, mce) hardware stack
|
* severe exception (double fault, nmi, stack fault, debug, mce) hardware stack
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
static inline int valid_stack_ptr(struct thread_info *tinfo, void *p)
|
||||||
|
{
|
||||||
|
void *t = (void *)tinfo;
|
||||||
|
return p > t && p < t + THREAD_SIZE - 3;
|
||||||
|
}
|
||||||
|
|
||||||
void dump_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long * stack,
|
void dump_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long * stack,
|
||||||
struct stacktrace_ops *ops, void *data)
|
struct stacktrace_ops *ops, void *data)
|
||||||
{
|
{
|
||||||
const unsigned cpu = smp_processor_id();
|
const unsigned cpu = smp_processor_id();
|
||||||
unsigned long *irqstack_end = (unsigned long *)cpu_pda(cpu)->irqstackptr;
|
unsigned long *irqstack_end = (unsigned long *)cpu_pda(cpu)->irqstackptr;
|
||||||
unsigned used = 0;
|
unsigned used = 0;
|
||||||
|
struct thread_info *tinfo;
|
||||||
|
|
||||||
if (!tsk)
|
if (!tsk)
|
||||||
tsk = current;
|
tsk = current;
|
||||||
|
@ -370,7 +377,8 @@ void dump_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long * s
|
||||||
/*
|
/*
|
||||||
* This handles the process stack:
|
* This handles the process stack:
|
||||||
*/
|
*/
|
||||||
HANDLE_STACK (((long) stack & (THREAD_SIZE-1)) != 0);
|
tinfo = current_thread_info();
|
||||||
|
HANDLE_STACK (valid_stack_ptr(tinfo, stack));
|
||||||
#undef HANDLE_STACK
|
#undef HANDLE_STACK
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(dump_trace);
|
EXPORT_SYMBOL(dump_trace);
|
||||||
|
|
|
@ -88,7 +88,11 @@ static inline void clustered_apic_check(void)
|
||||||
|
|
||||||
static inline int apicid_to_node(int logical_apicid)
|
static inline int apicid_to_node(int logical_apicid)
|
||||||
{
|
{
|
||||||
|
#ifdef CONFIG_SMP
|
||||||
return apicid_2_node[hard_smp_processor_id()];
|
return apicid_2_node[hard_smp_processor_id()];
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Mapping from cpu number to logical apicid */
|
/* Mapping from cpu number to logical apicid */
|
||||||
|
|
|
@ -938,8 +938,11 @@ int unwind(struct unwind_frame_info *frame)
|
||||||
else {
|
else {
|
||||||
retAddrReg = state.version <= 1 ? *ptr++ : get_uleb128(&ptr, end);
|
retAddrReg = state.version <= 1 ? *ptr++ : get_uleb128(&ptr, end);
|
||||||
/* skip augmentation */
|
/* skip augmentation */
|
||||||
if (((const char *)(cie + 2))[1] == 'z')
|
if (((const char *)(cie + 2))[1] == 'z') {
|
||||||
ptr += get_uleb128(&ptr, end);
|
uleb128_t augSize = get_uleb128(&ptr, end);
|
||||||
|
|
||||||
|
ptr += augSize;
|
||||||
|
}
|
||||||
if (ptr > end
|
if (ptr > end
|
||||||
|| retAddrReg >= ARRAY_SIZE(reg_info)
|
|| retAddrReg >= ARRAY_SIZE(reg_info)
|
||||||
|| REG_INVALID(retAddrReg)
|
|| REG_INVALID(retAddrReg)
|
||||||
|
@ -963,9 +966,7 @@ int unwind(struct unwind_frame_info *frame)
|
||||||
if (cie == NULL || fde == NULL) {
|
if (cie == NULL || fde == NULL) {
|
||||||
#ifdef CONFIG_FRAME_POINTER
|
#ifdef CONFIG_FRAME_POINTER
|
||||||
unsigned long top, bottom;
|
unsigned long top, bottom;
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONFIG_FRAME_POINTER
|
|
||||||
top = STACK_TOP(frame->task);
|
top = STACK_TOP(frame->task);
|
||||||
bottom = STACK_BOTTOM(frame->task);
|
bottom = STACK_BOTTOM(frame->task);
|
||||||
# if FRAME_RETADDR_OFFSET < 0
|
# if FRAME_RETADDR_OFFSET < 0
|
||||||
|
|
Loading…
Reference in a new issue