Commit Graph

274326 Commits

Author SHA1 Message Date
maxv
302ce37157 Add comments. 2020-02-21 18:31:55 +00:00
rin
8a8f8609f8 Do not try to recovery from data page fault in interrupt context;
catch up belatedly with powerpc/trap.c rev 1.49 and etc.:

    http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/powerpc/powerpc/trap.c#rev1.49
2020-02-21 15:15:48 +00:00
joerg
1fb1813c28 LLVM doesn't use term.h, so don't check for it when probing here either.
Increase robustness of checks for incremental builds by forcing a
dependency on the Makefile itself.
2020-02-21 15:00:44 +00:00
rin
1b26c2a61c Tiny improvements to copyin() and copyout():
- Use lwz/stw instead of 4-byte lswi/stswi for 405 and later, which
  support unaligned word load/store by hardware. In many cases, both
  source and destination are aligned on word boundaries.

- Use dcbst instead of dcbf to flush cache. The former does not
  invalidate the cache line. Copied data should be used soon after.
2020-02-21 14:49:57 +00:00
rin
17eddb1bb1 Cosmetic changes for assembler codes. No binary changes. 2020-02-21 14:27:20 +00:00
rin
8847bd2d2b When UPAGES > 1, both __HAVE_CPU_UAREA_ROUTINES and PMAP_MAP_POOLPAGE
must be defined in order to allocate physically contiguous memory for
u-area.
2020-02-21 13:38:05 +00:00
skrll
df08bba629 Use designated initialisers 2020-02-21 13:33:07 +00:00
rin
b851f544a9 Comment out badaddr() and badaddr_read() on ibm4xx for now.
They are not used nor exposed externally in any header file; these
functions may have never been tested so far.

Enable them again when necessary.

Note that badaddr() for oea is used by macppc port, where it is
declared as an external function.
2020-02-21 13:32:31 +00:00
rin
2791303760 In ppc4xx_tlb_find_victim(), mark kernel stack page TLBF_REF instead of
TLBF_USED. This should be originally intended behavior of this code
segment, because

- TLBF_USED is already checked just before, so marking this page
  TLBF_USED is no-op.
- TLBF_REF flag exempts that page from being flushed from TLB in next
  scan, when kernel stack may be still there with high probability.
2020-02-21 13:16:16 +00:00
skrll
c02d4e447c Improve a comment 2020-02-21 13:15:54 +00:00
rin
4d2aef8b1b Reduce UPAGES from 2 to 1 for ibm4xx, which was originally 1 and bumped
to 2 in rev 1.29:

    http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/powerpc/include/param.h#rev1.29

Since page size is 16KB on ibm4xx, USPACE is still 16KB, which is the
same size as on other powerpc processors.

This avoids kernel crash described in PR kern/54994. Also, even if the
PR is resolved, fork(2) easily fails with ENOMEM if UPAGES is 2, which
requires physically contiguous pages for u-area. No bad side effect is
observed as far as I can see.

XXX
Even with this commit, kern/54994 still critically affects other archs
with __HAVE_CPU_UAREA_ROUTINES, i.e., alpha, mips, powerpc/{oea,booke},
and riscv.
2020-02-21 12:56:37 +00:00
skrll
71d602f2c7 Fix a memory leak. Spotted by nat@ 2020-02-21 12:41:29 +00:00
riastradh
00772fbc46 OOPS -- fix mistake in previous commit.
bbusy really needs to return the error; otherwise things are very
bad!
2020-02-21 02:04:40 +00:00
joerg
ce578dfc2b Explicitly cast pointers to uintptr_t before casting to enums. They are
not necessarily the same size. Don't cast pointers to bool, check for
NULL instead.
2020-02-21 00:26:21 +00:00
kamil
4fbe278b92 Refactor dbregs_dont_inherit_lwp()
Switch from native LWP calls to pthread(3) calls.
2020-02-20 23:57:16 +00:00
joerg
8c0c92a33c The global offset table is spelled .TOC. on PPC64, so preserve that symbol. 2020-02-20 22:52:10 +00:00
kamil
8eecffe079 Minor changes to t_ptrace_wait*
Add check for security.models.extensions.user_set_dbregs in the
concurrent event tests.

Use unconditionally atf_tc_skip(); as the test is racy.
2020-02-20 22:38:54 +00:00
jdolecek
8eb142c9a0 protect deferred lists' manipulation by config_misc_lock, same as
config_pending semaphore itself; right now this also covers
DVF_ATTACH_INPROGRESS flag
2020-02-20 21:14:23 +00:00
christos
e9bf148a44 Fix failing unittests (by restoring old changes). 2020-02-20 19:59:12 +00:00
pgoyette
5df404349f Typo: s/./,/ 2020-02-20 18:24:20 +00:00
riastradh
f638f19cd2 Fix kassert in lfs by initializing vp first. 2020-02-20 15:48:52 +00:00
riastradh
1cc3b53db1 Buffer cache SDT probes. 2020-02-20 15:48:38 +00:00
riastradh
16a0e8da32 Use vn_bwrite, not genfs_nullop, for VOP_BWRITE.
VOP_BWRITE is responsible for calling biodone; can't just leave it
hanging.

XXX pullup
2020-02-20 15:48:05 +00:00
wiz
4bfcf0cd70 Fix two entries. 2020-02-20 15:04:53 +00:00
rin
4663a8e656 When emulating obsoleted arm32 instructions, use ufetch(9) rather than
dereference tf_pc directly to retrieve an instruction.

Even if tf_pc is valid when processor decodes the instruction, someone
can unmap its page before tf_pc is read in the exception handler.

Now, SIGSEGV is delivered correctly to the process in this case, rather
than kernel panic.

Pointed out by maxv.
Discussed with ryo and skrll.
2020-02-20 12:15:33 +00:00
mrg
acd38f9259 in bus_dmamap_load_pglist() try a 32-element array of
bus_dma_segment_t's before attempting to allocate.

this hopefully avoids hangs i've had in X since updating
from netbsd-8 to netbsd-9 that i've tracked down to this
function failing with ENOMEM.

XXX: maybe can avoid the alloc entirely by batching these
calls in 32 segments each.

XXX pullup-9
2020-02-20 09:07:39 +00:00
rin
7908ba96b0 Pull in arm_generic_dma.c to RPI kernel for arm_generic_dma_tag, which is
required by fdt_dma_machdep.c.
2020-02-20 08:31:17 +00:00
skrll
a0a61c51a5 G/C 2020-02-20 08:27:38 +00:00
ozaki-r
e90f6c59d3 shmif: use cprng_strong32 to generate random bytes for a MAC address
cprng_fast32 sometimes returns indentical bytes, which look
"20:0e:11:33" in a MAC address, on different rump_server instances.
That leads MAC address duplications resulting in a test failure.

Fix it by using cprng_strong32 instead of cprng_fast32.  However
we should rather fix cprng_fast32 (or rump itself) somehow.

The fix mitigates PR kern/54897 but test failures due to other
causes still remain.
2020-02-20 08:06:15 +00:00
ozaki-r
79945603f0 tests: abort if MAC address duplication found 2020-02-20 08:02:26 +00:00
ozaki-r
e8f138ca5c tests: dump stats of an interface before destroying it 2020-02-20 07:58:19 +00:00
skrll
7876d47fd7 Use orr instead of mov (an alias for orr) to appease clang... *shrug* 2020-02-20 07:52:55 +00:00
rin
e3331ab957 libpthread sets initial value of MSR for lwp's. However, appropriate
value differs b/w oea/booke/ibm4xx, and there's no way to obtain it
from userland. Therefore, this initial value should be corrected by
cpu_setmcontext().

- Comment this in libpthread
- Add KASSERT in cpu_mcontext_validate()
2020-02-20 07:07:02 +00:00
rin
6b1fb9e0ac Oops, sort header again. My bad... 2020-02-20 06:36:04 +00:00
rin
681658a534 Provide no-op's as pcu_ops_md_defs[PCU_FPU] even if !PPC_HAVE_FPU.
This is required by subr_pcu.c rev 1.21 and later:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/subr_pcu.c#rev1.21

Otherwise, panic occurs when FP instruction is emulated on machines
without FPU.

Note that PowerPC UISA as well as SVR4 ABI require FP instructions,
and emulation is enabled unconditionally on machines without FPU.
2020-02-20 06:12:47 +00:00
rin
8e1e641fbd Convert mi_userret(9) into powerpc-specific userret().
This is necessary in order to support RAS.

There are some sanity checks in userret() as well.
2020-02-20 05:57:49 +00:00
rin
e8c96653f0 Sort more headers... 2020-02-20 05:55:24 +00:00
rin
3e0c0349b0 Sort headers. 2020-02-20 05:46:08 +00:00
rin
46f5e0cdde Clear ti_ctx when flushing a TLB entry for clarity. 2020-02-20 05:34:37 +00:00
rin
e2deec759f Fix off-by-one error for ctx (ASID).
Note that NUM_CTX = 256 = 0 stands for disabling protection by ASID.
2020-02-20 05:21:54 +00:00
rin
e5c227565a Fix NULL dereference; "pap" argument of pmap_extract(9) can be NULL. 2020-02-20 05:13:16 +00:00
rin
db7d700c24 eieio is implemented as sync on 40x. Therefore, "sync; eieio" and
"eieio; sync" can be replaced by a single sync.
2020-02-20 05:10:01 +00:00
rin
1c329715d0 Add PPC_IBM440 flag as 440 is significantly different from 40x processors.
(It may be more easily supported by booke than by ibm4xx.)
2020-02-20 05:03:54 +00:00
rin
f45ae8fdd7 Fix !__HAVE_FAST_SOFTINTS build for debugging. 2020-02-20 04:59:43 +00:00
rin
d5ff9c1cbc Make this compile again with PGALLOC_VERBOSE. 2020-02-20 04:54:47 +00:00
jmcneill
750e1342f6 Add support for brcm,bcm2711-emmc2 2020-02-20 01:44:06 +00:00
jmcneill
62c7172551 Remove custom bus dma tag handling. 2020-02-20 01:43:07 +00:00
jmcneill
080d691fc9 Attach bcmgpio before devices that may need it 2020-02-20 01:36:37 +00:00
jmcneill
4951916a8c Add dma-ranges support. 2020-02-20 01:35:55 +00:00
martin
bcf119c046 Remove unused "rel" global variable and make the -r option a no-op. 2020-02-19 21:51:21 +00:00