summaryrefslogtreecommitdiff
path: root/sys/arch/mips64
AgeCommit message (Collapse)Author
2017-03-02Add a new sysctl machdep.lidaction. The sysctl works as follows:Martin Natano
machdep.lidaction=0 # do nothing machdep.lidaction=1 # suspend machdep.lidaction=2 # hibernate lidsuspend is just an alias for lidaction, so if you change one, the other one will have the same value. The plan is to remove machdep.lidsuspend eventually when people have upgraded their /ets/sysctl.conf. discussed with deraadt, who came up with the new MIB name no objections mlarkin ok stsp halex jcs
2017-02-19Add IPI counter.Visa Hankala
2017-02-12Split up fork1():Philip Guenther
- FORK_THREAD handling is a totally separate function, thread_fork(), that is only used by sys___tfork() and which loses the flags, func, arg, and newprocp parameters and gains tcb parameter to guarantee the new thread's TCB is set before the creating thread returns - fork1() loses its stack and tidptr parameters Common bits factor out: - struct proc allocation and initialization moves to thread_new() - maxthread handling moves to fork_check_maxthread() - setting the new thread running moves to fork_thread_start() The MD cpu_fork() function swaps its unused stacksize parameter for a tcb parameter. luna88k testing by aoyama@, alpha testing by dlg@ ok mpi@
2017-02-08In exec_elf.c: expand ELFNAME(), ELFNAME2(), and ELFNAMEEND() exceptPhilip Guenther
leaving out the size, so that ELFNAME2(exec,makecmds) becomes exec_elf_makecmds instead of exec_elf{32,64}_makecmds and then delete the ELFNAME2() and ELFNAMEEND() macros. Move the prototypes for functions local to exec_elf.c to there from exec_elf.h. Simplify the SMALL_KERNEL conditionals around the ELF coredump code. Change exec_conf.c to use the size-generic names and macros Remove exec_elf{32,64}.c and just build exec_elf.c; delete the _KERN_DO_ELF and _KERN_DO_ELF64 #defines. ok jca@, encouragement from deraadt@ and tom@
2017-01-21Add _MIPS_ISA_MIPS32 and _MIPS_ISA_MIPS64 defines for clang.Visa Hankala
OK deraadt@ phessler@ mpi@
2017-01-21p_comm is the process's command and isn't per thread, so move it fromPhilip Guenther
struct proc to struct process. ok deraadt@ kettenis@
2017-01-03Remove #define __SWAP_BROKEN from mips64. The architecture nowVisa Hankala
has a proper pmap_collect() implementation, and the current uvm_swapout_threads() code does not need other MD interfaces. OK miod@
2017-01-02Allow freeing of newly empty directory pages.Visa Hankala
2016-12-30Ansify pmap_copy().Visa Hankala
2016-12-30When entering a mapping on write access, compute the PTE after makingVisa Hankala
the page dirty. This lets the system avoid an extra TLB modify fault because the TLB mapping now allows writes immediately. Noticed by miod@
2016-12-23Tweaks suggested by miod@Visa Hankala
2016-12-22Extend the size of user virtual address space from 2GB to 1TB on mips64Visa Hankala
by adding another level to page directories. This improves ASLR and complements W^X added earlier on some systems, giving a notable update to the architecture's security. Besides, there is now more room for running tasks that hog memory. Testing help from deraadt@ and fcambus@. Platforms tested: loongson, octeon, sgi/IP27 and sgi/IP30 (IP30 also with 4KB pages).
2016-12-21Add a driver for OCTEON MMC host controller.Visa Hankala
Tested on EdgeRouter Pro, and Shasta. OK mpi@
2016-12-17Make Octeon model strings a bit more specific. While there,Visa Hankala
add CN70xx/CN71xx.
2016-12-16Provide the "machdep.lidsuspend" sysctl on Loongson.Frederic Cambus
OK visa@
2016-12-12Tweak IPI register definitions.Visa Hankala
2016-12-06Get PTE shift using PTE_LOG.Visa Hankala
2016-11-21Enabling Loongson 3A bits turned on a code path that uses a MIPS64r2Visa Hankala
register on Loongson 2. This causes a boot failure on LS2 because the CPU does not implement the register. Disable the code on LS2 similarly to mips64 pte.h. Yeelong boot hang reported and fix tested by matthieu@
2016-11-06Add interrupt handling routines for Loongson 3A.Visa Hankala
Feedback from miod@
2016-10-27Revert previous `ncpus' change because the percpu code now worksVisa Hankala
without it.
2016-10-26Increment `ncpus' to its final value already during autoconfiguration soVisa Hankala
that percpu data areas get allocated properly on mips64 platforms. It is too late to set the value during launch of secondary CPUs. ok jasper@ kettenis@ dlg@
2016-10-19Change pmap_proc_iflush() to take a process instead of a procPhilip Guenther
powerpc: rename second argument of pmap_proc_iflush() to match other archs ok kettenis@
2016-10-19The first argument to process_domem() and its uio_procp should be curprocPhilip Guenther
ok kettenis@
2016-10-09Do not use MIPS64r2 instructions on Loongson 2. Now, a generic loongsonVisa Hankala
kernel has to learn a new trick in order to use TLB RI/XI on 3A2000.
2016-10-08Various printf claim to report the PID, so actually report that and not the TIDPhilip Guenther
Build testing assistance from deraadt@
2016-09-25Make a move towards ending 4 decades of kernel snooping.Theo de Raadt
Add sysctl kern.allowkmem (default 0) which controls the ability to open /dev/mem or /dev/kmem at securelevel > 0. Over 15 years we converted 99% of utilities in the tree to operate on sysctl-nodes (either by themselves or via code hiding in the guts of -lkvm). pstat -d and -v & procmap are affected and continued use of them will require kern.allowkmem=1 in /etc/sysctl.conf. acpidump (and it's buddy sendbug) are affected, but we'll work out a solution soon. There will be some impact in ports. ok kettenis guenther
2016-09-19fix whitespace at EOLJasper Lievisse Adriaanse
2016-09-15all pools have their ipl set via pool_setipl, so fold it into pool_init.David Gwynne
the ioff argument to pool_init() is unused and has been for many years, so this replaces it with an ipl argument. because the ipl will be set on init we no longer need pool_setipl. most of these changes have been done with coccinelle using the spatch below. cocci sucks at formatting code though, so i fixed that by hand. the manpage and subr_pool.c bits i did myself. ok tedu@ jmatthew@ @ipl@ expression pp; expression ipl; expression s, a, o, f, m, p; @@ -pool_init(pp, s, a, o, f, m, p); -pool_setipl(pp, ipl); +pool_init(pp, s, a, ipl, f, m, p);
2016-09-06Define PTE_* macros in one place. Use the lwu instruction for 32-bit PTEVisa Hankala
loads on all systems as the TLB code does not need sign extension.
2016-09-03Increase the number of mbufs on most architectures. This is basedAlexander Bluhm
on a guess how much memory a typical machine has. If the value is too high, users may run out of kernel memory. Then we will have to adjust this again. OK claudio@ deraadt@
2016-08-16Remove RM7000/RM9000-specific performance counter code. It originatesVisa Hankala
from PMON2000 and has not been enabled on OpenBSD. Suggested by and ok miod@ (after seeing a quad_t cleanup patch of mine)
2016-08-14Utilize the TLB Execute-Inhibit bit with non-executable mappings on CPUsVisa Hankala
that support the Execute-Inhibit exception. This makes user space W^X effective on Octeon Plus and later Octeon versions. Feedback from miod@, thanks! No objection from deraadt@
2016-08-06Add PageGrain bits.Visa Hankala
2016-08-01bring the light of ansi to a few more filesTed Unangst
2016-05-23Place a cpu-dependent trap/illegal instruction over the remainder of theTheo de Raadt
sigtramp page, so that it will generate a nice kernel fault if touched. While here, move most of the sigtramps to the .rodata segment, because they are not executed in the kernel. Also some preparation for sliding the actual sigtramp forward (will need some gdb changes) ok mlarkin kettenis
2016-05-21hand-massage sendsig() and sys_sigreturn() to be much more similar.Theo de Raadt
ok guenther kettenis
2016-05-11Another attempt to make the mips64 pmap MP-safe. Now at leastVisa Hankala
pmap_enter(9), pmap_remove(9) and pmap_page_protect(9) should be safe to use without the kernel lock. No objection from deraadt@
2016-05-10SROP mitigation. sendsig() stores a (per-process ^ &sigcontext) cookieTheo de Raadt
inside the sigcontext. sigreturn(2) checks syscall entry was from the exact PC addr in the (per-process ASLR) sigtramp, verifies the cookie, and clears it to prevent sigcontext reuse. not yet tested on landisk, sparc, *88k, socppc. ok kettenis
2016-04-27G/C DDB_REGS.Martin Pieuchot
2016-04-24Make pmap_invalidate_*_page() and pmap_update_*_page() operate only onVisa Hankala
the local TLB and add pmap_shootdown_page() for invalidating remote TLBs. Where the code previously updated a remote TLB entry, the code now issues a remote invalidation, like in architectures with a hardware-managed TLB. This eases work in the MP land because invalidations do not need to strictly follow the order of page table updates. Almost as a side effect, pmap_emulate_modify() no longer touches remote TLBs. It is no use to force a TLB D bit on other CPUs because they might not need it. Moreover, a shootdown IPI probably has a higher overhead than a local TLBModified exception.
2016-04-24Keep pmap_update_{kernel,user}_page() inside pmap.c.Visa Hankala
2016-04-23Sync dcaches and invalidate icaches of all active CPUs of a pmap whenVisa Hankala
making a page executable. This prevents some icache inconsistencies that could arise when a process modifies its code pages and begins executing them while switching between CPUs. These inconsistencies caused process crashes on multiprocessor IP27/IP30 systems under load. Crashes reported by deraadt@ Feedback from Miod, thanks!
2016-03-19Reduces the noise around the global ``ticks'' variable by renamingMartin Pieuchot
all the local ones to ``nticks''. ok stefan@, deraadt@
2016-03-06Rename mips64's trap_frame into trapframe.Martin Pieuchot
For coherency with other archs and in order to use it in MI code. ok visa@, tobiasu@
2016-03-01guard macro args with parensmmcc
from Michal Mazurek, ok deraadt@
2016-03-01DB_SYM_NULL -> NULL.Martin Pieuchot
2016-02-27Rename kdb_trap() into db_ktrap().Martin Pieuchot
The goal is to include it in the list of functions that must not be instrumented. All ddb(8) functions should be in this list and have their names start with 'db_'. ok visa@, deraadt@
2016-02-01Zap stray pmap_kenter_cache() prototype.Visa Hankala
2016-02-01Move modify bit emulation into pmap.c to gather pmap C code in one place.Visa Hankala
2016-01-10Back out the MP pmap diff for rework. The code does not work onVisa Hankala
non-PMAP_DIRECT systems due to lock recursion.