Skip to content

Commit c4a1745

Browse files
author
Linus Torvalds
committed
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6: (230 commits) [SPARC64]: Update defconfig. [SPARC64]: Fix 2 bugs in huge page support. [SPARC64]: CONFIG_BLK_DEV_RAM fix [SPARC64]: Optimized TSB table initialization. [SPARC64]: Allow CONFIG_MEMORY_HOTPLUG to build. [SPARC64]: Use SLAB caches for TSB tables. [SPARC64]: Don't kill the page allocator when growing a TSB. [SPARC64]: Randomize mm->mmap_base when PF_RANDOMIZE is set. [SPARC64]: Increase top of 32-bit process stack. [SPARC64]: Top-down address space allocation for 32-bit tasks. [SPARC64] bbc_i2c: Fix cpu check and add missing module license. [SPARC64]: Fix and re-enable dynamic TSB sizing. [SUNSU]: Fix missing spinlock initialization. [TG3]: Do not try to access NIC_SRAM_DATA_SIG on Sun parts. [SPARC64]: First cut at VIS simulator for Niagara. [SPARC64]: Fix system type in /proc/cpuinfo and remove bogus OBP check. [SPARC64]: Add SMT scheduling support for Niagara. [SPARC64]: Fix 32-bit truncation which broke sparsemem. [SPARC64]: Move over to sparsemem. [SPARC64]: Fix new context version SMP handling. ...
2 parents 88dcb91 + ac0eb3e commit c4a1745

125 files changed

Lines changed: 14183 additions & 4015 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/sparc/kernel/ioport.c‎

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ static void _sparc_free_io(struct resource *res)
217217
unsigned long plen;
218218

219219
plen = res->end - res->start + 1;
220-
if ((plen & (PAGE_SIZE-1)) != 0) BUG();
220+
BUG_ON((plen & (PAGE_SIZE-1)) != 0);
221221
sparc_unmapiorange(res->start, plen);
222222
release_resource(res);
223223
}
@@ -512,8 +512,7 @@ void pci_free_consistent(struct pci_dev *pdev, size_t n, void *p, dma_addr_t ba)
512512
dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size,
513513
int direction)
514514
{
515-
if (direction == PCI_DMA_NONE)
516-
BUG();
515+
BUG_ON(direction == PCI_DMA_NONE);
517516
/* IIep is write-through, not flushing. */
518517
return virt_to_phys(ptr);
519518
}
@@ -528,8 +527,7 @@ dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size,
528527
void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t ba, size_t size,
529528
int direction)
530529
{
531-
if (direction == PCI_DMA_NONE)
532-
BUG();
530+
BUG_ON(direction == PCI_DMA_NONE);
533531
if (direction != PCI_DMA_TODEVICE) {
534532
mmu_inval_dma_area((unsigned long)phys_to_virt(ba),
535533
(size + PAGE_SIZE-1) & PAGE_MASK);
@@ -542,17 +540,15 @@ void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t ba, size_t size,
542540
dma_addr_t pci_map_page(struct pci_dev *hwdev, struct page *page,
543541
unsigned long offset, size_t size, int direction)
544542
{
545-
if (direction == PCI_DMA_NONE)
546-
BUG();
543+
BUG_ON(direction == PCI_DMA_NONE);
547544
/* IIep is write-through, not flushing. */
548545
return page_to_phys(page) + offset;
549546
}
550547

551548
void pci_unmap_page(struct pci_dev *hwdev,
552549
dma_addr_t dma_address, size_t size, int direction)
553550
{
554-
if (direction == PCI_DMA_NONE)
555-
BUG();
551+
BUG_ON(direction == PCI_DMA_NONE);
556552
/* mmu_inval_dma_area XXX */
557553
}
558554

@@ -576,11 +572,10 @@ int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents,
576572
{
577573
int n;
578574

579-
if (direction == PCI_DMA_NONE)
580-
BUG();
575+
BUG_ON(direction == PCI_DMA_NONE);
581576
/* IIep is write-through, not flushing. */
582577
for (n = 0; n < nents; n++) {
583-
if (page_address(sg->page) == NULL) BUG();
578+
BUG_ON(page_address(sg->page) == NULL);
584579
sg->dvma_address = virt_to_phys(page_address(sg->page));
585580
sg->dvma_length = sg->length;
586581
sg++;
@@ -597,11 +592,10 @@ void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents,
597592
{
598593
int n;
599594

600-
if (direction == PCI_DMA_NONE)
601-
BUG();
595+
BUG_ON(direction == PCI_DMA_NONE);
602596
if (direction != PCI_DMA_TODEVICE) {
603597
for (n = 0; n < nents; n++) {
604-
if (page_address(sg->page) == NULL) BUG();
598+
BUG_ON(page_address(sg->page) == NULL);
605599
mmu_inval_dma_area(
606600
(unsigned long) page_address(sg->page),
607601
(sg->length + PAGE_SIZE-1) & PAGE_MASK);
@@ -622,8 +616,7 @@ void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents,
622616
*/
623617
void pci_dma_sync_single_for_cpu(struct pci_dev *hwdev, dma_addr_t ba, size_t size, int direction)
624618
{
625-
if (direction == PCI_DMA_NONE)
626-
BUG();
619+
BUG_ON(direction == PCI_DMA_NONE);
627620
if (direction != PCI_DMA_TODEVICE) {
628621
mmu_inval_dma_area((unsigned long)phys_to_virt(ba),
629622
(size + PAGE_SIZE-1) & PAGE_MASK);
@@ -632,8 +625,7 @@ void pci_dma_sync_single_for_cpu(struct pci_dev *hwdev, dma_addr_t ba, size_t si
632625

633626
void pci_dma_sync_single_for_device(struct pci_dev *hwdev, dma_addr_t ba, size_t size, int direction)
634627
{
635-
if (direction == PCI_DMA_NONE)
636-
BUG();
628+
BUG_ON(direction == PCI_DMA_NONE);
637629
if (direction != PCI_DMA_TODEVICE) {
638630
mmu_inval_dma_area((unsigned long)phys_to_virt(ba),
639631
(size + PAGE_SIZE-1) & PAGE_MASK);
@@ -650,11 +642,10 @@ void pci_dma_sync_sg_for_cpu(struct pci_dev *hwdev, struct scatterlist *sg, int
650642
{
651643
int n;
652644

653-
if (direction == PCI_DMA_NONE)
654-
BUG();
645+
BUG_ON(direction == PCI_DMA_NONE);
655646
if (direction != PCI_DMA_TODEVICE) {
656647
for (n = 0; n < nents; n++) {
657-
if (page_address(sg->page) == NULL) BUG();
648+
BUG_ON(page_address(sg->page) == NULL);
658649
mmu_inval_dma_area(
659650
(unsigned long) page_address(sg->page),
660651
(sg->length + PAGE_SIZE-1) & PAGE_MASK);
@@ -667,11 +658,10 @@ void pci_dma_sync_sg_for_device(struct pci_dev *hwdev, struct scatterlist *sg, i
667658
{
668659
int n;
669660

670-
if (direction == PCI_DMA_NONE)
671-
BUG();
661+
BUG_ON(direction == PCI_DMA_NONE);
672662
if (direction != PCI_DMA_TODEVICE) {
673663
for (n = 0; n < nents; n++) {
674-
if (page_address(sg->page) == NULL) BUG();
664+
BUG_ON(page_address(sg->page) == NULL);
675665
mmu_inval_dma_area(
676666
(unsigned long) page_address(sg->page),
677667
(sg->length + PAGE_SIZE-1) & PAGE_MASK);

‎arch/sparc64/Kconfig‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,15 @@ endchoice
186186

187187
endmenu
188188

189+
config ARCH_SPARSEMEM_ENABLE
190+
def_bool y
191+
192+
config ARCH_SPARSEMEM_DEFAULT
193+
def_bool y
194+
195+
config LARGE_ALLOCS
196+
def_bool y
197+
189198
source "mm/Kconfig"
190199

191200
config GENERIC_ISA_DMA
@@ -350,6 +359,15 @@ config SOLARIS_EMUL
350359

351360
endmenu
352361

362+
config SCHED_SMT
363+
bool "SMT (Hyperthreading) scheduler support"
364+
depends on SMP
365+
default y
366+
help
367+
SMT scheduler support improves the CPU scheduler's decision making
368+
when dealing with UltraSPARC cpus at a cost of slightly increased
369+
overhead in some places. If unsure say N here.
370+
353371
config CMDLINE_BOOL
354372
bool "Default bootloader kernel arguments"
355373

‎arch/sparc64/defconfig‎

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Automatically generated make config: don't edit
3-
# Linux kernel version: 2.6.16-rc2
4-
# Tue Feb 7 17:47:18 2006
3+
# Linux kernel version: 2.6.16
4+
# Mon Mar 20 01:23:21 2006
55
#
66
CONFIG_SPARC=y
77
CONFIG_SPARC64=y
@@ -115,14 +115,20 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y
115115
CONFIG_HUGETLB_PAGE_SIZE_4MB=y
116116
# CONFIG_HUGETLB_PAGE_SIZE_512K is not set
117117
# CONFIG_HUGETLB_PAGE_SIZE_64K is not set
118+
CONFIG_ARCH_SPARSEMEM_ENABLE=y
119+
CONFIG_ARCH_SPARSEMEM_DEFAULT=y
120+
CONFIG_LARGE_ALLOCS=y
118121
CONFIG_SELECT_MEMORY_MODEL=y
119-
CONFIG_FLATMEM_MANUAL=y
122+
# CONFIG_FLATMEM_MANUAL is not set
120123
# CONFIG_DISCONTIGMEM_MANUAL is not set
121-
# CONFIG_SPARSEMEM_MANUAL is not set
122-
CONFIG_FLATMEM=y
123-
CONFIG_FLAT_NODE_MEM_MAP=y
124+
CONFIG_SPARSEMEM_MANUAL=y
125+
CONFIG_SPARSEMEM=y
126+
CONFIG_HAVE_MEMORY_PRESENT=y
124127
# CONFIG_SPARSEMEM_STATIC is not set
128+
CONFIG_SPARSEMEM_EXTREME=y
129+
CONFIG_MEMORY_HOTPLUG=y
125130
CONFIG_SPLIT_PTLOCK_CPUS=4
131+
CONFIG_MIGRATION=y
126132
CONFIG_GENERIC_ISA_DMA=y
127133
CONFIG_SBUS=y
128134
CONFIG_SBUSCHAR=y
@@ -655,6 +661,7 @@ CONFIG_SERIAL_SUNCORE=y
655661
CONFIG_SERIAL_SUNSU=y
656662
CONFIG_SERIAL_SUNSU_CONSOLE=y
657663
CONFIG_SERIAL_SUNSAB=m
664+
CONFIG_SERIAL_SUNHV=y
658665
CONFIG_SERIAL_CORE=y
659666
CONFIG_SERIAL_CORE_CONSOLE=y
660667
# CONFIG_SERIAL_JSM is not set
@@ -1116,11 +1123,7 @@ CONFIG_USB_HIDDEV=y
11161123
# CONFIG_INFINIBAND is not set
11171124

11181125
#
1119-
# SN Devices
1120-
#
1121-
1122-
#
1123-
# EDAC - error detection and reporting (RAS)
1126+
# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
11241127
#
11251128

11261129
#

‎arch/sparc64/kernel/Makefile‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ obj-y := process.o setup.o cpu.o idprom.o \
1111
traps.o devices.o auxio.o una_asm.o \
1212
irq.o ptrace.o time.o sys_sparc.o signal.o \
1313
unaligned.o central.o pci.o starfire.o semaphore.o \
14-
power.o sbus.o iommu_common.o sparc64_ksyms.o chmc.o
14+
power.o sbus.o iommu_common.o sparc64_ksyms.o chmc.o \
15+
visemul.o
1516

1617
obj-$(CONFIG_PCI) += ebus.o isa.o pci_common.o pci_iommu.o \
17-
pci_psycho.o pci_sabre.o pci_schizo.o
18+
pci_psycho.o pci_sabre.o pci_schizo.o \
19+
pci_sun4v.o pci_sun4v_asm.o
1820
obj-$(CONFIG_SMP) += smp.o trampoline.o
1921
obj-$(CONFIG_SPARC32_COMPAT) += sys32.o sys_sparc32.o signal32.o
2022
obj-$(CONFIG_BINFMT_ELF32) += binfmt_elf32.o
@@ -38,5 +40,5 @@ else
3840
CMODEL_CFLAG := -m64 -mcmodel=medlow
3941
endif
4042

41-
head.o: head.S ttable.S itlb_base.S dtlb_base.S dtlb_backend.S dtlb_prot.S \
43+
head.o: head.S ttable.S itlb_miss.S dtlb_miss.S ktlb.S tsb.S \
4244
etrap.S rtrap.S winfixup.S entry.S

‎arch/sparc64/kernel/binfmt_aout32.c‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <asm/system.h>
3232
#include <asm/uaccess.h>
3333
#include <asm/pgalloc.h>
34+
#include <asm/mmu_context.h>
3435

3536
static int load_aout32_binary(struct linux_binprm *, struct pt_regs * regs);
3637
static int load_aout32_library(struct file*);
@@ -238,6 +239,8 @@ static int load_aout32_binary(struct linux_binprm * bprm, struct pt_regs * regs)
238239
(current->mm->start_data = N_DATADDR(ex));
239240
current->mm->brk = ex.a_bss +
240241
(current->mm->start_brk = N_BSSADDR(ex));
242+
current->mm->free_area_cache = current->mm->mmap_base;
243+
current->mm->cached_hole_size = 0;
241244

242245
current->mm->mmap = NULL;
243246
compute_creds(bprm);
@@ -329,15 +332,8 @@ static int load_aout32_binary(struct linux_binprm * bprm, struct pt_regs * regs)
329332

330333
current->mm->start_stack =
331334
(unsigned long) create_aout32_tables((char __user *)bprm->p, bprm);
332-
if (!(orig_thr_flags & _TIF_32BIT)) {
333-
unsigned long pgd_cache = get_pgd_cache(current->mm->pgd);
334-
335-
__asm__ __volatile__("stxa\t%0, [%1] %2\n\t"
336-
"membar #Sync"
337-
: /* no outputs */
338-
: "r" (pgd_cache),
339-
"r" (TSB_REG), "i" (ASI_DMMU));
340-
}
335+
tsb_context_switch(current->mm);
336+
341337
start_thread32(regs, ex.a_entry, current->mm->start_stack);
342338
if (current->ptrace & PT_PTRACED)
343339
send_sig(SIGTRAP, current, 0);

‎arch/sparc64/kernel/binfmt_elf32.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ MODULE_AUTHOR("Eric Youngdale, David S. Miller, Jakub Jelinek");
153153
#undef MODULE_DESCRIPTION
154154
#undef MODULE_AUTHOR
155155

156+
#include <asm/a.out.h>
157+
156158
#undef TASK_SIZE
157-
#define TASK_SIZE 0xf0000000
159+
#define TASK_SIZE STACK_TOP32
158160

159161
#include "../../../fs/binfmt_elf.c"

‎arch/sparc64/kernel/cpu.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <asm/system.h>
1414
#include <asm/fpumacro.h>
1515
#include <asm/cpudata.h>
16+
#include <asm/spitfire.h>
1617

1718
DEFINE_PER_CPU(cpuinfo_sparc, __cpu_data) = { 0 };
1819

@@ -71,6 +72,12 @@ void __init cpu_probe(void)
7172
unsigned long ver, fpu_vers, manuf, impl, fprs;
7273
int i;
7374

75+
if (tlb_type == hypervisor) {
76+
sparc_cpu_type = "UltraSparc T1 (Niagara)";
77+
sparc_fpu_type = "UltraSparc T1 integrated FPU";
78+
return;
79+
}
80+
7481
fprs = fprs_read();
7582
fprs_write(FPRS_FEF);
7683
__asm__ __volatile__ ("rdpr %%ver, %0; stx %%fsr, [%1]"

0 commit comments

Comments
 (0)