Commit Graph

278350 Commits

Author SHA1 Message Date
christos 1d895808a5 Fix skipping of directories that begin with a '.' in -R mode.
It is not enough to avoid displaying the contents of the directory,
we need to set FTS_SKIP to avoid descending into any subdirs too.
Otherwise, if a ".foo" directory has a subdirectory "bar", ls will
descend into bar and display its contents. From Todd Miller
2020-07-07 14:29:06 +00:00
rin a0f5a77ba6 rascons_init_rasops(): Initialize color palette only for macppc.
Fix build failure for ofppc.
2020-07-07 13:57:20 +00:00
simonb 3616bcfaa5 Sort missing IDs (users and groups) by the numeric ID. 2020-07-07 12:01:21 +00:00
rin 926200353e PR bin/55468
Fix crash due to out-of-bounds access with Ctrl-W.

PR is only for nottywerase, but also fix ttywerase case, taken from
OpenBSD via nvi2:

http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/vi/vi/v_txt.c#rev1.23
5d5365d358

Also, comment there is no worry for altwerase specific code, which
seems suspicious at a glance.

Reported by Azuma OKAMOTO.
Thanks for detailed explanation how to reproduce the problem!
2020-07-07 10:58:43 +00:00
skrll d8434ea326 KASSERT polling or holding sc_lock in a few more places.
kern/52569: Entering ddb using USB keyboard panics with "locking against myself"
2020-07-07 10:02:17 +00:00
msaitoh d245628f58 - Remove the waitfor argument from mii_phy_auto().
- Whitespace fix.
2020-07-07 08:44:12 +00:00
msaitoh 53f3973f63 - Call tlphy_auto correctly.
- It's not required to do busy-wait by mii_phy_auto(sc, 1). Now there is
 no any PHY driver which calls mii_phy_auto(sc, 1).
2020-07-07 08:35:16 +00:00
msaitoh 1f74e5c827 "no media present" is intended case on tlphy(4), so don't use
aprint_error_dev().
2020-07-07 06:59:22 +00:00
msaitoh 1f34756c5d No functional change:
- u_int32_t -> uint32_t
 - KNF.
2020-07-07 06:27:37 +00:00
thorpej ca8ce3aeb1 Overhaul the interface to pci_configure_bus():
- Don't expose how PCI bus configuration resource management is implemented.
  Provide a new resource provider API:

  ==> pciconf_resource_init() -- Initialize a PCI configuration resources
      container.
  ==> pciconf_resource_add() -- Add a PCI configuration resource to the
      container (I/O, MEM, or prefetchable MEM).  Multiple resources of
      each type may be added.
  ==> pciconf_resource_fini() -- Tear down the PCI configurtation resources
      container once the bus has been configured.

  This is much easier to use than the previous method of providing an
  extent map for each kind of resource, and works better for e.g. ACPI
  platforms that provide potentially multiple PCI resources in tables
  provided by firmware.

- Re-implement PCI configuration resource management using vmem arenas,
  rather than extent maps.
2020-07-07 03:38:45 +00:00
thorpej 8635cb3dd6 Explicitly include <sys/pool.h> here; don't rely on it being included
by the includer.
2020-07-07 03:23:33 +00:00
rin adeeb717b4 Enable COPY_SYMTAB in case of directly booted from Open Firmware
with ofwboot being skipped.
2020-07-07 02:39:59 +00:00
rin b79e24cb90 Sync wscons colors with GENERIC; now it works fine! 2020-07-07 02:37:27 +00:00
rin 7a83765833 It turned out that using some Open Firmware routines causes the system
freeze after calling OF_quiesce().

This is why setting color palette crash the system for some Power Mac G5
models, like PowerMac11,2.

Therefore, stop using color-palette and backlight callbacks for genfb(4)
in this case.

Also, postpone OF_quiesce() after rascons_init_rasops(), and initialize
color palette there if OF is going to be quiesced and color depth is 8.

Now, color palette for wscons is initialized correctly for PowerMac11,2.
2020-07-07 02:33:54 +00:00
rin 0dc6e1315d Fix boot failure for PowerMac11,2 when ``auto-boot?'' is true.
For some machines like PowerMac11,2, Open Firmware does not correctly
initialize console-related variables, like font-adr and line#, when
``auto-boot?'' is true; -1 is returned instead of correct values.

Fall back to wsfont embedded in kernel in this case. Also, do not use
line# if it is negative.
2020-07-07 02:10:20 +00:00
rin 9552a516cb Part of PR port-powerpc/55425
openssl fails on FPU emulation for powerpc

When machdep.fpu_present sysctl variable can be retrieved, and
its value is zero, avoid using FPU arithmetic.

FPU is absent and emulated by kernel in that case, and calculation
results are not correct in bit-to-bit precision.

This behavior should be useful even if we could fix FPU emulation;
it is much faster to skip FPU arithmetic in general, rather than
relying upon emulation by kernel via illegal instruction handler.
2020-07-07 01:47:47 +00:00
rin 49bfe4a5c4 Part of PR port-powerpc/55425
openssl fails on FPU emulation for powerpc

Provide machdep.fpu_present sysctl variable like other ports.

Userland can get informed that FPU is absent and emulated in software
(and calculation results may not be correct in bit-to-bit precision).

This variable should be useful even if we could fix FPU emulation;
it is much faster to skip FPU arithmetic in general, rather than
relying upon emulation by kernel via illegal instruction handler.
2020-07-07 01:39:23 +00:00
rin 49d0e22cdf Revert previous; tmpfs should be fixed instead.
Pointed out by thorpej@, thanks!
2020-07-07 00:59:29 +00:00
rin 85af57ca4b For booke, fix signo and other siginfo returned for userland by
syncing with oea and ibm4xx.

Now, tests/kernel/t_trapsignal:bus_handle and friends pass on booke.
2020-07-07 00:49:09 +00:00
rin 4ac28b877c Do not clear pcb_onfault for error path of setfault().
This is caller's responsibility, and all the callers actually do so.
2020-07-07 00:41:32 +00:00
rin 9cb29a6afc For booke, restore callee saved registers when recovery for page fault
fails for kernel.

OOPS! How on the earth we had overlooked this error so far...
2020-07-07 00:37:46 +00:00
rin f3f89b215c Fix kernel panic due to tmpfs.
pmap for booke assumes that the ``va'' argument for pmap_kenter_pa(9) is
page-aligned. However, by recent changes, tmpfs became to use ``va'' with
page offset via ubc_uiomove(9). So, truncate it to page boundary.
2020-07-07 00:28:30 +00:00
uwe 70f6ed9ef6 Pads are not to be automatically refreshed on input.
X/Open Curses says in the documentation for newpad():

  Automatic refreshes of pads (e.g., from scrolling or echoing of
  input) do not occur.

And in the documentation for get*():

  If the current or specified window is not a pad, and it has been
  moved or modified since the last refresh operation, then it will be
  refreshed before another character is read.

From Michael Forney in PR lib/55457
2020-07-06 23:33:38 +00:00
jmcneill 026e4ac043 Add -R flag to specify a README file to add at the bottom of directory
autoindex listings.
2020-07-06 23:31:36 +00:00
uwe f6dea36d0e mvwins*(WINDOW *win, ...) functions - call wins* on win, not stdscr.
From Naman Jain in PR lib/55460.
2020-07-06 22:46:50 +00:00
rin 30c3dcd174 Include missing opt_lockdebug.h. 2020-07-06 22:32:22 +00:00
fcambus 5e2629248f Use C99 initializers in wsdisplay_font struct definitions for
Spleen kernel fonts.
2020-07-06 20:19:14 +00:00
christos e837be8744 - always set both ip and ip6, otherwise a kernel assertion can be triggered
- move alignment early so that we do less work
2020-07-06 18:49:12 +00:00
christos e6556af56e new mapped test. 2020-07-06 18:47:02 +00:00
christos a314e6f743 add a test for v4 mapped addresses 2020-07-06 18:45:25 +00:00
riastradh 12ad556adb Restore the lwp's fpu state, not zeros, and leave with fpu enabled.
We need to clear the fpu state anyway because it is likely to contain
secrets at this point.  Previously we set it to zeros, and then issued
stts to disable the fpu in order to detect the mistake of further use
of the fpu in kernel.  But there must be some path I haven't identified
yet that doesn't do fpu_handle_deferred, leading to fpudna panics.

In any case, there's no benefit to restoring the fpu state twice
(once with zeros and once with the real data).  The downside is,
although this avoids spurious fpudna traps, using fpu_kern_enter in a
softint has the side effect that -- until the next userland context
switch triggering stts -- we no longer detect misuse of fpu in the
kernel in that lwp.  This will serve for now, but we should find
another way to issue clts/stts judiciously to detect such misuse.

May improve the continued symptoms of
https://mail-index.netbsd.org/current-users/2020/07/02/msg039051.html
although may not fix everything.
2020-07-06 18:30:48 +00:00
christos 8049036801 don't open the socket twice. 2020-07-06 16:24:06 +00:00
rin b2a25713ef Use (CI_SAVEMAX*CPUSAVE_LEN) as CPUSAVE_SIZE for MODULAR || _MODULE,
since it exceeds 128 (256 for now).

XXX
We should use CTASSERT here, but it conflicts with genassym...
2020-07-06 13:20:55 +00:00
rin 626c0d3c75 Set cpu_psluserset, cpu_pslusermod, cpu_pslusermask for MODULAR. 2020-07-06 13:10:19 +00:00
rin 8b33b85dcb Stop using DDBX which is defined nowhere. 2020-07-06 11:24:57 +00:00
rin 6cda7def08 This file is not used for ibm4xx. 2020-07-06 11:23:59 +00:00
rin 1ab49ea065 Include required opt_*.h for sure. 2020-07-06 11:09:15 +00:00
rin 71e435233f - Drop unused opt_multiprocessor.h.
- Include missing opt_ppcarch.h.
2020-07-06 11:08:21 +00:00
rin ff15f7629d Drop unused opt_altivec.h and opt_multiprocessor.h. 2020-07-06 11:07:39 +00:00
rin 5d3942491b Drop unused opt_lockdebug.h. 2020-07-06 11:06:52 +00:00
rin aecb1b8aa5 - Drop unused opt_ddb.h.
- Include missing opt_ppcarch.h.
2020-07-06 11:05:54 +00:00
rin 35eebeea98 Drop unused opt_ppcarch.h. 2020-07-06 11:05:05 +00:00
rin 39209f775b Drop unused opt_interrupt.h. 2020-07-06 11:02:44 +00:00
rin 3969ec7243 Drop unused opt_altivec.h, opt_interrupt.h, opt_ipi.h, and opt_pic.h. 2020-07-06 11:01:24 +00:00
rin 099eb7c2c5 - Drop unused opt_compat_netbsd.h.
- Include missing opt_multiprocessor.h.
2020-07-06 10:59:37 +00:00
rin feee965756 Drop unused opt_ppcparam.h. 2020-07-06 10:58:06 +00:00
rin ea38276975 Include missing opt_modular.h so that struct vm_page_md is compatible to
that for booke.
2020-07-06 10:57:03 +00:00
rin a313c274d6 Include missing opt_multiprocessor.h. 2020-07-06 10:54:56 +00:00
rin d7e3eb5d52 Drop unused opt_multiprocessor.h includes. 2020-07-06 10:52:12 +00:00
rin a37f3167d0 Drop unused opt_lockdebug.h. 2020-07-06 10:50:32 +00:00