summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/booke
Commit message (Collapse)AuthorAgeFilesLines
* MFC r275616:kib2014-12-151-0/+1
| | | | | | | | | | | | | | | Thread waiting for the vfork(2)-ed child to exec or exit, must allow for the suspension. MFC r275683 (by andreast): Fix build for powerpc(32|64) kernels. MFC r275686 (by andreast): Fix kernel build for booke. r275639 (by andrew) is not merged, since arm/arm/syscall.c is not present on the stable/10 branch, and arm/arm/trap.c already includes sys/kernel.h.
* Fix a leak of the wired pages when unwiring of the PROT_NONE-mappedkib2014-09-011-15/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wired region. Rework the handling of unwire to do the it in batch, both at pmap and object level. All commits below are by alc. MFC r268327: Introduce pmap_unwire(). MFC r268591: Implement pmap_unwire() for powerpc. MFC r268776: Implement pmap_unwire() for arm. MFC r268806: pmap_unwire(9) man page. MFC r269134: When unwiring a region of an address space, do not assume that the underlying physical pages are mapped by the pmap. This fixes a leak of the wired pages on the unwiring of the region mapped with no access allowed. MFC r269339: In the implementation of the new function pmap_unwire(), the call to MOEA64_PVO_TO_PTE() must be performed before any changes are made to the PVO. Otherwise, MOEA64_PVO_TO_PTE() will panic. MFC r269365: Correct a long-standing problem in moea{,64}_pvo_enter() that was revealed by the combination of r268591 and r269134: When we attempt to add the wired attribute to an existing mapping, moea{,64}_pvo_enter() do nothing. (They only set the wired attribute on newly created mappings.) MFC r269433: Handle wiring failures in vm_map_wire() with the new functions pmap_unwire() and vm_object_unwire(). Retire vm_fault_{un,}wire(), since they are no longer used. MFC r269438: Rewrite a loop in vm_map_wire() so that gcc doesn't think that the variable "rv" is uninitialized. MFC r269485: Retire pmap_change_wiring(). Reviewed by: alc
* Merge the changes to pmap_enter(9) for sleep-less operation (requestedkib2014-08-241-28/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | by flag). The ia64 pmap.c changes are direct commit, since ia64 is removed on head. MFC r269368 (by alc): Retire PVO_EXECUTABLE. MFC r269728: Change pmap_enter(9) interface to take flags parameter and superpage mapping size (currently unused). MFC r269759 (by alc): Update the text of a KASSERT() to reflect the changes in r269728. MFC r269822 (by alc): Change {_,}pmap_allocpte() so that they look for the flag PMAP_ENTER_NOSLEEP instead of M_NOWAIT/M_WAITOK when deciding whether to sleep on page table page allocation. MFC r270151 (by alc): Replace KASSERT that no PV list locks are held with a conditional unlock. Reviewed by: alc Approved by: re (gjb) Sponsored by: The FreeBSD Foundation
* MFC r258800, r258802, r258805, r258806, r258807, r258851, r258857,ian2014-05-141-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r259199, r259484, r259513, r259514, r259516 The kernel stack guard pages are only below the stack pointer, not above. Remove unnecessary double-setting of the thread's onfault state in copyinstr(). Open Firmware mandates that certain cross-references, in particular those in /chosen, be ihandles. The ePAPR spec makes those cross-reference phandles, since FDT has no concept of ihandles. Have the OF FDT CI module interpret queries about ihandles as cross-reference phandles. Real OF systems have an ihandle under /chosen/stdout, not a phandle. Use the right type. Rearchitect platform memory map parsing to make it less Open Firmware-centric. Remove fdtbus_bs_tag definition, which is now obsolete. The remainder of this file is also slated for future demolition. Return the correct IEEE 1275 code for "nextprop". Use the common Open Firmware PCI interrupt routing code instead of the duplicate version in dev/fdt. Configure interrupt sense based on device tree information. Simplify the ofw_bus_lookup_imap() API slightly: make it allocate maskbuf internally instead of requiring the caller to allocate it.
* MFC r258268, r258271, r258272, r258274, r258275, r258427, r258694, r258696,ian2014-05-141-60/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | r258697, r258757 Do not assume a value for #address-cells when parsing the OF translations map. This allows the kernel to get farther with OpenBIOS on 64-bit CPUs. Actually look up #address-cells instead of assuming it is correlated with the Uninorth version number. #interrupt-cells belongs to the iparent, not the device parent. Add a sysctl to allow disabling resetting the OF syscons. For PCI<->PCI bridges, #address-cells may be 3. Make RTAS calls, which call setfault() to recover from machine checks, preserve any existing fault buffer. badaddr() is used only in the grackle PCI driver, so move its definition there. Clean up a spurious setfault() declaration as well. This [phyp_console] driver doesn't need the /options node, so don't check for it. Use the Open Firmware-based CPU frequency determination as a generic fallback if we can't measure CPU frequency. This is also useful on a variety of embedded systems using FDT.
* MFC r258259, r258798, r259010ian2014-05-141-16/+1
| | | | | | | | | Unify handling of illegal instruction faults between AIM and Book-E. Make uart_cpu_powerpc work on both FDT and OFW systems. Fix debug printfs in FPU_EMU to compile on powerpc64 and enable it for powerpc64.
* MFC r258247, r258250, r258257ian2014-05-141-0/+5
| | | | | | | | | | | Remove a pointless #ifdef AIM. This is just PPC64 specific, including 64-bit Book-E. Make single precision floating point arithmetic actually work Split the function of the PCB_FPU flags into two: PCB_FPU now indicates that the actual FPU is enabled, while PCB_FPREGS indicates that the FPU state structure in the PCB is valid.
* MFC r257995, r258244, r258246,ian2014-05-142-222/+9
| | | | | | | | | Rename the "bare" platform "mpc85xx" Also turn "bare" into a truly bare platform Move CCSR discovery into the platform module There is no reason Book-E needs to save XER and CTR on context switches.
* MFC r258002, r258024, r258027, r258051, r258052, r258243, r258244, r258002,ian2014-05-147-484/+21
| | | | | | | | | | | | | | | | | r258024, r258027, r258051, r258052, r258243, Follow up r223485, which made AIM use the ABI thread pointer instead of PCPU fields for curthread, by doing the same to Book-E. Use the same implementation of copyinout.c for both AIM and Book-E. Actually add IOMMU domain to the list of known mappings. Following the approach with ACPI DMAR on x86, split IOMMU handling into a variant PCI bus instead of trying to shoehorn it into the PCI host bridge adapter. Make sure that TLB1 mappings are aligned correctly.
* MFC r257702, r257745, r257746, r257747, r257751, r257791, r257793,ian2014-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r257794, r257795, r257992 Teach nexus(4) about Open Firmware (e.g. FDT) on ARM and MIPS, retiring fdtbus in most cases. Make OF_nextprop() work correctly for FDT by using the libfdt fdt_next_property_offset() API. Do not panic if pmap_mincore() is called. An addendum: it is possible, though of questionable utility, for a node to have no properties at all. Add definition for the Atheros 8021 gigabit PHY. Consolidate Apple firmware hacks and improve them by switching on the presence of mac-io devices in the tree, which uniquely identifies Apple hardware. Allow OF_decode_addr() to also be able to map resources on big-endian devices. Make tsec work with the device tree present on the RB800. Be more flexible about which compatible strings to accept. This brings up the PCI Express bus on the RB800 using the firmware device tree. Rename the "bare" platform "mpc85xx", which is what it actually is, and add actual platform probing based on PVR.
* MFC r257180, r257195, r257196, r257198, r257209, r257295ian2014-05-141-6/+18
| | | | | | | | | | | | Add some extra sanity checking and checks to printf format specifiers. Try even harder to find a console before giving up. Make devices with registers into the KVA region work reliably. Turn on VM_KMEM_SIZE_SCALE on 32-bit as well as 64-bit PowerPC. Return NOKEY instead of 0 if there are no more key presses queued.
* MFC r257161, r257169, r257178, r257190, r257191ian2014-05-144-47/+196
| | | | | | | | | | | | | | | | | | | | | | | | | Add pmap_mapdev_attr() and pmap_kenter_attr() interfaces. Fix concurrency issues with TLB1 updates and make pmap_kextract() search TLB1 mappings as well Interrelated improvements to early boot mappings: - Remove explicit requirement that the SOC registers be found except as an optimization (although the MPC85XX LAW drivers still require they be found externally, which should change). - Remove magic CCSRBAR_VA value. - Allow bus_machdep.c's early-boot code to handle non 1:1 mappings and systems not in real-mode or global 1:1 maps in early boot. - Allow pmap_mapdev() on Book-E to reissue previous addresses if the area is already mapped. Additionally have it check all mappings, not just the CCSR area. Add some extra sanity checking and checks to printf format specifiers. Bump initial TLB size. The kernel is not necessarily less than 16 MB Handle (in a slightly ugly way) ePAPR-type loaders that just place a device tree into r3.
* MFC r256973, r256974ian2014-05-131-0/+19
| | | | | | If the device tree directly contains the timebase frequency, use it. This property is required by ePAPR, but maintain the fallback to bus-frequency for compatibility. Allow 32 or 64 bits.
* MFC r256814, r256816, r256818, r256846, r256855, r256864 (by nwhitehorn):ian2014-05-132-4/+7
| | | | | | | | | | - Handle 2GB of ram - Allow the OFW interrupt mapping code to work with PCI devices not enumerated by Open Firmware, as in the case of FDT. - Provide an interface for PCI bus drivers that need some of ofw_pci's metadata during attach. - Use standard ofw_bus helpers instead of reinventing the wheel. - Make hard-wired TLB allocations be at minimum one page.
* MFC r256792, r256793, r256799 (by nwhitehorn): Unify AIM and booke code.ian2014-05-132-688/+0
|
* - Create kern.ipc.sendfile namespace, and put the new "readhead" OIDglebius2013-09-221-0/+11
| | | | | | | | | there as "kern.ipc.sendfile.readahead". - Push all nsfbuf related tunables into MD code. Don't move them to new namespace in favor of POLA. Reviewed by: scottl Approved by: re (gjb)
* The pmap function pmap_clear_reference() is no longer used. Remove it.alc2013-09-201-34/+0
| | | | | | | | | pmap_clear_reference() has had exactly one caller in the kernel for several years, more precisely, since FreeBSD 8. Now, that call no longer exists. Approved by: re (kib) Sponsored by: EMC / Isilon Storage Division
* Revert r254501. Instead, reuse the type stability of the struct pmapkib2013-08-221-3/+1
| | | | | | | | | | | which is the part of struct vmspace, allocated from UMA_ZONE_NOFREE zone. Initialize the pmap lock in the vmspace zone init function, and remove pmap lock initialization and destruction from pmap_pinit() and pmap_release(). Suggested and reviewed by: alc (previous version) Tested by: pho Sponsored by: The FreeBSD Foundation
* The soft and hard busy mechanism rely on the vm object lock to work.attilio2013-08-091-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unify the 2 concept into a real, minimal, sxlock where the shared acquisition represent the soft busy and the exclusive acquisition represent the hard busy. The old VPO_WANTED mechanism becames the hard-path for this new lock and it becomes per-page rather than per-object. The vm_object lock becames an interlock for this functionality: it can be held in both read or write mode. However, if the vm_object lock is held in read mode while acquiring or releasing the busy state, the thread owner cannot make any assumption on the busy state unless it is also busying it. Also: - Add a new flag to directly shared busy pages while vm_page_alloc and vm_page_grab are being executed. This will be very helpful once these functions happen under a read object lock. - Move the swapping sleep into its own per-object flag The KPI is heavilly changed this is why the version is bumped. It is very likely that some VM ports users will need to change their own code. Sponsored by: EMC / Isilon storage division Discussed with: alc Reviewed by: jeff, kib Tested by: gavin, bapt (older version) Tested by: pho, scottl
* Replace kernel virtual address space allocation with vmem. This providesjeff2013-08-072-2/+2
| | | | | | | | | | | | | transparent layering and better fragmentation. - Normalize functions that allocate memory to use kmem_* - Those that allocate address space are named kva_* - Those that operate on maps are named kmap_* - Implement recursive allocation handling for kmem_arena in vmem. Reviewed by: alc Tested by: pho Sponsored by: EMC / Isilon Storage Division
* Introduce new structure sfstat for collecting sendfile's statisticsae2013-07-151-1/+1
| | | | | | | and remove corresponding fields from struct mbstat. Use PCPU counters and SFSTAT_INC() macro for update these statistics. Discussed with: glebius
* o Relax locking assertions for vm_page_find_least()attilio2013-05-211-0/+2
| | | | | | | | | | | | o Relax locking assertions for pmap_enter_object() and add them also to architectures that currently don't have any o Introduce VM_OBJECT_LOCK_DOWNGRADE() which is basically a downgrade operation on the per-object rwlock o Use all the mechanisms above to make vm_map_pmap_enter() to work mostl of the times only with readlocks. Sponsored by: EMC / Isilon storage division Reviewed by: alc
* Relax the object locking assertion in pmap_enter_locked().alc2013-05-171-1/+1
| | | | | Reviewed by: attilio Sponsored by: EMC / Isilon Storage Division
* Add pmap function pmap_copy_pages(), which copies the content of thekib2013-03-141-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | pages around, taking array of vm_page_t both for source and destination. Starting offsets and total transfer size are specified. The function implements optimal algorithm for copying using the platform-specific optimizations. For instance, on the architectures were the direct map is available, no transient mappings are created, for i386 the per-cpu ephemeral page frame is used. The code was typically borrowed from the pmap_copy_page() for the same architecture. Only i386/amd64, powerpc aim and arm/arm-v6 implementations were tested at the time of commit. High-level code, not committed yet to the tree, ensures that the use of the function is only allowed after explicit enablement. For sparc64, the existing code has known issues and a stab is added instead, to allow the kernel linking. Sponsored by: The FreeBSD Foundation Tested by: pho (i386, amd64), scottl (amd64), ian (arm and arm-v6) MFC after: 2 weeks
* MFCattilio2013-03-021-19/+10
|\
| * MFcalloutng:mav2013-02-281-19/+10
| | | | | | | | | | | | | | Switch eventtimers(9) from using struct bintime to sbintime_t. Even before this not a single driver really supported full dynamic range of struct bintime even in theory, not speaking about practical inexpediency. This change legitimates the status quo and cleans up the code.
| * Merge from vmobj-rwlock:attilio2013-02-271-3/+2
| | | | | | | | | | | | | | | | | | | | | | VM_OBJECT_LOCKED() macro is only used to implement a custom version of lock assertions right now (which likely spread out thanks to copy and paste). Remove it and implement actual assertions. Sponsored by: EMC / Isilon storage division Reviewed by: alc Tested by: pho
| * Merge from vmc-playground branch:attilio2013-02-261-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace the sub-optimal uma_zone_set_obj() primitive with more modern uma_zone_reserve_kva(). The new primitive reserves before hand the necessary KVA space to cater the zone allocations and allocates pages with ALLOC_NOOBJ. More specifically: - uma_zone_reserve_kva() does not need an object to cater the backend allocator. - uma_zone_reserve_kva() can cater M_WAITOK requests, in order to serve zones which need to do uma_prealloc() too. - When possible, uma_zone_reserve_kva() uses directly the direct-mapping by uma_small_alloc() rather than relying on the KVA / offset combination. The removal of the object attribute allows 2 further changes: 1) _vm_object_allocate() becomes static within vm_object.c 2) VM_OBJECT_LOCK_INIT() is removed. This function is replaced by direct calls to mtx_init() as there is no need to export it anymore and the calls aren't either homogeneous anymore: there are now small differences between arguments passed to mtx_init(). Sponsored by: EMC / Isilon storage division Reviewed by: alc (which also offered almost all the comments) Tested by: pho, jhb, davide
* | MFCattilio2013-02-261-2/+1
| |
* | Hide the details for the assertion for VM_OBJECT_LOCK operations.attilio2013-02-211-5/+5
| | | | | | | | | | | | | | | | Rename current VM_OBJECT_LOCK_ASSERT(foo, RA_WLOCKED) into VM_OBJECT_ASSERT_WLOCKED(foo) Sponsored by: EMC / Isilon storage division Requested by: alc
* | Fix other architectures and ZFS.attilio2013-02-211-0/+1
| | | | | | | | Sponsored by: EMC / Isilon storage division
* | There is no need to use VM_OBJECT_LOCKED() as the assertion won'tattilio2013-02-201-3/+2
| | | | | | | | | | make the check available in any case if INVARIANTS is switched off. Remove VM_OBJECT_LOCKED().
* | Switch vm_object lock to be a rwlock.attilio2013-02-201-4/+4
|/ | | | | | | | * VM_OBJECT_LOCK and VM_OBJECT_UNLOCK are mapped to write operations * VM_OBJECT_SLEEP() is introduced as a general purpose primitve to get a sleep operation using a VM_OBJECT_LOCK() as protection * The approach must bear with vm_pager.h namespace pollution so many files require including directly rwlock.h
* Introduce PLATFORMMETHOD_END and use it.rpaulo2013-02-131-1/+1
|
* Replace all uses of the page queues lock by a R/W lock that is privatealc2012-11-031-34/+40
| | | | | | | | to this pmap. Eliminate two redundant #include's. Tested by: marcel
* 1. Have the APs initialize the TLB1 entries from what has beenmarcel2012-11-034-58/+89
| | | | | | | | | | | | | | programmed on the BSP during (early) boot. This makes sure that the APs get configured the same as the BSP, irrspective of how FreeBSD was loaded. 2. Make sure to flush the dcache after writing the TLB1 entries to the boot page. The APs aren't part of the coherency domain just yet. 3. Set pmap_bootstrapped after calling pmap_bootstrap(). The FDT code now maps the devices (like OF), and this resulted in a panic. 4. Since we pre-wire the CCSR, make sure not to map chunks of it in pmap_mapdev().
* userret() already checks for td_locks when INVARIANTS is enabled, soattilio2012-09-081-1/+0
| | | | | | | there is no need to check if Giant is acquired after it. Reviewed by: kib MFC after: 1 week
* Avoid recursion on the pvh global lock in the aim oea pmap.alc2012-07-101-1/+1
| | | | | | | Correct the return type of the pmap_ts_referenced() implementations. Reported by: jhibbits [1] Tested by: andreast
* Fix a typo that resulted in or-ing PTE_UW twice whrn PTE_SW was needed.marcel2012-07-021-1/+1
| | | | | | Note that setting the PTE_MODIFIED bit based on whether write is possible is incorrect. We should set PTE_MODIFIED based on whether the access is a write operation.
* Handle traps from the debugger. We need to catch them and re-entermarcel2012-07-021-0/+7
| | | | the debugger where they're being taken care of.
* Invalidate any TLB1 entries we don't need. The firmware (e.g. U-Boot)marcel2012-07-021-0/+4
| | | | may have added entries that conflict with TLB0 entries.
* Implement cpu_flush_dcache(). This allows us to optimize __syncicache()marcel2012-07-021-1/+18
| | | | for the common case in chich D-caches are coherent by virtue of busdma.
* 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.
OpenPOWER on IntegriCloud