aboutsummaryrefslogtreecommitdiffstats
path: root/arch
AgeCommit message (Collapse)AuthorFilesLines
2006-03-21Merge branch 'release' of ↵Linus Torvalds22-235/+725
git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6 * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6: [IA64-SGI] SN2-XP reduce kmalloc wrapper inlining [IA64] MCA: remove obsolete ifdef [IA64] MCA: update MCA comm field for user space tasks [IA64] MCA: print messages in MCA handler [IA64-SGI] - Eliminate SN pio_phys_xxx macros. Move to assembly [IA64] use icc defined constant [IA64] add __builtin_trap definition for icc build [IA64] clean up asm/intel_intrin.h [IA64] map ia64_hint definition to intel compiler intrinsic [IA64] hooks to wait for mmio writes to drain when migrating processes [IA64-SGI] driver bugfixes and hardware workarounds for CE1.0 asic [IA64-SGI] Handle SC env. powerdown events [IA64] Delete MCA/INIT sigdelayed code [IA64-SGI] sem2mutex ioc4.c [IA64] implement ia64 specific mutex primitives [IA64] Fix UP build with BSP removal support. [IA64] support for cpu0 removal
2006-03-21Merge master.kernel.org:/pub/scm/linux/kernel/git/herbert/crypto-2.6Linus Torvalds1-4/+3
* master.kernel.org:/pub/scm/linux/kernel/git/herbert/crypto-2.6: [CRYPTO] aes: Fixed array boundary violation [CRYPTO] tcrypt: Fix key alignment [CRYPTO] all: Add missing cra_alignmask [CRYPTO] all: Use kzalloc where possible [CRYPTO] api: Align tfm context as wide as possible [CRYPTO] twofish: Use rol32/ror32 where appropriate
2006-03-21Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6Linus Torvalds2-4/+2
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6: (81 commits) [PATCH] USB: omninet: fix up debugging comments [PATCH] USB serial: add navman driver [PATCH] USB: Fix irda-usb use after use [PATCH] USB: rtl8150 small fix [PATCH] USB: ftdi_sio: add Icom ID1 USB product and vendor ids [PATCH] USB: cp2101: add new device IDs [PATCH] USB: fix check_ctrlrecip to allow control transfers in state ADDRESS [PATCH] USB: vicam.c: fix a NULL pointer dereference [PATCH] USB: ZC0301 driver bugfix [PATCH] USB: add support for Creativelabs Silvercrest USB keyboard [PATCH] USB: storage: new unusual_devs.h entry: Mitsumi 7in1 Card Reader [PATCH] USB: storage: unusual_devs.h entry 0420:0001 [PATCH] USB: storage: another unusual_devs.h entry [PATCH] USB: storage: sandisk unusual_devices entry [PATCH] USB: fix initdata issue in isp116x-hcd [PATCH] USB: usbcore: usb_set_configuration oops (NULL ptr dereference) [PATCH] USB: usbcore: Don't assume a USB configuration includes any interfaces [PATCH] USB: ub 03 drop stall clearing [PATCH] USB: ub 02 remove diag [PATCH] USB: ub 01 remove first_open ...
2006-03-21Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6Linus Torvalds4-0/+22
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6: (23 commits) [PATCH] sysfs: fix a kobject leak in sysfs_add_link on the error path [PATCH] sysfs: don't export dir symbols [PATCH] get_cpu_sysdev() signedness fix [PATCH] kobject_add_dir [PATCH] debugfs: Add debugfs_create_blob() helper for exporting binary data [PATCH] sysfs: fix problem with duplicate sysfs directories and files [PATCH] Kobject: kobject.h: fix a typo [PATCH] Kobject: provide better warning messages when people do stupid things [PATCH] Driver core: add macros notice(), dev_notice() [PATCH] firmware: fix BUG: in fw_realloc_buffer [PATCH] sysfs: kzalloc conversion [PATCH] fix module sysfs files reference counting [PATCH] add EXPORT_SYMBOL_GPL_FUTURE() to USB subsystem [PATCH] add EXPORT_SYMBOL_GPL_FUTURE() to RCU subsystem [PATCH] add EXPORT_SYMBOL_GPL_FUTURE() [PATCH] Clean up module.c symbol searching logic [PATCH] kobj_map semaphore to mutex conversion [PATCH] kref: avoid an atomic operation in kref_put() [PATCH] handle errors returned by platform_get_irq*() [PATCH] driver core: platform_get_irq*(): return -ENXIO on error ...
2006-03-21Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivialLinus Torvalds1-431/+741
* git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial: README: bzip2 is not new Documentation/Changes: remove outdated translation references remove dead Radeon URL SCSI_AACRAID: add a help text update the i386 defconfig MAINTAINERS: remove the LANMEDIA entry Move ip2.c and ip2main.c to drivers/char/ip2/ where the other files
2006-03-21Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linusLinus Torvalds102-2540/+1917
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus: [MIPS] Update defconfigs. [MIPS] Separate CPU entries in /proc/cpuinfo with a blank line. [MIPS] sys_mmap2 offset argument should always be shifted 12, not PAGE_SHIFT. [MIPS] TX49XX has prefetch. [MIPS] Kill tlb-andes.c. [MIPS] War on whitespace: cleanup initial spaces followed by tabs. [MIPS] Makefile crapectomy. [MIPS] Reformat __xchg(). [MIPS] Mention Broadcom part number for BigSur board [MIPS] Remove CONFIG_BUILD_ELF64. [MIPS] Further sparsification for 32-bit compat code. [MIPS] fix wrong __user usage in _sysn32_rt_sigsuspend [MIPS] Signal cleanup [MIPS] Reformat all of signal32.c with tabs instead of space for consistency [MIPS] Delete unused sys32_waitpid. [MIPS] Make I/O helpers more customizable [MIPS] Symmetric Uniprocessor support for Qemu. [MIPS] sc-rm7k.c cleanup [MIPS] MIPS64 R2 optimizations for 64-bit endianess swapping. [MIPS] Add early console for Cobalt.
2006-03-21Merge master.kernel.org:/home/rmk/linux-2.6-armLinus Torvalds1-26/+2
* master.kernel.org:/home/rmk/linux-2.6-arm: [ARM] Fix cosmetic typo in asm/irq.h [ARM] 3367/1: CLCD mode no longer supported on the RealView boards [ARM] 3366/1: Allow the 16bpp mode configuration in the CLCD control register
2006-03-21Pull sn2-reduce-kmalloc-wrap into release branchTony Luck3-46/+85
2006-03-21Pull mca-cleanup into release branchTony Luck1-29/+55
2006-03-21Pull icc-cleanup into release branchTony Luck2-1/+73
2006-03-21Pull sn2-mmio-writes into release branchTony Luck2-2/+25
Hand-fixed conflicts: include/asm-ia64/machvec_sn2.h Signed-off-by: Tony Luck <tony.luck@intel.com>
2006-03-21Pull altix-ce1.0-asic into release branchTony Luck1-23/+303
2006-03-21Pull delete-sigdelayed into release branchTony Luck2-115/+0
2006-03-21Pull bsp-removal into release branchTony Luck12-19/+184
2006-03-21[MIPS] Update defconfigs.Ralf Baechle46-1830/+1537
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2006-03-21[MIPS] Separate CPU entries in /proc/cpuinfo with a blank line.Martin Michlmayr1-0/+1
Put in a blank line between CPU entries in /proc/cpuinfo, just like most other architectures (i386, ia64, x86_64) do. Signed-off-by: Martin Michlmayr <tbm@cyrius.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org> ---
2006-03-21[MIPS] sys_mmap2 offset argument should always be shifted 12, not PAGE_SHIFT.H. Peter Anvin2-1/+8
This patch adjusts the offset argument passed into sys_mmap2 to be always shifted 12, even when the native page size isn't 4K. This is what all existing userspace libraries expect. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org> ---
2006-03-21[MIPS] TX49XX has prefetch.Atsushi Nemoto3-2/+10
The TX49XX has the prefetch instruction. It supports only Pref_Load (hint 0). Actually changes in this patch except for Kconfig are not have any effects, I added these changes to prevent misuse of unsupported hints. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2006-03-21[MIPS] Kill tlb-andes.c.Thiemo Seufer3-260/+6
Basically identical to c-r4k.c, so maintaining one is really enough. Signed-off-by: Thiemo Seufer <ths@networkno.de> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2006-03-21[MIPS] War on whitespace: cleanup initial spaces followed by tabs.Ralf Baechle34-77/+78
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2006-03-21[MIPS] Makefile crapectomy.Ralf Baechle1-169/+39
Dump all the ridiculously complicated stuff that was needed support compilers older and newer than 3.0. Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Thiemo Seufer <ths@networkno.de>
2006-03-21[MIPS] Mention Broadcom part number for BigSur boardMartin Michlmayr1-1/+1
Mention the Broadcom part number for the BigSur board (BCM91480B) in Kconfig, just like it's done for other Broadcom boards. Signed-off-by: Martin Michlmayr <tbm@cyrius.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2006-03-21[MIPS] Remove CONFIG_BUILD_ELF64.Ralf Baechle9-48/+9
This option is no longer usable with supported compilers. It will be replaced by usage of -msym32 in a separate patch. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2006-03-21[MIPS] Further sparsification for 32-bit compat code.Atsushi Nemoto2-84/+88
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2006-03-21[MIPS] fix wrong __user usage in _sysn32_rt_sigsuspendAtsushi Nemoto1-1/+2
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2006-03-21[MIPS] Signal cleanupAtsushi Nemoto4-32/+16
Move function prototypes to asm/signal.h to detect trivial errors and add some __user tags to get rid of sparse warnings. Generated code should not be changed. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2006-03-21[MIPS] Reformat all of signal32.c with tabs instead of space for consistencyMartin Michlmayr1-6/+6
Signed-off-by: Martin Michlmayr <tbm@cyrius.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2006-03-21[MIPS] Delete unused sys32_waitpid.Ralf Baechle1-6/+0
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2006-03-21[MIPS] Symmetric Uniprocessor support for Qemu.Ralf Baechle3-1/+51
SMP bits needed to builds and run an SMP kernel. While only a single processor is supported ATM it's still useful for some SMP debugging using Qemu. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2006-03-21[MIPS] sc-rm7k.c cleanupAtsushi Nemoto1-16/+9
Use blast_scache_range, blast_inv_scache_range for rm7k scache routine. Output code should be logically same. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2006-03-21[MIPS] Add early console for Cobalt.Peter Horton5-8/+58
Signed-off-by: Peter Horton <pdh@colonel-panic.org> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2006-03-21[CRYPTO] aes: Fixed array boundary violationDavid McCullough1-4/+3
The AES setkey routine writes 64 bytes to the E_KEY area even though there are only 60 bytes there. It is in fact safe since E_KEY is immediately follwed by D_KEY which is initialised afterwards. However, doing this may trigger undefined behaviour and makes Coverity unhappy. So by combining E_KEY and D_KEY into one array we sidestep this issue altogether. This problem was reported by Adrian Bunk. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2006-03-20[PATCH] USB: OHCI for AU1200Jordan Crouse1-1/+1
ALCHEMY: Add OHCI support for AU1200 Updated by moving the OHCI support out of the EHCI patch. Signed-off-by: Jordan Crouse <jordan.crouse@amd.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-03-20[PATCH] USB: EHCI for AU1200Jordan Crouse2-3/+1
ALCHEMY: Add EHCI support for AU1200 Updated by removing the OHCI support Signed-off-by: Jordan Crouse <jordan.crouse@amd.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-03-20[PATCH] add EXPORT_SYMBOL_GPL_FUTURE()Greg Kroah-Hartman2-0/+18
This patch adds the ability to mark symbols that will be changed in the future, so that kernel modules that don't include MODULE_LICENSE("GPL") and use the symbols, will be flagged and printed out to the system log. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-03-20[PATCH] handle errors returned by platform_get_irq*()David Vrabel2-0/+4
platform_get_irq*() now returns on -ENXIO when the resource cannot be found. Ensure all users of platform_get_irq*() handle this error appropriately. Signed-off-by: David Vrabel <dvrabel@arcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-03-20Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6Linus Torvalds79-3298/+9759
* 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. ...
2006-03-20update the i386 defconfigAdrian Bunk1-431/+741
The i386 defconfig wasn't updated for ages. Instead of running "make oldconfig" on the old defconfig and trying to give reasonable answers at all new options, this patch replaces it with the one I'm using in 2.6.16-rc1. This way, it's a .config that is confirmed to work on at least one computer in the world. ;-) Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-03-20Merge branch 'master'Jeff Garzik9-49/+97
2006-03-20[SPARC64]: Update defconfig.David S. Miller1-11/+14
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix 2 bugs in huge page support.David S. Miller1-4/+175
1) huge_pte_offset() did not check the page table hierarchy elements as being empty correctly, resulting in an OOPS 2) Need platform specific hugetlb_get_unmapped_area() to handle the top-down vs. bottom-up address space allocation strategies. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: CONFIG_BLK_DEV_RAM fixAndrew Morton1-1/+1
init/do_mounts_rd.c depends upon CONFIG_BLK_DEV_RAM, not CONFIG_BLK_DEV_INITRD. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Optimized TSB table initialization.David S. Miller3-1/+71
We only need to write an invalid tag every 16 bytes, so taking advantage of this can save many instructions compared to the simple memset() call we make now. A prefetching implementation is implemented for sun4u and a block-init store version if implemented for Niagara. The next trick is to be able to perform an init and a copy_tsb() in parallel when growing a TSB table. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Allow CONFIG_MEMORY_HOTPLUG to build.David S. Miller1-0/+18
online_page() is straightforward, and then add a dummy remove_memory() that returns -EINVAL just like i386. There is no point in implementing remove_memory() since __remove_pages() has no implementation either. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Use SLAB caches for TSB tables.David S. Miller3-25/+69
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Don't kill the page allocator when growing a TSB.David S. Miller1-8/+35
Try only lightly on > 1 order allocations. If a grow fails, we are under memory pressure, so do not try to grow the TSB for this address space any more. If a > 0 order TSB allocation fails on a new fork, retry using a 0 order allocation. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Randomize mm->mmap_base when PF_RANDOMIZE is set.David S. Miller1-2/+14
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Increase top of 32-bit process stack.David S. Miller4-13/+17
Put it one page below the top of the 32-bit address space. This gives us ~16MB more address space to work with. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Top-down address space allocation for 32-bit tasks.David S. Miller2-9/+183
Currently allocations are very constrained for 32-bit processes. It grows down-up from 0x70000000 to 0xf0000000 which gives about 2GB of stack + dynamic mmap() space. So support the top-down method, and we need to override the generic helper function in order to deal with D-cache coloring. With these changes I was able to squeeze out a mmap() just over 3.6GB in size in a 32-bit process. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix and re-enable dynamic TSB sizing.David S. Miller4-106/+165
This is good for up to %50 performance improvement of some test cases. The problem has been the race conditions, and hopefully I've plugged them all up here. 1) There was a serious race in switch_mm() wrt. lazy TLB switching to and from kernel threads. We could erroneously skip a tsb_context_switch() and thus use a stale TSB across a TSB grow event. There is a big comment now in that function describing exactly how it can happen. 2) All code paths that do something with the TSB need to be guarded with the mm->context.lock spinlock. This makes page table flushing paths properly synchronize with both TSB growing and TLB context changes. 3) TSB growing events are moved to the end of successful fault processing. Previously it was in update_mmu_cache() but that is deadlock prone. At the end of do_sparc64_fault() we hold no spinlocks that could deadlock the TSB grow sequence. We also have dropped the address space semaphore. While we're here, add prefetching to the copy_tsb() routine and put it in assembler into the tsb.S file. This piece of code is quite time critical. There are some small negative side effects to this code which can be improved upon. In particular we grab the mm->context.lock even for the tsb insert done by update_mmu_cache() now and that's a bit excessive. We can get rid of that locking, and the same lock taking in flush_tsb_user(), by disabling PSTATE_IE around the whole operation including the capturing of the tsb pointer and tsb_nentries value. That would work because anyone growing the TSB won't free up the old TSB until all cpus respond to the TSB change cross call. I'm not quite so confident in that optimization to put it in right now, but eventually we might be able to and the description is here for reference. This code seems very solid now. It passes several parallel GCC bootstrap builds, and our favorite "nut cruncher" stress test which is a full "make -j8192" build of a "make allmodconfig" kernel. That puts about 256 processes on each cpu's run queue, makes lots of process cpu migrations occur, causes lots of page table and TLB flushing activity, incurs many context version number changes, and it swaps the machine real far out to disk even though there is 16GB of ram on this test system. :-) Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: First cut at VIS simulator for Niagara.David S. Miller3-1/+901
Niagara does not implement some of the VIS instructions in hardware, so we have to emulate them. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix system type in /proc/cpuinfo and remove bogus OBP check.David S. Miller3-69/+10
Report 'sun4v' when appropriate in /proc/cpuinfo Remove all the verifications of the OBP version string. Just make sure it's there, and report it raw in the bootup logs and via /proc/cpuinfo. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Add SMT scheduling support for Niagara.David S. Miller2-0/+27
The mapping is a simple "(cpuid >> 2) == core" for now. Later we'll add more sophisticated code that will walk the sun4v machine description and figure this out from there. We should also add core mappings for jaguar and panther processors. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix 32-bit truncation which broke sparsemem.David S. Miller1-10/+8
The page->flags manipulations done by the D-cache dirty state tracking was broken because the constants were not marked with "UL" to make them 64-bit, which means we were clobbering the upper 32-bits of page->flags all the time. This doesn't jive well with sparsemem which stores the section and indexing information in the top 32-bits of page->flags. This is yet another sparc64 bug which has been with us forever. While we're here, tidy up some things in bootmem_init() and paginig_init(): 1) Pass min_low_pfn to init_bootmem_node(), it's identical to (phys_base >> PAGE_SHIFT) but we should use consistent with the variable names we print in CONFIG_BOOTMEM_DEBUG 2) max_mapnr, although no longer used, was being set inaccurately, we shouldn't subtract pfn_base any more. 3) All the games with phys_base in the zones_*[] arrays we pass to free_area_init_node() are no longer necessary. Thanks to Josh Grebe and Fabbione for the bug reports and testing. Fix also verified locally on an SB2500 which had a memory layout that triggered the same problem. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Move over to sparsemem.David S. Miller3-43/+104
This has been pending for a long time, and the fact that we waste a ton of ram on some configurations kind of pushed things over the edge. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix new context version SMP handling.David S. Miller9-45/+60
Don't piggy back the SMP receive signal code to do the context version change handling. Instead allocate another fixed PIL number for this asynchronous cross-call. We can't use smp_call_function() because this thing is invoked with interrupts disabled and a few spinlocks held. Also, fix smp_call_function_mask() to count "cpus" correctly. There is no guarentee that the local cpu is in the mask yet that is exactly what this code was assuming. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Bulletproof MMU context locking.David S. Miller2-2/+4
1) Always spin_lock_init() in init_context(). The caller essentially clears it out, or copies the mm info from the parent. In both cases we need to explicitly initialize the spinlock. 2) Always do explicit IRQ disabling while taking mm->context.lock and ctx_alloc_lock. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: kzalloc() conversionEric Sesterhenn11-58/+27
this patch converts arch/sparc64 to kzalloc usage. Crosscompile tested with allyesconfig. Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix loop termination in mark_kpte_bitmap()David S. Miller1-1/+4
If we were aligned, but didn't have at least 256MB left to process, we would loop forever. Thanks to fabbione for the report and testing the fix. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Simplify TSB insert checks.David S. Miller2-23/+6
Don't try to avoid putting non-base page sized entries into the user TSB. It actually costs us more to check this than it helps. Eventually we'll have a multiple TSB scheme for user processes. Once a process starts using larger pages, we'll allocate and use such a TSB. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: More SUN4V cpu mondo bug fixing.David S. Miller1-16/+24
This cpu mondo sending interface isn't all that easy to use correctly... We were clearing out the wrong bits from the "mask" after getting something other than EOK from the hypervisor. It turns out the hypervisor can just be resent the same cpu_list[] array, with the 0xffff "done" entries still in there, and it will do the right thing. So don't update or try to rebuild the cpu_list[] array to condense it. This requires the "forward_progress" check to be done slightly differently, but this new scheme is less bug prone than what we were doing before. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix sun4v mna winfixup handling.David S. Miller1-4/+4
We were clobbering a base register before we were done using it. Fix a comment typo while we're here. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix mini RTC driver reading.David S. Miller1-0/+2
Need to subtract 1900 from year and 1 from month before giving it back to userspace. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Do not allow mapping pages within 4GB of 64-bit VA hole.David S. Miller1-22/+68
The UltraSPARC T1 manual recommends this because the chip could instruction prefetch into the VA hole, and this would also make decoding certain kinds of memory access traps more difficult (because the chip sign extends certain pieces of trap state). Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix _PAGE_EXEC handling.David S. Miller3-8/+15
First of all, use the known _PAGE_EXEC_{4U,4V} value instead of loading _PAGE_EXEC from memory. We either know which one to use by context, or we can code patch the test. Next, we need to check executability of a PTE in the generic TSB miss handler. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix typo in SUN4V D-TLB miss handler.David S. Miller1-1/+1
Should put FAULT_CODE_DTLB into %g3 not FAULT_CODE_ITLB. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Add mini-RTC driver for Starfire and SUN4V.David S. Miller1-0/+279
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix bugs in SUN4V cpu mondo dispatch.David S. Miller2-57/+151
There were several bugs in the SUN4V cpu mondo dispatch code. In fact, if we ever got a EWOULDBLOCK or other error from the hypervisor call, we'd potentially send a cpu mondo multiple times to the same cpu and even worse we could loop until the timeout resending the same mondo over and over to such cpus. So let's bulletproof this thing as follows: 1) Implement cpu_mondo_send() and cpu_state() hypervisor calls in arch/sparc64/kernel/entry.S, add prototypes to asm/hypervisor.h 2) Don't build and update the cpulist using inline functions, this was causing the cpu mask to not get updated in the caller. 3) Disable interrupts during the entire mondo send, otherwise our cpu list and/or mondo block could get overwritten if we take an interrupt and do a cpu mondo send on the current cpu. 4) Check for all possible error return types from the cpu_mondo_send() hypervisor call. In particular: HV_EOK) Our work is done, all cpus have received the mondo. HV_CPUERROR) One or more of the cpus in the cpu list we passed to the hypervisor are in error state. Use cpu_state() calls over the entries in the cpu list to see which ones. Record them in "error_mask" and report this after we are done sending the mondo to cpus which are not in error state. HV_EWOULDBLOCK) We need to keep trying. Any other error we consider fatal, we report the event and exit immediately. 5) We only timeout if forward progress is not made. Forward progress is defined as having at least one cpu get the mondo successfully in a given cpu_mondo_send() call. Otherwise we bump a counter and delay a little. If the counter hits a limit, we signal an error and report the event. Also, smp_call_function_mask() error handling reports the number of cpus incorrectly. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix bugs in SMP TLB context version expiration handling.David S. Miller1-6/+10
1) We must flush the TLB, duh. 2) Even if the sw context was seen to be valid, the local cpu's hw context can be out of date, so reload it unconditionally. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix indexing into kpte_linear_bitmap.David S. Miller1-0/+1
Need to shift back up by 3 bits to get 8-byte entry index. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Avoid dcache-dirty page state management on sun4v.David S. Miller2-23/+30
It is totally wasted work, since we have no D-cache aliasing issues on sun4v. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Bulletproof hypervisor TLB flushing.David S. Miller2-26/+80
Check TLB flush hypervisor calls for errors and report them. Pass HV_MMU_ALL always for now, we can add back the optimization to avoid the I-TLB flush later. Always explicitly page align the virtual address arguments. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Report mondo error correctly in hypervisor_xcall_deliver().David S. Miller1-1/+1
It's in "arg0" not "func". Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Niagara optimized XOR functions for RAID.David S. Miller2-1/+312
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix binfmt_aout32.c build.Andrew Morton1-1/+1
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: destroy_context() needs to disable interrupts.David S. Miller1-2/+3
get_new_mmu_context() can be invoked from interrupt context now for the new SMP version wrap handling. So disable interrupt while taking ctx_alloc_lock in destroy_context() so we don't deadlock. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix TLB context allocation with SMT style shared TLBs.David S. Miller2-12/+37
The context allocation scheme we use depends upon there being a 1<-->1 mapping from cpu to physical TLB for correctness. Chips like Niagara break this assumption. So what we do is notify all cpus with a cross call when the context version number changes, and if necessary this makes them allocate a valid context for the address space they are running at the time. Stress tested with make -j1024, make -j2048, and make -j4096 kernel builds on a 32-strand, 8 core, T2000 with 16GB of ram. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Put syscall tables after trap table.David S. Miller1-1/+2
Otherwise with too much stuff enabled in the kernel config we can end up with an unaligned trap table. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Export _PAGE_E and _PAGE_CACHE to modules.David S. Miller1-0/+4
SBUS flash driver needs it. Noticed by Fabbione. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Drop %gl to 0 before re-enabling PSTATE_IE in rtrapDavid S. Miller1-1/+2
If we take a window fault, on SUN4V set %gl to zero before we turn PSTATE_IE back on in %pstate. Otherwise if we take an interrupt we'll end up with corrupt register state. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Create a seperate kernel TSB for 4MB/256MB mappings.David S. Miller2-6/+33
It can map all of the linear kernel mappings with zero TSB hash conflicts for systems with 16GB or less ram. In such cases, on SUN4V, once we load up this TSB the first time with all the mappings, we never take a linear kernel mapping TLB miss ever again, the hypervisor handles them all. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Make use of Niagara 256MB PTEs for kernel mappings.David S. Miller2-15/+96
We use a bitmap, one bit for every 256MB of memory. If the bit is set we can use a 256MB PTE for linear mappings, else we have to use a 4MB PTE. SUN4V support is there, and we can very easily add support for Panther cpu 256MB PTEs in the future. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Use sun4v_cpu_idle() in cpu_idle() on SUN4V.David S. Miller1-49/+32
We have to turn off the "polling nrflag" bit when we sleep the cpu like this, so that we'll get a cross-cpu interrupt to wake the processor up from the yield. We also have to disable PSTATE_IE in %pstate around the yield call and recheck need_resched() in order to avoid any races. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64] math-emu: Delete debugging printk left by previous commit.David S. Miller1-1/+0
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Add sun4v_cpu_yield().David S. Miller1-0/+9
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Kill cpudata->idle_volume.David S. Miller2-10/+2
Set, but never used. We used to use this for dynamic IRQ retargetting, but that code died a long time ago. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Niagara optimized memset/bzero/clear_user.David S. Miller3-1/+165
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Pass multiple CPUs at once to hypervisor cross-call API.David S. Miller1-54/+0
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Args to SUNW,set-trap-table are 64-bit.David S. Miller1-2/+7
They were getting truncated to 32-bit and this is very bad when your MMU fault status area is in physical memory above 4GB on SUN4V. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Handle unimplemented FPU square-root on Niagara.David S. Miller1-2/+23
The math-emu code only expects unfinished fpop traps when emulating FPU sqrt instructions on pre-Niagara chips. On Niagara we can get unimplemented fpop, so handle that. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Typo in sun4v_data_access_exception log message.David S. Miller1-1/+1
Should be "Dax" not "Iax". Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Handle zero-length map requests in pci_sun4v.cDavid S. Miller1-2/+2
By simply changing the do-while loop into a plain while loop. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Kill stray PGLIST_NENTS check in pci_sun4v.cDavid S. Miller1-2/+0
I forgot to remove the one in pci_4v_map_sg() during the iommu batching commit. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix typo in dump_tl1_traplog()David S. Miller1-1/+1
Actually make use of the 'limit' we compute. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Disable smp_report_regs() for now.David S. Miller1-1/+2
It's extremely noisy and causes much grief on slow consoles with large numbers of cpus. We'll have to provide this some saner way in order to re-enable this. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Remove PGLIST_NENTS PCI IOMMU mapping limitation on SUN4V.David S. Miller3-83/+171
Use a batching queue system for IOMMU mapping setup, with a page sized batch. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Use KERN_EMERG in dump_tl1_traplog() and sun4v TLB errors.David S. Miller1-7/+13
We're about to seriously die in these cases so it is important that the messages make it to the console. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix unaligned access winfxup handling on SUN4V.David S. Miller2-17/+34
Another case where we have to force ourselves into global register level one. Also make sure the arguments passed to sun4v_do_mna() are correct. This area actually needs some more work, for example spill fixup is not necessarily going to do the right thing for this case. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Set %gl to 1 in kvmap_itlb_longpath on SUN4V.David S. Miller1-1/+1
Just like kvmap_dtlb_longpath we have to force the global register level to one in order to mimick the PSTATE_MG --> PSTATE_AG trasition done on SUN4U. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Export a PAGE_SHARED symbol.David S. Miller1-0/+5
For drivers/media/*, noticed by Fabbione. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: More TLB/TSB handling fixes.David S. Miller7-51/+64
The SUN4V convention with non-shared TSBs is that the context bit of the TAG is clear. So we have to choose an "invalid" bit and initialize new TSBs appropriately. Otherwise a zero TAG looks "valid". Make sure, for the window fixup cases, that we use the right global registers and that we don't potentially trample on the live global registers in etrap/rtrap handling (%g2 and %g6) and that we put the missing virtual address properly in %g5. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Don't do anything in flush_ptrace_access() on SUN4V.David S. Miller1-0/+3
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix some SUN4V TLB handling bugs.David S. Miller3-5/+92
1) Add error return checking for TLB load hypervisor calls. 2) Don't fallthru to dtlb tsb miss handler from itlb tsb miss handler, oops. 3) On window fixups, propagate fault information to fixup handler correctly. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Check for errors in hypervisor_tlb_lock().David S. Miller1-0/+5
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Init boot cpu's trap_block[] before paging_init()David S. Miller1-2/+2
It must be ready when we take over the trap table. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Define ARCH_HAS_READ_CURRENT_TIMER.David S. Miller2-18/+9
This gives more consistent bogomips and delay() semantics, especially on sun4v. It gives weird looking values though... Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Set associativity of kernel TSB descriptor correctly.David S. Miller1-1/+1
It should be 1, not 0. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: __bzero_noasi --> __clear_userDavid S. Miller2-10/+10
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Put SUN4V ITSB miss into correct trap table entry.David S. Miller1-6/+4
It's 0x9 not 0xb. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Use phys tsb address in tsb_insert() in SUN4V.David S. Miller1-1/+1
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix uniprocessor IRQ targetting on SUN4V.David S. Miller3-55/+53
We need to use the real hardware processor ID when targetting interrupts, not the "define to 0" thing the uniprocessor build gives us. Also, fill in the Node-ID and Agent-ID fields properly on sun4u/Safari. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix PCI IRQ probing regression.David S. Miller1-5/+5
If the top-level cnode had multi entries in it's "reg" property, we'd fail. The buffer wasn't large enough in such cases. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Get SUN4V SMP working.David S. Miller5-50/+84
The sibling cpu bringup is extremely fragile. We can only perform the most basic calls until we take over the trap table from the firmware/hypervisor on the new cpu. This means no accesses to %g4, %g5, %g6 since those can't be TLB translated without our trap handlers. In order to achieve this: 1) Change sun4v_init_mondo_queues() so that it can operate in several modes. It can allocate the queues, or install them in the current processor, or both. The boot cpu does both in it's call early on. Later, the boot cpu allocates the sibling cpu queue, starts the sibling cpu, then the sibling cpu loads them in. 2) init_cur_cpu_trap() is changed to take the current_thread_info() as an argument instead of reading %g6 directly on the current cpu. 3) Create a trampoline stack for the sibling cpus. We do our basic kernel calls using this stack, which is locked into the kernel image, then go to our proper thread stack after taking over the trap table. 4) While we are in this delicate startup state, we put 0xdeadbeef into %g4/%g5/%g6 in order to catch accidental accesses. 5) On the final prom_set_trap_table*() call, we put &init_thread_union into %g6. This is a hack to make prom_world(0) work. All that wants to do is restore the %asi register using get_thread_current_ds(). Longer term we should just do the OBP calls to set the trap table by hand just like we do for everything else. This would avoid that silly prom_world(0) issue, then we can remove the init_thread_union hack. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Disable smp_report_regs() for now.David S. Miller1-0/+2
For 32 cpus and a slow console, it just wedges the machine especially with DETECT_SOFTLOCKUP enabled. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Rewrite pci_intmap_match().David S. Miller1-114/+155
The whole algorithm was wrong. What we need to do is: 1) Walk each PCI bus above this device on the path to the PCI controller nexus, and for each: a) If interrupt-map exists, apply it, record IRQ controller node b) Else, swivel interrupt number using PCI_SLOT(), use PCI bus parent OBP node as controller node c) Walk up to "controller node" until we hit the first PCI bus in this domain, or "controller node" is the PCI controller OBP node 2) If we walked to PCI controller OBP node, we're done. 3) Else, apply PCI controller interrupt-map to interrupt. There is some stuff that needs to be checked out for ebus and isa, but the PCI part is good to go. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Don't set interrupt state to IDLE in enable_irq().David S. Miller1-4/+0
We'll lose events that way. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix return from trap on SUN4V.David S. Miller1-1/+3
We need to set the global register set _AND_ disable PSTATE_IE in %pstate. The original patch sequence was leaving PSTATE_IE enabled when returning to kernel mode, oops. This fixes the random register corruption being seen on SUN4V. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Set dummy bucket->{imap,iclr} unique on SUN4V.David S. Miller1-5/+10
So that free_irq() disable's the IRQ correctly. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Add sun4v_cpu_qconf() hypervisor call.David S. Miller2-19/+19
Call it from register_one_mondo(). Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: do_fptrap needs to load the thread reg into %g6.David S. Miller1-0/+1
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix bogus call to sun4v_mna in winfixup code.David S. Miller1-1/+1
The C function is named sun4v_do_mna not sun4v_mna. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix tl1 trap state capture/dump on SUN4V.David S. Miller2-1/+9
No trap levels above 2 in privileged mode on SUN4V. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64] PCI: Size TSB correctly on SUN4V.David S. Miller1-6/+16
Forgot to multiply by 8 * 1024, oops. Correct the size constant when the virtual-dma arena is 2GB in size, it should bet 256 not 128. Finally, log some info about the TSB at probe time. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Don't use ASI_QUAD_LDD_PHYS on SUN4V.David S. Miller1-2/+2
Need to use ASI_QUAD_LDD_PHYS_4V instead. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Do not write garbage into %pstate in tsb_context_switch().David S. Miller1-1/+7
For SUN4V, we were clobbering %o5 to do the hypervisor call. This clobbers the saved %pstate value and we end up writing garbage into that register as a result. Oops. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix flush_tsb_user() on SUN4V.David S. Miller1-1/+1
Needs to use physical addressing just like cheetah_plus. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix comment typo in __flush_tlb_kernel_range.David S. Miller1-1/+1
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Decode virtual-devices interrupts correctly.David S. Miller1-12/+86
Need to translate through the interrupt-map{,-mask] properties. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Add prom_{start,stop}cpu_cpuid().David S. Miller2-5/+23
Use prom_startcpu_cpuid() on SUN4V instead of prom_startcpu(). We should really test for "SUNW,start-cpu-by-cpuid" presence and use it if present even on SUN4U. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix pci_intmap_match().David S. Miller1-3/+10
When crawling up the PCI bus chain, stop at the first node that has an interrupt-map property before we hit the root. Also, if we use a bus interrupt-{map,mask} do not forget to update the 'intmask' pointer as we do for the 'intmap' pointer. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Two IRQ handling fixes.David S. Miller1-3/+8
On SUN4V, force IRQ state to idle in enable_irq(). However, I'm still not sure this is %100 correct. Call add_interrupt_randomness() on SUN4V too. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Use different cache sizing defaults on SUN4V.David S. Miller2-14/+48
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Make lack of interrupt-map-* a fatal error on SUN4V.David S. Miller1-13/+14
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix sun4v_intr_setenabled() return value check in enable_irq().David S. Miller1-1/+1
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Explicitly init *nregs to 0 in find_device_prom_node().David S. Miller1-3/+3
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Restrict PCI bus scanning on SUN4V.David S. Miller1-20/+16
On the PBM's first bus number, only allow device 0, function 0, to be poked at with PCI config space accesses. For some reason, this single device responds to all device numbers. Also, reduce the verbiage of the debugging log printk's for PCI cfg space accesses in the SUN4V PCI controller driver, so that it doesn't overwhelm the slow SUN4V hypervisor console. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix C-function name called by sun4v_mna trap code.David S. Miller2-2/+2
The trap code was calling itself :-) Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Don't printk() any messaages in sun4v_build_irq().David S. Miller1-3/+0
It just clutters up the log. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: INO is never fully specified already on SUN4V.David S. Miller1-9/+11
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Kill sun4v_register_fault_status() on SMP.David S. Miller1-3/+1
That now gets done as a side effect of taking over the trap table from OBP. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: arch/sparc64/kernel/trampoline.S needs asm/cpudata.hDavid S. Miller1-0/+1
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Make error codes available from sun4v_intr_get*().David S. Miller1-3/+18
And check for errors at call sites. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Pass correct ino to sun4v_intr_*().David S. Miller1-8/+11
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Use TRAP_LOAD_IRQ_WORK() in sun4v device mondo handler.David S. Miller1-4/+1
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix IOMMU mapping on sun4v.David S. Miller1-30/+46
We should dynamically allocate the per-cpu pglist not use an in-kernel-image datum, since __pa() does not work on such addresses. Also, consistently use "u32" for devhandle. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Trim down sun4v IRQ translation kernel log message.David S. Miller1-2/+2
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64] sunhv: Bug fixes.David S. Miller1-0/+1
Add udelay to polling console write loop, and increment the loop limit. Name the device "ttyHV" and pass that to add_preferred_console() when we're using hypervisor console. Kill sunhv_console_setup(), it's empty. Handle the case where we don't want to use hypervisor console. (ie. we have a head attached to a sun4v machine) Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Probe virtual-devices root node on sun4v.David S. Miller1-0/+58
This is where we learn how to get the interrupts for things like the hypervisor console device. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Kill spurious semicolon in sun4v_pci_init().David S. Miller1-1/+1
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Program IRQ registers correctly on sun4v.David S. Miller1-24/+47
Need to use hypervisor calls instead of direct register accesses. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Generic sun4v_build_irq().David S. Miller2-28/+34
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: More SUN4V PCI work.David S. Miller1-14/+102
Get bus range from child of PCI controller root nexus. This is actually a hack, but the PCI-E bridge sitting at the top of the PCI tree responds to PCI config cycles for every device number, so best to just ignore it for now. Preliminary PCI irq routing, needs lots of work. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Log faulting vaddr when bogus kernel PC detected.David S. Miller1-2/+3
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Implement rest of generic interrupt hypervisor calls.David S. Miller1-1/+65
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Move devino_to_sysino out of pci_sun4v_asm.SDavid S. Miller3-14/+12
It is not PCI specific, it is for all system interrupts. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Range check bus number in SUN4V PCI controller driver.David S. Miller1-9/+24
It has to be somewhere in the range from pbm->pci_first_busno to pbm->pci_last_busno, inclusive. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Missing 'return' statement in sun4v_pci_init().David S. Miller1-4/+3
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Implement basic pci_sun4v_scan_bus().David S. Miller1-3/+46
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: PCI-SUN4V fixes.David S. Miller1-8/+33
Clear top 8-bits of physical addresses in "ranges" property. This gives the actual physical address. Detect PBM-A vs. PBM-B by checking bit 0x40 of the devhandle. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Use inline patching for critical PTE operations.David S. Miller1-208/+3
This handles the SUN4U vs SUN4V PTE layout differences with near zero performance cost. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Move PTE field definitions back into asm/pgtable.hDavid S. Miller1-84/+0
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Don't expect cfg space in PCI PBM ranges on SUN4V.David S. Miller1-15/+5
PCI cfg space is accessed transparently through the Hypervisor and not through direct cpu PIO operations. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix branch signedness bug in all code patching.David S. Miller3-3/+6
The bug that hit SUN4V TLB patching exists elsewhere. Make sure we cure all such cases. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Recognize "virtual-console" as input and output console device.David S. Miller2-0/+11
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Do not try to synchronize %stick registers on SUN4V.David S. Miller1-1/+5
Writes by privileged code are not allowed. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Do not try to write to %tick or %stick on SUN4V.David S. Miller1-10/+16
Writes by privileged code are disallowed. The hypervisor manages the non-privileged bit. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix mondo queue allocations.David S. Miller3-30/+59
We have to use bootmem during init_IRQ and page alloc for sibling cpu calls. Also, fix incorrect hypervisor call return value checks in the hypervisor SMP cpu mondo send code. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Deal with PTE layout differences in SUN4V.David S. Miller11-429/+645
Yes, you heard it right, they changed the PTE layout for SUN4V. Ho hum... This is the simple and inefficient way to support this. It'll get optimized, don't worry. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Register kernel TSB with hypervisor.David S. Miller2-2/+72
We do this right after we take over the trap table from OBP. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix some SUN4V TLB miss bugs.David S. Miller2-13/+68
Code patching did not sign extend negative branch offsets correctly. Kernel TLB miss path needs patching and %g4 register preservation in order to handle SUN4V correctly. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix typo in sun4v_patch().David S. Miller1-1/+1
Second instruction offset is '4' not '3'. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix sun4v early bootup.David S. Miller1-15/+20
prom_sun4v_name should be "sun4v" not "SUNW,sun4v" Also, this is too early to make use of the .sun4v_Xinsn_patch code patching, so just check things manually. This gets us at least to prom_init() on Niagara. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix some Niagara memcpy() bugs.David S. Miller2-4/+8
We need to restore the %asi register properly. For the kernel this means get_fs(), for user this means ASI_PNF. Also, NGcopy_to_user.S was including U3memcpy.S instead of NGmemcpy.S, oops :-) Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Handle hypervisor case correctly in copy_tsb().David S. Miller1-2/+9
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fetch bootup time of day from Hypervisor.David S. Miller1-8/+50
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Simplify sun4v TLB handling using macros.David S. Miller2-87/+61
There was also a bug in sun4v_itlb_miss, it loaded the MMU Fault Status base into %g3 instead of %g2. This pointed out a fast path for TSB miss processing, since we have %g2 with the MMU Fault Status base, we can use that to quickly load up the PGD phys address. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Use ASI_SCRATCHPAD address 0x0 properly.David S. Miller6-162/+113
This is where the virtual address of the fault status area belongs. To set it up we don't make a hypervisor call, instead we call OBP's SUNW,set-trap-table with the real address of the fault status area as the second argument. And right before that call we write the virtual address into ASI_SCRATCHPAD vaddr 0x0. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: First cut at SUN4V PCI IOMMU handling.David S. Miller4-31/+550
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fix hypervisor call arg passing.David S. Miller5-53/+53
Function goes in %o5, args go in %o0 --> %o5. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Implement SUN4V PCI config space access.David S. Miller3-4/+93
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: More SUN4V PCI controller work.David S. Miller4-1/+364
Add assembler file for PCI hypervisor calls. Setup basic skeleton of SUN4V PCI controller driver. Add 32-bit devhandle to PBM struct, as this is needed for hypervisor calls. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Beginnings of SUN4V PCI controller support.David S. Miller4-9/+107
Abstract out IOMMU operations so that we can have a different set of calls on sun4v, which needs to do things through hypervisor calls. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Fetch cpu mid properly on sun4v.David S. Miller1-3/+20
If there is a "cpuid" property, use that. Else suck it out of the top bits of the "reg" property. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: SUN4V memory exception trap handlers.David S. Miller4-24/+325
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Hypervisor TSB context switching.David S. Miller2-16/+74
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Implement sun4v TSB miss handlers.David S. Miller3-9/+64
When we register a TSB with the hypervisor, so that it or hardware can handle TLB misses and do the TSB walk for us, the hypervisor traps down to these trap when it incurs a TSB miss. Processing is simple, we load the missing virtual address and context, and do a full page table walk. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: kernel/cpu.c needs asm/spitfire.hDavid S. Miller1-0/+1
For 'tlb_type'. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Print ARCH as SUN4V when tlb_type is hypervisor.David S. Miller1-1/+4
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Detect sun4v early in boot process.David S. Miller10-80/+264
We look for "SUNW,sun4v" in the 'compatible' property of the root OBP device tree node. Protect every %ver register access, to make sure it is not touched on sun4v, as %ver is hyperprivileged there. Lock kernel TLB entries using hypervisor calls instead of calls into OBP. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Sun4v cross-call sending support.David S. Miller3-2/+151
Technically the hypervisor call supports sending in a list of all cpus to get the cross-call, but I only pass in one cpu at a time for now. The multi-cpu support is there, just ifdef'd out so it's easy to enable or delete it later. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Sun4v interrupt handling.David S. Miller5-3/+554
Sun4v has 4 interrupt queues: cpu, device, resumable errors, and non-resumable errors. A set of head/tail offset pointers help maintain a work queue in physical memory. The entries are 64-bytes in size. Each queue is allocated then registered with the hypervisor as we bring cpus up. The two error queues each get a kernel side buffer that we use to quickly empty the main interrupt queue before we call up to C code to log the event and possibly take evasive action. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Allocate and register the 4 sun4v mondo queues at bootup.David S. Miller2-1/+59
Needs to occur before we enable PSTATE_IE in %pstate. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Verify all trap_per_cpu assembler offsets in trap_init()David S. Miller1-1/+12
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Patch up mmu context register writes for sun4v.David S. Miller8-61/+166
sun4v uses ASI_MMU instead of ASI_DMMU Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Register per-cpu fault status area with sun4v hypervisor.David S. Miller2-4/+28
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Niagara copy/clear page.David S. Miller3-0/+114
Happily we have no D-cache aliasing issues on these chips, so the implementation is very straightforward. Add a stub in bootup which will be where the patching calls will be made for niagara/sun4v/hypervisor. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Rename gl_{1,2}insn_patch --> sun4v_{1,2}insn_patchDavid S. Miller7-28/+28
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Initial sun4v TLB miss handling infrastructure.David S. Miller6-16/+332
Things are a little tricky because, unlike sun4u, we have to: 1) do a hypervisor trap to do the TLB load. 2) do the TSB lookup calculations by hand Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Add missing memory barriers to instruction patching functions.David S. Miller1-0/+7
V9 requires a write memory barrier before the instruction flush. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Sanitize %pstate writes for sun4v.David S. Miller6-206/+82
If we're just switching between different alternate global sets, nop it out on sun4v. Also, get rid of all of the alternate global save/restore in the OBP CIF trampoline code. Signed-off-by: David S. Miller <davem@davemloft.net>