Commit Graph

255802 Commits

Author SHA1 Message Date
christos
0cc54e49cb KNF. 2018-01-07 15:26:43 +00:00
maxv
6fcf3f0aab Switch x86_retpatch[] -> HOTPATCH(). 2018-01-07 13:43:23 +00:00
maxv
57976a3c3e Fix previous - atomic_lockpatch[] is still there. 2018-01-07 13:37:39 +00:00
maxv
9ef803fea5 Switch x86_lockpatch[] -> HOTPATCH(). 2018-01-07 13:15:23 +00:00
maxv
99d8611c28 Implement a real hotpatch feature.
Define a HOTPATCH() macro, that puts a label and additional information
in the new .rodata.hotpatch kernel section. In patch.c, scan the section
and patch what needs to be. Now it is possible to hotpatch the content of
a macro.

SMAP is switched to use this new system; this saves a call+ret in each
kernel entry/exit point.

Many other operating systems do the same.
2018-01-07 12:42:46 +00:00
kre
b36637ee94 PR bin/52905
Document, and properly implement, the -q and -e options to dkctl xxN listwedges.
(implementation fix supplied by Petar Bogdanovic.)
2018-01-07 12:29:25 +00:00
mlelstv
451e80f07d Fix block address calculation for bad sectors. 2018-01-07 11:37:30 +00:00
maxv
1cb7949fd5 Give patchbytes an array. 2018-01-07 11:24:45 +00:00
maxv
7d34bd9bc2 Use uvm_km_alloc instead of kmem_zalloc. 2018-01-07 10:16:13 +00:00
christos
9fd2befeec use a fixed-size type, this code also exists in
sys/dev/dkwedge/dkwedge_bsdlabel.c
2018-01-07 03:35:43 +00:00
mlelstv
2f6dbbcf88 Use sysctl to retrieve iostat names instead of parsing possibly
truncated iostat output.

Check dkctl listwedges output with grep.

Fixes PR 59205.
2018-01-06 23:44:06 +00:00
nat
ba7d7fa18b Only signal a pause change on a transition of a pause change.
This addresses a problem found in audio/sox causing high cpu usage.

Path and analysis by Onno van der Linden.
2018-01-06 23:15:36 +00:00
nat
29ac8c3c0c Whitespace. 2018-01-06 21:16:36 +00:00
jmcneill
d5f1b2266e Enable automatic booting on tegra210 2018-01-06 20:27:31 +00:00
uwe
db934fc2af Drive-by markup improvements. 2018-01-06 16:54:09 +00:00
kamil
f615c5a6fd doc: Tweak the vadvise removal entry in CHANGES
Note the removal of the vadvise header
2018-01-06 16:52:57 +00:00
kamil
f98f70a745 Revert vadvise(2) removal
This system call was used in legacy Lisp code, that was inherited to modern
age and still compiled against supported compat layers (e.g. in clisp,
oaklisp, Franz Lisp).

It used to instruct the kernel about paging policy (G/C aware, flush etc).

Newly compiled code (assuming that it will detect vadvise()) will use the
libc stub for vadvise(). The headers for this interface are gone.

vadvise(2) could be marked as COMPAT_80, but as long as we support ultrix,
sunos or aout68k ABI, don't bother with this.

Requested by <mrg>
2018-01-06 16:41:23 +00:00
uwe
239916cbb8 Make synopsis a bit less verbose and hopefully more readable. 2018-01-06 16:01:43 +00:00
snj
f293296fc4 fix a few typos in comments 2018-01-06 09:46:22 +00:00
snj
adee6b5e35 add missing dtrace tag for librtld_db.0 2018-01-06 09:31:03 +00:00
maxv
f25fcbff4d Mmh, I made a mistake in r1.10 - I forgot to update this function call. 2018-01-06 08:44:01 +00:00
macallan
ca569de986 support underlines 2018-01-06 07:26:54 +00:00
snj
9d37d7200a add strfmon_l man page links 2018-01-05 20:51:13 +00:00
kamil
763ed9e584 Register new weak symbol in libc for internal usage: atoi
The NetBSD Standard C Library uses internally some of its functions with
a mangled symbol name, usually "_symbol". The internal functions shall not
use the global (public) symbols.

Add atoi to namespace.h.

Register a new __weak_alias() entry for atoi() in atoi.c.

atoi() is used internally in getrpcent(), rresvport_af(), ftok(), err(),
__llvm_profile_write_file(), llvm_gcda_start_file(), citrus_iconv_open(),
getprotoent_r(), __rpc_uaddr2taddr_af(), __res_nopt_rdata() and
servent_parseline().

This revision switches the internal usage to the internal symbol.

Sponsored by <The NetBSD Foundation>
2018-01-05 20:30:51 +00:00
kamil
947899dacf Register new weak symbol in libc for internal usage: asctime
The NetBSD Standard C Library uses internally some of its functions with
a mangled symbol name, usually "_symbol". The internal functions shall not
use the global (public) symbols.

Add asctime to namespace.h.

Register a new __weak_alias() entry for asctime() in asctime.c.

acstime() is used internally in ctime and __ctime50. This revision switches
the internal usage to the internal symbol.

Sponsored by <The NetBSD Foundation>
2018-01-05 20:01:31 +00:00
kamil
17a7df3a53 Register dl_iterate_phdr in the libc's namespace.h
The NetBSD Standard C Library uses internally some of its functions with
a mangled symbol name, usually "_symbol". The internal functions shall not
use the global (public) symbols.

Stop using the public global name of dl_iterate_phdr in tls/tls.c:
__libc_static_tls_setup().

Follow the approach with other dlopen(3)-like functions with the
namespace.h in the dl_iterate_phdr() case. Use internally a weak symbol:
__dl_iterate_phdr instead of dl_iterate_phdr.

Sponsored by <The NetBSD Foundation>
2018-01-05 19:29:44 +00:00
kamil
575eeceb5d Include namespace.h in a few of libc source files
The NetBSD Standard C Library uses internally some of its functions with
a mangled symbol name, usually "_symbol". The internal functions shall not
use the global (public) symbols.

This change finishes elimination of usage of the global name of the
following symbols:
  - close -> _close
  - execve -> _execve
  - fcntl -> _fcntl
  - setcontext -> _setcontext
  - wait6 -> _wait6
  - write -> _write
  - writev -> _writev

Sponsored by <The NetBSD Foundation>
2018-01-05 19:01:36 +00:00
kamil
9b020cc558 Register more syscalls in namespace.h (of libc)
Add weak symbols for:
 - fcntl
 - close
 - execve
 - setcontext
 - wait6
 - write
 - writev

These syscalls are already marked as WEAKASM, generating weak references.

Sponsored by <The NetBSD Foundation>
2018-01-05 18:57:06 +00:00
kamil
b3babee32b Include namespace.h in GCDAProfiling.c (compiler_rt)
The NetBSD Standard C Library uses internally some of its functions with
a mangled symbol name, usually "_symbol". The internal functions shall not
use the global (public) symbols.

This change eliminates usage of the global name of the following symbols:
  - fdopen -> _fdopen
  - mmap -> _mmap
  - strdup -> _strdup

Sponsored by <The NetBSD Foundation>
2018-01-05 17:54:31 +00:00
kamil
5236f0d558 Include namespace.h in citrus/citrus_lc_ctype.c
The NetBSD Standard C Library uses internally some of its functions with
a mangled symbol name, usually "_symbol". The internal functions shall not
use the global (public) symbols.

This change eliminates usage of the global name of the following symbol:
  - strlcpy -> _strlcpy

Sponsored by <The NetBSD Foundation>
2018-01-05 17:52:06 +00:00
christos
249cf59313 use some size_t, add whitespace between functions, rcsids. 2018-01-05 14:22:26 +00:00
christos
087be49549 PR/52900: Tomohiro Kusumi: Fix kernel panic when target's ->init() failed
Reliably unbusy the target in the *all* the destroy routines, so ioctl
does not need to do it.
2018-01-05 14:22:05 +00:00
flxd
b88074d92e Comment out DIAGNOSTIC/DEBUG/LOCKDEBUG from r1.192 slowing down real machines.
OK christos@
2018-01-05 13:20:45 +00:00
flxd
8322a83c8a Check presence of VFB01/VFB02 frame buffer option on DEC(station|system) 3100. 2018-01-05 13:11:32 +00:00
msaitoh
7909c778fe Add NVMe devices. 2018-01-05 10:04:13 +00:00
martin
14e42d58e6 Mark L1e_idx as __diagused, it is only referenced in a KASSERT. 2018-01-05 09:13:48 +00:00
maxv
a4d0307ee1 Add a __HAVE_PCPU_AREA option, enabled by default on native amd64 but not
Xen.

With this option, the CPU structures that must always be present in the
CPU's page tables are moved on L4 slot 384, which means address
0xffffc00000000000.

A new pcpu_area structure is defined. It contains shared structures (IDT,
LDT), and then an array of pcpu_entry structures, indexed by cpu_index(ci).
Theoretically the LDT should be in the array, but this will be done later.

During the boot procedure, cpu0 calls pmap_init_pcpu, which creates a
page tree that is able to map the pcpu_area structure entirely. cpu0 then
immediately maps the shared structures. Later, every CPU goes through
cpu_pcpuarea_init, which allocates physical pages and kenters the relevant
pcpu_entry to them. Finally, each pointer is replaced to point to pcpuarea.

The point of this change is to make sure that the structures that must
always be present in the page tables have their own L4 slot. Until now
their L4 slot was that of pmap_kernel, and making a distinction between
what must be mapped and what does not need to be was complicated.

Even in the non-speculative-bug case this change makes some sense: there
are several x86 instructions that leak the addresses of the CPU structures,
and putting these structures inside pmap_kernel actually offered a way to
compute the address of the kernel heap - which would have made ASLR on it
plainly useless, had we implemented that.

Note that, for now, pcpuarea does not contain rsp0.

Unfortunately this change adds many #ifdefs, and makes the code harder to
understand. There is also some duplication, but that will be solved later.
2018-01-05 08:04:20 +00:00
uwe
f89964526a Driver for EM Microelectronic EM3027 RTC and temperature sensor. 2018-01-05 03:07:15 +00:00
christos
8b26e6d696 Don't stomp past the end of the array! need __arraycount not sizeof()
Found by chuq, while debugging the sdf.org crashes
XXX: pullup-8
Restructure a bit for readability.
2018-01-05 01:53:15 +00:00
christos
fa3ceadced don't print for ENOEXEC 2018-01-05 01:51:36 +00:00
pgoyette
e01eb3407e Bump size of uefi image - we've outgrown the old size 2018-01-05 01:33:11 +00:00
kamil
c5b83981a9 Add bunch of missing includes of namespace.h in libc
The NetBSD Standard C Library uses internally some of its functions with
a mangled symbol name, usually "_symbol". The internal functions shall not
use the global (public) symbols.

This change eliminates usage of the global changes of the following symbols:
 - strlcat -> _strlcat
 - sysconf -> __sysconf
 - closedir -> _closedir
 - fparseln -> _fparseln
 - kill -> _kill
 - mkstemp -> _mkstemp
 - reallocarr -> _reallocarr
 - strcasecmp -> _strcasecmp
 - strncasecmp -> _strncasecmp
 - strptime -> _strptime
 - strtok_r -> _strtok_r
 - sysctl -> _sysctl
 - dlopen -> __dlopen
 - dlclose -> __dlclose
 - dlsym -> __dlsym

Sponsored by <The NetBSD Foundation>
2018-01-04 20:57:28 +00:00
maxv
31acdb2583 Declare gdt_size as const, simplifies. 2018-01-04 20:38:30 +00:00
maxv
9baa91b0bd Declare IOMAP_VALIDOFF, not to use ci_tss pointers. 2018-01-04 14:02:23 +00:00
maxv
8b0fa23784 Allocate the TSS area dynamically. This way cpu_info and cpu_tss can be
put in separate pages.
2018-01-04 13:36:30 +00:00
maxv
ad750876f8 Group the different TSSes into a cpu_tss structure. And pack this
structure to make sure there is no padding between 'tss' and 'iomap'.
2018-01-04 12:34:15 +00:00
msaitoh
a566db57e8 Add ASPM workaround for 8257[1234] and 82583 to prevent device timeout or
hangup. Fixes PR#52818 reported by Shinichi Doyashiki.
2018-01-04 09:43:27 +00:00
christos
59b5a49a77 Add a new sockopt member to keep track of the actual size of the option
that should be returned to the caller in getsockopt(2).

(Tom Ivar Helbekkmo)
2018-01-04 01:42:25 +00:00
knakahara
0d3459cf8b fix "intrctl list" panic when ACPI is disabled.
reviewed by cherry@n.o and tested by msaitoh@n.o, thanks.
2018-01-04 01:01:59 +00:00
khorben
db8ce746e1 Fix off-by-one when calling snprintf(9) in hdafg_getdev()
This is actually harmless, since:
- the offset is too short rather than too long (no overflow)
- the struct audio_device comes from userland (no information leak)

"looks good to me" nat@
2018-01-04 00:09:12 +00:00