diff options
Diffstat (limited to 'arch/sparc/kernel')
| -rw-r--r-- | arch/sparc/kernel/led.c | 8 | ||||
| -rw-r--r-- | arch/sparc/kernel/pci_msi.c | 4 | ||||
| -rw-r--r-- | arch/sparc/kernel/smp_64.c | 103 | ||||
| -rw-r--r-- | arch/sparc/kernel/syscalls/syscall.tbl | 1 | ||||
| -rw-r--r-- | arch/sparc/kernel/sysfs.c | 12 | ||||
| -rw-r--r-- | arch/sparc/kernel/traps_32.c | 4 | ||||
| -rw-r--r-- | arch/sparc/kernel/traps_64.c | 4 | 
7 files changed, 12 insertions, 124 deletions
diff --git a/arch/sparc/kernel/led.c b/arch/sparc/kernel/led.c index 3a66e62eb2a0..ab657b359789 100644 --- a/arch/sparc/kernel/led.c +++ b/arch/sparc/kernel/led.c @@ -114,18 +114,16 @@ static const struct proc_ops led_proc_ops = {  };  #endif -static struct proc_dir_entry *led; -  #define LED_VERSION	"0.1"  static int __init led_init(void)  {  	timer_setup(&led_blink_timer, led_blink, 0); -	led = proc_create("led", 0, NULL, &led_proc_ops); -	if (!led) +#ifdef CONFIG_PROC_FS +	if (!proc_create("led", 0, NULL, &led_proc_ops))  		return -ENOMEM; - +#endif  	printk(KERN_INFO  	       "led: version %s, Lars Kotthoff <[email protected]>\n",  	       LED_VERSION); diff --git a/arch/sparc/kernel/pci_msi.c b/arch/sparc/kernel/pci_msi.c index fb5899cbfa51..9ed11985768e 100644 --- a/arch/sparc/kernel/pci_msi.c +++ b/arch/sparc/kernel/pci_msi.c @@ -146,13 +146,13 @@ static int sparc64_setup_msi_irq(unsigned int *irq_p,  	msiqid = pick_msiq(pbm);  	err = ops->msi_setup(pbm, msiqid, msi, -			     (entry->msi_attrib.is_64 ? 1 : 0)); +			     (entry->pci.msi_attrib.is_64 ? 1 : 0));  	if (err)  		goto out_msi_free;  	pbm->msi_irq_table[msi - pbm->msi_first] = *irq_p; -	if (entry->msi_attrib.is_64) { +	if (entry->pci.msi_attrib.is_64) {  		msg.address_hi = pbm->msi64_start >> 32;  		msg.address_lo = pbm->msi64_start & 0xffffffff;  	} else { diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c index b98a7bbe6728..a1f78e9ddaf3 100644 --- a/arch/sparc/kernel/smp_64.c +++ b/arch/sparc/kernel/smp_64.c @@ -1526,50 +1526,6 @@ void smp_send_stop(void)  		smp_call_function(stop_this_cpu, NULL, 0);  } -/** - * pcpu_alloc_bootmem - NUMA friendly alloc_bootmem wrapper for percpu - * @cpu: cpu to allocate for - * @size: size allocation in bytes - * @align: alignment - * - * Allocate @size bytes aligned at @align for cpu @cpu.  This wrapper - * does the right thing for NUMA regardless of the current - * configuration. - * - * RETURNS: - * Pointer to the allocated area on success, NULL on failure. - */ -static void * __init pcpu_alloc_bootmem(unsigned int cpu, size_t size, -					size_t align) -{ -	const unsigned long goal = __pa(MAX_DMA_ADDRESS); -#ifdef CONFIG_NUMA -	int node = cpu_to_node(cpu); -	void *ptr; - -	if (!node_online(node) || !NODE_DATA(node)) { -		ptr = memblock_alloc_from(size, align, goal); -		pr_info("cpu %d has no node %d or node-local memory\n", -			cpu, node); -		pr_debug("per cpu data for cpu%d %lu bytes at %016lx\n", -			 cpu, size, __pa(ptr)); -	} else { -		ptr = memblock_alloc_try_nid(size, align, goal, -					     MEMBLOCK_ALLOC_ACCESSIBLE, node); -		pr_debug("per cpu data for cpu%d %lu bytes on node%d at " -			 "%016lx\n", cpu, size, node, __pa(ptr)); -	} -	return ptr; -#else -	return memblock_alloc_from(size, align, goal); -#endif -} - -static void __init pcpu_free_bootmem(void *ptr, size_t size) -{ -	memblock_free(ptr, size); -} -  static int __init pcpu_cpu_distance(unsigned int from, unsigned int to)  {  	if (cpu_to_node(from) == cpu_to_node(to)) @@ -1578,57 +1534,9 @@ static int __init pcpu_cpu_distance(unsigned int from, unsigned int to)  		return REMOTE_DISTANCE;  } -static void __init pcpu_populate_pte(unsigned long addr) +static int __init pcpu_cpu_to_node(int cpu)  { -	pgd_t *pgd = pgd_offset_k(addr); -	p4d_t *p4d; -	pud_t *pud; -	pmd_t *pmd; - -	if (pgd_none(*pgd)) { -		pud_t *new; - -		new = memblock_alloc_from(PAGE_SIZE, PAGE_SIZE, PAGE_SIZE); -		if (!new) -			goto err_alloc; -		pgd_populate(&init_mm, pgd, new); -	} - -	p4d = p4d_offset(pgd, addr); -	if (p4d_none(*p4d)) { -		pud_t *new; - -		new = memblock_alloc_from(PAGE_SIZE, PAGE_SIZE, PAGE_SIZE); -		if (!new) -			goto err_alloc; -		p4d_populate(&init_mm, p4d, new); -	} - -	pud = pud_offset(p4d, addr); -	if (pud_none(*pud)) { -		pmd_t *new; - -		new = memblock_alloc_from(PAGE_SIZE, PAGE_SIZE, PAGE_SIZE); -		if (!new) -			goto err_alloc; -		pud_populate(&init_mm, pud, new); -	} - -	pmd = pmd_offset(pud, addr); -	if (!pmd_present(*pmd)) { -		pte_t *new; - -		new = memblock_alloc_from(PAGE_SIZE, PAGE_SIZE, PAGE_SIZE); -		if (!new) -			goto err_alloc; -		pmd_populate_kernel(&init_mm, pmd, new); -	} - -	return; - -err_alloc: -	panic("%s: Failed to allocate %lu bytes align=%lx from=%lx\n", -	      __func__, PAGE_SIZE, PAGE_SIZE, PAGE_SIZE); +	return cpu_to_node(cpu);  }  void __init setup_per_cpu_areas(void) @@ -1641,8 +1549,7 @@ void __init setup_per_cpu_areas(void)  		rc = pcpu_embed_first_chunk(PERCPU_MODULE_RESERVE,  					    PERCPU_DYNAMIC_RESERVE, 4 << 20,  					    pcpu_cpu_distance, -					    pcpu_alloc_bootmem, -					    pcpu_free_bootmem); +					    pcpu_cpu_to_node);  		if (rc)  			pr_warn("PERCPU: %s allocator failed (%d), "  				"falling back to page size\n", @@ -1650,9 +1557,7 @@ void __init setup_per_cpu_areas(void)  	}  	if (rc < 0)  		rc = pcpu_page_first_chunk(PERCPU_MODULE_RESERVE, -					   pcpu_alloc_bootmem, -					   pcpu_free_bootmem, -					   pcpu_populate_pte); +					   pcpu_cpu_to_node);  	if (rc < 0)  		panic("cannot initialize percpu area (err=%d)", rc); diff --git a/arch/sparc/kernel/syscalls/syscall.tbl b/arch/sparc/kernel/syscalls/syscall.tbl index 46adabcb1720..4398cc6fb68d 100644 --- a/arch/sparc/kernel/syscalls/syscall.tbl +++ b/arch/sparc/kernel/syscalls/syscall.tbl @@ -495,3 +495,4 @@  # 447 reserved for memfd_secret  448	common	process_mrelease		sys_process_mrelease  449	common  futex_waitv                     sys_futex_waitv +450	common	set_mempolicy_home_node		sys_set_mempolicy_home_node diff --git a/arch/sparc/kernel/sysfs.c b/arch/sparc/kernel/sysfs.c index 6d60d416f0dd..f19487e4cc71 100644 --- a/arch/sparc/kernel/sysfs.c +++ b/arch/sparc/kernel/sysfs.c @@ -244,22 +244,10 @@ static void __init check_mmu_stats(void)  		mmu_stats_supported = 1;  } -static void register_nodes(void) -{ -#ifdef CONFIG_NUMA -	int i; - -	for (i = 0; i < MAX_NUMNODES; i++) -		register_one_node(i); -#endif -} -  static int __init topology_init(void)  {  	int cpu, ret; -	register_nodes(); -  	check_mmu_stats();  	for_each_possible_cpu(cpu) { diff --git a/arch/sparc/kernel/traps_32.c b/arch/sparc/kernel/traps_32.c index 5630e5a395e0..179aabfa712e 100644 --- a/arch/sparc/kernel/traps_32.c +++ b/arch/sparc/kernel/traps_32.c @@ -86,9 +86,7 @@ void __noreturn die_if_kernel(char *str, struct pt_regs *regs)  	}  	printk("Instruction DUMP:");  	instruction_dump ((unsigned long *) regs->pc); -	if(regs->psr & PSR_PS) -		do_exit(SIGKILL); -	do_exit(SIGSEGV); +	make_task_dead((regs->psr & PSR_PS) ? SIGKILL : SIGSEGV);  }  void do_hw_interrupt(struct pt_regs *regs, unsigned long type) diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c index 6863025ed56d..21077821f427 100644 --- a/arch/sparc/kernel/traps_64.c +++ b/arch/sparc/kernel/traps_64.c @@ -2559,9 +2559,7 @@ void __noreturn die_if_kernel(char *str, struct pt_regs *regs)  	}  	if (panic_on_oops)  		panic("Fatal exception"); -	if (regs->tstate & TSTATE_PRIV) -		do_exit(SIGKILL); -	do_exit(SIGSEGV); +	make_task_dead((regs->tstate & TSTATE_PRIV)? SIGKILL : SIGSEGV);  }  EXPORT_SYMBOL(die_if_kernel);  |