summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/booke
Commit message (Collapse)AuthorAgeFilesLines
* Panic openly if we cannot retrieve memory information from the device tree.raj2012-05-301-3/+3
| | | | | | | | This is a critical condition and can lead to all sorts of misterious hangs if not handled. Obtained from: Semihalf Also reported by: thompsa
* Extract vendor specific Book-E pieces into separate files and have a commonraj2012-05-303-39/+384
| | | | | | | | skeleton (maybe we should kobj-tize this one day). Note the PPC4xx bit is not connected to the build yet. Obtained from: AppliedMicro, Semihalf.
* Remove redundant check, we catch ULE platform support in commonraj2012-05-271-4/+0
| | | | sys/kern/sched_ule.c
* Let us manage differences of Book-E PowerPC variations i.e. vendor /raj2012-05-272-1/+7
| | | | | | | | | | | | implementation specific vs. the common architecture definition. Bring PPC4XX defines (PSL, SPR, TLB). Note the new definitions under BOOKE_PPC4XX are not used in the code yet. This change set is not supposed to affect existing E500 support, it's just another reorg step before bringing support for E500mc, E5500 and PPC465. Obtained from: AppliedMicro, Freescale, Semihalf
* Retrieve CPU number info from the device tree.raj2012-05-261-18/+8
| | | | Obtained from: Freescale, Semihalf.
* Rename e500 prefix to match other Book-E CPU variations. CPU id tidbits forraj2012-05-262-8/+10
| | | | | | the new cores. Obtained from: Freescale, Semihalf.
* Fix physical address type to vm_paddr_t.raj2012-05-241-10/+10
|
* o Rename kernload_ap to bp_kernelload. This to introduce a common prefixmarcel2012-05-243-19/+39
| | | | | | | | | | | | | | | | for variables that live in the boot page. o Add bp_trace (yes, it's in the boot page) that gets zeroed before we try to wake a core and to which the core being woken can write markers so that we know where the core was in case it doesn't wake up. The boot code does not yet write markers (too follow). o Disable the boot page translation to allow the last 4K page to be used for whatever we please. It would get mapped otherwise. o Fix kernstart in the case of SMP. The start argument is typically page aligned due to the alignment requirements that come with having a boot page. The point of using trunc_page is that we get the actual load address given that the entry point is immediately following the ELF headers. In the SMP case this ended up exactly 4K after the load address. Hence subtracting 1 from start.
* Finally, try to enable the nxstacks on amd64 and powerpc64 for both 64bitkib2012-01-301-0/+5
| | | | | | | and 32bit ABIs. Also try to enable nxstacks for PAE/i386 when supported, and some variants of powerpc32. MFC after: 2 months (if ever)
* Fix OF_finddevice error return value in case of FDT.jchandra2011-12-021-1/+1
| | | | | | | | | | | | | | | | | | | According to the open firmware standard, finddevice call has to return a phandle with value of -1 in case of error. This commit is to: - Fix the FDT implementation of this interface (ofw_fdt_finddevice) to return (phandle_t)-1 in case of error, instead of 0 as it does now. - Fix up the callers of OF_finddevice() to compare the return value with -1 instead of 0 to check for errors. - Since phandle_t is unsigned, the return value of OF_finddevice should be checked with '== -1' rather than '<= 0' or '> 0', fix up these cases as well. Reported by: nwhitehorn Reviewed by: raj Approved by: raj, nwhitehorn
* Remove locking of the vm page queues from several pmaps, which onlykib2011-09-281-2/+0
| | | | | | | | | protected the dirty mask updates. The dirty mask updates are handled by atomics after the r225840. Submitted by: alc Tested by: flo (sparc64) MFC after: 2 weeks
* Inline the syscallenter() and syscallret(). This reduces the time measuredkib2011-09-111-0/+2
| | | | | | | | by the syscall entry speed microbenchmarks by ~10% on amd64. Submitted by: jhb Approved by: re (bz) MFC after: 2 weeks
* Split the vm_page flags PG_WRITEABLE and PG_REFERENCED into atomickib2011-09-061-15/+15
| | | | | | | | | | | | | | | | | flags field. Updates to the atomic flags are performed using the atomic ops on the containing word, do not require any vm lock to be held, and are non-blocking. The vm_page_aflag_set(9) and vm_page_aflag_clear(9) functions are provided to modify afalgs. Document the changes to flags field to only require the page lock. Introduce vm_page_reference(9) function to provide a stable KPI and KBI for filesystems like tmpfs and zfs which need to mark a page as referenced. Reviewed by: alc, attilio Tested by: marius, flo (sparc64); andreast (powerpc, powerpc64) Approved by: re (bz)
* - Move the PG_UNMANAGED flag from m->flags to m->oflags, renaming the flagkib2011-08-091-17/+15
| | | | | | | | | | | | | | to VPO_UNMANAGED (and also making the flag protected by the vm object lock, instead of vm page queue lock). - Mark the fake pages with both PG_FICTITIOUS (as it is now) and VPO_UNMANAGED. As a consequence, pmap code now can use use just VPO_UNMANAGED to decide whether the page is unmanaged. Reviewed by: alc Tested by: pho (x86, previous version), marius (sparc64), marcel (arm, ia64, powerpc), ray (mips) Sponsored by: The FreeBSD Foundation Approved by: re (bz)
* Cross a T and dot an I:marcel2011-08-021-2/+3
| | | | | | | | | | o Fix awkward use of braces in combination with mis-indentation. A mistake, that happened to yield the right behaviour? o Fix typo in comment. No functional change. Approved by: re (blanket)
* It's invalid to use GLOBAL() for kernload_ap, as the macro switchesmarcel2011-08-021-1/+2
| | | | | | to the .data section. We need kernload_ap in the boot page. Approved by: re (blanket)
* There's no ':' after GLOBAL(). Missed due to no SMP testing.marcel2011-08-021-1/+1
| | | | Approved by: re (blanket)
* Add support for Juniper's loader. The difference between FreeBSD's andmarcel2011-08-023-125/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | Juniper's loader is that Juniper's loader maps all of the kernel and preloaded modules at the right virtual address before jumping into the kernel. FreeBSD's loader simply maps 16MB using the physical address and expects the kernel to jump through hoops to relocate itself to it's virtual address. The problem with the FreeBSD loader's approach is that it typically maps too much or too little. There's no harm if it's too much (other than wasting space), but if it's too little then the kernel will simply not boot, because the first thing the kernel needs is the bootinfo structure, which is never mapped in that case. The page fault that early is fatal. The changes constitute: 1. Do not remap the kernel in locore.S. We're mapped where we need to be so we can pretty much call into C code after setting up the stack. 2. With kernload and kernload_ap not set in locore.S, we need to set them in pmap.c: kernload gets defined when we preserve the TLB1. Here we also determine the size of the kernel mapped. kernload_ap is set first thing in the pmap_bootstrap() method. 3. Fix tlb1_map_region() and its use to properly externd the mapped kernel size to include low-level data structures. Approved by: re (blanket) Obtained from: Juniper Networks, Inc
* Fix r224187: .word defines a 16-bit object and size_t is defined asmarcel2011-07-311-2/+2
| | | | | | a 32-bit intergal. Use .long to define sintrcnt and sintrname. Approved by: re (blanket)
* - Remove the eintrcnt/eintrnames usage and introduce the concept ofattilio2011-07-181-2/+5
| | | | | | | | | | | | | | | | sintrcnt/sintrnames which are symbols containing the size of the 2 tables. - For amd64/i386 remove the storage of intr* stuff from assembly files. This area can be widely improved by applying the same to other architectures and likely finding an unified approach among them and move the whole code to be MI. More work in this area is expected to happen fairly soon. No MFC is previewed for this patch. Tested by: pluknet Reviewed by: jhb Approved by: re (kib)
* With retirement of cpumask_t and usage of cpuset_t for representing aattilio2011-07-041-6/+6
| | | | | | | | | | | | | | | mask of CPUs, pc_other_cpus and pc_cpumask become highly inefficient. Remove them and replace their usage with custom pc_cpuid magic (as, atm, pc_cpumask can be easilly represented by (1 << pc_cpuid) and pc_other_cpus by (all_cpus & ~(1 << pc_cpuid))). This change is not targeted for MFC because of struct pcpu members removal and dependency by cpumask_t retirement. MD review by: marcel, marius, alc Tested by: pluknet MD testing by: marcel, marius, gonzo, andreast
* Use the ABI-mandated thread pointer register (r2 for ppc32, r13 for ppc64)nwhitehorn2011-06-233-12/+12
| | | | | | | | | | | | | | | instead of a PCPU field for curthread. This averts a race on SMP systems with a high interrupt rate where the thread looking up the value of curthread could be preempted and migrated between obtaining the PCPU pointer and reading the value of pc_curthread, resulting in curthread being observed to be the current thread on the thread's original CPU. This played merry havoc with the system, in particular with mutexes. Many thanks to jhb for helping me work this one out. Note that Book-E is in principle susceptible to the same problem, but has not been modified yet due to lack of Book-E hardware. MFC after: 2 weeks
* MFCattilio2011-05-311-2/+2
|
* MFCattilio2011-05-294-95/+102
|\
| * Better support different kernel hand-offs. When loaded directlymarcel2011-05-283-53/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from U-Boot, the kernel is passed a standard argc/argv pair. The Juniper loader passes the metadata pointer as the second argument and passes 0 in the first. The FreeBSD loader passes the metadata pointer in the first argument. As such, have locore preserve the first 2 arguments in registers r30 & r31. Change e500_init() to accept these arguments. Don't pass global offsets (i.e. kernel_text and _end) as arguments to e500_init(). We can reference those directly. Rename e500_init() to booke_init() now that we're changing the prototype. In booke_init(), "decode" arg1 and arg2 to obtain the metadata pointer correctly. For the U-Boot case, clear SBSS and BSS and bank on having a static FDT for now. This allows loading the ELF kernel and jumping to the entry point without trampoline.
| * o The P1020(E) & P2020(E) also have two cores. This conditional hasmarcel2011-05-271-18/+20
| | | | | | | | | | | | | | | | | | | | a tendency to grow unwieldy so we may want to revisit this in due time. o Simplify the CPU reset function by writing to the reset control register irrespective of whether the CPU has one and automatically falling back to the debug control register if we didn't reset the CPU. The side-effect is that we now properly reset future processors without first having to add the system version to the list.
| * Wire the kernel using TLB1 entry 0 rather than entry 1. A more recentmarcel2011-05-272-23/+10
| | | | | | | | | | | | U-Boot as found on the P1020RDB doesn't like it when we use entry 1 (for some reason) whereas an older U-Boot doesn't mind if we use entry 0. If anything else, this simplifies the code a bit.
* | MFCattilio2011-05-271-2/+5
|\ \ | |/
| * Don't assume we have a valid bootinfo pointer.marcel2011-05-261-2/+5
| |
| * Revert r222069,222068 as they were intended to be committed to theattilio2011-05-182-10/+6
| | | | | | | | | | | | largeSMP branch. Reported by: pluknet
| * Fix warning spit out.attilio2011-05-181-4/+7
| | | | | | | | Reported by: sbruno
| * Fix newly introduced code.attilio2011-05-181-2/+3
| | | | | | | | Reported by: sbruno
* | Fix usage of cpumask that cannot be used like that anymore.attilio2011-05-181-2/+2
| | | | | | | | Reported by: pluknet
* | MFCattilio2011-05-171-0/+1
|\ \ | |/
* | Add the powerpc support.attilio2011-05-091-4/+6
|/ | | | | | | Note that there is a dirty hack for calling openpic_write(), but nwhitehorn approved it. Discussed with: nwhitehorn
* Make MSGBUF_SIZE kernel option a loader tunable kern.msgbufsize.pluknet2011-01-212-3/+2
| | | | | | | Submitted by: perryh pluto.rain.com (previous version) Reviewed by: jhb Approved by: kib (mentor) Tested by: universe
* For architectures not using direct map , and requiring real KVA page forkib2011-01-181-1/+1
| | | | | | | | | | | | | | sf buf allocation, use wakeup() instead of wakeup_one() to notify sf buffer waiters about free buffer. sf_buf_alloc() calls msleep(PCATCH) when SFB_CATCH flag was given, and for simultaneous wakeup and signal delivery, msleep() returns EINTR/ERESTART despite the thread was selected for wakeup_one(). As result, we loose a wakeup, and some other waiter will not be woken up. Reported and tested by: az Reviewed by: alc, jhb MFC after: 1 week
* Support booting non FDT-capable loaders:marcel2011-01-172-3/+31
| | | | | | 1. Allow embedding the FDT into the kernel, just like PowerPC/book-E. 2. If the loader passes us a pointer to the bootinfo structure, save it and use it to fill in the gaps (e.g. bus frequencies, etc).
* After some off-list discussion, revert a number of changes to thedim2010-11-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | DPCPU_DEFINE and VNET_DEFINE macros, as these cause problems for various people working on the affected files. A better long-term solution is still being considered. This reversal may give some modules empty set_pcpu or set_vnet sections, but these are harmless. Changes reverted: ------------------------------------------------------------------------ r215318 | dim | 2010-11-14 21:40:55 +0100 (Sun, 14 Nov 2010) | 4 lines Instead of unconditionally emitting .globl's for the __start_set_xxx and __stop_set_xxx symbols, only emit them when the set_vnet or set_pcpu sections are actually defined. ------------------------------------------------------------------------ r215317 | dim | 2010-11-14 21:38:11 +0100 (Sun, 14 Nov 2010) | 3 lines Apply the STATIC_VNET_DEFINE and STATIC_DPCPU_DEFINE macros throughout the tree. ------------------------------------------------------------------------ r215316 | dim | 2010-11-14 21:23:02 +0100 (Sun, 14 Nov 2010) | 2 lines Add macros to define static instances of VNET_DEFINE and DPCPU_DEFINE.
* Apply the STATIC_VNET_DEFINE and STATIC_DPCPU_DEFINE macros throughoutdim2010-11-141-1/+1
| | | | the tree.
* Add some platform KOBJ extensions and continue integrating PowerPCnwhitehorn2010-11-121-9/+0
| | | | | | | | | | hypervisor infrastructure support: - Fix coexistence of multiple platform modules in the same kernel - Allow platform modules to provide an SMP topology - PowerPC hypervisors limit the amount of memory accessible in real mode. Allow the platform modules to specify the maximum real-mode address, and modify the bits of the kernel that need to allocate real-mode-accessible buffers to respect this limits.
* Centralize CPU idle routines into powerpc/cpu.c and use the samenwhitehorn2010-11-121-44/+0
| | | | | cpu_idle_hook mechanism that x86 uses for overriding the idle routine. This is required for supporting ilding the CPU under PowerPC hypervisors.
* Fix typo in the comment.raj2010-11-111-1/+1
|
* Use local TLB_UNLOCKED marker instead of MTX_UNOWNED for Book-E PowerPC trapraj2010-11-113-7/+6
| | | | | | | | | | routines. This unbreaks Book-E build after the recent machine/mutex.h removal. While there move tlb_*lock() prototypes to machine/tlb.h. Submitted by: jhb
* Remove unused includes of <sys/mutex.h> and <machine/mutex.h>.jhb2010-11-091-2/+0
|
* Adjust the order of operations in spinlock_enter() and spinlock_exit() tojhb2010-11-051-4/+10
| | | | | | | | | | | | | | | | | | work properly with single-stepping in a kernel debugger. Specifically, these routines have always disabled interrupts before increasing the nesting count and restored the prior state of interrupts after decreasing the nesting count to avoid problems with a nested interrupt not disabling interrupts when acquiring a spin lock. However, trap interrupts for single-stepping can still occur even when interrupts are disabled. Now the saved state of interrupts is not saved in the thread until after interrupts have been disabled and the nesting count has been increased. Similarly, the saved state from the thread cannot be read once the nesting count has been decreased to zero. To fix this, use temporary variables to store interrupt state and shuffle it between the thread's MD area and the appropriate registers. In cooperation with: bde MFC after: 1 month
* Introduce inheritance into the PowerPC MMU kobj interface.grehan2010-09-151-6/+1
| | | | | | | | | | | | | | | | | include/mmuvar.h - Change the MMU_DEF macro to also create the class definition as well as define the DATA_SET. Add a macro, MMU_DEF_INHERIT, which has an extra parameter specifying the MMU class to inherit methods from. Update the comments at the start of the header file to describe the new macros. booke/pmap.c aim/mmu_oea.c aim/mmu_oea64.c - Collapse mmu_def_t declaration into updated MMU_DEF macro The MMU_DEF_INHERIT macro will be used in the PS3 MMU implementation to allow it to inherit the stock powerpc64 MMU methods. Reviewed by: nwhitehorn
* Refactor timer management code with priority to one-shot operation mode.mav2010-09-131-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main goal of this is to generate timer interrupts only when there is some work to do. When CPU is busy interrupts are generating at full rate of hz + stathz to fullfill scheduler and timekeeping requirements. But when CPU is idle, only minimum set of interrupts (down to 8 interrupts per second per CPU now), needed to handle scheduled callouts is executed. This allows significantly increase idle CPU sleep time, increasing effect of static power-saving technologies. Also it should reduce host CPU load on virtualized systems, when guest system is idle. There is set of tunables, also available as writable sysctls, allowing to control wanted event timer subsystem behavior: kern.eventtimer.timer - allows to choose event timer hardware to use. On x86 there is up to 4 different kinds of timers. Depending on whether chosen timer is per-CPU, behavior of other options slightly differs. kern.eventtimer.periodic - allows to choose periodic and one-shot operation mode. In periodic mode, current timer hardware taken as the only source of time for time events. This mode is quite alike to previous kernel behavior. One-shot mode instead uses currently selected time counter hardware to schedule all needed events one by one and program timer to generate interrupt exactly in specified time. Default value depends of chosen timer capabilities, but one-shot mode is preferred, until other is forced by user or hardware. kern.eventtimer.singlemul - in periodic mode specifies how much times higher timer frequency should be, to not strictly alias hardclock() and statclock() events. Default values are 2 and 4, but could be reduced to 1 if extra interrupts are unwanted. kern.eventtimer.idletick - makes each CPU to receive every timer interrupt independently of whether they busy or not. By default this options is disabled. If chosen timer is per-CPU and runs in periodic mode, this option has no effect - all interrupts are generating. As soon as this patch modifies cpu_idle() on some platforms, I have also refactored one on x86. Now it makes use of MONITOR/MWAIT instrunctions (if supported) under high sleep/wakeup rate, as fast alternative to other methods. It allows SMP scheduler to wake up sleeping CPUs much faster without using IPI, significantly increasing performance on some highly task-switching loads. Tested by: many (on i386, amd64, sparc64 and powerc) H/W donated by: Gheorghe Ardelean Sponsored by: iXsystems, Inc.
* Update PowerPC event timer code to use new event timers infrastructure.mav2010-09-113-53/+126
| | | | | | Reviewed by: nwitehorn Tested by: andreast H/W donated by: Gheorghe Ardelean
* Restructure how reset and poweroff are handled on PowerPC systems, sincenwhitehorn2010-08-311-0/+31
| | | | | | | | | | | | | | | | | the existing code was very platform specific, and broken for SMP systems trying to reboot from KDB. - Add a new PLATFORM_RESET() method to the platform KOBJ interface, and migrate existing reset functions into platform modules. - Modify the OF_reboot() routine to submit the request by hand to avoid the IPIs involved in the regular openfirmware() routine. This fixes reboot from KDB on SMP machines. - Move non-KDB reset and poweroff functions on the Powermac platform into the relevant power control drivers (cuda, pmu, smu), instead of using them through the Open Firmware backdoor. - Rename platform_chrp to platform_powermac since it has become increasingly Powermac specific. When we gain support for IBM systems, we will grow a new platform_chrp.
OpenPOWER on IntegriCloud