Commit Graph

151964 Commits

Author SHA1 Message Date
ryoon
11e94a8068 usbdevs: Add Linux USB 3.0 debugging port serial device 2020-07-04 08:05:26 +00:00
skrll
db6bf946c6 Protect with #ifdef _KERNEL 2020-07-04 07:02:35 +00:00
rin
95165b7965 Fix previous; add missing <uvm/uvm.h> include. 2020-07-04 04:59:36 +00:00
rin
8c4e0d2bbb Fix uvmexp.ncolors for some big.LITTLE configuration; it is uncertain
which CPU is used as primary, and as a result, secondary CPUs can
require larger number of colors.

In order to solve this problem, update uvmexp.ncolors via
uvm_page_recolor(9) when secondary CPUs are attached, as done for
other ports like x86.

Pointed out by jmcneill@, and discussed on port-arm@:
http://mail-index.netbsd.org/port-arm/2020/07/03/msg006837.html

Tested and OK'd by ryo@.
2020-07-04 04:39:20 +00:00
jdolecek
8648f78621 add a cast to (struct statvfs *) for STATVFSBUF_GET() to make sure it's
never assigned to anything else
2020-07-03 19:37:27 +00:00
christos
5a80c6a868 sync with mount.h, always use the structure size. 2020-07-03 19:00:01 +00:00
jdolecek
6471d774f6 don't overallocate (follows similar change to compat/sys/statvfs.h) 2020-07-03 18:49:37 +00:00
skrll
b1eeadb79c KNF (sort includes) 2020-07-03 17:22:14 +00:00
skrll
4a314e0b78 1 page is enough for memhook now since the merge of the rmind-uvmplock
branch and the removal of sys/arch/arm/arm32/mem.c

The last users of memhook don't care about number of CPUs or page colours.
2020-07-03 17:14:23 +00:00
maxv
ef06fc5cad hardclock_ticks -> getticks() 2020-07-03 16:23:02 +00:00
maxv
0da96df8e5 In cpu_uarea_{alloc,free}:
- My previous change in this file was not correct, kremove does not free
   the underlying PA, which caused a very slow leak under memory pressure.
   Rework to correctly free the PA.
 - Add a second redzone, this time after the stack, to catch several stack
   overflows. The main concern is read overflows which leak the heap that
   follows the stack.
 - UVM_KMF_WAITVA doesn't fail, so remove error check.
 - Add KASSERTs.
2020-07-03 16:17:24 +00:00
maxv
0cdc224fdb Sync trace-pc and trace-cmp. 2020-07-03 16:11:11 +00:00
maxv
81c09e8431 Print the backend name when attaching. 2020-07-03 16:09:54 +00:00
skrll
3b3140f5f6 KNF 2020-07-03 15:31:25 +00:00
christos
d6527692c4 don't overallocate (requested by maxv@) 2020-07-03 14:08:53 +00:00
isaki
bebda9f2a3 Fix an argument passes to auixp_intr().
This is rest of rev 1.39 (split device_t/softc) in 2012.
Problem reported and tested by Riccardo Mottola.
2020-07-03 12:39:54 +00:00
jmcneill
7c5cd4a6aa Move db_reset_cmd prototype to db_machdep.h (forgot to commit this file) 2020-07-03 10:19:18 +00:00
skrll
b6d64ab7ab Make this compile/work on 32-bit archs. OK'ed my maxv
I thought about uintptr_t, but didn't change from Elf_Addr
2020-07-03 08:19:20 +00:00
skrll
1328297211 Consistency...#define<tab> 2020-07-03 06:49:26 +00:00
skrll
467df8a73e KNF (sort #includes) 2020-07-03 06:35:05 +00:00
skrll
d084c0fc75 Style and share a debug string 2020-07-03 06:33:39 +00:00
skrll
bebb61e6d8 Use howmany() 2020-07-03 06:26:41 +00:00
skrll
cba5346832 Whitespace 2020-07-03 06:22:48 +00:00
skrll
7369e038e0 Wrap a comment 2020-07-03 06:15:27 +00:00
skrll
88a427068b Provide a db_reset_cmd prototype 2020-07-03 06:13:00 +00:00
rin
c9e3efd544 Add support of ptrace(2) for COMPAT_NETBSD32.
Now, GDB for arm32 is usable for debugging 32bit applications.

OK ryo@
2020-07-02 13:04:46 +00:00
rin
ed24610792 pmap_procwr(): sync icache even if p != curproc. This fixes applications
like GDB for arm32, that rewrite text of other process.

Thanks to ryo@ for discussion.
2020-07-02 13:01:11 +00:00
rin
864ad9df8e Set uvmexp.ncolors appropriately, which is required for some CPU
models with VIPT icache.

Otherwise, alias in virtual address results in inconsistent results,
at least for applications that rewrite text of other process, e.g.,
GDB for arm32.

Also, this hopefully fixes other unexpected failures due to alias.

Confirmed that there's no observable regression in performance;
difference in ``time make -j8'' for GENERIC64 kernel on BCM2837
with and without setting uvmexp.ncolors is within 0.1%.

Thanks to ryo@ for discussion.
2020-07-02 12:59:31 +00:00
macallan
b7d8551aa7 add $NetBSD: 2020-07-02 12:47:19 +00:00
macallan
14909839c0 proplib API catchup 2020-07-02 12:45:27 +00:00
martin
b83e3fc8ed Initialize ci_kfpu_spl earlier for secondary CPUs. From riastradh 2020-07-02 11:49:48 +00:00
jmcneill
336dbb3e65 Add ddb "mach reset" command for Arm ports. 2020-07-02 11:10:47 +00:00
rin
4db2f9236b Fix typo; PMAP_OEA64_BRIDGE not PMAP_OEA_BRIDGE.
Tested on Power Mac G5.
2020-07-02 10:28:11 +00:00
lukem
2c4fb72252 loader.efi doesn't have source
(Untested fix)
2020-07-02 09:07:24 +00:00
msaitoh
4af81626f6 prop_data_data_nocopy -> prop_data_value 2020-07-02 09:02:04 +00:00
rin
4acff240b3 Remove pointless cast; dp is already uint32_t *.
No functional changes intended.
2020-07-02 07:49:44 +00:00
rin
8f480339f5 Correct SRCS; bsdstart.S not bsdstart.s.
Fix build with bsd.dep.mk rev 1.87, which requires more strict
filename matching.

Found by martin.
2020-07-01 23:37:10 +00:00
jdolecek
87e5223f68 revert, not working 2020-07-01 17:57:14 +00:00
jdolecek
2cd6ed210c ignore interrupt when not expecting one, particularly don't invoke
the irqack in this case

seems cmdide doesn't honour WDCTL_IDS when executing polled commands,
and there is a race where the irqack call interferes with polled
command and causes a lockup

reported by Martin Husemann
2020-07-01 15:10:01 +00:00
ryo
697eec1bf5 add workaround for Neoverse N1 erratum 1542419 2020-07-01 08:02:13 +00:00
ryo
0c7bdc13f0 - On some systems with a different cache line size (and DIC,IDC) per CPU, trap "mrs Xt,ctr_el0" instruction
to return the minimum cache line size of the system to userland.
- add CLIDR_EL1 and CTR_EL0 to struct aarch64_sysctl_cpu_id.

On most systems, cache line size is the same for all CPUs, so this mechanism won't be required.
Rather, this is primarily for errata support, which will be committed later.
2020-07-01 08:01:07 +00:00
ryo
561087550e Switch the Icache sync operation to the necessary and sufficient one according to the CTR_EL0.DIC and CTR_EL0.IDC flags.
If CTR_EL0.DIC=1, Icache invalidation is not required.
If CTR_EL0.IDC=1, Dcache clean before Icache invalidation is not required.
CLIDR_EL1.LoC is 0, or CLIDR_EL1.LoUIS and CLIDR_EL1.LoUU are 0, Dcache clean is not required as well.

SEE ALSO ARMARM, "CTR_EL0 Cache Type Register", and "CLIDR_EL1 Cache Level ID Register"
2020-07-01 07:59:16 +00:00
riastradh
8747f41571 copystr is now in libkern; don't redefine it in rumpcopy.c.
Should fix build breakage from the copystr changes.
2020-07-01 00:42:13 +00:00
riastradh
aac1a7e566 Reallocate registers to avoid abusing callee-saves registers, v8-v15.
Forgot to consult the AAPCS before committing this before -- oops!

While here, take advantage of the 32 aarch64 simd registers to avoid
all stack spills.
2020-06-30 23:06:02 +00:00
riastradh
6d5a7eed7d Use `.arch_extension aes' for aese/aesmc/aesd/aesimc.
Unlike `.arch_extension crypto', this works with clang; both work
with gas, so we'll go with this.

Clang still can't handle aes_armv8_64.S yet -- it gets confused by
dup and mov on lanes, but this makes progress.
2020-06-30 21:53:39 +00:00
riastradh
b54ccdd478 Use .p2align rather than .align.
Apparently on arm, .align is actually an alias for .p2align, taking a
power of two rather than a number of bytes, so aes_armv8_64.o was
bloated to 32KB with obscene alignment when it only needed to be
barely past 4KB.

Do the same for the x86 aes_ni_64.S -- even though .align takes a
number of bytes rather than a power of two on x86, let's just stay
away from the temptations of the evil .align directive.
2020-06-30 21:41:03 +00:00
riastradh
aedb0d4e40 Tweak clang neon intrinsics so they build.
(this file is still a kludge)
2020-06-30 21:24:00 +00:00
riastradh
bd9707e06e New test sys/crypto/aes/t_aes.
Runs aes_selftest on all kernel AES implementations supported on the
current hardware, not just the preferred one.
2020-06-30 20:32:10 +00:00
msaitoh
24cca43843 If an error occurred in sme_refresh function, pass ENVSYS_SINVALID.
OK'd by pgoyette.
2020-06-30 19:02:42 +00:00
riastradh
c8c5c422ac Limit aes_neon to cpu_cortex | aarch64.
We won't use it on any other systems, and it doesn't build without
NEON anyway.  Verified earmv7hf GENERIC, aarch64 GENERIC64, and
earmv6 RPI2 all build with this.
2020-06-30 17:03:13 +00:00