projects/linux·commit c4a1745a

Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6

c4a1745a · Linus Torvalds <[email protected]> · 2006-03-20 11:57:50 -08:00

* 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.
  ...
Commit
c4a1745aa09fc110afdefea0e5d025043e348bae
Parents
88dcb911 · ac0eb3eb

Merge commit. Changes below are compared with the first parent: 88dcb911.

Changes

125 files changed · +14183 −4015

FileStatusAddDelContent
arch/sparc/kernel/ioport.cmodified+15−25View file
arch/sparc64/Kconfigmodified+18−0View file
arch/sparc64/defconfigmodified+14−11View file
arch/sparc64/kernel/Makefilemodified+5−3View file
arch/sparc64/kernel/binfmt_aout32.cmodified+5−9View file
arch/sparc64/kernel/binfmt_elf32.cmodified+3−1View file
arch/sparc64/kernel/cpu.cmodified+7−0View file
arch/sparc64/kernel/devices.cmodified+179−10View file
arch/sparc64/kernel/dtlb_backend.Sdeleted+0−170View before deletion
arch/sparc64/kernel/dtlb_base.Sdeleted+0−109View before deletion
arch/sparc64/kernel/dtlb_miss.Sadded+39−0View file
arch/sparc64/kernel/ebus.cmodified+1−2View file
arch/sparc64/kernel/entry.Smodified+232−99View file
arch/sparc64/kernel/etrap.Smodified+72−98View file
arch/sparc64/kernel/head.Smodified+172−82View file
arch/sparc64/kernel/irq.cmodified+252−87View file
arch/sparc64/kernel/itlb_base.Sdeleted+0−79View before deletion
arch/sparc64/kernel/itlb_miss.Sadded+39−0View file
arch/sparc64/kernel/ktlb.Smodified+224−139View file
arch/sparc64/kernel/pci.cmodified+13−0View file
arch/sparc64/kernel/pci_common.cmodified+174−127View file
arch/sparc64/kernel/pci_iommu.cmodified+23−13View file
arch/sparc64/kernel/pci_psycho.cmodified+10−13View file
arch/sparc64/kernel/pci_sabre.cmodified+10−13View file
arch/sparc64/kernel/pci_schizo.cmodified+10−14View file
arch/sparc64/kernel/pci_sun4v.cadded+1147−0View file
arch/sparc64/kernel/pci_sun4v.hadded+31−0View file
arch/sparc64/kernel/pci_sun4v_asm.Sadded+95−0View file
arch/sparc64/kernel/process.cmodified+57−76View file
arch/sparc64/kernel/ptrace.cmodified+3−0View file
arch/sparc64/kernel/rtrap.Smodified+105−10View file
arch/sparc64/kernel/sbus.cmodified+5−5View file
arch/sparc64/kernel/setup.cmodified+124−285View file
arch/sparc64/kernel/smp.cmodified+314−104View file
arch/sparc64/kernel/sparc64_ksyms.cmodified+14−12View file
arch/sparc64/kernel/sun4v_ivec.Sadded+334−0View file
arch/sparc64/kernel/sun4v_tlb_miss.Sadded+421−0View file
arch/sparc64/kernel/sys_sparc.cmodified+263−34View file
arch/sparc64/kernel/sys_sparc32.cmodified+5−4View file
arch/sparc64/kernel/time.cmodified+348−25View file
arch/sparc64/kernel/trampoline.Smodified+163−75View file
arch/sparc64/kernel/traps.cmodified+388−15View file
arch/sparc64/kernel/tsb.Sadded+442−0View file
arch/sparc64/kernel/ttable.Smodified+25−38View file
arch/sparc64/kernel/unaligned.cmodified+34−11View file
arch/sparc64/kernel/us2e_cpufreq.cmodified+5−6View file
arch/sparc64/kernel/us3_cpufreq.cmodified+5−6View file
arch/sparc64/kernel/visemul.cadded+894−0View file
arch/sparc64/kernel/vmlinux.lds.Smodified+16−0View file
arch/sparc64/kernel/winfixup.Smodified+124−356View file
arch/sparc64/lib/Makefilemodified+2−0View file
arch/sparc64/lib/NGbzero.Sadded+163−0View file
arch/sparc64/lib/NGcopy_from_user.Sadded+37−0View file
arch/sparc64/lib/NGcopy_to_user.Sadded+40−0View file
arch/sparc64/lib/NGmemcpy.Sadded+368−0View file
arch/sparc64/lib/NGpage.Sadded+96−0View file
arch/sparc64/lib/NGpatch.Sadded+33−0View file
arch/sparc64/lib/U3patch.Smodified+2−1View file
arch/sparc64/lib/bzero.Smodified+9−9View file
arch/sparc64/lib/clear_page.Smodified+5−7View file
arch/sparc64/lib/copy_page.Smodified+2−5View file
arch/sparc64/lib/delay.cmodified+8−11View file
arch/sparc64/lib/xor.Smodified+299−1View file
arch/sparc64/math-emu/math.cmodified+22−2View file
arch/sparc64/mm/Makefilemodified+1−1View file
arch/sparc64/mm/fault.cmodified+11−4View file
arch/sparc64/mm/generic.cmodified+18−22View file
arch/sparc64/mm/hugetlbpage.cmodified+175−4View file
arch/sparc64/mm/init.cmodified+797−650View file
arch/sparc64/mm/tlb.cmodified+4−60View file
arch/sparc64/mm/tsb.cadded+440−0View file
arch/sparc64/mm/ultra.Smodified+293−81View file
arch/sparc64/prom/cif.Smodified+17−194View file
arch/sparc64/prom/console.cmodified+6−0View file
arch/sparc64/prom/init.cmodified+8−52View file
arch/sparc64/prom/misc.cmodified+24−20View file
arch/sparc64/prom/p1275.cmodified+0−11View file
arch/sparc64/prom/tree.cmodified+6−3View file
arch/sparc64/solaris/misc.cmodified+2−2View file
drivers/net/tg3.cmodified+4−0View file
drivers/sbus/char/bbc_i2c.cmodified+3−1View file
drivers/serial/Kconfigmodified+7−0View file
drivers/serial/Makefilemodified+1−0View file
drivers/serial/sunhv.cadded+550−0View file
drivers/serial/sunsab.cmodified+10−9View file
drivers/serial/sunsu.cmodified+15−11View file
drivers/serial/sunzilog.cmodified+29−6View file
include/asm-sparc/idprom.hmodified+9−17View file
include/asm-sparc/oplib.hmodified+2−0View file
include/asm-sparc/uaccess.hmodified+0−47View file
include/asm-sparc64/a.out.hmodified+5−1View file
include/asm-sparc64/asi.hmodified+17−1View file
include/asm-sparc64/cpudata.hmodified+193−10View file
include/asm-sparc64/elf.hmodified+17−5View file
include/asm-sparc64/head.hmodified+15−0View file
include/asm-sparc64/hypervisor.hadded+2128−0View file
include/asm-sparc64/idprom.hmodified+1−11View file
include/asm-sparc64/intr_queue.hadded+15−0View file
include/asm-sparc64/irq.hmodified+4−0View file
include/asm-sparc64/mmu.hmodified+22−14View file
include/asm-sparc64/mmu_context.hmodified+81−81View file
include/asm-sparc64/numnodes.hadded+6−0View file
include/asm-sparc64/oplib.hmodified+19−24View file
include/asm-sparc64/page.hmodified+4−9View file
include/asm-sparc64/pbm.hmodified+3−0View file
include/asm-sparc64/pci.hmodified+45−11View file
include/asm-sparc64/pgalloc.hmodified+27−139View file
include/asm-sparc64/pgtable.hmodified+516−188View file
include/asm-sparc64/pil.hmodified+3−1View file
include/asm-sparc64/processor.hmodified+8−15View file
include/asm-sparc64/pstate.hmodified+5−4View file
include/asm-sparc64/scratchpad.hadded+14−0View file
include/asm-sparc64/smp.hmodified+3−27View file
include/asm-sparc64/sparsemem.hadded+12−0View file
include/asm-sparc64/spitfire.hmodified+1−0View file
include/asm-sparc64/system.hmodified+2−5View file
include/asm-sparc64/thread_info.hmodified+3−6View file
include/asm-sparc64/timex.hmodified+6−0View file
include/asm-sparc64/tlbflush.hmodified+19−6View file
include/asm-sparc64/tsb.hadded+281−0View file
include/asm-sparc64/ttable.hmodified+261−11View file
include/asm-sparc64/uaccess.hmodified+1−45View file
include/asm-sparc64/vdev.hadded+16−0View file
include/asm-sparc64/xor.hmodified+30−4View file
include/linux/serial_core.hmodified+3−0View file

Only the first 600 diff lines are shown. Download the complete patch.

arch/sparc/kernel/ioport.c

View file
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c
index d39c9f2..460f72e 100644
--- a/arch/sparc/kernel/ioport.c
+++ b/arch/sparc/kernel/ioport.c
@@ -217,7 +217,7 @@ static void _sparc_free_io(struct resource *res)
unsigned long plen;
plen = res->end - res->start + 1;
- if ((plen & (PAGE_SIZE-1)) != 0) BUG();
+ BUG_ON((plen & (PAGE_SIZE-1)) != 0);
sparc_unmapiorange(res->start, plen);
release_resource(res);
}
@@ -512,8 +512,7 @@ void pci_free_consistent(struct pci_dev *pdev, size_t n, void *p, dma_addr_t ba)
dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size,
int direction)
{
- if (direction == PCI_DMA_NONE)
- BUG();
+ BUG_ON(direction == PCI_DMA_NONE);
/* IIep is write-through, not flushing. */
return virt_to_phys(ptr);
}
@@ -528,8 +527,7 @@ dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size,
void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t ba, size_t size,
int direction)
{
- if (direction == PCI_DMA_NONE)
- BUG();
+ BUG_ON(direction == PCI_DMA_NONE);
if (direction != PCI_DMA_TODEVICE) {
mmu_inval_dma_area((unsigned long)phys_to_virt(ba),
(size + PAGE_SIZE-1) & PAGE_MASK);
@@ -542,8 +540,7 @@ void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t ba, size_t size,
dma_addr_t pci_map_page(struct pci_dev *hwdev, struct page *page,
unsigned long offset, size_t size, int direction)
{
- if (direction == PCI_DMA_NONE)
- BUG();
+ BUG_ON(direction == PCI_DMA_NONE);
/* IIep is write-through, not flushing. */
return page_to_phys(page) + offset;
}
@@ -551,8 +548,7 @@ dma_addr_t pci_map_page(struct pci_dev *hwdev, struct page *page,
void pci_unmap_page(struct pci_dev *hwdev,
dma_addr_t dma_address, size_t size, int direction)
{
- if (direction == PCI_DMA_NONE)
- BUG();
+ BUG_ON(direction == PCI_DMA_NONE);
/* mmu_inval_dma_area XXX */
}
@@ -576,11 +572,10 @@ int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents,
{
int n;
- if (direction == PCI_DMA_NONE)
- BUG();
+ BUG_ON(direction == PCI_DMA_NONE);
/* IIep is write-through, not flushing. */
for (n = 0; n < nents; n++) {
- if (page_address(sg->page) == NULL) BUG();
+ BUG_ON(page_address(sg->page) == NULL);
sg->dvma_address = virt_to_phys(page_address(sg->page));
sg->dvma_length = sg->length;
sg++;
@@ -597,11 +592,10 @@ void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents,
{
int n;
- if (direction == PCI_DMA_NONE)
- BUG();
+ BUG_ON(direction == PCI_DMA_NONE);
if (direction != PCI_DMA_TODEVICE) {
for (n = 0; n < nents; n++) {
- if (page_address(sg->page) == NULL) BUG();
+ BUG_ON(page_address(sg->page) == NULL);
mmu_inval_dma_area(
(unsigned long) page_address(sg->page),
(sg->length + PAGE_SIZE-1) & PAGE_MASK);
@@ -622,8 +616,7 @@ void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents,
*/
void pci_dma_sync_single_for_cpu(struct pci_dev *hwdev, dma_addr_t ba, size_t size, int direction)
{
- if (direction == PCI_DMA_NONE)
- BUG();
+ BUG_ON(direction == PCI_DMA_NONE);
if (direction != PCI_DMA_TODEVICE) {
mmu_inval_dma_area((unsigned long)phys_to_virt(ba),
(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
void pci_dma_sync_single_for_device(struct pci_dev *hwdev, dma_addr_t ba, size_t size, int direction)
{
- if (direction == PCI_DMA_NONE)
- BUG();
+ BUG_ON(direction == PCI_DMA_NONE);
if (direction != PCI_DMA_TODEVICE) {
mmu_inval_dma_area((unsigned long)phys_to_virt(ba),
(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
{
int n;
- if (direction == PCI_DMA_NONE)
- BUG();
+ BUG_ON(direction == PCI_DMA_NONE);
if (direction != PCI_DMA_TODEVICE) {
for (n = 0; n < nents; n++) {
- if (page_address(sg->page) == NULL) BUG();
+ BUG_ON(page_address(sg->page) == NULL);
mmu_inval_dma_area(
(unsigned long) page_address(sg->page),
(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
{
int n;
- if (direction == PCI_DMA_NONE)
- BUG();
+ BUG_ON(direction == PCI_DMA_NONE);
if (direction != PCI_DMA_TODEVICE) {
for (n = 0; n < nents; n++) {
- if (page_address(sg->page) == NULL) BUG();
+ BUG_ON(page_address(sg->page) == NULL);
mmu_inval_dma_area(
(unsigned long) page_address(sg->page),
(sg->length + PAGE_SIZE-1) & PAGE_MASK);

arch/sparc64/Kconfig

View file
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
index 4c0a50a..c3685b3 100644
--- a/arch/sparc64/Kconfig
+++ b/arch/sparc64/Kconfig
@@ -186,6 +186,15 @@ endchoice
endmenu
+config ARCH_SPARSEMEM_ENABLE
+ def_bool y
+
+config ARCH_SPARSEMEM_DEFAULT
+ def_bool y
+
+config LARGE_ALLOCS
+ def_bool y
+
source "mm/Kconfig"
config GENERIC_ISA_DMA
@@ -350,6 +359,15 @@ config SOLARIS_EMUL
endmenu
+config SCHED_SMT
+ bool "SMT (Hyperthreading) scheduler support"
+ depends on SMP
+ default y
+ help
+ SMT scheduler support improves the CPU scheduler's decision making
+ when dealing with UltraSPARC cpus at a cost of slightly increased
+ overhead in some places. If unsure say N here.
+
config CMDLINE_BOOL
bool "Default bootloader kernel arguments"

arch/sparc64/defconfig

View file
diff --git a/arch/sparc64/defconfig b/arch/sparc64/defconfig
index 069d497..f819a96 100644
--- a/arch/sparc64/defconfig
+++ b/arch/sparc64/defconfig
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.16-rc2
-# Tue Feb 7 17:47:18 2006
+# Linux kernel version: 2.6.16
+# Mon Mar 20 01:23:21 2006
#
CONFIG_SPARC=y
CONFIG_SPARC64=y
@@ -115,14 +115,20 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_HUGETLB_PAGE_SIZE_4MB=y
# CONFIG_HUGETLB_PAGE_SIZE_512K is not set
# CONFIG_HUGETLB_PAGE_SIZE_64K is not set
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_ARCH_SPARSEMEM_DEFAULT=y
+CONFIG_LARGE_ALLOCS=y
CONFIG_SELECT_MEMORY_MODEL=y
-CONFIG_FLATMEM_MANUAL=y
+# CONFIG_FLATMEM_MANUAL is not set
# CONFIG_DISCONTIGMEM_MANUAL is not set
-# CONFIG_SPARSEMEM_MANUAL is not set
-CONFIG_FLATMEM=y
-CONFIG_FLAT_NODE_MEM_MAP=y
+CONFIG_SPARSEMEM_MANUAL=y
+CONFIG_SPARSEMEM=y
+CONFIG_HAVE_MEMORY_PRESENT=y
# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPARSEMEM_EXTREME=y
+CONFIG_MEMORY_HOTPLUG=y
CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_MIGRATION=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_SBUS=y
CONFIG_SBUSCHAR=y
@@ -655,6 +661,7 @@ CONFIG_SERIAL_SUNCORE=y
CONFIG_SERIAL_SUNSU=y
CONFIG_SERIAL_SUNSU_CONSOLE=y
CONFIG_SERIAL_SUNSAB=m
+CONFIG_SERIAL_SUNHV=y
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
# CONFIG_SERIAL_JSM is not set
@@ -1116,11 +1123,7 @@ CONFIG_USB_HIDDEV=y
# CONFIG_INFINIBAND is not set
#
-# SN Devices
-#
-
-#
-# EDAC - error detection and reporting (RAS)
+# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
#
#

arch/sparc64/kernel/Makefile

View file
diff --git a/arch/sparc64/kernel/Makefile b/arch/sparc64/kernel/Makefile
index 83d67eb..6f68164 100644
--- a/arch/sparc64/kernel/Makefile
+++ b/arch/sparc64/kernel/Makefile
@@ -11,10 +11,12 @@ obj-y := process.o setup.o cpu.o idprom.o \
traps.o devices.o auxio.o una_asm.o \
irq.o ptrace.o time.o sys_sparc.o signal.o \
unaligned.o central.o pci.o starfire.o semaphore.o \
- power.o sbus.o iommu_common.o sparc64_ksyms.o chmc.o
+ power.o sbus.o iommu_common.o sparc64_ksyms.o chmc.o \
+ visemul.o
obj-$(CONFIG_PCI) += ebus.o isa.o pci_common.o pci_iommu.o \
- pci_psycho.o pci_sabre.o pci_schizo.o
+ pci_psycho.o pci_sabre.o pci_schizo.o \
+ pci_sun4v.o pci_sun4v_asm.o
obj-$(CONFIG_SMP) += smp.o trampoline.o
obj-$(CONFIG_SPARC32_COMPAT) += sys32.o sys_sparc32.o signal32.o
obj-$(CONFIG_BINFMT_ELF32) += binfmt_elf32.o
@@ -38,5 +40,5 @@ else
CMODEL_CFLAG := -m64 -mcmodel=medlow
endif
-head.o: head.S ttable.S itlb_base.S dtlb_base.S dtlb_backend.S dtlb_prot.S \
+head.o: head.S ttable.S itlb_miss.S dtlb_miss.S ktlb.S tsb.S \
etrap.S rtrap.S winfixup.S entry.S

arch/sparc64/kernel/binfmt_aout32.c

View file
diff --git a/arch/sparc64/kernel/binfmt_aout32.c b/arch/sparc64/kernel/binfmt_aout32.c
index 202a80c..d7caa60 100644
--- a/arch/sparc64/kernel/binfmt_aout32.c
+++ b/arch/sparc64/kernel/binfmt_aout32.c
@@ -31,6 +31,7 @@
#include <asm/system.h>
#include <asm/uaccess.h>
#include <asm/pgalloc.h>
+#include <asm/mmu_context.h>
static int load_aout32_binary(struct linux_binprm *, struct pt_regs * regs);
static int load_aout32_library(struct file*);
@@ -238,6 +239,8 @@ static int load_aout32_binary(struct linux_binprm * bprm, struct pt_regs * regs)
(current->mm->start_data = N_DATADDR(ex));
current->mm->brk = ex.a_bss +
(current->mm->start_brk = N_BSSADDR(ex));
+ current->mm->free_area_cache = current->mm->mmap_base;
+ current->mm->cached_hole_size = 0;
current->mm->mmap = NULL;
compute_creds(bprm);
@@ -329,15 +332,8 @@ beyond_if:
current->mm->start_stack =
(unsigned long) create_aout32_tables((char __user *)bprm->p, bprm);
- if (!(orig_thr_flags & _TIF_32BIT)) {
- unsigned long pgd_cache = get_pgd_cache(current->mm->pgd);
-
- __asm__ __volatile__("stxa\t%0, [%1] %2\n\t"
- "membar #Sync"
- : /* no outputs */
- : "r" (pgd_cache),
- "r" (TSB_REG), "i" (ASI_DMMU));
- }
+ tsb_context_switch(current->mm);
+
start_thread32(regs, ex.a_entry, current->mm->start_stack);
if (current->ptrace & PT_PTRACED)
send_sig(SIGTRAP, current, 0);

arch/sparc64/kernel/binfmt_elf32.c

View file
diff --git a/arch/sparc64/kernel/binfmt_elf32.c b/arch/sparc64/kernel/binfmt_elf32.c
index a1a12d2..8a2abcc 100644
--- a/arch/sparc64/kernel/binfmt_elf32.c
+++ b/arch/sparc64/kernel/binfmt_elf32.c
@@ -153,7 +153,9 @@ MODULE_AUTHOR("Eric Youngdale, David S. Miller, Jakub Jelinek");
#undef MODULE_DESCRIPTION
#undef MODULE_AUTHOR
+#include <asm/a.out.h>
+
#undef TASK_SIZE
-#define TASK_SIZE 0xf0000000
+#define TASK_SIZE STACK_TOP32
#include "../../../fs/binfmt_elf.c"

arch/sparc64/kernel/cpu.c

View file
diff --git a/arch/sparc64/kernel/cpu.c b/arch/sparc64/kernel/cpu.c
index 00eed88..11cc0ca 100644
--- a/arch/sparc64/kernel/cpu.c
+++ b/arch/sparc64/kernel/cpu.c
@@ -13,6 +13,7 @@
#include <asm/system.h>
#include <asm/fpumacro.h>
#include <asm/cpudata.h>
+#include <asm/spitfire.h>
DEFINE_PER_CPU(cpuinfo_sparc, __cpu_data) = { 0 };
@@ -71,6 +72,12 @@ void __init cpu_probe(void)
unsigned long ver, fpu_vers, manuf, impl, fprs;
int i;
+ if (tlb_type == hypervisor) {
+ sparc_cpu_type = "UltraSparc T1 (Niagara)";
+ sparc_fpu_type = "UltraSparc T1 integrated FPU";
+ return;
+ }
+
fprs = fprs_read();
fprs_write(FPRS_FEF);
__asm__ __volatile__ ("rdpr %%ver, %0; stx %%fsr, [%1]"

arch/sparc64/kernel/devices.c

View file
diff --git a/arch/sparc64/kernel/devices.c b/arch/sparc64/kernel/devices.c
index df9a1ca..007e892 100644
--- a/arch/sparc64/kernel/devices.c
+++ b/arch/sparc64/kernel/devices.c
@@ -12,6 +12,7 @@
#include <linux/string.h>
#include <linux/spinlock.h>
#include <linux/errno.h>
+#include <linux/bootmem.h>
#include <asm/page.h>
#include <asm/oplib.h>
@@ -20,6 +21,8 @@
#include <asm/spitfire.h>
#include <asm/timer.h>
#include <asm/cpudata.h>
+#include <asm/vdev.h>
+#include <asm/irq.h>
/* Used to synchronize acceses to NatSemi SUPER I/O chip configure
* operations in asm/ns87303.h
@@ -29,13 +32,158 @@ DEFINE_SPINLOCK(ns87303_lock);
extern void cpu_probe(void);
extern void central_probe(void);
-static char *cpu_mid_prop(void)
+u32 sun4v_vdev_devhandle;
+int sun4v_vdev_root;
+
+struct vdev_intmap {
+ unsigned int phys;
+ unsigned int irq;
+ unsigned int cnode;
+ unsigned int cinterrupt;
+};
+
+struct vdev_intmask {
+ unsigned int phys;
+ unsigned int interrupt;
+ unsigned int __unused;
+};
+
+static struct vdev_intmap *vdev_intmap;
+static int vdev_num_intmap;
+static struct vdev_intmask vdev_intmask;
+
+static void __init sun4v_virtual_device_probe(void)
+{
+ struct linux_prom64_registers regs;
+ struct vdev_intmap *ip;
+ int node, sz, err;
+
+ if (tlb_type != hypervisor)
+ return;
+
+ node = prom_getchild(prom_root_node);
+ node = prom_searchsiblings(node, "virtual-devices");
+ if (!node) {
+ prom_printf("SUN4V: Fatal error, no virtual-devices node.\n");
+ prom_halt();
+ }
+
+ sun4v_vdev_root = node;
+
+ prom_getproperty(node, "reg", (char *)&regs, sizeof(regs));
+ sun4v_vdev_devhandle = (regs.phys_addr >> 32UL) & 0x0fffffff;
+
+ sz = prom_getproplen(node, "interrupt-map");
+ if (sz <= 0) {
+ prom_printf("SUN4V: Error, no vdev interrupt-map.\n");
+ prom_halt();
+ }
+
+ if ((sz % sizeof(*ip)) != 0) {
+ prom_printf("SUN4V: Bogus interrupt-map property size %d\n",
+ sz);
+ prom_halt();
+ }
+
+ vdev_intmap = ip = alloc_bootmem_low_pages(sz);
+ if (!vdev_intmap) {
+ prom_printf("SUN4V: Error, cannot allocate vdev_intmap.\n");
+ prom_halt();
+ }
+
+ err = prom_getproperty(node, "interrupt-map", (char *) ip, sz);
+ if (err == -1) {
+ prom_printf("SUN4V: Fatal error, no vdev interrupt-map.\n");
+ prom_halt();
+ }
+ if (err != sz) {
+ prom_printf("SUN4V: Inconsistent interrupt-map size, "
+ "proplen(%d) vs getprop(%d).\n", sz,err);
+ prom_halt();
+ }
+
+ vdev_num_intmap = err / sizeof(*ip);
+
+ err = prom_getproperty(node, "interrupt-map-mask",
+ (char *) &vdev_intmask,
+ sizeof(vdev_intmask));
+ if (err <= 0) {
+ prom_printf("SUN4V: Fatal error, no vdev "
+ "interrupt-map-mask.\n");
+ prom_halt();
+ }
+ if (err % sizeof(vdev_intmask)) {
+ prom_printf("SUN4V: Bogus interrupt-map-mask "
+ "property size %d\n", err);
+ prom_halt();
+ }
+
+ printk("SUN4V: virtual-devices devhandle[%x]\n",
+ sun4v_vdev_devhandle);
+}
+
+unsigned int sun4v_vdev_device_interrupt(unsigned int dev_node)
+{
+ unsigned int irq, reg;
+ int err, i;
+
+ err = prom_getproperty(dev_node, "interrupts",
+ (char *) &irq, sizeof(irq));
+ if (err <= 0) {
+ printk("VDEV: Cannot get \"interrupts\" "
+ "property for OBP node %x\n", dev_node);
+ return 0;
+ }
+
+ err = prom_getproperty(dev_node, "reg",
+ (char *) &reg, sizeof(reg));
+ if (err <= 0) {
+ printk("VDEV: Cannot get \"reg\" "
+ "property for OBP node %x\n", dev_node);
+ return 0;
+ }
+
+ for (i = 0; i < vdev_num_intmap; i++) {
+ if (vdev_intmap[i].phys == (reg & vdev_intmask.phys) &&
+ vdev_intmap[i].irq == (irq & vdev_intmask.interrupt)) {
+ irq = vdev_intmap[i].cinterrupt;
+ break;
+ }
+ }
+
+ if (i == vdev_num_intmap) {
+ printk("VDEV: No matching interrupt map entry "
+ "for OBP node %x\n", dev_node);
+ return 0;
+ }
+
+ return sun4v_build_irq(sun4v_vdev_devhandle, irq, 5, 0);
+}
+
+static const char *cpu_mid_prop(void)
{
if (tlb_type == spitfire)
return "upa-portid";
return "portid";
}
+static int get_cpu_mid(int prom_node)
+{
+ if (tlb_type == hypervisor) {
+ struct linux_prom64_registers reg;
+
+ if (prom_getproplen(prom_node, "cpuid") == 4)
+ return prom_getintdefault(prom_node, "cpuid", 0);
+
+ prom_getproperty(prom_node, "reg", (char *) &reg, sizeof(reg));
+ return (reg.phys_addr >> 32) & 0x0fffffffUL;
+ } else {
+ const char *prop_name = cpu_mid_prop();
+
+ return prom_getintdefault(prom_node, prop_name, 0);
+ }
+}
+
static int check_cpu_node(int nd, int *cur_inst,
int (*compare)(int, int, void *), void *compare_arg,
int *prom_node, int *mid)
@@ -50,7 +198,7 @@ static int check_cpu_node(int nd, int *cur_inst,
if (prom_node)
*prom_node = nd;
if (mid)
- *mid = prom_getintdefault(nd, cpu_mid_prop(), 0);
+ *mid = get_cpu_mid(nd);
return 0;
}
@@ -105,7 +253,7 @@ static int cpu_mid_compare(int nd, int instance, void *_arg)
int desired_mid = (int) (long) _arg;
int this_mid;
- this_mid = prom_getintdefault(nd, cpu_mid_prop(), 0);
+ this_mid = get_cpu_mid(nd);
if (this_mid == desired_mid)
return 0;
return -ENODEV;
@@ -126,7 +274,8 @@ void __init device_scan(void)
#ifndef CONFIG_SMP
{
- int err, cpu_node;
+ int err, cpu_node, def;
+
err = cpu_find_by_instance(0, &cpu_node, NULL);
if (err) {
prom_printf("No cpu nodes, cannot continue\n");
@@ -135,21 +284,40 @@ void __init device_scan(void)
cpu_data(0).clock_tick = prom_getintdefault(cpu_node,
"clock-frequency",
0);
+
+ def = ((tlb_type == hypervisor) ?
+ (8 * 1024) :
+ (16 * 1024));
cpu_data(0).dcache_size = prom_getintdefault(cpu_node,
"dcache-size",
- 16 * 1024);
+ def);
+
+ def = 32;
cpu_data(0).dcache_line_size =
- prom_getintdefault(cpu_node, "dcache-line-size", 32);
+ prom_getintdefault(cpu_node, "dcache-line-size",
+ def);
+
+ def = 16 * 1024;
cpu_data(0).icache_size = prom_getintdefault(cpu_node,
"icache-size",
- 16 * 1024);
+ def);
+
+ def = 32;
cpu_data(0).icache_line_size =
- prom_getintdefault(cpu_node, "icache-line-size", 32);
+ prom_getintdefault(cpu_node, "icache-line-size",
+ def);
+
+ def = ((tlb_type == hypervisor) ?
+ (3 * 1024 * 1024) :
+ (4 * 1024 * 1024));
cpu_data(0).ecache_size = prom_getintdefault(cpu_node,
"ecache-size",
- 4 * 1024 * 1024);
+ def);
+
+ def = 64;
cpu_data(0).ecache_line_size =
- prom_getintdefault(cpu_node, "ecache-line-size", 64);
+ prom_getintdefault(cpu_node, "ecache-line-size",
+ def);
printk("CPU[0]: Caches "
"D[sz(%d):line_sz(%d)] "
"I[sz(%d):line_sz(%d)] "
@@ -160,6 +328,7 @@ void __init device_scan(void)
}
#endif
+ sun4v_virtual_device_probe();
central_probe();
cpu_probe();

arch/sparc64/kernel/dtlb_backend.S

View before deletion
diff --git a/arch/sparc64/kernel/dtlb_backend.S b/arch/sparc64/kernel/dtlb_backend.S
deleted file mode 100644
index acc889a..0000000
--- a/arch/sparc64/kernel/dtlb_backend.S
+++ /dev/null
@@ -1,170 +0,0 @@

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/dtlb_base.S

View before deletion

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/dtlb_miss.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/ebus.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/entry.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/etrap.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/head.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/irq.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/itlb_base.S

View before deletion

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/itlb_miss.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/ktlb.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/pci.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/pci_common.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/pci_iommu.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/pci_psycho.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/pci_sabre.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/pci_schizo.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/pci_sun4v.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/pci_sun4v.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/pci_sun4v_asm.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/process.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/ptrace.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/rtrap.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/sbus.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/setup.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/smp.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/sparc64_ksyms.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/sun4v_ivec.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/sun4v_tlb_miss.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/sys_sparc.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/sys_sparc32.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/time.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/trampoline.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/traps.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/tsb.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/ttable.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/unaligned.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/us2e_cpufreq.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/us3_cpufreq.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/visemul.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/vmlinux.lds.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/kernel/winfixup.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/lib/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/lib/NGbzero.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/lib/NGcopy_from_user.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/lib/NGcopy_to_user.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/lib/NGmemcpy.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/lib/NGpage.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/lib/NGpatch.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/lib/U3patch.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/lib/bzero.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/lib/clear_page.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/lib/copy_page.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/lib/delay.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/lib/xor.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/math-emu/math.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/mm/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/mm/fault.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/mm/generic.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/mm/hugetlbpage.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/mm/init.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/mm/tlb.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/mm/tsb.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/mm/ultra.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/prom/cif.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/prom/console.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/prom/init.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/prom/misc.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/prom/p1275.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/prom/tree.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc64/solaris/misc.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/tg3.c

View file

This diff is incomplete. Download the complete patch.

drivers/sbus/char/bbc_i2c.c

View file

This diff is incomplete. Download the complete patch.

drivers/serial/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/serial/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/serial/sunhv.c

View file

This diff is incomplete. Download the complete patch.

drivers/serial/sunsab.c

View file

This diff is incomplete. Download the complete patch.

drivers/serial/sunsu.c

View file

This diff is incomplete. Download the complete patch.

drivers/serial/sunzilog.c

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc/idprom.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc/oplib.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc/uaccess.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/a.out.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/asi.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/cpudata.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/elf.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/head.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/hypervisor.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/idprom.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/intr_queue.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/irq.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/mmu.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/mmu_context.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/numnodes.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/oplib.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/page.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/pbm.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/pci.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/pgalloc.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/pgtable.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/pil.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/processor.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/pstate.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/scratchpad.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/smp.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/sparsemem.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/spitfire.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/system.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/thread_info.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/timex.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/tlbflush.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/tsb.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/ttable.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/uaccess.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/vdev.h

View file

This diff is incomplete. Download the complete patch.

include/asm-sparc64/xor.h

View file

This diff is incomplete. Download the complete patch.

include/linux/serial_core.h

View file

This diff is incomplete. Download the complete patch.