summaryrefslogtreecommitdiffstats
path: root/sys/mips/mips
Commit message (Collapse)AuthorAgeFilesLines
* MFC r293613:dchagin2016-01-162-0/+3
| | | | | Implement vsyscall hack. Prior to 2.13 glibc uses vsyscall instead of vdso. An upcoming linux_base-c6 needs it.
* MFC r283479:dchagin2016-01-092-12/+0
| | | | | | | | | The kernel sends signals to the processes via ABI specific sv_sendsig method. Native ABI do not need signal conversion, only emulators may want this. Usually emulators implements its own sv_sendsig method. For now only ibcs2 emulator does not have own sv_sendsig implementation and depends on native sendsig() method. So, remove any extra attempts to convert signal numbers from native sendsig() methods except from i386 where ibsc2 is living.
* MFC r283382:dchagin2016-01-092-0/+3
| | | | | In preparation for switching linuxulator to the use the native 1:1 threads add a hook for cleaning thread resources before the thread die.
* MFC r288000:kib2015-09-271-16/+17
| | | | Add support for weak symbols to the kernel linkers.
* MFC r280957rstone2015-09-171-2/+2
| | | | | | | | | | | Fix integer truncation bug in malloc(9) A couple of internal functions used by malloc(9) and uma truncated a size_t down to an int. This could cause any number of issues (e.g. indefinite sleeps, memory corruption) if any kernel subsystem tried to allocate 2GB or more through malloc. zfs would attempt such an allocation when run on a system with 2TB or more of RAM.
* MFC r282120:hselasky2015-05-051-2/+2
| | | | | | | | | | | | The add_bounce_page() function can be called when loading physical pages which pass a NULL virtual address. If the BUS_DMA_KEEP_PG_OFFSET flag is set, use the physical address to compute the page offset instead. The physical address should always be valid when adding bounce pages and should contain the same page offset like the virtual address. Submitted by: Svatopluk Kraus <onwahe@gmail.com> Reviewed by: jhb@
* MFC r277643:kib2015-02-141-2/+0
| | | | | | | Remove Giant from /dev/mem and /dev/kmem. MFC r277743: Arm: ensure that _tmppt KVA is used exclusively.
* MFC r278001:kib2015-02-072-3/+3
| | | | Do not qualify the mcontext_t *mcp argument for set_mcontext(9) as const.
* MFC r263710, r273377, r273378, r273423 and r273455:hselasky2014-10-271-2/+2
| | | | | | | - De-vnet hash sizes and hash masks. - Fix multiple issues related to arguments passed to SYSCTL macros. Sponsored by: Mellanox Technologies
* Fix a leak of the wired pages when unwiring of the PROT_NONE-mappedkib2014-09-011-21/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-26/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 r266826, r266827markj2014-08-091-22/+0
| | | | | Move some duplicated hook definitions from machine-dependent files to kern_dtrace.c.
* MFC 263036, 263059: delete advertising clause in licenses, renumber.ian2014-05-171-1/+1
|
* MFC r261423, r261424, r261516, r261513, r261562, r261563, r261564, r261565,ian2014-05-151-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | r261596, r261606 Add the imx sdhci controller. Move Open Firmware device root on PowerPC, ARM, and MIPS systems to a sub-node of nexus (ofwbus) rather than direct attach under nexus. This fixes FDT on x86 and will make coexistence with ACPI on ARM systems easier. SPARC is unchanged. Add the missing ')' at end of sentence. Reword it to use a more common idiom. Pass the kernel physical address to initarm through the boot param struct. Make functions only used in vfp.c static, and remove vfp_enable. Fix __syscall on armeb EABI. As it returns a 64-bit value it needs to place 32-bit data in r1, not r0. 64-bit data is already packed correctly. Use abp_physaddr for the physical address over KERNPHYSADDR. This helps us remove the need to load the kernel at a fixed address. Remove references to PHYSADDR where it's used only in debugging output. Dynamically generate the page table. This will allow us to detect the physical address we are loaded at to change the mapping.
* MFC r257702, r257745, r257746, r257747, r257751, r257791, r257793,ian2014-05-141-114/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 r257334, r257336, r257337, r257338, r257341, r257342, r257343, r257370,ian2014-05-141-1/+1
| | | | | | | r257368, r257416 Hints-only devices should return BUS_PROBE_NOWILDCARD from their probe methods.
* Merge r264984scottl2014-05-071-1/+0
| | | | | | | | | Retire smp_active. It was racey and caused demonstrated problems with the cpufreq code. Replace its use with smp_started. There's at least one userland tool that still looks at the kern.smp.active sysctl, so preserve it but point it to smp_started as well. Obtained from: Netflix, Inc.
* MFC r263289: Update NetBSD Foundation copyrights to 2-clause BSDemaste2014-03-243-21/+0
| | | | | | | | | | | The NetBSD Foundation states "Third parties are encouraged to change the license on any files which have a 4-clause license contributed to the NetBSD Foundation to a 2-clause license." This change removes clauses 3 and 4 from copyright / license blocks that list The NetBSD Foundation as the only copyright holder. Sponsored by: The FreeBSD Foundation
* MFR r261294:brooks2014-03-031-1/+1
| | | | | | Remove an unneeded space in the BERI merge. Sponsored by: DARPA, AFRL
* MFC r257417: Remove references to an unused fasttrap probe hookavg2014-02-171-3/+2
|
* MFC r256939brooks2014-01-291-0/+1
| | | | | | | | | | | | | | | MFP4: Change 221767 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/02/05 14:18:53 When printing out information on a TLB MOD exception for a user process (e.g., an attempt to write to a read-only page), report it as a "write" in the console message, rather than "unknown". Change 221768 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/02/05 14:28:00 Fix post-compile but pre-commit typo in last changeset. Sponsored by: DARPA/AFRL
* MFC r256937:brooks2014-01-292-31/+29
| | | | | | | | | | | | | | MFP4: Change 231031 by brooks@brooks_zenith on 2013/07/11 16:22:08 Turn the unused and uncompilable MIPS_DISABLE_L1_CACHE define in cache.c into an option and when set force I- and D-cache line sizes to 0 (the latter part might be better as a tunable). Fix some casts in an #if 0'd bit of code which attempts to disable L1 cache ops when the cache is coherent. Sponsored by: DARPA/AFRL
* MFC r257228:kib2013-12-171-0/+10
| | | | | Add bus_dmamap_load_ma() function to load map with the array of vm_pages.
* MFC r256935brooks2013-11-011-7/+19
| | | | | | | | | | | MFP4: Change 228019 by bz@bz_zenith on 2013/04/23 13:55:30 Add kernel side support for large TLB on BERI/CHERI. Modelled similar to NLM Sponsored by: DAPRA/AFRL Approved by: re (delphij)
* Add read/write bus barriers for MIPS.adrian2013-10-091-0/+4
| | | | | | | | Tested: * AR9344 - mips74k SoC Approved by: re@ (delphij)
* Shuffle the includes around so they occur after opt_global.h is included;adrian2013-10-091-4/+5
| | | | | | | this way the CPU ABI / core #define items are there. Reviewed by: imp@ Approved by: re@ (gjb)
* Add pagemask debugging output in "show tlb" in the debugger.adrian2013-09-291-2/+5
| | | | | Approved by: re (marius) Obtained from: bsdimp
* - Create kern.ipc.sendfile namespace, and put the new "readhead" OIDglebius2013-09-221-5/+17
| | | | | | | | | 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-18/+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
* Use a better version of memcpy/bcopy for mips kernel.jchandra2013-09-072-92/+286
| | | | | | | | Use a variant of mips libc memcpy for kernel. This implementation uses 64-bit operations when compiled for 64-bit, and is significantly faster in that case. Submitted by: Tanmay Jagdale <tanmayj@broadcom.com>
* On those machines, where sf_bufs do not represent any real object, makeglebius2013-09-061-7/+3
| | | | | | | | | sf_buf_alloc()/sf_buf_free() inlines, to save two calls to an absolutely empty functions. Reviewed by: alc, kib, scottl Sponsored by: Nginx, Inc. Sponsored by: Netflix
* pmap_protect() on MIPS does not need to acquire the pvh global lock.alc2013-09-011-2/+0
|
* Implement pmap_advise().alc2013-08-311-1/+82
|
* Significantly reduce the cost, i.e., run time, of calls to madvise(...,alc2013-08-291-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | MADV_DONTNEED) and madvise(..., MADV_FREE). Specifically, introduce a new pmap function, pmap_advise(), that operates on a range of virtual addresses within the specified pmap, allowing for a more efficient implementation of MADV_DONTNEED and MADV_FREE. Previously, the implementation of MADV_DONTNEED and MADV_FREE relied on per-page pmap operations, such as pmap_clear_reference(). Intuitively, the problem with this implementation is that the pmap-level locks are acquired and released and the page table traversed repeatedly, once for each resident page in the range that was specified to madvise(2). A more subtle flaw with the previous implementation is that pmap_clear_reference() would clear the reference bit on all mappings to the specified page, not just the mapping in the range specified to madvise(2). Since our malloc(3) makes heavy use of madvise(2), this change can have a measureable impact. For example, the system time for completing a parallel "buildworld" on a 6-core amd64 machine was reduced by about 1.5% to 2.0%. Note: This change only contains pmap_advise() implementations for a subset of our supported architectures. I will commit implementations for the remaining architectures after further testing. For now, a stub function is sufficient because of the advisory nature of pmap_advise(). Discussed with: jeff, jhb, kib Tested by: pho (i386), marcel (ia64) Sponsored by: EMC / Isilon Storage Division
* Revert r254501. Instead, reuse the type stability of the struct pmapkib2013-08-221-3/+0
| | | | | | | | | | | 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-073-19/+5
| | | | | | | | | | | | | 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
* Include sys/systm.h after sys/param.h.ae2013-07-151-1/+1
| | | | Suggested by: pluknet
* 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
* Make support for atomics on ARM complete.ed2013-06-151-9/+9
| | | | | | | | | Provide both __sync_*-style and __atomic_*-style functions that perform the atomic operations on ARMv5 by using Restartable Atomic Sequences. While there, clean up some pieces of code where it's sufficient to use regular uint32_t to store register contents and don't need full reg_t's. Also sync this back to the MIPS code.
* - Add a BIT_FFS() macro and use it to replace cpusetffs_obj()jeff2013-06-131-2/+2
| | | | | Discussed with: attilio Sponsored by: EMC / Isilon Storage Division
* Bring the stdatomic for MIPS code slightly more in sync with the ARM version.ed2013-06-131-13/+18
|
* Merge the 1 and 2 byte versions of the atomic functions into one.ed2013-06-081-207/+108
| | | | | | | | After pushing in my fix for the 2 byte functions, I realized that the functions for 1 and 2 byte operations had become identical. Reduce the code size by merging the functions for 1 and 2 byte operations together. While there, slightly improve variable naming and comments.
* Actually make the 2-byte atomics work.ed2013-06-081-33/+87
| | | | | | | | | Even though I tested the 1-byte operations on arbitrarily aligned bytes, it seems I did not do this for the 2-byte operations. Create easy to read functions that are used to get/put bytes and halfwords in words. To keep the compiler happy, explicitly read two bytes into a union to obtain a 16-bit value.
* Add proper __sync_*() intrinsics for MIPS.ed2013-06-081-0/+436
| | | | | | | | | | | | | | | | | | | | To make <stdatomic.h> work on MIPS (and ARM) using GCC, we need to provide implementations of the __sync_*() functions. I already added these functions for 4 and 8 byte types to libcompiler-rt some time ago, based on top of <machine/atomic.h>. Unfortunately, <machine/atomic.h> only provides a subset of the features needed to implement <stdatomic.h>. This means that in some cases we had to do compare-and-exchange calls in loops, where a simple ll/sc would suffice. Also implement these functions for 1 and 2 byte types. MIPS only provides ll/sc instructions for 4 and 8 byte types, but this is of course no limitation. We can simply load 4 bytes and use some bitmask tricks to modify only the bytes affected. Discussed on: mips, arch Tested with: QEMU
* Don't assign the copyright to the FreeBSD foundation for the yearsmarcel2013-05-291-1/+0
| | | | | | | this file is in FreeBSD. There's formality to this that hasn't happened and Juniper is perfectly fine with being the holder. Discussed with: eadler, imp, jhb
* Change the copyright notice to a standard BSD 2-clause license and assignmarcel2013-05-231-0/+22
| | | | | | | | | | | | | | | ownership to the FreeBSD foundation for the years this file has been in the FreeBSD repository. This file was originally created by Juniper as part of upgrading to FreeBSD 4.10 (which had no MIPS support) and held functions found on other machines It grew actual functionality over time. The functionaliy was copied from other architectures and ported to MIPS on a as-needed basis. Approved by: Mark Baushke (Juniper IP) Approved by: Megan Sugiyama (Juniper legal) Pointed out by: jmallett@ Requested by: core (jhb@)
* o Relax locking assertions for vm_page_find_least()attilio2013-05-211-1/+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
* Fix several typoseadler2013-05-121-1/+1
| | | | | | PR: kern/176054 Submitted by: Christoph Mallon <christoph.mallon@gmx.de> MFC after: 3 days
* MFp4 CH=227440:bz2013-05-092-134/+134
| | | | | | | | | Convert the structures to C99 style initialisation, which makes it a lot easier to check that all of them are set and to generate a derived template from them. Sponsored by: DARPA, AFRL MFC after: 2 weeks
OpenPOWER on IntegriCloud