Re: rw_lock_held() & friends

2020-12-07 Thread Philip Guenther
On Mon, Dec 7, 2020 at 11:16 AM Alexandr Nedvedicky < alexandr.nedvedi...@oracle.com> wrote: > What's the plan for rw_write_held()? Currently macro is true, if whoever > holds > the lock. > > > > > +#define rw_write_held(rwl) (rw_status(rwl) == RW_WRITE) > Nope. rw_status() returns

Re: Use SMR_TAILQ for `ps_threads'

2020-12-02 Thread Philip Guenther
On Tue, Dec 1, 2020 at 5:48 AM Martin Pieuchot wrote: ... > exit1() for a multi-threaded process does the following: > > atomic_setbits_int(>p_flag, P_WEXIT); > single_thread_check(p, 0); // directly or via single_thread_set() > SMR_TAILQ_REMOVE_LOCKED(>ps_threads, p,

Re: stdio: fclose(3), fopen(3): intended locking hierarchy?

2020-11-30 Thread Philip Guenther
On Mon, Nov 30, 2020 at 6:10 PM Scott Cheloha wrote: > On Sat, Nov 28, 2020 at 01:41:50PM -0800, Philip Guenther wrote: > ... > > After thinking through states more, #4 isn't safe: _fwalk() can't take > > sfp_mutex because it's called from __srefill() which has its FILE locke

Re: kvm_getfiles and KERN_FILE_BYFILE

2020-11-29 Thread Philip Guenther
On Sun, Nov 29, 2020 at 12:14 PM Martijn van Duren < openbsd+t...@list.imperialat.at> wrote: > On Sat, 2020-11-28 at 16:23 -0800, Philip Guenther wrote: > > On Thu, Nov 26, 2020 at 1:08 PM Martijn van Duren < > openbsd+t...@list.imperialat.at> wrote: > > > I

Re: kvm_getfiles and KERN_FILE_BYFILE

2020-11-28 Thread Philip Guenther
n/netstat/inet.c usr.bin/fstat/fstat.c usr.bin/fstat/fuser.c usr.bin/systat/netstat.c Philip Guenther

Re: stdio: fclose(3), fopen(3): intended locking hierarchy?

2020-11-28 Thread Philip Guenther
On Fri, Nov 27, 2020 at 10:35 PM Philip Guenther wrote: ... > So yeah, maybe it does work to: > 1) make __sfp() FLOCKFILE() the allocated FILE before unlocking sfp_mutex > 2) update f{,d,mem,un}open() and open_*memstream() to match (1), unlocking >in all paths when the

Re: stdio: fclose(3), fopen(3): intended locking hierarchy?

2020-11-27 Thread Philip Guenther
on to not have false-positives, but otherwise the other bits above still apply, I believe. Would be a major ABI change...and if we do that there's like 3 other things we should do at the same time (merge __sfileext into FILE, grow _file to an int, and maybe move the recursive mutex for f{,un}lockfile() into FILE?) Philip Guenther

Re: Fix ilogb(3)

2020-11-07 Thread Philip Guenther
inated in (large) part from what Kahan did with Intel, see https://people.eecs.berkeley.edu/~wkahan/ieee754status/754story.html I'm not nearly enough of a numerical analyst to judge the decision of the standard. Philip Guenther

Re: powerpc ld.lld fix

2020-11-01 Thread Philip Guenther
Makes sense. This code is just the space reservation, the relocation generation or whatever fills them in is suppressed already, yes? Assuming so, r+ On Sat, Oct 31, 2020 at 2:46 PM Mark Kettenis wrote: > > Date: Sat, 10 Oct 2020 23:19:19 +0200 (CEST) > > From: Mark Kettenis > > > > On

Re: Diff: Introductory Clause Comma Crap

2020-10-31 Thread Philip Guenther
particular item of concern and the proposed fix is agreed upon before spending the time to search and edit many other pages. This is true not just for documentation changes but code changes, of course: doing lots of work before there's "buy-in" is risking your time. Philip Guenther

Re: [PATCH] ifconfig: keep track of allowed ips pointer correctly

2020-10-27 Thread Philip Guenther
relying on that, which is easy in this case by just casting to "char *" instead. Philip Guenther

Re: [patch] const cclasses reference in ksh

2020-10-26 Thread Philip Guenther
On Mon, Oct 26, 2020 at 8:35 AM Matthew Martin wrote: > Recently cclasses in lib/libc/gen/charclass.h was made const.[1] > Mark the pointer used to walk the array in ksh const as well. > > 1: https://marc.info/?l=openbsd-cvs=160256416506433=2 > Ugh, I totally missed that reach-around. ok

Re: Infinite loop in uvm protection mapping

2020-10-19 Thread Philip Guenther
blockend = 080012240 > ... > Does anyone have an idea how to fix this issue? So, blockend is clearly wrong for va and eva. I suspect the use of L2_FRAME here: blockend = (va & L2_FRAME) + NBPD_L2; is wrong here and it should be blockend = (va & VA_SIGN_NEG(L2_FRAME)) + NBPD_L2; or some equivalent expression to keep all the bits above the frame. Philip Guenther

Re: incorrect result from getppid for ptraced processes

2020-09-04 Thread Philip Guenther
On Fri, Sep 4, 2020 at 2:59 PM Mateusz Guzik wrote: > On 9/5/20, Philip Guenther wrote: > > On Fri, Sep 4, 2020 at 1:06 PM Mateusz Guzik wrote: > > > >> On 9/4/20, Vitaliy Makkoveev wrote: > >> > On Fri, Sep 04, 2020 at 05:24:42PM +0200, Mateusz Guzik wr

Re: incorrect result from getppid for ptraced processes

2020-09-04 Thread Philip Guenther
_p->ps_pptr->ps_pid; > > + if (p->p_p->ps_flags & PS_TRACED) > > + *retval = p->p_p->ps_oppid; > > + else > > + *retval = p->p_p->ps_pptr->ps_pid; > > + > > return (0); > > } > > This is definitely a bare minimum fix, but it does the job. > ptrace() has behaved like this for the life of OpenBSD and an indefinite number of years previous in the BSD releases. What has happened that a definitely incomplete fix is needed Right Now? Philip Guenther

Re: timekeep: fixing large skews on amd64 with RDTSCP

2020-07-17 Thread Philip Guenther
efore the second rdtsc (so that the sequence is actually complete before the second one). In this case, is it a problem if instructions after the rdtsc that are not dependent on its result may be started before it's actually complete? If not, then there's no reason to bracket that side. Philip Guenther

Re: disable libc sys wrappers?

2020-07-09 Thread Philip Guenther
call to early_static_init(), and definitely after any fixup by ld.so) that it should work Just Fine. I would flip the test to check the environment before running issetugid(2) because the syscall is more expensive and it's nice not to clutter the kdump output. ;-) Philip Guenther

Re: SSE in kernel?

2020-06-23 Thread Philip Guenther
S stuff in the kernel, for example. c.f. /usr/src/sys/arch/amd64/amd64/aesni.c Philip Guenther

Re: EV_SET(2) shadows variable

2020-04-05 Thread Philip Guenther
On Sat, 4 Apr 2020, Theo de Raadt wrote: > Philip Guenther wrote: > > > On Fri, 3 Apr 2020, Martin Pieuchot wrote: > > > Thanks, here it is, ok? > > > > ok guenther@ > > Should we do the same to all other macros, just in case? Checking /usr/include/{,

Re: split futex into three

2020-04-05 Thread Philip Guenther
On Sun, 5 Apr 2020, Stuart Henderson wrote: > On 2020/04/05 10:28, Martin Pieuchot wrote: > > Another way to proceed would be to do a port grep for futex and see what > > the ecosystem is using. > > Sorry it's not filtered, but : > > https://junkpile.org/grep.futex.gz Sure looks like the only

Re: kdump futex fix

2020-04-04 Thread Philip Guenther
On Sat, 4 Apr 2020, Martin Pieuchot wrote: > On 03/04/20(Fri) 19:26, Philip Guenther wrote: > > On Fri, 3 Apr 2020, Martin Pieuchot wrote: > > > Depending on the operation requested futex(2) might return the number of > > > woken threads or an error. That means the fo

Re: split futex into three

2020-04-04 Thread Philip Guenther
On Sat, 4 Apr 2020, Paul Irofti wrote: > Here is a proper diff (both sys and libc into one). Okay, bunch o' comments and thoughts of varying strength of opinion. > diff --git lib/libc/Symbols.list lib/libc/Symbols.list > index f9aa62ab6e8..4fa37a835aa 100644 > --- lib/libc/Symbols.list > +++

Re: kdump futex fix

2020-04-03 Thread Philip Guenther
On Fri, 3 Apr 2020, Martin Pieuchot wrote: > Depending on the operation requested futex(2) might return the number of > woken threads or an error. That means the following... > > mpv CALL futex(0xa58935899b0,0x82,1,0,0) > mpv RET futex -1 errno 1 Operation not permitted > > ...is

Re: EV_SET(2) shadows variable

2020-04-03 Thread Philip Guenther
On Fri, 3 Apr 2020, Martin Pieuchot wrote: > Thanks, here it is, ok? ok guenther@

Re: EV_SET(2) shadows variable

2020-04-02 Thread Philip Guenther
ut it currently blows up on the FD_ZERO() and would blow up in the EV_SET() with your proposed diff. Philip Guenther

Re: ktrwriteraw & vget

2020-03-17 Thread Philip Guenther
On Tue, Mar 17, 2020 at 5:18 AM Martin Pieuchot wrote: > On 17/03/20(Tue) 04:02, Philip Guenther wrote: > > On Tue, Mar 17, 2020 at 1:07 AM Martin Pieuchot wrote: > > [...] > > > @@ -663,8 +668,6 @@ ktrwriteraw(struct proc *curp, struct vn > > >

Re: ktrwriteraw & vget

2020-03-17 Thread Philip Guenther
st, can't the vnode vp points to be invalidated and reused? Maybe this vget() should be split into vref() + vn_lock(), and the vput() similarly split into VOP_UNLOCK() + vrele(), so the vrele() can be left after this LIST_FOREACH() while the VOP_UNLOCK() is hoisted to the "vn_lock() succeeded" path. Philip Guenther

Re: posix_openpt: allow O_CLOEXEC

2020-02-06 Thread Philip Guenther
om its flags argument. 2b) bonus: do (2) but also provide a flag which tells the kernel to *not open* the slave, and use that in posix_openpt(), fixing a subtle bug in our posix_openpt()'s behavior I guess I meant three ways. Side note: posix_openpt() should, like openpty(), unconditionally pass O_CLOEXEC when opening /dev/ptm. Philip Guenther

Re: waitpid vs ptrace

2020-01-30 Thread Philip Guenther
hat the child has been attached to and is being stopped and started by its tracer should be completely invisible to the original parent.) Philip Guenther

Re: TIMESPEC_TO_NSEC(): futex(2), __thrsigdivert(2) & __thrsleep(2)

2020-01-12 Thread Philip Guenther
imeouts were specified with timespec+clockid_t+"is absolute" flag, can that be slotted into all this without wailing and gnashing of teeth? ** I have no idea if any ports actually do that Philip Guenther

Re: PATCH: fix race condition in binutils-2.17 build

2020-01-02 Thread Philip Guenther
On Thu, Jan 2, 2020 at 2:26 AM Marc Espie wrote: > We don't normally hit this thanks to the "expensive job" heuristics > (meaning that we don't start the second target while the first is > building), but still there is a race, and if for whatever reason we > remove that heuristics we hit it

Re: sparc64: iommu: unbreak DEBUG build: %lx and time_t

2019-12-23 Thread Philip Guenther
_ttime_t; > /usr/include/sys/_types.h:typedef __int64_t __time_t; /* > epoch time */ > /usr/include/amd64/_types.h:typedef long long __int64_t; > > OK? Any better idea? In general, for time_t we've case to (long long) and used %ll,

Re: dmesg alloc

2019-12-23 Thread Philip Guenther
On Mon, 23 Dec 2019, Alexander Bluhm wrote: > dmesg(8) allocates a bit too much memory. > > sysctl KERN_MSGBUFSIZE returns msg_bufs. > sysctl KERN_MSGBUF copies out msg_bufs + offsetof(struct msgbuf, > msg_bufc) bytes. > dmesg allocates msg_bufs + sizeof(struct msgbuf) - 1 bytes. > > This is not

Re: fix mcount.po target in libc/gmon/Makefile.inc

2019-12-19 Thread Philip Guenther
On Thu, 19 Dec 2019, Theo Buehler wrote: > According to the comment in lib/libc/gmon/Makefile.inc, mcount needs > special treatment since it cannot be compiled with profiling or pie. > > When depend was removed as an independent target, this special case was > missed. Align it with the inference

Re: amd64 SMEP SMAP trap panic print

2019-12-19 Thread Philip Guenther
On Fri, 20 Dec 2019, Alexander Bluhm wrote: > Can we use the regular trap panic for SMEP and SMAP? pageflttrap() > returns 0 to print a nice reason in kerntrap(). Especially if ddb is > disabled, additional information is printed. > > attempt to access user address 0xe27539f1000 in supervisor

Re: inteldrm(4) fix

2019-12-17 Thread Philip Guenther
On Tue, Dec 17, 2019 at 5:02 AM Mark Kettenis wrote: > Hit the > > KASSERT(curcpu()->ci_inatomic == 0); > > in pagefault_disable(). Analysis of the code in i915_gem_execbuffer.c > shows that pagefault_disable() may be called when page faults are > already disabled, i.e. from

Re: Sync KVE_ET_* with UVM_ET_*

2019-12-05 Thread Philip Guenther
On Thu, Dec 5, 2019 at 9:15 AM Martin Pieuchot wrote: > Sync with reality, will help KERN_PROC_VMMAP consumers. Ok? > ok guenther@

Re: fwide() does not unlock if error was occurred

2019-12-02 Thread Philip Guenther
On Mon, Dec 2, 2019 at 7:48 PM Masato Asou wrote: > fwide() does not unlock if error was occurred. > > ok? > ok guenther@

Re: iwm: support 9260 devices

2019-11-16 Thread Philip Guenther
needed. > > Better diff which fixes an Rx throughput issue which was present in > the previous diff. Looking good so far on my X1 extreme once I added PCI_PRODUCT_INTEL_WL_9560_2 next to the _1 lines in if_iwm.c. Awesome! Philip Guenther

Re: Fix cpio -Hustar -o

2019-11-14 Thread Philip Guenther
On Thu, Nov 14, 2019 at 1:36 PM Christian Weisgerber wrote: > I found this discrepancy surprising: > > $ find /bin -print | cpio -o -Hustar >foo > $ file foo > foo: POSIX tar archive > $ find /bin -print | cpio -Hustar -o >foo > $ file foo > foo: ASCII cpio archive (SVR4 with CRC) > > The

Re: fix amd64 pmap comment

2019-11-02 Thread Philip Guenther
On Sat, Nov 2, 2019 at 4:34 AM Martin Pieuchot wrote: > uvm_km_alloc(9) has never been used in amd64's pmap. pool_get(9) is the > thing since its import by mickey@. > > ok? > ok guenther@

ftp: utime->utimensat: use UTIME_OMIT instead of calling time()

2019-10-13 Thread Philip Guenther
time with UTIME_NOW, I propose leaving the atime unchanged with UTIME_OMIT. Thoughts? oks? Philip Guenther Index: ftp.c === RCS file: /data/src/openbsd/src/usr.bin/ftp/ftp.c,v retrieving revision 1.105 diff -u -p -r1.105 ftp.c

Re: Remove some sigvec Xr's

2019-07-25 Thread Philip Guenther
wrong choice, albeit inconsistent with csh(1). Part of me feels like _if_ they're going to mention umask(2), setrlimit(2), and sigaction(2), then they should mention chdir(2), as the other classic "must be in the shell" syscall. Philip Guenther

Re: remove duplicate definitions of LAPIC_ID_MASK and LAPIC_ID_SHIFT

2019-07-25 Thread Philip Guenther
On Thu, Jul 25, 2019 at 4:44 PM Kevin Lo wrote: > ok? > Yes, please. guenther@

Re: Comment fix: No mcontext

2019-07-13 Thread Philip Guenther
On Thu, Jul 11, 2019 at 10:12 PM Benjamin Baier wrote: > there is no mcontext, and since V1.2 of process_machdep.c struct reg > and struct trapframe don't have to be closely synced. > process_machdep.c no longer memcpy's one to the other. > Yep. Committed. Thanks! Philip Guenther

logger(1): add -c option for LOG_CONS

2019-06-16 Thread Philip Guenther
Testing something else I needed to call syslog(3) with LOG_CONS. Diff below adds support to logger(1) for doing that. Option choice is compatible with NetBSD. ok? Philip Guenther Index: logger.1 === RCS file: /data/src

Re: usr.bin/getconf: Add reporting LONG_BIT

2019-05-27 Thread Philip Guenther
nf does not. > Desirable? OK? > That's the way to do it, I just have this vague "what tempting lunacy has led them to this?" lurking in my mind. Philip Guenther

Re: Make pthread_np.h standalone

2019-05-27 Thread Philip Guenther
On Mon, May 27, 2019 at 7:36 AM Jeremie Courreges-Anglas wrote: > > A bunch of our ports expect pthread_np.h to be standalone, alas our > version doesn't include pthread.h. The diff below should help us get > rid of some patches in (at least) mongodb, mono, gnustep and webkitgtk4. > > ok? > ok

Re: wall(1) unveil for non-root users

2019-05-16 Thread Philip Guenther
in those programs > are used to indicate "I am ok with messages to my tty". > > That is an old behaviour, but I bet that is the history of this S_IWGRP > check. > Yep. mesg(1) manipulates your tty's group-write bit so that wall(1), talk(1), and write(1) can check it. Philip Guenther

Re: ld.so speedup (part 2)

2019-05-11 Thread Philip Guenther
agreed it's good, so I've committed it with some tweaking to the #defines to make them self-explanatory and have contiguous bit-assignments. Thank you for identifying this badly inefficient algorithm and spotting how easy it was to fix! Philip Guenther

Re: Switch powerpc to big PIC

2019-02-05 Thread Philip Guenther
/Makefile needs updating too: --- # Override powerpc default of -fPIE # XXX if this is safe, why not override CFLAGS for alpha and sparc64 too? # Does it work because the csu bits come first and get the first few GOT # entries? .if ${MACHINE_ARCH} == "powerpc" CFLAGS+=-fpie .endif --- Philip Guenther

Re: trunk shouldnt care if it's stacked

2019-01-09 Thread Philip Guenther
ing is handled via possibly recursive calls then there's an effective limit imposed by size of the kernel stack. Imposing a depth limit also prevents looping a stack by adding an upper trunk to a bottom one. Philip Guenther

Re: ksh: quote empties

2018-12-30 Thread Philip Guenther
On Sun, 15 Apr 2018, Martijn Dekker wrote: > Op 15-04-18 om 03:41 schreef Philip Guenther: > > On Sun, 15 Apr 2018, Klemens Nanni wrote: > > > It also badly effects non-empty cases: > > ... > > > $ ./obj/ksh -c alias > > > autoload='' > > >

reduce libgen.h usage

2018-12-30 Thread Philip Guenther
only prototypes dirname() and basename(). There are a bunch of source files that #include it but don't need it; the diff below deletes those pointless includes. ok? Philip Index: bin/ksh/edit.c === RCS file:

Re: ldapd, fix warnings when compiling with gcc

2018-12-04 Thread Philip Guenther
On Tue, Dec 4, 2018 at 5:40 AM Claudio Jeker wrote: > Gcc is unhappy about the void * usage in printf: > search.c:325: warning: format '%s' expects type 'char *', but argument 2 > has type 'void *' > search.c:345: warning: format '%.*s' expects type 'char *', but argument 3 > has type 'void *' >

Re: [patch] sh.1 getopts inaccurate

2018-11-28 Thread Philip Guenther
On Wed, Nov 28, 2018 at 10:52 PM Solene Rapenne wrote: > I'm not familiar with getopts, first time I use it and the man page was > confusing. It says "a colon following an option indicates it may take an > argument". > I understand this as: if I use the string "s:" then I can use "-s" or "-s >

Re: ksh: be even more posixly correct on local/typeset

2018-11-20 Thread Philip Guenther
is could > breakage? > "set -o posix" is, IMO, about dealing with the places where ksh and posix diverge. Using it as a hammer for strict compliance eliminates that middle ground of "posix behavior with extensions". I would not consider that a positive direction. Philip Guenther

Re: tap(4) minor number too large

2018-11-11 Thread Philip Guenther
On Sun, Nov 11, 2018 at 10:03 PM David Gwynne wrote: ... > so like this? > ... > --- if_tun.c24 Feb 2018 07:20:04 - 1.181 > +++ if_tun.c12 Nov 2018 06:02:51 - > @@ -193,6 +193,9 @@ tun_create(struct if_clone *ifc, int uni > struct tun_softc*tp; >

Re: tap(4) minor number too large

2018-11-11 Thread Philip Guenther
ng in one of mknod() or mknodat(). As the guy who did the last type bump that invasive, Just Say No. Philip Guenther

Re: AMD64 buffer cache 4GB cap anything new, multiqueueing plans? ("64bit DMA on amd64" cont)

2018-11-06 Thread Philip Guenther
arly Theo's comments, is that no one actually demonstrated a case where lack of 64bit DMA caused any problems or limitations. If you have a system and use where lack of 64bit DMA creates a performance limitation, then describe it and, *more importantly*, *why* you think the DMA limit is involved. Philip Guenther

Re: httpd: fix/consistency cast for ctype function

2018-11-03 Thread Philip Guenther
On Fri, Nov 2, 2018 at 4:14 AM Hiltjo Posthuma wrote: > I noticed many ctype functions (such as isalpha, isdigit, tolower) are > cast to > unsigned char in httpd. This patch changes it also for one remaining check. > Yep. Committed. Thanks! Philip Guenther

Re: cron.c patch

2018-10-20 Thread Philip Guenther
On Sat, Oct 20, 2018 at 2:41 PM Edgar Pettijohn III wrote: > On 10/20/18 6:40 PM, Philip Guenther wrote: > > On Sat, Oct 20, 2018 at 2:34 PM Edgar Pettijohn III < > ed...@pettijohn-web.com> wrote: > >> I'm guessing the if block will never hit since listen returns e

Re: cron.c patch

2018-10-20 Thread Philip Guenther
On Sat, Oct 20, 2018 at 2:34 PM Edgar Pettijohn III wrote: > I'm guessing the if block will never hit since listen returns either 0 or > -1. > Uh, but -1 is true. Philip

Re: multicast.4: drop unneeded (void *) casts

2018-10-19 Thread Philip Guenther
On Fri, Oct 19, 2018 at 6:20 AM Scott Cheloha wrote: ... > Sure, looks cleaner. ok? ok guenther@

Re: multicast.4: drop unneeded (void *) casts

2018-10-18 Thread Philip Guenther
On Thu, Oct 18, 2018 at 4:00 PM wrote: > getsockopt(2) and setsockopt(2) take a void pointer for the third > parameter so there is no need for any of these casts. > Yep. > I can do other style(9)-type cleanup in a subsequent diff or I can > cook this diff and do it all in one. > > Thoughts,

Re: copy and paste error in rb tree code

2018-10-08 Thread Philip Guenther
On Mon, Oct 8, 2018 at 6:03 PM David Gwynne wrote: > According to https://github.com/FRRouting/frr/pull/3106, Coverity thinks > I made a copy and paste error regarding one of the augment calls in > RBT_REMOVE. I'm inclined to agree. > > The augment code is only used by uvm_map.c, and it seems to

Re: bsd.rd failure in VirtualBox

2018-09-15 Thread Philip Guenther
it. I've generated a new diff that should fix this, so a future snap should fix this, though when that'll happend depends on the snap builder's schedule. Philip Guenther

Re: [patch] Fix an error in chmod.1

2018-09-13 Thread Philip Guenther
-x--x-wx 2 guenther wheel 512 Sep 13 22:24 dir w- 1 guenther wheel0 Sep 13 22:24 file $ The other-write bit was set in my file mode creation mask, so the "-rw" was treated like "ug-rw,o-r" and did not change the other-write permission on the file or directory. Philip Guenther

Re: add uid_from_user/gid_from_group [1/3]

2018-09-12 Thread Philip Guenther
On Wed, 12 Sep 2018, Todd C. Miller wrote: > Thanks for the feedback, here's an updated diff that eliminates > pwcache.h, gracefully handles table allocation failure and massages the > comments to be a bit more general. > > I can take a look at supporting arbitrary length names in the future.

Re: add uid_from_user/gid_from_group [2/3]

2018-09-11 Thread Philip Guenther
On Mon, 10 Sep 2018, Todd C. Miller wrote: > This removes cache.c from pax in favor of using the new uid_from_user() > and gid_from_group() functions in libc. I've added explicit calls to > setpassent() and setgroupent() since they are no longer implicitly > called. This part is ok guenther@

Re: add uid_from_user/gid_from_group [1/3]

2018-09-11 Thread Philip Guenther
On Mon, 10 Sep 2018, Todd C. Miller wrote: ... > --- /dev/null 1 Jan 1970 00:00:00 - > +++ lib/libc/gen/pwcache.h10 Sep 2018 00:46:44 - ... > +/* > + * Constants and data structures used to implement group and password file > + * caches. Traditional passwd/group cache routines perform

Re: add uid_from_user/gid_from_group [1/3]

2018-09-11 Thread Philip Guenther
On Mon, 10 Sep 2018, Todd C. Miller wrote: > This is a port of uid_from_user() and gid_from_group() from NetBSD (also > present in FreeBSD). ... > --- lib/libc/gen/pwcache.c25 Nov 2015 23:16:01 - 1.13 > +++ lib/libc/gen/pwcache.c10 Sep 2018 15:04:35 - ... > +/* > + * routines

Re: Linux DRM

2018-09-03 Thread Philip Guenther
am, not just to minimize OpenBSD costs in this area, but so that all OSes that draw from that base can benefit. Philip Guenther

Re: Floating point exception on boot after using syspatch(8)

2018-08-01 Thread Philip Guenther
ymptoms have improved (or changed at all) there. Philip Guenther

Re: Kill MD-specific interrupt enable/disable API on amd64

2018-07-24 Thread Philip Guenther
On Tue, Jul 24, 2018 at 1:02 PM Mark Kettenis wrote: > Diff below switches to the MI equivalent and kills the MD-specific > API. > > ok? > ok guenther@

Re: CVS: cvs.openbsd.org: src

2018-07-12 Thread Philip Guenther
On Thu, Jul 12, 2018 at 2:11 PM Philip Guenther wrote: > CVSROOT:/cvs > Module name:src > Changes by: guent...@cvs.openbsd.org2018/07/12 08:11:11 > > Modified files: > sys/arch/amd64/amd64: cpu.c identcpu.c locore.

Re: signal to process or posix thread

2018-07-09 Thread Philip Guenther
g > list on whether a signal should be delivered delayed. > Yep. Philip Guenther

Re: pthread_barrier_init: check count argument

2018-07-05 Thread Philip Guenther
On Thu, Jul 5, 2018 at 1:20 AM Paul Irofti wrote: > POSIX mandates that we return EINVAL if count equals zero on barrier > initialization. Which makes sense to me. > > This also fixes posixtestsuite conformance 3-1 test. > > OK? > ok guenther@

Re: acpi(4) attach glue for amd64/i386

2018-07-01 Thread Philip Guenther
On Sun, Jul 1, 2018 at 8:00 AM Mark Kettenis wrote: > Diff below moves the attach glue from acpi.c into acpi_machdep.c. > Gets rid of an #ifdef and helps me avoid an ugly hack on arm64. There > is some additional code duplication, but I think this is acceptable. > > ok? > Fewer ifdefs, yay.

Re: Use -z notext -z norelro for armv7 efiboot

2018-06-22 Thread Philip Guenther
On Fri, Jun 22, 2018 at 3:04 AM Mark Kettenis wrote: > Creating relocations inside .text is inherent to the way we wrap an > ELF shared object inside a PE executable. But without -z notext > lld(1) complains about this. Also pass -z norelro to suppress the > creation of a separate rodata

Re: [patch] Use snprintf to implement concat in etc.c

2018-06-08 Thread Philip Guenther
the calls is completely superfluous, to my eye. But really, ldconfig is pretty uninteresting, being run very, very rarely, so polishing it is like sanding the rough spots on the bottoms of table legs, where they touch the floor. We've spent more cycles talking about it then it'll use in a year...

Re: witness report

2018-06-03 Thread Philip Guenther
On Sun, Jun 3, 2018 at 12:51 PM, Amit Kulkarni wrote: > On Sun, 3 Jun 2018 10:37:30 -0700 > Philip Guenther wrote: > ... > > Index: kern/kern_rwlock.c > > === > > RCS file: /data/src/openbsd/s

Re: witness report

2018-06-03 Thread Philip Guenther
On Sun, 3 Jun 2018, Theo de Raadt wrote: > Philip Guenther wrote: > > The warning is not that a single filesystem is being locked > > recursively by a single thread, but just that a single thread is > > holding locks on multiple filesystems. > > vfs_stall()

Re: witness report

2018-06-03 Thread Philip Guenther
On Sun, Jun 3, 2018 at 9:08 AM, Theo de Raadt wrote: > Philip Guenther wrote: > > > On Sun, Jun 3, 2018 at 3:26 AM, Klemens Nanni wrote: > > > > > Snap from 31.05.2018 with > > > > > > OpenBSD 6.3-current (GENERIC.MP) #0: Sat Jun 2 16:21:22 CEST 20

Re: witness report

2018-06-03 Thread Philip Guenther
alent to multiple threads each holding only a single mount lock and nothing else. Even if we agree that evaluation is correct, I don't think we want to mark mnt_lock as DUPOK for all purposes, but rather just pass LOP_DUPOK through for the calls from vfs_stall(). Philip Guenther

Re: Drop memory barriers from _aromic_lock() on armv7 and arm64

2018-05-21 Thread Philip Guenther
On Mon, May 14, 2018 at 11:36 AM, Mark Kettenis wrote: > Since the callers now add the barriers we can drop them here. > > ok? > ok guenther@

Re: de-hole some structs on amd64

2018-05-20 Thread Philip Guenther
/ > + struct timespec p_rtime; /* Real time. */ > u_int p_estcpu;/* Time averaged value of p_cpticks. */ > int p_cpticks; /* Ticks of cpu time. */ > Again, you've separated the scheduling parameter from the /* scheduling */ comment, putting member that aren't about scheduling between them. Philip Guenther

Re: ld.so arm64 syscalls

2018-05-15 Thread Philip Guenther
On Tuesday, May 15, 2018, Mark Kettenis wrote: > There's a subtle bug in the DL_SYSCALL() implementation on arm64. > Upon error we're supposed to return -errno. The code does a negate of > the lower 32-bit bits. This means that syscalls that return a 64-bit > number

Re: Missing hardlink for /usr/bin/cc

2018-05-13 Thread Philip Guenther
, while the others are packaged in compXY.tgz. Perhaps we should move the others into baseXY.tgz so the link is preserved, but that would have to be only on the clang-as-cc archs and there are probably other catches I haven't noticed. This is perhaps a puzzle best for Theo... Philip Guenther

Re: Say no to LARVAL

2018-05-10 Thread Philip Guenther
On Wed, May 9, 2018 at 3:31 AM, Martin Pieuchot <m...@openbsd.org> wrote: > On 08/05/18(Tue) 14:12, Philip Guenther wrote: > > On Tue, 8 May 2018, Martin Pieuchot wrote: > > > The way our kernel allocates and populates new 'struct file *' is > > > currently a co

Re: Say no to LARVAL

2018-05-08 Thread Philip Guenther
On Tue, 8 May 2018, Martin Pieuchot wrote: > The way our kernel allocates and populates new 'struct file *' is > currently a complete mess. One of the problems is that it puts > incomplete descriptors on the global `filehead' list and on the > open file array `fd_ofiles'. But to make sure that

restore: preserve symlink mode

2018-04-26 Thread Philip Guenther
When a symlink is restored, set its mode to the value from the dump. This is totally cosmetic, as the kernel ignores the mode on symlinks, but it's nice to restore to the original. ok? Philip Index: tape.c === RCS file:

Re: on-line kernel debugging

2018-04-25 Thread Philip Guenther
an impediment then that would be a waste of time. Philip Guenther

Re: Make binutils not barf on binaries linked with lld

2018-04-24 Thread Philip Guenther
On Tue, Apr 24, 2018 at 8:43 PM, Mark Kettenis wrote: > So lld generates .gnu.hash sections that our ancient binutils doesn't > grok. With the diff below (taken from FreeBSD's binutils, so GPLv2) > fixes this. > > ok? > > --- gnu/usr.bin/binutils-2.17/bfd/elf.c 10 Aug

Re: semaphore: validate timespec and handle SA_RESTART

2018-04-24 Thread Philip Guenther
On Mon, 23 Apr 2018, Paul Irofti wrote: > After discussing further with mpi@ and guenther@, we decided to first > fix the existing semaphore implementation with regards to SA_RESTART > and POSIX compliant returns in the case where we deal with restartable > signals. > > Currently we return EINTR

Re: ksh: quote empties

2018-04-14 Thread Philip Guenther
On Sun, 15 Apr 2018, Klemens Nanni wrote: > It also badly effects non-empty cases: ... > $ ./obj/ksh -c alias > autoload='' > functions='' Hah! The original diff i actually broken (it tests the wrong variable) but I fixed that by accident when I manually made the diff in my

Re: ksh: quote empties

2018-04-14 Thread Philip Guenther
On Sun, 15 Apr 2018, Martijn Dekker wrote: > $ ksh -c 'trap "" CONT; trap' > trap -- CONT > > That is not "suitable for re-entry into the shell". Empty words must be > quoted, or they disappear. Expected output: > > trap -- '' CONT > > Patch below. OK? That also changes the output of set,

Re: sem_trywait(3) and sem_wait(3) can return EINTR

2018-03-28 Thread Philip Guenther
ep}while loop and will never return EINTR. In the end, _sem_wait() will return EINTR only if the thread was canceled...in which case the function that called _sem_wait() will never return but instead call _thread_canceled() via the LEAVE_CANCEL_POINT_INNER() macro. Philip Guenther

Re: free(9) while holding a rwlock

2018-02-21 Thread Philip Guenther
On Wed, Feb 21, 2018 at 1:26 AM, Martin Pieuchot wrote: > Is it safe? What kind of deadlock/weird situation can occur? > > I'm asking because the diff below, that introduces a lock to protect uid > globals, has an XXX comment from guenther@ asking if it is a problem. > The

Meltdown, aka "Dear Intel, you suck"

2018-01-05 Thread Philip Guenther
* (if still though to be necessary for arm) after that. No promises on only applying it to Intel CPUs or knobs to disable it, yet: we'll see how complex that would make things. As always, our own developer laptops are the first targets, so we're invested in it working and being usable. Philip

  1   2   3   4   5   6   7   8   9   10   >