Commit graph

8271 commits

Author SHA1 Message Date
cinap_lenrek
27a83106f4 oexportfs: move legacy code for cpu and import to separate program
The initial protocol handling in exportfs for
cpu and import services is a huge mess.

Saparate the code out into its own program with
its own oexportfs(4) manpage.
2020-12-13 20:09:03 +01:00
cinap_lenrek
0b33b3b8ad kernel: implement per file descriptor OCEXEC flag, reject ORCLOSE when opening /fd, /srv and /shr
The OCEXEC flag used to be maintained per channel,
making it shared between all the file desciptors.

This has a unexpected side effects with regard to
channel passing drivers such as devdup (/fd),
devsrv (/srv) and devshr (/shr).

For example, opening a /srv file with OCEXEC
makes it impossible to be remounted by exportfs
as it internally does a exec() to mount and
re-export it. There is no way to reset the flag.

This change makes the OCEXEC flag per file descriptor,
so a open with the OCEXEC flag only affects the fd
group of the calling process, and not the channel
itself.

On rfork(RFFDG), the per file descriptor flags get
copied.

On dup(), the per file descriptor flags are reset.

The second modification is that /fd, /srv and /shr
should reject the ORCLOSE flag, as the files that
are returned have already been opend.
2020-12-13 16:04:09 +01:00
cinap_lenrek
b2b2d2cb4c sdiahci: assume 64-bit PCIWADDR() 2020-12-12 18:16:06 +01:00
cinap_lenrek
5ea540e75d sdiahci: enable pci busmaster before ahciconfigdrive() (fix qemu crash)
enable pci busmaster before set the fis-receive-enable
bit in the port command register.

not doing so triggers a crash in qemu like:

address_space_unmap: Assertion `mr != NULL' failed.

as qemu tries to process the dma command list as soon
as we set that flag and busmaster dma needs to be enabled
at this point.
2020-12-12 18:00:41 +01:00
cinap_lenrek
b1d1fa04b9 merge 2020-12-11 15:24:35 +01:00
cinap_lenrek
fc0f08c651 pc, pc64: make sure write combining is supported in MTRR's before setting it 2020-12-11 15:23:03 +01:00
cinap_lenrek
658c994cff pc, pc64: ignore MTRR's when MTRRCap.vcnt and MTRRCap.fix are zero
Bhyve returns 0 in MTRRCap register, so we
can use that instead on relying on cpuid only
to see if MTRR's are supported.

That way we can get rid of the sanity check
in memory.c.
2020-12-11 15:21:44 +01:00
Sigrid
345e93dd4c update Finnish kbmap: fix ¤ on shift+4 and add more AltGr variants 2020-12-11 15:18:41 +01:00
Sigrid
f5d1fce9b5 vmx: clean up mksegment, memset only if segment existed (devsegment clears new ones) 2020-12-10 12:19:45 +01:00
Sigrid
d7120ecb77 src: work on awk scripts too, see "src valley" (thanks phil9) 2020-12-10 10:33:42 +01:00
cinap_lenrek
cef91f23e7 pc, pc64: work around bhyve all uncached MTRR's 2020-12-10 01:47:19 +01:00
cinap_lenrek
635be84831 merge 2020-12-09 01:05:14 +01:00
cinap_lenrek
eb3d055eb3 backout OCEXEC changes when potentially opening /srv files
Opening a /srv file sets the close-on-exec flag on the
shared channel breaking the exportfs openmount() hack.

The devsrv tries to prevent posting a channel with the
close-on-exec or remove-on-close flags. but nothing
currently prevents this poisoning on open.

Until this gets fixed in eigther exportfs or devsrv,
i'll back out the changes that could have potential side
effects like this.
2020-12-09 01:04:03 +01:00
kvik
07d3d9bf0c sega(1): fix keys (thanks bigato) 2020-12-08 21:20:13 +01:00
cinap_lenrek
5149f204b7 plan9.ini(8): document *nomtrr= and order the table 2020-12-08 17:16:12 +01:00
cinap_lenrek
8efbd243e1 pc, pc64: cleanup cpuidentify() and some comments 2020-12-08 16:58:41 +01:00
cinap_lenrek
b2ffb6ccc5 pc, pc64: add *nomtrr= kernel parameter 2020-12-08 16:34:36 +01:00
cinap_lenrek
263dc8093d pc64: preserve reserved bits in CR0/CR4 for amd64 in mtrr setstate()
On AMD64, CR0/CR4 are 64-bit registers, with
the upper half reserved. So use uintptr type
to store the register values to get 32 bit on 386
and 64 bit on AMD64.
2020-12-08 16:00:57 +01:00
cinap_lenrek
4db8a82f5a vncv: backing out previous change, this needs another revision 2020-12-08 15:15:13 +01:00
Sigrid
b1da2bb10b vncv: do NOT map Kaltgr to meta, introduce Mod4 (Super) as an extra key to use instead 2020-12-08 14:32:28 +01:00
Sigrid
93c6f8cb0d vmx(1): build vmxgdb by default, clean it up as well 2020-12-08 13:18:10 +01:00
cinap_lenrek
4ba5cb6c6a vmx: nanosec(): fix non-interruptable temporary, assign fasthz only once after xstart 2020-12-08 13:04:52 +01:00
cinap_lenrek
01eb04060b pc: move ldmxcsr() prototype to fpu.c 2020-12-08 12:42:36 +01:00
cinap_lenrek
de5770c352 vmx: add fmt checking, fix fmt errors, remove duplication for vmdebug 2020-12-08 12:40:28 +01:00
Sigrid
07805ac892 nusb/kb: update button state if event was actually received, fix typos (thanks umbraticus) 2020-12-08 11:47:15 +01:00
Sigrid
3d9abd96ae devmouse: remove redundant check 2020-12-08 11:21:18 +01:00
Sigrid
e812aa617f mouse(3): blankS, setS to follow the convention (thanks umbraticus) 2020-12-08 10:34:10 +01:00
Sigrid
014bf3fe7c mouse(3): document "scrollswap" ctl message, fix style a bit (thanks umbraticus) 2020-12-08 10:21:17 +01:00
Sigrid
8f9d4d7c27 vesa: make unsupported function not an error, set return status 2020-12-08 10:08:49 +01:00
Sigrid
96850d8bb4 vmx: add -D option to enable debug messages, use vmdebug for non-fatal "errors" 2020-12-08 10:01:44 +01:00
cinap_lenrek
c74458c98b vmx: add -v|-w flag to control window creation behaviour
The -v flag now does not create a new rio window,
while -w flag does (restores the old behaviour).

This allows vmx to run under vncs and is in general
mode aligned to other emulators and programs.
2020-12-07 18:59:54 +01:00
cinap_lenrek
1bb96d542c libcomplete: open internal file-descriptor with OCEXEC flag 2020-12-07 17:18:33 +01:00
cinap_lenrek
383a2ca79b libsec: open internal file-descriptors with OCEXEC flag 2020-12-07 17:14:34 +01:00
cinap_lenrek
d5928fb515 merge 2020-12-07 16:48:19 +01:00
cinap_lenrek
f7e21d7692 libauthsrv: open internal file-descriptors with OCEXEC flag 2020-12-07 16:47:06 +01:00
cinap_lenrek
f433f1426b libauth: open internal file-descriptors with OCEXEC flag 2020-12-07 16:46:34 +01:00
Sigrid
6c29cf79f0 aux/kbdfs, kbmaps: enable Kmod4 for other layouts, not just neo2 2020-12-07 16:42:56 +01:00
cinap_lenrek
f341ae8c77 libdraw: open file-descriptor with OCEXEC flag in readcolmap() 2020-12-07 16:30:27 +01:00
cinap_lenrek
1a900513fb libndb: open internal file-descriptors with OCEXEC flag 2020-12-07 15:15:02 +01:00
cinap_lenrek
5e59c57bb1 lib9p: open internal file-descriptor with OCEXEC flag in getremotesys() 2020-12-07 14:54:27 +01:00
cinap_lenrek
4d4b6a19de lib9p: open /mnt/factotum/rpc with OCEXEC flag in auth9p() 2020-12-07 14:51:53 +01:00
cinap_lenrek
d570229e82 lib9p: improve reqqueuecreate()
- open /proc/n/ctl with OCEXEC flag
- format pid as ulong
- don't leak the fd
2020-12-07 14:49:12 +01:00
cinap_lenrek
b3c9249500 merge 2020-12-07 14:33:51 +01:00
cinap_lenrek
4d22dbb0f5 libdraw: open internal file-descriptors with OCEXEC flag 2020-12-07 14:32:34 +01:00
cinap_lenrek
e8b871ef5a libdraw: remove unused Error label in freescreen() 2020-12-07 14:32:12 +01:00
cinap_lenrek
c10e21b491 libthread: reduce stack usage of threadkill*(), open /proc/n/ctl with OCEXEC flag 2020-12-07 14:31:02 +01:00
cinap_lenrek
e45bd6814a libthread: reduce stack usage for ioprocs, open /proc/n/ctl with OCEXEC flag 2020-12-07 14:29:45 +01:00
cinap_lenrek
1e2657ee97 libthread: simplify threadsetname()
- open /proc/n/args with OCEXEC flag
- reduce stack usage by using smaller buffer for path
- format pid as ulong
2020-12-07 14:27:46 +01:00
cinap_lenrek
f1e15da8f5 libc: open internal file-descriptor with OCEXEC flag 2020-12-07 14:24:51 +01:00
cinap_lenrek
544bca0290 rio: format pid's as ulongs 2020-12-07 14:23:41 +01:00