Commit Graph

297849 Commits

Author SHA1 Message Date
bouyer fa9ca3cca2 Adjust privcmd_notify() so it has a chance to work in a PVH environnement too. 2022-09-01 12:26:00 +00:00
riastradh 092adc4c94 drmfb: Take is_console property from parent, not from self.
The parent is the pci or platform device that firmware knows about.
The `drmfb' device is more of a fictitious invention of the drm stack
that exists for the convenience of the genfb abstraction which needs
device_private to be a struct genfb_softc.

Let's see if this does any better than the last attempt to rework the
logic here.
2022-09-01 12:01:36 +00:00
riastradh 33464fc593 i915: Stop pretending the GTT size is zero as workaround.
Whatever bug this was I don't know how to reproduce any more.
Convinces Mesa iris_dri.so to work on this kernel.
2022-09-01 11:49:23 +00:00
riastradh ed809c7ce7 drm_mm: Give up on trying to phrase find_hole with public rbtree API.
Firefox works with WebGL on Mesa iris_dri.so now.
2022-09-01 11:48:59 +00:00
msaitoh d7198e62f3 KNF. No functional change. 2022-09-01 10:10:20 +00:00
riastradh 8940082214 drm: Fix dma fence stub fix so the lock is actually initialized.
Tested but forgot to amend change before exporting to CVS again.
2022-09-01 09:37:06 +00:00
rin e7be9b6f6b Do not raise SNaN exception for QNaN. 2022-09-01 06:10:58 +00:00
rin 5ef7ca99eb Set FPSCR[FPRF] for calculated result, for all instructions
that are documented to update this field.

Exceptions are fcti{w,d}{,z}; FPSCR[FPRF] becomes undefined,
according to Power ISA. We do not overwrite this field for
these insns at the moment.
2022-09-01 06:08:16 +00:00
rin 62f3100b4b static-fy fpu_fto[ixsd](). NFC. 2022-09-01 05:58:19 +00:00
rin 2acd85f535 Further fix for fcti{w,d}{,z}.
- Treat {Q,S}NaN correctly.
- Set exception bits appropriately.
- Introduce round_int().
2022-09-01 05:56:52 +00:00
rin 97361ac471 Remove stale comment. 2022-09-01 05:51:51 +00:00
thorpej a3c9a952a3 pktq_rps_hash(): Make the "funcp" argument const. 2022-09-01 05:04:22 +00:00
thorpej 0077b7b35c pktq_dequeue(): Prevent packets from getting stuck beind barrier markers.
pktq_barrier() ensures that all packets enqueued before the barrier have
been dequeued before the barrier returns.  However, previously, pktq_dequeue()
would return NULL when a barrier marker was encountered.  If there were
packets queued up behind the marker and no additional softint were scheduled
for the pktqueue, those packets would end up stranded.  pktq_dequeue() now
continues to the next slot after the marker, ensuring that processing can
continue after the barrier has been signaled.
2022-09-01 02:35:06 +00:00
riastradh d83a40f33c drm: Fix dma fence stub so it works with locking operations. 2022-09-01 01:54:38 +00:00
riastradh b4008985b6 drm_mm: Match __drm_mm_interval_first semantics.
- Use the right search criterion.
- Return &mm->head_node, not NULL, if not found.
2022-09-01 01:54:28 +00:00
bouyer 4a760274ce If we check XENPV, make sure to #include "opt_xen.h" 2022-08-31 14:00:44 +00:00
bouyer 8047ea2d23 Remove XENPV support from xenmem; it's only used for !XENPV at this time. 2022-08-31 12:53:27 +00:00
bouyer f461aebfae Work in progress on dom0 PVH support: ioctl support for tools.
Basically, in PVH mode (where XENFEAT_auto_translated_physmap is enabled),
the hypervisor will not map foreing ressources in our virtual address
space for us. Instead, we have to pass it an address in our physical
address space (but not mapped to some RAM) where the ressource will show up
and then enter this PA in pour page table.

For this, introduce xenmem_* which manage the PA space. In PVH mode this
is just allocated from the iomem_ex extent.

With this, I can start a PV domU, and the guest's kernel boots (and
the console works). It hangs because the backend driver can't map the
frontend ressources (yet).

Note that, per https://xenbits.xen.org/docs/unstable/support-matrix.html,
dom0 PVH support is still considered experimental by Xen.
2022-08-31 12:51:56 +00:00
riastradh c5301d0824 dtrace_sdt: Fix bug in builtin module reference counting.
Don't module_hold(NULL)!  This mistake was introduced in my attempt
to get dtrace working for sdt probes defined in non-builtin modules
like zfs.
2022-08-31 12:34:04 +00:00
riastradh cf221fb572 reallocarr(3): Touch up xrefs. 2022-08-31 12:18:41 +00:00
riastradh a2fb076e11 reallocarr(3): Bump date. Note overflow is handled internally. 2022-08-31 12:17:14 +00:00
riastradh 249e1d8c11 reallocarr(3): Clarify semantics. 2022-08-31 12:10:05 +00:00
msaitoh 1bfc2d5f90 Fix previous to make it compile again. 2022-08-31 05:24:41 +00:00
riastradh f29b0cae59 crashme(9): New debug.crashme.mutex_recursion method.
Takes a lock twice.  Set it to 1 for adaptive lock, 2 for spin lock.
2022-08-30 22:38:26 +00:00
riastradh 4707b092a7 lockdebug(9): Try to show symbol names if possible.
Also print the possible owner in ddb/crash `show lock' even if the
kernel is built without LOCKDEBUG.

Output may not be as pretty before with two neatly aligned columns,
but that can be changed; for now the value of having the symbols
printed instead of just obscure hex addresses (which one's an lwp
address and which one's a code pointer? can never remember!) should
outweigh the prettiness temporarily lost.
2022-08-30 22:38:17 +00:00
riastradh 5ec46ddfac ddb(9): Make db_symstr safe to use concurrently with pserialize(9). 2022-08-30 22:38:01 +00:00
riastradh 953ad39a79 ddb(4): Use db_num_to_strbuf in db_symstr.
Simplifies it and will make safer to use.
2022-08-30 22:37:36 +00:00
riastradh 3566aefb0b ddb(9): New db_num_to_strbuf.
Like db_num_to_str, but writes to caller-provided buffer instead of
returning pointer to static storage.
2022-08-30 22:37:03 +00:00
riastradh b672ca148d /etc/ssh: Install ssh_known_hosts with mode 644.
Makes it agree with the mtree and more convenient for admin to edit.

XXX pullup-8
XXX pullup-9
2022-08-30 22:36:48 +00:00
martin 3a0698b068 Simplify name trimming following a suggestion from rillig. 2022-08-30 15:27:37 +00:00
riastradh 03cefdfdcf etc: Fix permissions of various editable configuration files.
This way they match the mtree and make sense and don't cause editors
to ask to override read-only files when editing them.

Exception: Not sure /etc/bluetooth/protocols makes as much sense to
edit, but the mtree says 644, so if you want to change it, make sure
to change it in both places -- Makefile and mtree.

XXX pullup-8
XXX pullup-9
2022-08-30 13:40:37 +00:00
riastradh d5d881d693 /root: Install .cshrc and .profile links with the same mode.
Previously we would:

1. Install /root/.cshrc and /root/.profile with mode FILESMODE=644 as
   requested in src/etc/root/Makefile and as echoed in
   /etc/mtree/special.

2. Create hard links at /.cshrc and /.profile through CONFIGLINKS.

3. Because LINKSMODE was unset and defaults to NOBINMODE=444, change
   the mode to 444.

This scenario is confusing, and mtree objects to it, which is bad for
warning fatigue in a security-relevant mechanism.  (There are also
several other files mtree objects to out of the box -- we should fix
those too.)

With this change we install the links with the same mode as the
original files, in agreement with the mtree.  The files, .cshrc and
.profile, are intended to be editable configuration files, so 644
makes sense while 444 makes no sense and gets in the way of editors
like vi.

Discussed on tech-userlevel:
https://mail-index.netbsd.org/tech-userlevel/2022/08/29/msg013498.html

XXX pullup-8
XXX pullup-9
2022-08-30 13:14:48 +00:00
martin 692793ef41 Fix typo (pointed out by rillig) 2022-08-30 11:45:28 +00:00
martin 61e8f3dfee Invoke magic C promotion rules as originally intended - oops!
Pointed out by rillig@
2022-08-30 11:44:15 +00:00
rin 2a0258e422 Fix fcti{w,d}{,z}.
- Treat 64-bit integer correctly for fctid{,z}.
- Respect round mode specified by FPSCR[RN].

XXX
- Set FPSCR[FR] and [FI] appropriately.
- Also set FPSCR[FPRF]?
- fctid{,z} traps on powerpc32 (confirmed on 603e and G4).
2022-08-30 11:09:34 +00:00
rin c880b8ffef Move FTYPE_* definitions from instr.h to fpu_emu.h.
They are not defined by architecture, and used only for FPU emulation.
2022-08-30 11:05:59 +00:00
riastradh 06b9790dd4 x86: Rename x86/efi.c -> x86/efi_machdep.c.
Avoid collision with dev/efi.c.
2022-08-30 11:03:36 +00:00
rin fd170bda49 Do not assert FPSCR[UX] when overflow. 2022-08-30 11:00:49 +00:00
rin bb2c4f4391 Fix fsel; frB is chosen when frA is negative or NaN.
For fpu_emu.c rev 1.41 or prior, wrong register was chosen for
NaN with sign bit being cleared.
2022-08-30 10:59:43 +00:00
rin bcec730863 Fix mcrfs; Clear copied exception bits, and do not raise any exception. 2022-08-30 10:55:06 +00:00
rin a4da158f33 Misc clean up for mtfsf{,i}. NFC. 2022-08-30 10:53:12 +00:00
rin 0e21243cbe Fix mtfsb[01]; these can clear/set any FPSCR bits other than FEX and VX. 2022-08-30 10:50:56 +00:00
rin 1b2567fe98 Fix logic for FPSCR[FEX].
It is logical OR (similar to FPSCR[VX]) of raised exception bits for
enabled exceptions.
2022-08-30 10:48:31 +00:00
rin 69d24959db Revert rev 1.29:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/powerpc/fpu/fpu_emu.c#rev1.29

> FPSCR[FEX] is not a sticky bit; it is always cleared when read from
> userland via mffs on real hardware.

This turned out to be wrong. FEX is actually observed for 603e.
2022-08-30 10:43:38 +00:00
christos 42e6ad3ad9 Add cert verification, together with an environment variable "NO_CERT_VERIFY",
to turn it off.
2022-08-30 08:51:28 +00:00
riastradh 4b3ee8b4fa cgdconfig(8): Gracefully handle failed verification with shared keys.
The first time each key is verified, if verification fails, we chuck
the failed key and try again with passphrase re-entry.

But if a key has already been verified, and verification fails,
assume something is wrong with the disk and fail.
2022-08-30 08:48:41 +00:00
riastradh e3088cb1a5 nvme(4): Actually check if bp is null as commented previously.
I had tested this change, but forgot to amend the commit before
exporting to CVS.
2022-08-30 08:48:24 +00:00
rin 51f0641c51 Document SCSI sync transfer support for AV Macs. 2022-08-30 08:17:15 +00:00
leot ac8a7a7063 Fix capitalization of NetBSD.org
Noticed via htutils/scripts/case-netbsd script.
2022-08-30 07:29:44 +00:00
rin 5eafc22a16 Drop one more register qualifier. 2022-08-30 01:48:09 +00:00