From owner-svn-src-all@freebsd.org Tue Nov 17 18:00:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1705B46AEBD; Tue, 17 Nov 2020 18:00:05 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CbDHT08tjz3Ds6; Tue, 17 Nov 2020 18:00:05 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id E7A79FC16; Tue, 17 Nov 2020 18:00:04 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f175.google.com with SMTP id 3so16390219qtx.3; Tue, 17 Nov 2020 10:00:04 -0800 (PST) X-Gm-Message-State: AOAM533GI75F6QcxSmEn8go7JXhTEghUfIRcVOwGuR2VRwiqVk4OFA/D d+jEELb3otWwTYtr0AUmupUr4kxZcIh8DctZDDg= X-Google-Smtp-Source: ABdhPJwgtAZ0r9qA1SamyEd+VNWxSbuBJ4ZUuD9Mxcx/ySuv3qK47sk/WcL2DYWN3VHEtdu/dquveM0MVaKZHyJrGs8= X-Received: by 2002:ac8:4897:: with SMTP id i23mr349650qtq.211.1605636004421; Tue, 17 Nov 2020 10:00:04 -0800 (PST) MIME-Version: 1.0 References: <202011170336.0AH3awYt006482@repo.freebsd.org> <20201117171114.GA1158@spindle.one-eyed-alien.net> In-Reply-To: <20201117171114.GA1158@spindle.one-eyed-alien.net> From: Kyle Evans Date: Tue, 17 Nov 2020 11:59:50 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r367744 - in head/sys: compat/freebsd32 kern sys To: Brooks Davis Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Nov 2020 18:00:05 -0000 On Tue, Nov 17, 2020 at 11:11 AM Brooks Davis wrote: > > On Tue, Nov 17, 2020 at 03:36:58AM +0000, Kyle Evans wrote: > > Modified: head/sys/compat/freebsd32/freebsd32.h > > ============================================================================== > > --- head/sys/compat/freebsd32/freebsd32.h Tue Nov 17 03:34:01 2020 (r367743) > > +++ head/sys/compat/freebsd32/freebsd32.h Tue Nov 17 03:36:58 2020 (r367744) > > @@ -94,6 +94,27 @@ struct itimerval32 { > > struct timeval32 it_value; > > }; > > > > +struct umtx_time32 { > > + struct timespec32 _timeout; > > + uint32_t _flags; > > + uint32_t _clockid; > > +}; > > + > > +struct umtx_robust_lists_params_compat32 { > > + uint32_t robust_list_offset; > > + uint32_t robust_priv_list_offset; > > + uint32_t robust_inact_offset; > > +}; > > + > > +struct umutex32 { > > + volatile __lwpid_t m_owner; /* Owner of the mutex */ > > + __uint32_t m_flags; /* Flags of the mutex */ > > + __uint32_t m_ceilings[2]; /* Priority protect ceiling */ > > + __uint32_t m_rb_lnk; /* Robust linkage */ > > + __uint32_t m_pad; > > + __uint32_t m_spare[2]; > > +}; > > + > > #define FREEBSD4_MFSNAMELEN 16 > > #define FREEBSD4_MNAMELEN (88 - 2 * sizeof(int32_t)) > > > > > > Modified: head/sys/compat/freebsd32/freebsd32_misc.c > > ============================================================================== > > --- head/sys/compat/freebsd32/freebsd32_misc.c Tue Nov 17 03:34:01 2020 (r367743) > > +++ head/sys/compat/freebsd32/freebsd32_misc.c Tue Nov 17 03:36:58 2020 (r367744) > > @@ -84,6 +84,7 @@ __FBSDID("$FreeBSD$"); > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -3764,4 +3765,12 @@ freebsd32_sched_rr_get_interval(struct thread *td, > > error = copyout(&ts32, uap->interval, sizeof(ts32)); > > } > > return (error); > > +} > > + > > +int > > +freebsd32__umtx_op(struct thread *td, struct freebsd32__umtx_op_args *uap) > > +{ > > + > > + return (kern__umtx_op(td, uap->obj, uap->op, uap->val, uap->uaddr, > > + uap->uaddr2, &umtx_native_ops32)); > > } > > > > Putting any of this under compat/freebsd32 seems like a somewhat > odd choice since all the work is done in kern_umtx.h. In CheriBSD, > everything just lives there so nothing has to be exposed in headers. > I have no strong opinion here -- my initial impression of the suggestion to move the struct definitions into freebsd32 was that: 1.) One can then quickly reference the definition of, e.g., timespec32 when I'm looking at a umtx_time32, and 2.) It'd be 'cleaner', requiring less #ifdef soup in kern_umtx.c The follow-up patch muddies the waters a lot, as we end up using the compat32 definitions on all 64-bit platforms anyways even without compat32. I don't object to moving any/all of this back, if you think that's better. Thanks, Kyle Evans