Re: [PATCH] mk.conf(5) - cleanup after KERBEROS5 removal
On Wed, Oct 19, 2016 at 04:55:40AM +0100, Raf Czlonka wrote: > Hi all, > > KERBEROS5 remnant - "[yes]" has been introduced[0] but never removed[1]. committed, thanks! > > Cheers, > > Raf > > [0] > http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/share/man/man5/mk.conf.5.diff?r1=1.24&r2=1.25 > [1] > http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/share/man/man5/mk.conf.5.diff?r1=1.25&r2=1.26 > > Index: share/man/man5/mk.conf.5 > === > RCS file: /cvs/src/share/man/man5/mk.conf.5,v > retrieving revision 1.31 > diff -u -p -r1.31 mk.conf.5 > --- share/man/man5/mk.conf.5 31 Mar 2016 15:53:25 - 1.31 > +++ share/man/man5/mk.conf.5 19 Oct 2016 03:43:30 - > @@ -182,7 +182,6 @@ Reduces redundant tests. > Be careful! > Redundant tests may not be redundant when installing substantially > updated GNU programs. > -.Bq yes > .It Ev NOPIC > Do not build shared libraries. > .It Ev NOPIE >
Re: acpiec on acer aspire S7 with CURRENT
Thanks! Now everything seems to work. Minor tweak - maybe need extra newline after "acpiec0 at acpi0" acpiprt9 at acpi0: bus -1 (RP08) acpiprt10 at acpi0: bus -1 (PEG0) acpiprt11 at acpi0: bus -1 (PEG1) acpiprt12 at acpi0: bus -1 (PEG2) acpiec0 at acpi0acpiec0: Not running on HW-Reduced ACPI type 8 acpiec0: invalid resource #3 type 134 acpicpu0 at acpi0: C3(200@506 mwait.1@0x60), C2(200@148 mwait.1@0x33), C1(1000@1 mwait.1), PSS acpicpu1 at acpi0: C3(200@506 mwait.1@0x60), C2(200@148 mwait.1@0x33), C1(1000@1 mwait.1), PSS On Tue, Oct 18, 2016 at 11:31 AM, Paul Irofti wrote: > On Tue, Oct 18, 2016 at 10:22:06AM -0700, Ilya Kaliman wrote: >> Hi! >> >> The patch seems to work partially - acpiec now gets initialized. The >> suspend-on-lid-close does not work anymore, though (it works with my >> initial patch). > > Right, that's because I had an off-by-one in the switch case. I wonder > how my laptop managed to function with that bug... > > Please try again with this diff. > > > Index: acpidev.h > === > RCS file: /cvs/src/sys/dev/acpi/acpidev.h,v > retrieving revision 1.38 > diff -u -p -u -p -r1.38 acpidev.h > --- acpidev.h 12 Aug 2015 05:59:54 - 1.38 > +++ acpidev.h 18 Oct 2016 18:30:24 - > @@ -323,10 +323,12 @@ struct acpiec_softc { > int sc_ecbusy; > > /* command/status register */ > + bus_size_t sc_ec_sc; > bus_space_tag_t sc_cmd_bt; > bus_space_handle_t sc_cmd_bh; > > /* data register */ > + bus_size_t sc_ec_data; > bus_space_tag_t sc_data_bt; > bus_space_handle_t sc_data_bh; > > Index: acpiec.c > === > RCS file: /cvs/src/sys/dev/acpi/acpiec.c,v > retrieving revision 1.54 > diff -u -p -u -p -r1.54 acpiec.c > --- acpiec.c23 Aug 2016 18:26:21 - 1.54 > +++ acpiec.c18 Oct 2016 18:30:25 - > @@ -407,13 +407,53 @@ acpiec_getregister(const u_int8_t *buf, > } > > int > +acpiec_parse_resources(union acpi_resource *crs, void *arg) > +{ > + struct acpiec_softc *sc = arg; > + int type = AML_CRSTYPE(crs); > + > + static int argno = 0; > + > + switch (argno) { > + case 0: > + if (type != SR_IOPORT) { > + printf("%s: Unexpected resource #%d type %d\n", > + DEVNAME(sc), argno, type); > + break; > + } > + sc->sc_data_bt = sc->sc_acpi->sc_iot; > + sc->sc_ec_data = crs->sr_ioport._max; > + break; > + case 1: > + if (type != SR_IOPORT) { > + printf("%s: Unexpected resource #%d type %d\n", > + DEVNAME(sc), argno, type); > + break; > + } > + sc->sc_cmd_bt = sc->sc_acpi->sc_iot; > + sc->sc_ec_sc = crs->sr_ioport._max; > + break; > + case 2: > + if (!sc->sc_acpi->sc_hw_reduced) { > + printf("%s: Not running on HW-Reduced ACPI type %d\n", > + DEVNAME(sc), type); > + break; > + } > + /* XXX: handle SCI GPIO */ > + break; > + default: > + printf("%s: invalid resource #%d type %d\n", > + DEVNAME(sc), argno, type); > + } > + > + argno++; > + return 0; > +} > + > +int > acpiec_getcrs(struct acpiec_softc *sc, struct acpi_attach_args *aa) > { > struct aml_valueres; > - bus_size_t ec_sc, ec_data; > - int dtype, ctype; > - char*buf; > - int size, ret; > int64_t gpe; > struct acpi_ecdt*ecdt = aa->aaa_table; > extern struct aml_node aml_root; > @@ -423,11 +463,17 @@ acpiec_getcrs(struct acpiec_softc *sc, s > /* Get GPE, Data and Control segments */ > sc->sc_gpe = ecdt->gpe_bit; > > - ctype = ecdt->ec_control.address_space_id; > - ec_sc = ecdt->ec_control.address; > - > - dtype = ecdt->ec_data.address_space_id; > - ec_data = ecdt->ec_data.address; > + if (ecdt->ec_control.address_space_id == GAS_SYSTEM_IOSPACE) > + sc->sc_cmd_bt = sc->sc_acpi->sc_iot; > + else > + sc->sc_cmd_bt = sc->sc_acpi->sc_memt; > + sc->sc_ec_sc = ecdt->ec_control.address; > + > + if (ecdt->ec_data.address_space_id == GAS_SYSTEM_IOSPACE) > + sc->sc_data_bt = sc->sc_acpi->sc_iot; > + else > + sc->sc_data_bt = sc->sc_acpi->sc_memt; > + sc->sc_ec_data = e
[PATCH] mk.conf(5) - cleanup after KERBEROS5 removal
Hi all, KERBEROS5 remnant - "[yes]" has been introduced[0] but never removed[1]. Cheers, Raf [0] http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/share/man/man5/mk.conf.5.diff?r1=1.24&r2=1.25 [1] http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/share/man/man5/mk.conf.5.diff?r1=1.25&r2=1.26 Index: share/man/man5/mk.conf.5 === RCS file: /cvs/src/share/man/man5/mk.conf.5,v retrieving revision 1.31 diff -u -p -r1.31 mk.conf.5 --- share/man/man5/mk.conf.531 Mar 2016 15:53:25 - 1.31 +++ share/man/man5/mk.conf.519 Oct 2016 03:43:30 - @@ -182,7 +182,6 @@ Reduces redundant tests. Be careful! Redundant tests may not be redundant when installing substantially updated GNU programs. -.Bq yes .It Ev NOPIC Do not build shared libraries. .It Ev NOPIE
Re: bluhm's splsoftassert
On Tue, Sep 20, 2016 at 04:17:37PM +0200, Mike Belopuhov wrote: > On 20 September 2016 at 15:55, Alexander Bluhm > wrote: > > On Tue, Sep 20, 2016 at 08:21:55AM -0400, David Hill wrote: > >> With bluhm's r1.160 uipc_socket.c. > > > > With splsoftnet() in soshutdown() I can fix this one. > > > > splassert: sowwakeup: want 5 have 0 > > Starting stack trace... > > splassert_check() at splassert_check+0x78 > > sowwakeup() at sowwakeup+0x27 > > uipc_usrreq() at uipc_usrreq+0xfd > > sys_shutdown() at sys_shutdown+0x67 > > syscall() at syscall+0x27b > > --- syscall (number 134) --- > > end of kernel > > end trace frame: 0xe8f2cba5e80, count: 252 > > 0xe8f305dc16a: > > End of stack trace. > > > > ok? > > > > OK mikeb > > Can we assert that *_usrreq is always called under splsoftnet? > I recall fixing some of them for raw sockets and some such and > was wondering if the spl has to be raised before we end up there. > Just playing around with splsoftassert's and had to add the following splsoftnet's to get my machine to be quiet. Index: kern/sys_socket.c === RCS file: /cvs/src/sys/kern/sys_socket.c,v retrieving revision 1.22 diff -u -p -r1.22 sys_socket.c --- kern/sys_socket.c 6 Oct 2016 17:02:10 - 1.22 +++ kern/sys_socket.c 18 Oct 2016 20:15:47 - @@ -167,6 +167,7 @@ int soo_stat(struct file *fp, struct stat *ub, struct proc *p) { struct socket *so = fp->f_data; + int s; memset(ub, 0, sizeof (*ub)); ub->st_mode = S_IFSOCK; @@ -177,8 +178,10 @@ soo_stat(struct file *fp, struct stat *u ub->st_mode |= S_IWUSR | S_IWGRP | S_IWOTH; ub->st_uid = so->so_euid; ub->st_gid = so->so_egid; + s = splsoftnet(); (void) ((*so->so_proto->pr_usrreq)(so, PRU_SENSE, (struct mbuf *)ub, NULL, NULL, p)); + splx(s); return (0); } Index: kern/uipc_syscalls.c === RCS file: /cvs/src/sys/kern/uipc_syscalls.c,v retrieving revision 1.135 diff -u -p -r1.135 uipc_syscalls.c --- kern/uipc_syscalls.c8 Oct 2016 02:16:43 - 1.135 +++ kern/uipc_syscalls.c18 Oct 2016 20:15:47 - @@ -1049,7 +1049,7 @@ sys_getsockname(struct proc *p, void *v, struct socket *so; struct mbuf *m = NULL; socklen_t len; - int error; + int error, s; if ((error = getsock(p, SCARG(uap, fdes), &fp)) != 0) return (error); @@ -1061,7 +1061,9 @@ sys_getsockname(struct proc *p, void *v, if (error) goto bad; m = m_getclr(M_WAIT, MT_SONAME); + s = splsoftnet(); error = (*so->so_proto->pr_usrreq)(so, PRU_SOCKADDR, 0, m, 0, p); + splx(s); if (error) goto bad; error = copyaddrout(p, m, SCARG(uap, asa), len, SCARG(uap, alen)); @@ -1087,7 +1089,7 @@ sys_getpeername(struct proc *p, void *v, struct socket *so; struct mbuf *m = NULL; socklen_t len; - int error; + int error, s; if ((error = getsock(p, SCARG(uap, fdes), &fp)) != 0) return (error); @@ -1103,7 +1105,9 @@ sys_getpeername(struct proc *p, void *v, if (error) goto bad; m = m_getclr(M_WAIT, MT_SONAME); + s = splsoftnet(); error = (*so->so_proto->pr_usrreq)(so, PRU_PEERADDR, 0, m, 0, p); + splx(s); if (error) goto bad; error = copyaddrout(p, m, SCARG(uap, asa), len, SCARG(uap, alen)); Index: net/if.c === RCS file: /cvs/src/sys/net/if.c,v retrieving revision 1.455 diff -u -p -r1.455 if.c --- net/if.c16 Oct 2016 21:45:17 - 1.455 +++ net/if.c18 Oct 2016 20:15:47 - @@ -2072,9 +2072,11 @@ ifioctl(struct socket *so, u_long cmd, c default: if (so->so_proto == 0) return (EOPNOTSUPP); + s = splsoftnet(); error = ((*so->so_proto->pr_usrreq)(so, PRU_CONTROL, (struct mbuf *) cmd, (struct mbuf *) data, (struct mbuf *) ifp, p)); + splx(s); break; } Index: net/pfkey.c === RCS file: /cvs/src/sys/net/pfkey.c,v retrieving revision 1.31 diff -u -p -r1.31 pfkey.c --- net/pfkey.c 5 Sep 2016 15:12:30 - 1.31 +++ net/pfkey.c 18 Oct 2016 20:15:47 - @@ -242,6 +242,8 @@ pfkey_usrreq(struct socket *socket, int { int rval; + splsoftassert(IPL_SOFTNET); + if ((socket->so_proto->pr_protocol > PFKEY_PROTOCOL_MAX) || (socket->so_proto->pr_protocol < 0) || !pfkey_versions[socket->so_proto->pr_protocol]) Index: net/raw_usrreq.c === RCS file: /cvs/src/sys/net/raw_usrre
Re: suspend/resume on macbooks
> Date: Tue, 18 Oct 2016 21:56:13 +0200 > From: Joris Vink > > Hi, > > Sending this out so others with Macbooks can test this. > > This diff may fix suspend/resume problems seen on certain Macbooks where > your display goes black but nothing else happens. > > Note that this is babysteps as after resume your system is missing its > battery, the keyboard backlight needs a kick via wsconsctl and if you > are in X you may have to switch VT's quickly to get something to > display. > > But at least you can suspend/resume, maybe. I think this is a bad choice. See: http://mjg59.dreamwidth.org/29954.html Does Windows susped/resume successfully on that machine? > Index: dsdt.c > === > RCS file: /cvs/src/sys/dev/acpi/dsdt.c,v > retrieving revision 1.225 > diff -u -p -u -p -r1.225 dsdt.c > --- dsdt.c27 Sep 2016 10:04:19 - 1.225 > +++ dsdt.c18 Oct 2016 19:37:59 - > @@ -1493,6 +1493,7 @@ char *aml_valid_osi[] = { > "Windows 2012", > "Windows 2013", > "Windows 2015", > + "Darwin", > NULL > }; > > >
suspend/resume on macbooks
Hi, Sending this out so others with Macbooks can test this. This diff may fix suspend/resume problems seen on certain Macbooks where your display goes black but nothing else happens. Note that this is babysteps as after resume your system is missing its battery, the keyboard backlight needs a kick via wsconsctl and if you are in X you may have to switch VT's quickly to get something to display. But at least you can suspend/resume, maybe. .joris Index: dsdt.c === RCS file: /cvs/src/sys/dev/acpi/dsdt.c,v retrieving revision 1.225 diff -u -p -u -p -r1.225 dsdt.c --- dsdt.c 27 Sep 2016 10:04:19 - 1.225 +++ dsdt.c 18 Oct 2016 19:37:59 - @@ -1493,6 +1493,7 @@ char *aml_valid_osi[] = { "Windows 2012", "Windows 2013", "Windows 2015", + "Darwin", NULL };
Re: CVS: cvs.openbsd.org: src (fwd)
> Date: Sun, 16 Oct 2016 13:58:17 -0700 > From: Philip Guenther > > Should have sent this to tech... Yes please! But by terminating the loop early, I you'll miss the case where the symbol shadows both a function and a global variable. > -- Forwarded message -- > Date: Sun, 16 Oct 2016 13:57:42 -0700 > From: Philip Guenther > To: Jeremie Courreges-Anglas > Cc: source-chan...@openbsd.org > Subject: Re: CVS: cvs.openbsd.org: src > > On Sun, 16 Oct 2016, Jeremie Courreges-Anglas wrote: > > CVSROOT:/cvs > > Module name:src > > Changes by: j...@cvs.openbsd.org2016/10/16 04:40:59 > > > > Modified files: > > usr.sbin/rpc.bootparamd: bootparamd.c > > > > Log message: > > Rename local variable 'err' to 'error', to avoid -Wshadow conflicts with > > err.h > > Ick. I know that newer gcc's have stopped generating shadow warning for > local variables vs global functions, such as this case. Making these > changes just because we have an old gcc is kinda annoying. > > So let's fix that and make our gcc a bit more like new ones. Written > without peeking at the new ones and tested against the .c file at bottom > to verify that it doesn't fail or crash on some weird combo of shadowing. > > oks? > > Philip Guenther > > > Index: c-decl.c > === > RCS file: /data/src/openbsd/src/gnu/gcc/gcc/c-decl.c,v > retrieving revision 1.4 > diff -u -p -r1.4 c-decl.c > --- c-decl.c 10 Sep 2015 10:56:35 - 1.4 > +++ c-decl.c 16 Oct 2016 20:50:10 - > @@ -1946,8 +1946,19 @@ warn_if_shadowing (tree new_decl) > warning (OPT_Wshadow, "declaration of %q+D shadows a parameter", > new_decl); > else if (DECL_FILE_SCOPE_P (old_decl)) > - warning (OPT_Wshadow, "declaration of %q+D shadows a global " > -"declaration", new_decl); > + { > + /* Don't warn about shadowing a global function unless the local > +variable is a pointer to a function */ > + if (TREE_CODE (old_decl) == FUNCTION_DECL > + && TREE_CODE (new_decl) != FUNCTION_DECL > + && (TREE_CODE (new_decl) != VAR_DECL > + || !POINTER_TYPE_P (TREE_TYPE (new_decl)) > + || TREE_CODE (TREE_TYPE (TREE_TYPE (new_decl))) > +!= FUNCTION_TYPE)) > + break; > + warning (OPT_Wshadow, "declaration of %q+D shadows a global " > + "declaration", new_decl); > + } > else if (TREE_CODE (old_decl) == FUNCTION_DECL >&& DECL_BUILT_IN (old_decl)) > { > > > > -- test-shadow.c --- > int var; > void func(void); > void (*func_ptr)(void) = func; > enum { ENUM }; > typedef int type; > > void > test_var(int var_arg, void (*func_ptr_arg)(void)) > { > int var; > int func; > int func_ptr; > int ENUM; > int type; > { > int var_arg; > int func_ptr_arg; > } > } > > void > test_func_ptr(int var_arg, void (*func_ptr_arg)(void)) > { > void (*var)(void); > void (*func)(void); > void (*func_ptr)(void); > void (*ENUM)(void); > void (*type)(void); > { > void (*var_arg)(void); > void (*func_ptr_arg)(void); > } > } > > void > test_int_ptr(int var_arg, void (*func_ptr_arg)(void)) > { > int *var; > int *func; > int *func_ptr; > int *ENUM; > int *type; > { > int *var_arg; > int *func_ptr_arg; > } > } > > void > test_enum(int var_arg, void (*func_ptr_arg)(void)) > { > enum { var }; > enum { func }; > enum { func_ptr }; > enum { ENUM }; > enum { type }; > { > enum { var_arg }; > enum { func_ptr_arg }; > } > } > > void > test_type(int var_arg, void (*func_ptr_arg)(void)) > { > typedef int var; > typedef int func; > typedef int func_ptr; > typedef int ENUM; > typedef int type; > { > typedef int var_arg; > typedef int func_ptr_arg; > } > } > > void > test_var_param( > int var, > int func, > int func_ptr, > int ENUM, > int type) > { > } > > void > test_func_ptr_param( > void (*var)(void), > void (*func)(void), > void (*func_ptr)(void), > void (*ENUM)(void), > void (*type)(void)) > { > } > >
Re: sparc64: delete old "traptrace" bits
> Date: Sun, 16 Oct 2016 23:30:07 -0700 > From: Philip Guenther > > In 2003(!) a pile of code was deleted from sparc64's locore.s: > > revision 1.35 > date: 2003/05/17 07:09:08; author: art; state: Exp; lines: +1 -957; > Get rid of lots of hairy ifdefs that we'll most likely never use. > TRAPTRACE, TRAPSTATS, FLTTRACE and SCHED_DEBUG. > > mdw@ henric@ ok. > > > That was the code that actually put data into the trap_trace[] array, > rendering the remaining trap_trace* code useless. How about we delete > those bits? > > This built and the box booted with the resulting kernel. > > ok? ok kettenis@ > Index: sparc64/autoconf.c > === > RCS file: /cvs/src/sys/arch/sparc64/sparc64/autoconf.c,v > retrieving revision 1.126 > diff -u -p -r1.126 autoconf.c > --- sparc64/autoconf.c8 Jun 2016 17:24:44 - 1.126 > +++ sparc64/autoconf.c17 Oct 2016 06:25:36 - > @@ -586,11 +586,6 @@ bootpath_build(void) > #else > printf("kernel has no debugger\n"); > #endif > - } else if (*cp == 't') { > - /* turn on traptrace w/o breaking into kdb */ > - extern int trap_trace_dis; > - > - trap_trace_dis = 0; > } > } > } > Index: sparc64/db_interface.c > === > RCS file: /cvs/src/sys/arch/sparc64/sparc64/db_interface.c,v > retrieving revision 1.45 > diff -u -p -r1.45 db_interface.c > --- sparc64/db_interface.c8 Oct 2016 05:49:09 - 1.45 > +++ sparc64/db_interface.c17 Oct 2016 06:25:37 - > @@ -73,17 +73,6 @@ db_regs_t ddb_regs; /* register state */ > > extern void OF_enter(void); > > -extern struct traptrace { > - unsigned short tl:3,/* Trap level */ > - ns:4, /* PCB nsaved */ > - tt:9; /* Trap type */ > - unsigned short pid; /* PID */ > - u_int tstate; /* tstate */ > - u_int tsp; /* sp */ > - u_int tpc; /* pc */ > - u_int tfault; /* MMU tag access */ > -} trap_trace[], trap_trace_end[]; > - > static long nil; > > static int > @@ -231,14 +220,12 @@ void db_pmap_kernel(db_expr_t, int, db_e > void db_pload_cmd(db_expr_t, int, db_expr_t, char *); > void db_pmap_cmd(db_expr_t, int, db_expr_t, char *); > void db_lock(db_expr_t, int, db_expr_t, char *); > -void db_traptrace(db_expr_t, int, db_expr_t, char *); > void db_dump_buf(db_expr_t, int, db_expr_t, char *); > void db_dump_espcmd(db_expr_t, int, db_expr_t, char *); > void db_watch(db_expr_t, int, db_expr_t, char *); > void db_xir(db_expr_t, int, db_expr_t, char *); > > static void db_dump_pmap(struct pmap*); > -static void db_print_trace_entry(struct traptrace *, int); > > #ifdef MULTIPROCESSOR > void db_cpuinfo_cmd(db_expr_t, int, db_expr_t, char *); > @@ -272,9 +259,6 @@ db_ktrap(type, tf) > struct trapstate *ts = &ddb_regs.ddb_ts[0]; > extern int savetstate(struct trapstate *ts); > extern void restoretstate(int tl, struct trapstate *ts); > - extern int trap_trace_dis; > - > - trap_trace_dis++; > > #if NTDA > 0 > tda_full_blast(); > @@ -336,7 +320,6 @@ db_ktrap(type, tf) > *(struct frame *)tf->tf_out[6] = ddb_regs.ddb_fr; > #endif > *tf = ddb_regs.ddb_tf; > - trap_trace_dis--; > > #ifdef MULTIPROCESSOR > if (!db_switch_cpu) > @@ -1098,78 +1081,6 @@ db_setpcb(addr, have_addr, count, modif) > db_printf("PID %ld not found.\n", addr); > } > > -static void > -db_print_trace_entry(te, i) > - struct traptrace *te; > - int i; > -{ > - db_printf("%d:%d p:%d tt:%d:%llx:%llx %llx:%llx ", i, > - (int)te->tl, (int)te->pid, > - (int)te->tt, (unsigned long long)te->tstate, > - (unsigned long long)te->tfault, (unsigned long long)te->tsp, > - (unsigned long long)te->tpc); > - db_printsym((u_long)te->tpc, DB_STGY_PROC, db_printf); > - db_printf(": "); > - if ((te->tpc && !(te->tpc&0x3)) && > - curproc && > - (curproc->p_pid == te->pid)) { > - db_disasm((u_long)te->tpc, 0); > - } else db_printf("\n"); > -} > - > -void > -db_traptrace(addr, have_addr, count, modif) > - db_expr_t addr; > - int have_addr; > - db_expr_t count; > - char *modif; > -{ > - int i, start = 0, full = 0, reverse = 0; > - struct traptrace *end; > - > - start = 0; > - end = &trap_trace_end[0]; > - > - { > - register char c, *cp = modif; > - if (modif) > - while ((c = *cp++) != 0) { > - if (c == 'f') > - full = 1; > - if (c == 'r') > - revers
Re: acpiec on acer aspire S7 with CURRENT
On Tue, Oct 18, 2016 at 10:22:06AM -0700, Ilya Kaliman wrote: > Hi! > > The patch seems to work partially - acpiec now gets initialized. The > suspend-on-lid-close does not work anymore, though (it works with my > initial patch). Right, that's because I had an off-by-one in the switch case. I wonder how my laptop managed to function with that bug... Please try again with this diff. Index: acpidev.h === RCS file: /cvs/src/sys/dev/acpi/acpidev.h,v retrieving revision 1.38 diff -u -p -u -p -r1.38 acpidev.h --- acpidev.h 12 Aug 2015 05:59:54 - 1.38 +++ acpidev.h 18 Oct 2016 18:30:24 - @@ -323,10 +323,12 @@ struct acpiec_softc { int sc_ecbusy; /* command/status register */ + bus_size_t sc_ec_sc; bus_space_tag_t sc_cmd_bt; bus_space_handle_t sc_cmd_bh; /* data register */ + bus_size_t sc_ec_data; bus_space_tag_t sc_data_bt; bus_space_handle_t sc_data_bh; Index: acpiec.c === RCS file: /cvs/src/sys/dev/acpi/acpiec.c,v retrieving revision 1.54 diff -u -p -u -p -r1.54 acpiec.c --- acpiec.c23 Aug 2016 18:26:21 - 1.54 +++ acpiec.c18 Oct 2016 18:30:25 - @@ -407,13 +407,53 @@ acpiec_getregister(const u_int8_t *buf, } int +acpiec_parse_resources(union acpi_resource *crs, void *arg) +{ + struct acpiec_softc *sc = arg; + int type = AML_CRSTYPE(crs); + + static int argno = 0; + + switch (argno) { + case 0: + if (type != SR_IOPORT) { + printf("%s: Unexpected resource #%d type %d\n", + DEVNAME(sc), argno, type); + break; + } + sc->sc_data_bt = sc->sc_acpi->sc_iot; + sc->sc_ec_data = crs->sr_ioport._max; + break; + case 1: + if (type != SR_IOPORT) { + printf("%s: Unexpected resource #%d type %d\n", + DEVNAME(sc), argno, type); + break; + } + sc->sc_cmd_bt = sc->sc_acpi->sc_iot; + sc->sc_ec_sc = crs->sr_ioport._max; + break; + case 2: + if (!sc->sc_acpi->sc_hw_reduced) { + printf("%s: Not running on HW-Reduced ACPI type %d\n", + DEVNAME(sc), type); + break; + } + /* XXX: handle SCI GPIO */ + break; + default: + printf("%s: invalid resource #%d type %d\n", + DEVNAME(sc), argno, type); + } + + argno++; + return 0; +} + +int acpiec_getcrs(struct acpiec_softc *sc, struct acpi_attach_args *aa) { struct aml_valueres; - bus_size_t ec_sc, ec_data; - int dtype, ctype; - char*buf; - int size, ret; int64_t gpe; struct acpi_ecdt*ecdt = aa->aaa_table; extern struct aml_node aml_root; @@ -423,11 +463,17 @@ acpiec_getcrs(struct acpiec_softc *sc, s /* Get GPE, Data and Control segments */ sc->sc_gpe = ecdt->gpe_bit; - ctype = ecdt->ec_control.address_space_id; - ec_sc = ecdt->ec_control.address; - - dtype = ecdt->ec_data.address_space_id; - ec_data = ecdt->ec_data.address; + if (ecdt->ec_control.address_space_id == GAS_SYSTEM_IOSPACE) + sc->sc_cmd_bt = sc->sc_acpi->sc_iot; + else + sc->sc_cmd_bt = sc->sc_acpi->sc_memt; + sc->sc_ec_sc = ecdt->ec_control.address; + + if (ecdt->ec_data.address_space_id == GAS_SYSTEM_IOSPACE) + sc->sc_data_bt = sc->sc_acpi->sc_iot; + else + sc->sc_data_bt = sc->sc_acpi->sc_memt; + sc->sc_ec_data = ecdt->ec_data.address; /* Get devnode from header */ sc->sc_devnode = aml_searchname(&aml_root, ecdt->ec_id); @@ -456,60 +502,24 @@ acpiec_getcrs(struct acpiec_softc *sc, s return (1); } - size = res.length; - buf = res.v_buffer; - - ret = acpiec_getregister(buf, size, &dtype, &ec_data); - if (ret <= 0) { - dnprintf(10, "%s: failed to read DATA from _CRS\n", - DEVNAME(sc)); - aml_freevalue(&res); - return (1); - } - - buf += ret; - size -= ret; - - ret = acpiec_getregister(buf, size, &ctype, &ec_sc); - if (ret <= 0) { - dnprintf(10, "%s: failed to read S/C from _CRS\n", - DEVNAME(sc
Re: acpiec on acer aspire S7 with CURRENT
Hi! The patch seems to work partially - acpiec now gets initialized. The suspend-on-lid-close does not work anymore, though (it works with my initial patch). acpiprt10 at acpi0: bus -1 (PEG0) acpiprt11 at acpi0: bus -1 (PEG1) acpiprt12 at acpi0: bus -1 (PEG2) acpiec0 at acpi0acpiec0: invalid resource #0 type 8 acpiec0: Not running on HW-Reduced ACPI type 134 acpicpu0 at acpi0: C3(200@506 mwait.1@0x60), C2(200@148 mwait.1@0x33), C1(1000@1 mwait.1), PSS acpicpu1 at acpi0: C3(200@506 mwait.1@0x60), C2(200@148 mwait.1@0x33), C1(1000@1 mwait.1), PSS acpicpu2 at acpi0: C3(200@506 mwait.1@0x60), C2(200@148 mwait.1@0x33), C1(1000@1 mwait.1), PSS acpicpu3 at acpi0: C3(200@506 mwait.1@0x60), C2(200@148 mwait.1@0x33), C1(1000@1 mwait.1), PSS acpitz0 at acpi0: critical temperature is 99 degC acpitz1 at acpi0: critical temperature is 98 degC acpials0 at acpi0: ALSD acpiac0 at acpi0: AC unit online acpibat0 at acpi0: BAT0 model "AP13F3N" serial 2358 type LION oem "4f594e4153" acpibtn0 at acpi0: PWRB "10250759" at acpi0 not configured "SYN1B78" at acpi0 not configured "PNP0C14" at acpi0 not configured dwiic0 at acpi0: I2C1 addr 0xfe105000/0x1000 irq 7 iic0 at dwiic0 "BCM2E4E" at acpi0 not configured acpibtn1 at acpi0: LID0 acpibtn2 at acpi0: SLPB "PNP0C14" at acpi0 not configured "INT340E" at acpi0 not configured "INT33A0" at acpi0 not configured On Tue, Oct 18, 2016 at 3:25 AM, Paul Irofti wrote: >> Perhaps acpiec should use aml_parse_resource() instead of the hand-crafted >> parsing it does right now? That would solve the second problem, at >> least. > > Like this? > > To the OP can you please test this diff on your system and let me know > if it fixes things? > > I will move on to adding support for hardware reduced machines once this > diff is in and I see an actual ACPI dump that has GPIO AML code. > > > Index: acpidev.h > === > RCS file: /cvs/src/sys/dev/acpi/acpidev.h,v > retrieving revision 1.38 > diff -u -p -u -p -r1.38 acpidev.h > --- acpidev.h 12 Aug 2015 05:59:54 - 1.38 > +++ acpidev.h 18 Oct 2016 10:22:41 - > @@ -323,10 +323,12 @@ struct acpiec_softc { > int sc_ecbusy; > > /* command/status register */ > + bus_size_t sc_ec_sc; > bus_space_tag_t sc_cmd_bt; > bus_space_handle_t sc_cmd_bh; > > /* data register */ > + bus_size_t sc_ec_data; > bus_space_tag_t sc_data_bt; > bus_space_handle_t sc_data_bh; > > Index: acpiec.c > === > RCS file: /cvs/src/sys/dev/acpi/acpiec.c,v > retrieving revision 1.54 > diff -u -p -u -p -r1.54 acpiec.c > --- acpiec.c23 Aug 2016 18:26:21 - 1.54 > +++ acpiec.c18 Oct 2016 10:22:41 - > @@ -407,13 +407,53 @@ acpiec_getregister(const u_int8_t *buf, > } > > int > +acpiec_parse_resources(union acpi_resource *crs, void *arg) > +{ > + struct acpiec_softc *sc = arg; > + int type = AML_CRSTYPE(crs); > + > + static int argno = 0; > + > + switch (argno) { > + case 1: > + if (type != SR_IOPORT) { > + printf("%s: Unexpected resource #%d type %d\n", > + DEVNAME(sc), argno, type); > + break; > + } > + sc->sc_data_bt = sc->sc_acpi->sc_iot; > + sc->sc_ec_data = crs->sr_ioport._max; > + break; > + case 2: > + if (type != SR_IOPORT) { > + printf("%s: Unexpected resource #%d type %d\n", > + DEVNAME(sc), argno, type); > + break; > + } > + sc->sc_cmd_bt = sc->sc_acpi->sc_iot; > + sc->sc_ec_sc = crs->sr_ioport._max; > + break; > + case 3: > + if (!sc->sc_acpi->sc_hw_reduced) { > + printf("%s: Not running on HW-Reduced ACPI type %d\n", > + DEVNAME(sc), type); > + break; > + } > + /* XXX: handle SCI GPIO */ > + break; > + default: > + printf("%s: invalid resource #%d type %d\n", > + DEVNAME(sc), argno, type); > + } > + > + argno++; > + return 0; > +} > + > +int > acpiec_getcrs(struct acpiec_softc *sc, struct acpi_attach_args *aa) > { > struct aml_valueres; > - bus_size_t ec_sc, ec_data; > - int dtype, ctype; > - char*buf; > - int size, ret; > int64_t gpe; > struct acpi_ecdt*ecdt = aa->aaa_table; > extern struct aml_node aml_root; > @@ -423,11 +463,17 @@ acpiec_getcrs(struct acpiec_softc *sc, s > /* Get GPE, Data and Control
Re: splassert with if_run
I tested your change, no more messages in dmesg. Thank you. On 17 Oct 2016, at 22:52, Alexander Bluhm wrote: > On Mon, Oct 17, 2016 at 08:56:09PM +0200, egorenar-...@posteo.net wrote: >> i recently updated from 6.0 to a snapshot and >> since then i see splassert sometimes in my dmesg when i use if_run USB >> network device. > ... >> splassert_check() at splassert_check+0x78 >> sowakeup() at sowakeup+0x2c >> sorwakeup() at sorwakeup+0x84 >> route_input() at route_input+0x284 >> run_attach() at run_attach+0x322 > > This should fix it. > > ok? > > bluhm > > Index: net/rtsock.c > === > RCS file: /data/mirror/openbsd/cvs/src/sys/net/rtsock.c,v > retrieving revision 1.207 > diff -u -p -r1.207 rtsock.c > --- net/rtsock.c 27 Sep 2016 18:41:11 - 1.207 > +++ net/rtsock.c 17 Oct 2016 20:46:47 - > @@ -339,7 +339,7 @@ route_input(struct mbuf *m0, ...) > struct routecb *rop; > struct rt_msghdr *rtm; > struct mbuf *m = m0; > - int sockets = 0; > + int s, sockets = 0; > struct socket *last = NULL; > va_list ap; > struct sockproto *proto; > @@ -419,6 +419,7 @@ route_input(struct mbuf *m0, ...) > if (last) { > struct mbuf *n; > if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) != NULL) { > + s = splsoftnet(); > if (sbspace(&last->so_rcv) < (2 * MSIZE) || > sbappendaddr(&last->so_rcv, sosrc, > n, (struct mbuf *)NULL) == 0) { > @@ -435,11 +436,13 @@ route_input(struct mbuf *m0, ...) > sorwakeup(last); > sockets++; > } > + splx(s); > } > } > last = rp->rcb_socket; > } > if (last) { > + s = splsoftnet(); > if (sbspace(&last->so_rcv) < (2 * MSIZE) || > sbappendaddr(&last->so_rcv, sosrc, > m, (struct mbuf *)NULL) == 0) { > @@ -452,6 +455,7 @@ route_input(struct mbuf *m0, ...) > sorwakeup(last); > sockets++; > } > + splx(s); > } else > m_freem(m); > } >
Re: opencvs - show branch revision in status
On Mon, 17 Oct 2016 12:59:36 +0200, Joris Vink wrote: > Let's bring status a bit more inline with its GNU cvs counter part. > > This diff adds the branch revision for the sticky tag if set. OK millert@ - todd
getsockopt(2) update for SO_REUSEADDR
Hi A small update to getsockopt(2) to document that SO_REUSEADDR only works for same uid (or root). Index: lib/libc/sys/getsockopt.2 === RCS file: /cvs/src/lib/libc/sys/getsockopt.2,v retrieving revision 1.50 diff -u -p -r1.50 getsockopt.2 --- lib/libc/sys/getsockopt.2 13 Jun 2016 21:24:43 - 1.50 +++ lib/libc/sys/getsockopt.2 18 Oct 2016 13:06:48 - @@ -179,7 +179,7 @@ enables debugging in the underlying prot .Dv SO_REUSEADDR indicates that the rules used in validating addresses supplied in a .Xr bind 2 -call should allow reuse of local addresses. +call should allow reuse of local addresses (only by the same user id or root). .Dv SO_REUSEPORT allows completely duplicate bindings by multiple processes if they all set .Dv SO_REUSEPORT
fix carp "carppeer" + "real mac-address"
Hi, Currenlty when carppeer + "real mac-address" are used at once, changing MASTER by carpdemote causes "MASTER-MASTER" problem, BACKUP is to become MASTER but the present MASTER also will keep its state. The diff following will fix this problem. ok? Accept CARP advertisement packets whose destination is not for multicast. When both "carppeer" and "real mac-address" are used at once and the BACKUP is to take over the new MASTER, the present MASTER receives such packets. found by and diff from nagasaka at iij diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 9eb5552..bfbf430 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -453,7 +453,7 @@ carp_proto_input_if(struct ifnet *ifp, struct mbuf *m, int hlen) ismulti = IN_MULTICAST(ip->ip_dst.s_addr); /* check if received on a valid carp interface */ - if (!((ifp->if_type == IFT_CARP && ismulti) || + if (!(ifp->if_type == IFT_CARP || (ifp->if_type != IFT_CARP && !ismulti && ifp->if_carp != NULL))) { carpstats.carps_badif++; CARP_LOG(LOG_INFO, sc,
Re: acpiec on acer aspire S7 with CURRENT
> Perhaps acpiec should use aml_parse_resource() instead of the hand-crafted > parsing it does right now? That would solve the second problem, at > least. Like this? To the OP can you please test this diff on your system and let me know if it fixes things? I will move on to adding support for hardware reduced machines once this diff is in and I see an actual ACPI dump that has GPIO AML code. Index: acpidev.h === RCS file: /cvs/src/sys/dev/acpi/acpidev.h,v retrieving revision 1.38 diff -u -p -u -p -r1.38 acpidev.h --- acpidev.h 12 Aug 2015 05:59:54 - 1.38 +++ acpidev.h 18 Oct 2016 10:22:41 - @@ -323,10 +323,12 @@ struct acpiec_softc { int sc_ecbusy; /* command/status register */ + bus_size_t sc_ec_sc; bus_space_tag_t sc_cmd_bt; bus_space_handle_t sc_cmd_bh; /* data register */ + bus_size_t sc_ec_data; bus_space_tag_t sc_data_bt; bus_space_handle_t sc_data_bh; Index: acpiec.c === RCS file: /cvs/src/sys/dev/acpi/acpiec.c,v retrieving revision 1.54 diff -u -p -u -p -r1.54 acpiec.c --- acpiec.c23 Aug 2016 18:26:21 - 1.54 +++ acpiec.c18 Oct 2016 10:22:41 - @@ -407,13 +407,53 @@ acpiec_getregister(const u_int8_t *buf, } int +acpiec_parse_resources(union acpi_resource *crs, void *arg) +{ + struct acpiec_softc *sc = arg; + int type = AML_CRSTYPE(crs); + + static int argno = 0; + + switch (argno) { + case 1: + if (type != SR_IOPORT) { + printf("%s: Unexpected resource #%d type %d\n", + DEVNAME(sc), argno, type); + break; + } + sc->sc_data_bt = sc->sc_acpi->sc_iot; + sc->sc_ec_data = crs->sr_ioport._max; + break; + case 2: + if (type != SR_IOPORT) { + printf("%s: Unexpected resource #%d type %d\n", + DEVNAME(sc), argno, type); + break; + } + sc->sc_cmd_bt = sc->sc_acpi->sc_iot; + sc->sc_ec_sc = crs->sr_ioport._max; + break; + case 3: + if (!sc->sc_acpi->sc_hw_reduced) { + printf("%s: Not running on HW-Reduced ACPI type %d\n", + DEVNAME(sc), type); + break; + } + /* XXX: handle SCI GPIO */ + break; + default: + printf("%s: invalid resource #%d type %d\n", + DEVNAME(sc), argno, type); + } + + argno++; + return 0; +} + +int acpiec_getcrs(struct acpiec_softc *sc, struct acpi_attach_args *aa) { struct aml_valueres; - bus_size_t ec_sc, ec_data; - int dtype, ctype; - char*buf; - int size, ret; int64_t gpe; struct acpi_ecdt*ecdt = aa->aaa_table; extern struct aml_node aml_root; @@ -423,11 +463,17 @@ acpiec_getcrs(struct acpiec_softc *sc, s /* Get GPE, Data and Control segments */ sc->sc_gpe = ecdt->gpe_bit; - ctype = ecdt->ec_control.address_space_id; - ec_sc = ecdt->ec_control.address; - - dtype = ecdt->ec_data.address_space_id; - ec_data = ecdt->ec_data.address; + if (ecdt->ec_control.address_space_id == GAS_SYSTEM_IOSPACE) + sc->sc_cmd_bt = sc->sc_acpi->sc_iot; + else + sc->sc_cmd_bt = sc->sc_acpi->sc_memt; + sc->sc_ec_sc = ecdt->ec_control.address; + + if (ecdt->ec_data.address_space_id == GAS_SYSTEM_IOSPACE) + sc->sc_data_bt = sc->sc_acpi->sc_iot; + else + sc->sc_data_bt = sc->sc_acpi->sc_memt; + sc->sc_ec_data = ecdt->ec_data.address; /* Get devnode from header */ sc->sc_devnode = aml_searchname(&aml_root, ecdt->ec_id); @@ -456,60 +502,24 @@ acpiec_getcrs(struct acpiec_softc *sc, s return (1); } - size = res.length; - buf = res.v_buffer; - - ret = acpiec_getregister(buf, size, &dtype, &ec_data); - if (ret <= 0) { - dnprintf(10, "%s: failed to read DATA from _CRS\n", - DEVNAME(sc)); - aml_freevalue(&res); - return (1); - } - - buf += ret; - size -= ret; - - ret = acpiec_getregister(buf, size, &ctype, &ec_sc); - if (ret <= 0) { - dnprintf(10, "%s: failed to read S/C from _CRS\n", -
Re: malloc canaries for > page sized objects
> That is certainly not correct: snprintf and friends return the length as > it would have been if an infinite buffer was passed in. > So the strlen should stay. Oh wow. That was really stupid. Thanks
Re: malloc canaries for > page sized objects
On Tue, Oct 18, 2016 at 03:23:32AM +0200, Theo Buehler wrote: > On Sun, Oct 16, 2016 at 01:14:35PM +0200, Otto Moerbeek wrote: > > Hi, > > > > this diff is somewhat big since I decided to rewrite wrterror() to be > > able to get better error messages. > > > > Please review and test this with malloc option C (and other flags). An > > example run: > > > > a.out(85360) in free(): chunk canary corrupted 0x13c68f696000 > > 0x18a92@0x18a88 > > > > This means I overwrote a byte at offset 0x18a92 in a chunk of size > > 0x18a88 that is located at 0x13c68f696000. > > > > Only max 32 bytes after the requested size are filled with 0xdb and > > checked on free. > > This is very nice and reads very well. I tested it with C and CJ and S > on amd64 and it seems to work fine. > > A few small comments about the new wrterror(): > > In > > + snprintf(pidbuf, sizeof(pidbuf), "%s(%d) in %s(): ", __progname, > + getpid(), d->func ? d->func : "unknown"); > > I think you should truncate an insanely long __progname to 50 characters > to avoid overwriting the more important info that follows: > > snprintf(pidbuf, sizeof(pidbuf), "%.50s(%d) in %s(): ", __progname, > getpid(), d->func ? d->func : "unknown"); > > because the longest possible string after __progname is > > "(12345) in posix_memalign(): " > > which has 29 characters, so there is room for 50 non-NULs in pidbuf[80], > and these should be plenty enough to identify the offending program. indeed. > > > I'm slightly concerned about running strlen on pidbuf[] and buf[] in > case {,v}snprintf fail. Wouldn't it be cleaner to do something like > this: > > if ((ret = snprintf(pidbuf, ...)) >= 0) { > iov[0].iov_base = pidbuf; > iov[0].iov_len = ret; > } else { > /* hardcoded message */ > } > That is certainly not correct: snprintf and friends return the length as it would have been if an infinite buffer was passed in. So the strlen should stay. I'll make a new diff soon though with the error checking, although it might be overkill for this case. -Otto > and a small style nit: > > > @@ -1181,6 +1177,13 @@ omalloc(struct dir_info *pool, size_t sz > > memset(p, SOME_JUNK, > > psz - mopts.malloc_guard); > > } > > + else if (mopts.chunk_canaries) { > > } else if (mopts.chunk_canaries) { > > > + size_t csz = psz - mopts.malloc_guard - sz; > > + > > + if (csz > CHUNK_CHECK_LENGTH) > > + csz = CHUNK_CHECK_LENGTH; > > + memset(p + sz, SOME_JUNK, csz); > > + } > > } > > > > } else {