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

Re: use inline functions instead of __statement

2018-01-03 Thread Philip Guenther
its argument only once even without __statement? > The extension is the "({ ... })" syntax, not the __statement token. The latter is only there to suppress "you're using an extension!!!11!!" warnings. Without using the gcc ({ ... }) extension, how are you going to create a scope for a local variable in the middle of an expression? Philip Guenther

Re: Bug in dd's args.c, invalid check for error

2018-01-02 Thread Philip Guenther
On Tue, Jan 2, 2018 at 3:06 PM, Ingo Schwarze wrote: ... > OK for the patch at the end? > > Testing - before: > ... > --- args.c 16 Aug 2016 16:44:55 - 1.28 > +++ args.c 2 Jan 2018 22:47:19 - > @@ -406,8 +406,9 @@ get_off(char *val) > off_t num,

Re: armv7 unaligned access in libcrypto

2017-12-30 Thread Philip Guenther
gt; instead of __OpenBSD__. Makes things a little bit more obvious... > > Any of the LibreSSL folks have an opinion about that? I'm in favor of that, as the tests as is are opaque in intent. Philip Guenther

Re: paste(1): default to stdin if no files given

2017-12-30 Thread Philip Guenther
doing that. > Here's a diff syncing with FreeBSD to error out on missing files. > Feedback? Looks good to me. Unless there are any objections, I'll commit your diff. Philip Guenther > diff --git a/usr.bin/paste/paste.c b/usr.bin/paste/paste.c > index 4b00413e5bb..e64ac882510 100644

Re: wsconsctl: minor cleanup

2017-12-30 Thread Philip Guenther
On Sat, Dec 30, 2017 at 8:51 AM, Anton Lindqvist wrote: > > Get rid of a unused variable and define the noinput lex option in order > to suppress the following warning: > > map_scan.c:1235:16: warning: function 'input' is not needed and will not > be emitted > static int

Re: clock_gettime: add CLOCK_BOOTTIME clockid

2017-12-14 Thread Philip Guenther
; Nope. To quote clock_gettime(3) CLOCK_UPTIME time whose absolute value is the time the system has been running and not suspended, providing accurate uptime measurement, both absolute and interval Philip Guenther

Re: Symbols.map for libfuse

2017-12-14 Thread Philip Guenther
out, with the updated diff below. I used DEF and PROTO > from guenther's libkvm diff for intra-library calls. Looks good to me. If helg@ finds a need to expose some APIs being held here we can always bump again. :-) Philip Guenther

Symbols.map for libkvm

2017-12-13 Thread Philip Guenther
nit PLT removed: kvm_close kvm_nlist kvm_read : corwin; ok? Philip Guenther Index: lib/libkvm/Makefile === RCS file: /cvs/src/lib/libkvm/Makefile,v retrieving revision 1.18 diff -u -p -r1.18 Makefile ---

Re: Symbols.map for libutil

2017-12-13 Thread Philip Guenther
On Thu, 14 Dec 2017, Mark Kettenis wrote: > Diff below makes sure libutil doesn't export any unwanted symbols. The > immediate motivation here is to prevent exportong certain libgcc symbols > on armv7 that cause issues when switching from gcc to clang. > > With this diff, only symbols present

Re: sign of char on arm64

2017-12-12 Thread Philip Guenther
uld like confirmation because for all BSD where I have the > information, I always have a signed char (aarch64-freebsd, > powerpc-netbsd, arm-netbsd, ...), except arm64 on OpenBSD. > > Is it expected ? > Yes. Note that powerpc-openbsd has char as unsigned. Philip Guenther

Re: __cxa_thread_atexit

2017-12-04 Thread Philip Guenther
On Mon, 4 Dec 2017, Mark Kettenis wrote: > The ld.so bits have been committed last week. So here is a new version > of the diff. This version exports __cxa_thread_atexit_impl such that > gcc picks up our implementation. __cxa_thread_atexit becomes a weak > alias such that static linking

Re: gettimeofday(2) does not conform to POSIX.1-2008?

2017-12-03 Thread Philip Guenther
On Sun, 3 Dec 2017, Theo de Raadt wrote: > > EFAULT is kinda interesting in that POSIX documents its existence but > > does not require it to ever be returned. Here's what POSIX says > > normatively: ... > POSIX is a wimpy subset of UNIX, specified so unstrictly that it > becomes difficult to

Re: gettimeofday(2) does not conform to POSIX.1-2008?

2017-12-03 Thread Philip Guenther
day() when you pass NULL, POSIX says "nope, out of bounds". Philip Guenther

kdump: fcntl(F_GETOWN) doesn't take an argument

2017-11-28 Thread Philip Guenther
ntl -34617/0x78c7 (It would be nice if we displayed the fnctl command's additional argument in the prefered form for its type, such as just decimal for pid/pgid args, and ditto for return values, but that requires more thought...) ok? Philip Guenther Index: usr.bin/kd

Re: Set soname for shared libraries

2017-11-13 Thread Philip Guenther
On Mon, Nov 13, 2017 at 12:25 PM, Mark Kettenis wrote: > The diff below changes bsd.lib.mk such that we set the DT_SONAME entry > for shared libraries to the name of the shared library. This brings > us in line with other ELF systems and allows us to use symlinks to >

Re: 64bit DMA on amd64

2017-11-11 Thread Philip Guenther
; > What algorithms drive the buffer cache structure now? If I recall Bob and Ted's undeadly posts correctly, the buffers are both in per-vnode red-black trees and a global 2Q structure to manage the total set of buffers. (How those names will be useful I don't know.) Philip Guenther

Re: TLS with static non-PIE binaries

2017-11-09 Thread Philip Guenther
On Thu, Nov 9, 2017 at 12:07 AM, Charles Collicutt <char...@collicutt.co.uk> wrote: > On Wed, Nov 08, 2017 at 10:58:09PM -0800, Philip Guenther wrote: > > @nobits means the section won't have filespace (where the initialization > > data is) included in the loaded

Re: TLS with static non-PIE binaries

2017-11-08 Thread Philip Guenther
On Wed, Nov 8, 2017 at 10:43 PM, Charles Collicutt <char...@collicutt.co.uk> wrote: > On Sun, Nov 05, 2017 at 01:02:36PM -0800, Philip Guenther wrote: > > Well, ld.so and libc _should_ currently support startup-time TLS using > the > > initial-exec and local-exec modules.

Re: how does ld.so work when dlsym'ing a weak symbol (environ)

2017-11-06 Thread Philip Guenther
braries that don't depend on libc (which is the common case to permit operation across version bumps). Philip Guenther

Re: TLS with static non-PIE binaries

2017-11-05 Thread Philip Guenther
On Mon, 6 Nov 2017, Charles Collicutt wrote: > On Sun, Nov 05, 2017 at 01:02:36PM -0800, Philip Guenther wrote: > > The problem with static non-PIE executables is that we don't pass an AUX > > vector to such processes, so the startup code can't find the TLS segment > >

Re: TLS with static non-PIE binaries

2017-11-05 Thread Philip Guenther
On Sun, 5 Nov 2017, Stuart Henderson wrote: > On 2017/11/05 21:08, Charles Collicutt wrote: > > Hello, > > > > I have a program that uses Thread-Local Storage (TLS) with the 'Local Exec' > > access model [1] on AMD64. This looks like it should work on OpenBSD and, > > indeed, it mostly does. > >

proctreelk

2017-10-14 Thread Philip Guenther
() and enterthispgrp() and the splitting out of killjobc() from exit1(). This diff should address the previously reported crashes seen when using ktrace(2) while creating/exiting processes. This has been stable for quite a while under my usage; please test and report any issues. Philip Guenther

Re: kernel panic i386

2017-10-14 Thread Philip Guenther
ang. The resulting object code is _substantially_ different: that clang doesn't inline the memcmp() call is just one aspect. Is there something in that code which clang is deciding to optimize in ways that break it? Philip Guenther

Re: kernel panic i386

2017-10-14 Thread Philip Guenther
d at memcmp+0x11:repe cmpsl (%esi),%es:(%edi) > ddb> > https://www.openbsd.org/ddb.html Without a backtrace, all we can see is that a copy operation in the kernel faulted, with no indication of *which* copy operation did so. Philip Guenther

drop __plt_{start,end} support

2017-10-07 Thread Philip Guenther
Our ld hasn't generated __plt_{start,end} symbols for over a year, back in 6.0, so it's time to kill support for them in ld.so. (Where it matters, the need for the writable PLT is handled by a) marking it RWE which is automatically mapped as RW and then mprotect()ed to RX after relocation

<    1   2   3   4   5   6   7   8   9   10   >