Commit Graph

272969 Commits

Author SHA1 Message Date
christos
08f54aa8c8 Don't add the 2 reserved clusters before we determine if we using fat16/fat32.
From FreeBSD: https://reviews.freebsd.org/D23082:

Correct off-by-two issue when determining FAT type.

In the code we used NumClusters as the upper (non-inclusive) boundary
of valid cluster number, so the actual value was 2 (CLUST_FIRST) more
than the real number of clusters. This causes a FAT16 media with
65524 clusters be treated as FAT32 and might affect FAT12 media with
4084 clusters as well.

To fix this, we increment NumClusters by CLUST_FIRST after the type
determination.
2020-01-11 16:29:07 +00:00
isaki
febfde9c6a Simplify async_mixer handling.
- It makes FIOASYNC code in mixer_ioctl() symmetric.
- For readability, mixer_async_{add,remove}() should take pid argument
  though pid is always curproc.
2020-01-11 04:53:10 +00:00
isaki
5ce2968c43 Remove old debug #ifdefs. 2020-01-11 04:06:13 +00:00
ad
3579ac3a50 UVM_PAGE_TREE_PENALTY isn't used any more. 2020-01-10 21:32:17 +00:00
christos
c6368baa64 use getline(3) 2020-01-10 18:35:29 +00:00
leot
792a71dec7 Add WP
From Rocky Hotas, thanks!
2020-01-10 16:18:21 +00:00
maya
67719436d2 Fix markup typo. 2020-01-10 14:56:00 +00:00
maya
4fece28851 Add some more licenses appearing in external.
Remove mentions of src/gnu that no longer exists.
Mention /usr/pkg/etc.
Bump date
2020-01-10 12:58:41 +00:00
martin
72be7ecea1 When asked to create a whole-disk partition for unknown usage, do not only
assert(false), but actually return an error (in case "assert" is a nop).
2020-01-10 12:55:14 +00:00
nia
1ab4db0dc0 Use first-level heading for "NetBSD" title in README.md 2020-01-10 12:33:28 +00:00
martin
a4b2d71dd5 Move the LABELSECTOR check and make it FS type specific - some partition
types (FFS, RAID) are allowed to overlap with the LABELSECTOR.
2020-01-10 10:47:35 +00:00
ad
0ba41c3f95 NetBSD 9.99.36 - scheduler changes 2020-01-10 09:47:19 +00:00
macallan
9fa0c92ad0 add lmu driver 2020-01-10 06:26:34 +00:00
macallan
2abd9a468e add driver for the ambient light sensor / keyboard light controller found in
PowerBook5,6 and probably others
2020-01-10 06:24:17 +00:00
martin
46aea08b01 PR install/54777: add dhcpcd to the install ramdisk 2020-01-09 20:07:46 +00:00
martin
484980a3f3 When reading the secondary disklabel partitions from an existing disklabel
set the mbr partitions as parent.
2020-01-09 19:51:49 +00:00
martin
a879768d74 PR install/54780: in the (of course totally unlikely) case that sysinst
should crash, run "stty sane".
2020-01-09 19:17:40 +00:00
macallan
a6cd3ae8c8 defflag KI2C_DEBUG 2020-01-09 18:49:06 +00:00
macallan
627d9cb448 if we have more than one i2c-bus node, look for children on both
now we find the light sensor in my shiny new toy
2020-01-09 18:47:46 +00:00
martin
c604f98ede Instead of a (bogus) attempt to query the model via ofctl, use the (now
fixed) sysctl hw.model instead.
2020-01-09 17:06:46 +00:00
ad
c5b060977a - Many small tweaks to the SMT awareness in the scheduler. It does a much
better job now at keeping all physical CPUs busy, while using the extra
  threads to help out.  In particular, during preempt() if we're using SMT,
  try to find a better CPU to run on and teleport curlwp there.

- Change the CPU topology stuff so it can work on asymmetric systems.  This
  mainly entails rearranging one of the CPU lists so it makes sense in all
  configurations.

- Add a parameter to cpu_topology_set() to note that a CPU is "slow", for
  where there are fast CPUs and slow CPUs, like with the Rockwell RK3399.
  Extend the SMT awareness to try and handle that situation too (keep fast
  CPUs busy, use slow CPUs as helpers).
2020-01-09 16:35:03 +00:00
maxv
f0ac038b23 Registering the host's CR0 is done outside of the VCPU loop, so it must be
cleared because it is also cleared inside the loop.

Not clearing it could trigger DNAs on VMEXITs, because STTS/CLTS are still
here as part of debugging since my FPU overhaul.
2020-01-09 16:27:57 +00:00
martin
2fac6cb259 When attaching the first fdtbus, use the root "comptabile" (or failing that:
"model") property to set the cpu model (in userland aka sysctl hw.model).
When attaching the first cpu, do not overwrite a cpu model if it already
had been set.
2020-01-09 16:23:41 +00:00
maxv
3cae8f6437 Mmh, as noted in PR/54847, this should be uint64_t, not uint16_t. Harmless
because we use only the two lowest bits anyway.

I believe this could be caught by KUBSAN; time to do another round of
NVMM+K_SAN testing.
2020-01-09 16:20:12 +00:00
ad
56f477e67b Add a recommendation for SMT to not split threads. XXX This should report
topo info to help the decision.
2020-01-09 15:50:16 +00:00
martin
abce8cb394 Finish conversion of extended partitioning parts to new abstract
backend interface. XXX still could use a lot of polishing.
2020-01-09 13:22:30 +00:00
msaitoh
82b4e8d166 Acquire/release host semaphore to share SMBus between the host and
the embedded controller (IMC).

 Without this change, "shutdown -r" does power off and not boot on ECS HDC-I2.
This change fixes the problem.
2020-01-09 12:49:12 +00:00
msaitoh
cc226cbe2a Reduce diff against OpenBSD. No functional change.
- USE CSR_{READ,WRITE}_*() macro.
- Move some macros from if_stge.c to if_stgereg.h
2020-01-09 10:54:16 +00:00
kamil
576cdd6361 Add missing compat define of PT32_GETXSTATE
Fixes i386 build.

Reviewed by <mgorny>
2020-01-09 10:46:31 +00:00
ad
fc833de53f Use __SHIFTIN()/__SHIFTOUT(). Suggested by riastradh@. 2020-01-09 10:43:45 +00:00
yamaguchi
edcbb7646e Make some parametes in ixl(4) be able to change when loading
for debugging

- nomsix(boolean)
   - disable msix support
- stats_interval(signed integer)
   - change interval for collecting statistic counters
- nqps_limit(signed integer)
   - limitation for the number of queue pairs
- {tx,rx}_ndescs(unsigned integer)
   - the number of discriptors in txqueue or rxqueue
2020-01-09 08:54:05 +00:00
thorpej
a7ebfbc5bb Re-enable the intr / mask / softint / unmask dance now that the x86
interrupt issue is fixed.  Verified working by ryoon@ (thanks!).
2020-01-09 04:04:01 +00:00
yamaguchi
ac53db4aac ixl(4) supports in-chip statistic counters per VSI 2020-01-09 02:55:41 +00:00
yamaguchi
6cade11055 ixl(4) supports in-chip statistic counters per port 2020-01-09 02:43:45 +00:00
ryo
6c4b616d74 fix behaviour mmap()/mprotect() when passed only PROT_EXEC.
when mmap()/mprotect() with only PROT_EXEC, syscall will be successful,
but the page actually hadn't been mapped.
it should be mapped with PROT_READ|PROT_EXEC implicitly. (r-x)
2020-01-09 01:38:34 +00:00
manu
aadbe7d326 Rollback multiboot2 for amd64, as requested by core 2020-01-09 00:42:24 +00:00
macallan
ed787f4d25 send PMF events for volume and brightness control keys on Apple keyboards 2020-01-08 23:28:56 +00:00
christos
0fb78fffb4 Back out previous. This has no chance to work unless the make variable parsing
is not changed do that instead of scanning for a single character delim ':',
it scans for "?:". This is because !empty(COMPILE.c:M*-pg*) contains a ':'.
2020-01-08 22:04:24 +00:00
skrll
c88f2c1a4e oldlwp is always non-NULL in cpu_switchto so remove the test for NULL. 2020-01-08 20:59:18 +00:00
skrll
cb88287373 Use fat16 as the partition is too small for fat32. from Harold Gutch 2020-01-08 20:49:22 +00:00
jmcneill
6372dd6bcf cpu_hatch is too late to report AP topology, do it at attach time instead 2020-01-08 18:47:43 +00:00
ad
2ddceed1d9 Hopefully fix some problems seen with MP support on non-x86, in particular
where curcpu() is defined as curlwp->l_cpu:

- mi_switch(): undo the ~2007ish optimisation to unlock curlwp before
  calling cpu_switchto().  It's not safe to let other actors mess with the
  LWP (in particular l->l_cpu) while it's still context switching.  This
  removes l->l_ctxswtch.

- Move the LP_RUNNING flag into l->l_flag and rename to LW_RUNNING since
  it's now covered by the LWP's lock.

- Ditch lwp_exit_switchaway() and just call mi_switch() instead.  Everything
  is in cache anyway so it wasn't buying much by trying to avoid saving old
  state.  This means cpu_switchto() will never be called with prevlwp ==
  NULL.

- Remove some KERNEL_LOCK handling which hasn't been needed for years.
2020-01-08 17:38:41 +00:00
mgorny
b4d38fb000 Add tests for reading registers from x86 core dumps 2020-01-08 17:23:34 +00:00
mgorny
7d1a2cdc58 Combine x86 register tests into unified test function
Reduce the code duplication and improve maintainability of x86 register
tests by combining all of them to a single base function.
2020-01-08 17:23:15 +00:00
mgorny
adb864df5e Fix alignment when reading core notes
Both desc and note header needs to be aligned.  Therefore, we need
to realign after skipping past desc as well.

While at it, fix the other alignment fix to use roundup() macro.
2020-01-08 17:22:40 +00:00
mgorny
77791248de Include XSTATE note in x86 core dumps
Introduce a simple COREDUMP_MACHDEP_LWP_NOTES logic to provide machdep
API for injecting per-LWP notes into coredumps, and use it to append
PT_GETXSTATE note.

Since the XSTATE block uses the same format on i386 and amd64, the code
does not have to conditionalize between 32-bit and 64-bit ELF format
on that.  However, it does need to distinguish between 32-bit and 64-bit
PT_* values.  In order to do that, it reuses PT32_* constant already
present for ptrace(), and adds a matching PT64_GETXSTATE to satisfy
the cpp logic.
2020-01-08 17:21:38 +00:00
ad
41a8f863b8 lockdebug_barrier(): allow the one permitted lock to be a sleep lock too. 2020-01-08 16:21:34 +00:00
ad
bf76aaa957 Make "mach cpu" in ddb show the IPL for each cpu. 2020-01-08 15:47:50 +00:00
macallan
df3da34f6a add lmtemp, found in some late powerbooks 2020-01-08 14:21:12 +00:00
ad
82106a470c NetBSD 9.99.35 - namecache changes 2020-01-08 14:04:06 +00:00