Commit Graph

259719 Commits

Author SHA1 Message Date
riastradh
92e1684438 Revert "Sprinkle cold conditionals to make tc_ticktock before inittimecounter."
Not needed if we're no longer doing tc_ticktock in printf.
2018-07-01 15:12:06 +00:00
christos
46e5459c53 disable one more size check for _LP32 to make pcc build. 2018-07-01 14:20:23 +00:00
jmcneill
a5d63f15fe Build fix 2018-07-01 10:46:02 +00:00
mbalmer
62e2d99666 Apply bugfix #7 from lua.org/bugs.html: Memory-allocation error when resizing
a table can leave it in an inconsistent state.
2018-07-01 10:08:38 +00:00
jmcneill
aeec0e9736 Revert previous 2018-07-01 09:53:54 +00:00
maxv
053a9f2f94 Use a variable-sized memcpy, instead of copying the PCB and then adding
the extra bytes. The PCB embeds the biggest static FPU state, but our
real FPU state may be smaller (FNSAVE), so we don't need to memcpy the
extra unused bytes.
2018-07-01 08:32:41 +00:00
maxv
337a599b92 Optimize FNSAVE. The size of its save area is 108 bytes, so don't set
x86_fpu_save_size = 512, because otherwise we uselessly memset extra
bytes at execve time.

While here use sizeof instead of hardcoded values.
2018-07-01 07:59:30 +00:00
maxv
922eadabce Use a switch, we can (and will) optimize each case separately. No
functional change.
2018-07-01 07:18:56 +00:00
riastradh
79ad738888 Sprinkle cold conditionals to make tc_ticktock before inittimecounter.
Enables Xen to boot again.

XXX Maybe we should have a tc_ticktock_cold instead or something so we
don't have to reach this far into the call graph.
2018-06-30 22:47:51 +00:00
kre
e2a662b2a9 Build fix bandaid.
This allows the builds including XEN to complete, but XEN kernels
built from these sources (at least, DomU) do not boot successfully.
2018-06-30 20:53:30 +00:00
jmcneill
233c5d85ef Use queue(3) API to manage lists. NFCI. 2018-06-30 20:34:43 +00:00
jmcneill
5375fcbde9 Simplify list initialization 2018-06-30 20:16:56 +00:00
jmcneill
9ba9b3fa04 Rock64 needs more time for the PHY to reset. Add a delay. 2018-06-30 18:27:10 +00:00
jmcneill
a3657ce00a Use syscon API 2018-06-30 18:20:35 +00:00
jmcneill
5403e5e50e Use syscon API 2018-06-30 18:07:32 +00:00
jmcneill
1ca6c5c5ec Add helper to lookup syscon by phandle 2018-06-30 18:07:12 +00:00
jmcneill
a515ac423f Use syscon API. 2018-06-30 17:54:07 +00:00
jmcneill
e335e77a65 ARM ARM refers to this as "ARM Generic Timer", so adjust printf at attach
to match.
2018-06-30 17:30:37 +00:00
jmcneill
30e8ea9402 Store node path in device properties "fdt-path" property:
# drvctl -p ehci0 fdt-path
    /soc/usb@5101000

While here, remove fdt_scan_bus (no longer required) and some debug printfs.
2018-06-30 17:28:09 +00:00
jmcneill
ca5cdadb4c When cold, manually update timecounters before calling getnanouptime. Now
kernel printf timestamps are updated properly before interrupts are
enabled.
2018-06-30 17:15:01 +00:00
jmcneill
012aca1c0a Attach simplebus on pass 0 2018-06-30 16:48:49 +00:00
jmcneill
7c5742513d cpus: use fdt_add_bus 2018-06-30 16:30:35 +00:00
jmcneill
61fd5480b9 Only install interrupt handler if dwc_gmac_attach succeeds. 2018-06-30 16:28:14 +00:00
jmcneill
89fbd4980d dwc_gmac_attach: return non-zero on failure 2018-06-30 16:27:48 +00:00
jmcneill
78c7f9844a Allow nodes to attach child devices using the same sorting rules as used
by the simplebus driver.
2018-06-30 16:22:56 +00:00
christos
a17e2f9d4b use a switch. 2018-06-30 16:05:44 +00:00
christos
57f6f93a3e Provide an inline to return the data part of the arp packet instead of
open-coding it in multiple places.
2018-06-30 15:08:04 +00:00
riastradh
1cf40ee15d Rearm the Xen timer on resume.
This just moves the timer-arming logic from xen_initclocks into
xen_resumeclocks so that it runs on resume too.

I hypothesize that this is necessary for Xen to resume.  Otherwise,
how could the one-shot timer possibly by rearmed?  On the other hand,
it is conceivable that something automatically rearms it.

This also reorders the initialization so that we establish a timer
interrupt handler first, and _then_ arm the timer.  If the order
matters, it is hard to imagine that the other way is correct:
conceivably, the interrupt could arrive before we've established the
handler, and then there's nothing to rearm it.

Whether this is _sufficient_ for Xen to resume, I don't know.
Symptoms recently reported in
<https://mail-index.netbsd.org/port-xen/2018/06/15/msg009207.html>
look different from how I would expect this to manifest, which is as
a system wedged because there's no no hardclock activity.

ok cherry
2018-06-30 14:59:38 +00:00
riastradh
ec94896e30 Use xcall to suspend/resume clocks on _all_ CPUs, not just current.
Compile-tested only -- kernel still runs but I haven't exercised this
code path.

By code inspection, this change or something like it is obviously
_necessary_ for Xen MP suspend/resume -- otherwise there's no logic
to suspend/resume the clocks on any CPU except the one that actually
triggers sysctl -w machdep.xen.suspend=1.

Whether this change is _sufficient_ for Xen MP suspend/resume to
work, I don't know.

ok cherry
2018-06-30 14:55:13 +00:00
riastradh
a9aa080355 Just use struct cpu_info members for the Xen clock state.
Silly to use percpu(9) for some things and struct cpu_info for
others.
2018-06-30 14:21:19 +00:00
jmcneill
8d4a1027a6 When attaching child devices, consider the best match for all passes
instead of just the current pass. Fixes an issue where a driver with a
lower match number and early pass number will attach instead of a better
match on a later pass.
2018-06-30 13:44:50 +00:00
jmcneill
fec1439d5f add syscon 2018-06-30 12:42:42 +00:00
jmcneill
87578108fb Use syscon API instead of mapping syscon registers ourselves. 2018-06-30 12:36:13 +00:00
jmcneill
5b0333eb17 Add support for system controller nodes. 2018-06-30 12:35:18 +00:00
jmcneill
a1405d385b No need to define our own emac node as this is in the upstream dts now. 2018-06-30 12:23:24 +00:00
kre
873631e713 Fix module build.
Options SUIDSCRIPTS and FDSCRIPTS will be off for the module.
If one (or both) should be enabled, add it to CPPFLAGSin the module Makefile.
2018-06-30 11:10:54 +00:00
jmcneill
a3f3f06c62 Add driver for DesignWare Watchdog Timer. Untested as I can't seem to find
the parent clock for this in the RK3328 documentation.
2018-06-30 10:50:30 +00:00
sevan
ab8dd17d7b vnconfig name is retained for backwards compatibility. Use vndconfig.
Heads up by <tsutsui>
2018-06-30 09:27:41 +00:00
eadler
ea2987652b bsd-family-tree: Add missing DragonFly and FreeBSD releases
Add DragonFly 5.2.1, 5.2.2, FreeBSD 11.2
2018-06-30 01:08:39 +00:00
christos
f3e9eebed2 defflag {SETUID,FD}SCRIPTS 2018-06-30 00:37:37 +00:00
riastradh
8f8bb0d3fd Rewrite Xen timecounter and hardclock timer.
With this change, the Xen timecounter should now be globally
monotonic, as every timecounter is supposed to be.  Should also fix a
litany of races in the timecounter logic.

Proposed last year; see mailing list for further details:
https://mail-index.netbsd.org/port-xen/2017/10/31/msg009112.html

ok cherry
2018-06-29 21:53:12 +00:00
christos
9f321dce94 Add our syslog format. 2018-06-29 20:18:36 +00:00
christos
8910c94cf4 add missing args for 123 2018-06-29 20:18:05 +00:00
maxv
ea978cc53a Add more KASSERTs.
Should help PR/53399.
2018-06-29 19:34:35 +00:00
maxv
a093a9e5c6 Call fpu_eagerswitch a little later, after we make sure newlwp is not
pinned.

Because if it is, the fpu state of the lwp we are context-switching to
is already installed on the current cpu, so no point re-installing it.
Or, it isn't, and in this case we don't want to install it.

This wrong re-installation can occur when we leave a softint.

It may fix bugs in places that call fpusave_lwp with spl != IPL_HIGH,
and that expect the fpu state to stay in memory. As far as I can tell
only cpu_lwp_free meets these conditions, and as far as I can tell
again, there it's harmless.

Should help PR/53399.
2018-06-29 19:21:43 +00:00
sevan
8ec25d68b5 Note vnconfig(8) may be of interest, especially when looking to mount an iso via
loopback.
2018-06-29 19:13:19 +00:00
msaitoh
cd131a6318 Detect USB 3.1. 2018-06-29 17:48:24 +00:00
roy
b729dec75a Remove dhclient from the base system.
Discussed here:
https://mail-index.netbsd.org/tech-userlevel/2018/06/21/msg011233.html
2018-06-29 12:34:13 +00:00
kamil
cd35dc3d84 Rework the changes to DTRACE/ZFS files that were fixing Clang/LLVM build
Rever changes to upstream files and replace them with additional -Wno-
compiler argument flags.

Tested with base LLVM.

Requested by <chuq>
2018-06-29 11:33:46 +00:00
thorpej
3e554dfa58 - Unify the "rtwn" and "urtwn" register definitions and initialization
tables into common header files shared by both drivers.
- Fix some register and bit definitions, from OpenBSD and verified against
  the vendor driver.
- Add some additional register / descriptor defnitions, from OpenBSD.
2018-06-29 04:02:10 +00:00