Re: svn commit: r333240 - in head/sys: powerpc/powerpc sys [appears to have broken the builds of head for riscv64]

2018-05-05 Thread Mark Millard
From:

https://ci.freebsd.org/job/FreeBSD-head-riscv64-build/7868/

(and later?) that tried to build -r333241 (or later):

--- bcopy.o ---
In file included from /workspace/src/sys/riscv/riscv/bcopy.c:39:0:
/workspace/src/sys/sys/systm.h:262:31: error: expected identifier or '(' before 
'{' token
 #define bcopy(from, to, len) ({\
   ^
/workspace/src/sys/riscv/riscv/bcopy.c:134:1: note: in expansion of macro 
'bcopy'
 bcopy(const void *src0, void *dst0, size_t length)
 ^
*** [bcopy.o] Error code 1

make[2]: stopped in /workspace/obj/workspace/src/riscv.riscv64/sys/RISCVTEST
1 error



The prior ci.freebsd.org build:

https://ci.freebsd.org/job/FreeBSD-head-riscv64-build/7867/

was successful and built -r333238 .


===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)

___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: SSP_CFLAGS for kernel

2018-05-05 Thread Kevin Oberman
On Sat, May 5, 2018 at 4:33 AM, Rozhuk Ivan  wrote:

> On Sat, 5 May 2018 12:38:37 +0200
> bryn1u85  wrote:
>
> > Don't touch src.conf
>
> I want to buils kernel and system with SSP too


Not relevant.

/etc/make.conf definitions are applied to ALL make operations and that
includes kernel and module building.
/etc/src.conf definitions are only applied to the kernel, modules, and
ports. When src.conf was created, it was explicitly NOT intended that the
file be used for building ports, but someone has changed that. It probably
should have been used for ports that built kernel modules, but not any
others, but that is not the case.
>From bsd.port.mk:
# We prefer to pass MK_*=no but it was only supported after a certain
# revision.  Passing WITHOUT_* may conflict with a make.conf or src.conf's
# WITH_* value.  Note that ports *do* pull in src.conf.
--
Kevin Oberman, Part time kid herder and retired Network Engineer
E-mail: rkober...@gmail.com
PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: IGNORE_OSVERSION=yes -- can't install pkg

2018-05-05 Thread Rodney W. Grimes
> On Sat, 2018-05-05 at 08:26 -0700, Chris H wrote:
> > On Fri, 04 May 2018 22:57:52 -0700  said
> > 
> > > 
> > > I just setup a jail from a 12-CURRENT I built awhile ago. It has no
> > > ports
> > > tree. So I'm attempting
> > > to install svnlite. issuing pkg search svnlite returns
> > > The package management tool is not yet installed on your system.
> > > Do you want to fetch and install it now? [y/N]: y
> > > Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:12:amd64/
> > > latest,
> > > please wait...
> > > Verifying signature with trusted certificate
> > > pkg.freebsd.org.2013102301...
> > > done
> > > [12current.localhost] Installing pkg-1.10.5...
> > > Newer FreeBSD version for package pkg:
> > > To ignore this error set IGNORE_OSVERSION=yes
> > > - package: 1200062
> > > - running kernel: 1200054
> > > Allow missmatch now?[Y/n]:
> > > 
> > > Umm, what? Should I ignore this error? If so, why is there an error
> > > at all?
> > > I answered no. Guess I won't be able to use pkg(8) on this jail(8).
> > > :-(
> > > 
> > > --Chris
> > OK the only reference[1] I can find regarding this, indicates that
> > answering "Y"
> > to Allow missmatch now? resulted in an ABI mismatch that caused
> > pkg(8) to be
> > unusable.
> > This is on an older version of 12, so I don't have anything that
> > might have
> > appeared in UPDATING. I really need this jail to resolve accumulating
> > pr(1)'s
> > on ports(7) I maintain.
> > 
> > Thank you.
> 
> The difference between 1200062 and 1200054 isn't going to affect
> anything except modules which are intimate with kernel internals, such
> as video drivers or virtualbox type stuff.
> 
> IMO, this new version checking done by pkg(8) is just bad Bad BAD. The
> only control you get is a knob that tells you to ignore any version
> mismatch. There appears to be no option to get the historical worked-
> really-well behavior of ignoring mismatches of the minor version for
> people who track -current.
> 
> -- Ian

And we also have packages that themselves arguable spit out
warnings simply cause they are built in a jail and against
a false kernel version that makes them think the ABI might
be different  (lsof port as an example).

-- 
Rod Grimes rgri...@freebsd.org
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: IGNORE_OSVERSION=yes -- can't install pkg

2018-05-05 Thread Ian Lepore
On Sat, 2018-05-05 at 08:26 -0700, Chris H wrote:
> On Fri, 04 May 2018 22:57:52 -0700  said
> 
> > 
> > I just setup a jail from a 12-CURRENT I built awhile ago. It has no
> > ports
> > tree. So I'm attempting
> > to install svnlite. issuing pkg search svnlite returns
> > The package management tool is not yet installed on your system.
> > Do you want to fetch and install it now? [y/N]: y
> > Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:12:amd64/
> > latest,
> > please wait...
> > Verifying signature with trusted certificate
> > pkg.freebsd.org.2013102301...
> > done
> > [12current.localhost] Installing pkg-1.10.5...
> > Newer FreeBSD version for package pkg:
> > To ignore this error set IGNORE_OSVERSION=yes
> > - package: 1200062
> > - running kernel: 1200054
> > Allow missmatch now?[Y/n]:
> > 
> > Umm, what? Should I ignore this error? If so, why is there an error
> > at all?
> > I answered no. Guess I won't be able to use pkg(8) on this jail(8).
> > :-(
> > 
> > --Chris
> OK the only reference[1] I can find regarding this, indicates that
> answering "Y"
> to Allow missmatch now? resulted in an ABI mismatch that caused
> pkg(8) to be
> unusable.
> This is on an older version of 12, so I don't have anything that
> might have
> appeared in UPDATING. I really need this jail to resolve accumulating
> pr(1)'s
> on ports(7) I maintain.
> 
> Thank you.

The difference between 1200062 and 1200054 isn't going to affect
anything except modules which are intimate with kernel internals, such
as video drivers or virtualbox type stuff.

IMO, this new version checking done by pkg(8) is just bad Bad BAD. The
only control you get is a knob that tells you to ignore any version
mismatch. There appears to be no option to get the historical worked-
really-well behavior of ignoring mismatches of the minor version for
people who track -current.

-- Ian

___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Regression Resume Lenovo T450

2018-05-05 Thread Manuel Stühn

On Fri, May 04, 2018 at 11:05:16AM -0700, Pete Wright wrote:



On 05/03/2018 23:07, Manuel Stühn wrote:


Since some time now CURRENT runs very smoothly on my Lenovo T450 in
conjunction with drm-stable-kmod installed. WLAN, Suspense
worked out of the box (at least ... until now). Due to pkg(8)
complaining about wrong ABI of packages, I've made an update from
r332385 (1200061) to r333091 (1200062), and now the T450 does not
resume anymore; i have to hold the power button for some time to power
it down. The ZFS-Boot-Environment I've made beforehand updating is
still capable of resuming.

I tried to find out which commit broke the resume for me by installing
older kernels, but even installing r332385 kernel (into the actual
r333091 userland) does not restore its capability to resume.

Any ideas or hints? Which information can i provide to help
investigating this matter?


have you tried suspend/resume without having the drm-next kmod loaded? 


Same effect. No resume...

--
Manuel

___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: IGNORE_OSVERSION=yes -- can't install pkg

2018-05-05 Thread Chris H

On Fri, 04 May 2018 22:57:52 -0700  said


I just setup a jail from a 12-CURRENT I built awhile ago. It has no ports
tree. So I'm attempting
to install svnlite. issuing pkg search svnlite returns
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:12:amd64/latest,
please wait...
Verifying signature with trusted certificate pkg.freebsd.org.2013102301...
done
[12current.localhost] Installing pkg-1.10.5...
Newer FreeBSD version for package pkg:
To ignore this error set IGNORE_OSVERSION=yes
- package: 1200062
- running kernel: 1200054
Allow missmatch now?[Y/n]:

Umm, what? Should I ignore this error? If so, why is there an error at all?
I answered no. Guess I won't be able to use pkg(8) on this jail(8). :-(

--Chris

OK the only reference[1] I can find regarding this, indicates that answering "Y"
to Allow missmatch now? resulted in an ABI mismatch that caused pkg(8) to be
unusable.
This is on an older version of 12, so I don't have anything that might have
appeared in UPDATING. I really need this jail to resolve accumulating pr(1)'s
on ports(7) I maintain.

Thank you.

--Chris

1 
https://unix.stackexchange.com/questions/430038/installed-incompatible-pkg-version-how-to-uninstall-or-fix-otherwise






___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: SSP_CFLAGS for kernel

2018-05-05 Thread Rozhuk Ivan
On Sat, 5 May 2018 12:38:37 +0200
bryn1u85  wrote:

> Don't touch src.conf

I want to buils kernel and system with SSP too.

 
> Entry for make.conf should looks like below:
> 
> WITH_SSP_PORTS=YES
> 
> SSP_CFLAGS=-fstack-protector-all
> 
> SSP_CXXFLAGS=-fstack-protector-all
 
SSP_CXXFLAGS does not used in system and ports, at least on 11.2.
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: SSP_CFLAGS for kernel

2018-05-05 Thread bryn1u85
Hey,
Don't touch src.conf

Entry for make.conf should looks like below:

WITH_SSP_PORTS=YES

SSP_CFLAGS=-fstack-protector-all

SSP_CXXFLAGS=-fstack-protector-all

It's working for me.

2018-05-05 2:59 GMT+02:00 Rozhuk Ivan :

> Hi!
>
> I set:
>
> /etc/src.conf:
> WITH_SSP=
>
> /etc/make.conf:
> SSP_CFLAGS=-fstack-protector-all
> WITH_SSP_PORTS=yes
>
>
> But in /usr/src/sys/conf/kern.mk:
>
> ...
> #
> # GCC SSP support
> #
> .if ${MK_SSP} != "no" && \
> ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips"
> CFLAGS+=-fstack-protector
> .endif
> ...
>
>
> Is there should be some thing like in /usr/src/share/mk/bsd.sys.mk:
>
> SSP_CFLAGS?=-fstack-protector
> CFLAGS+=${SSP_CFLAGS}
>
> ???
>
>
> PS: /usr/ports/UPDATING
> "The default SSP_CLFAGS is -fstack-protector, but -fstack-protector-all"
> should be:
> "The default SSP_CFLAGS is -fstack-protector, but -fstack-protector-all"
> ___
> freebsd-hack...@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
>
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: svn commit: r333175 - in head/sys: kern net netinet netinet6 sys: TRAP 12

2018-05-05 Thread O. Hartmann
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Am Thu, 3 May 2018 22:23:52 +0200
"O. Hartmann"  schrieb:


I'm not familiar with kernel debugging, so there are some struggles.

After compiling a debugging kernel on 

Version String: FreeBSD 12.0-CURRENT #2 r333269: Sat May  5 08:10:32 CEST 2018

Panic String: Lock tcp not exclusively locked @ 
/usr/src/sys/netinet/in_pcb.c:1391


And this is what I can provide you with:


Reading symbols from 
/usr/obj/usr/src/amd64.amd64/sys/WALHALL-DEBUG/kernel.full...done.

Unread portion of the kernel message buffer:
panic: Lock tcp not exclusively locked @ /usr/src/sys/netinet/in_pcb.c:1391

cpuid = 4
time = 1525510291
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfe00e485e670
vpanic() at vpanic+0x1a3/frame 0xfe00e485e6d0
panic() at panic+0x43/frame 0xfe00e485e730
_rw_wunlock_cookie() at _rw_wunlock_cookie+0x137/frame 0xfe00e485e760
in_pcbfree() at in_pcbfree+0x51a/frame 0xfe00e485e7b0
tcp_usr_detach() at tcp_usr_detach+0x15e/frame 0xfe00e485e7f0
sofree() at sofree+0x2f4/frame 0xfe00e485e840
soclose() at soclose+0x387/frame 0xfe00e485e8b0
closef() at closef+0x1f5/frame 0xfe00e485e940
closefp() at closefp+0xa0/frame 0xfe00e485e980
amd64_syscall() at amd64_syscall+0x6d3/frame 0xfe00e485eab0
fast_syscall_common() at fast_syscall_common+0x101/frame 0xfe00e485eab0
- --- syscall (6, FreeBSD ELF64, sys_close), rip = 0x80111adda, rsp = 
0x7fffdf3f7228, rbp =
0x7fffdf3f7240 --- KDB: enter: panic

__curthread () at ./machine/pcpu.h:231
231 __asm("movq %%gs:%1,%0" : "=r" (td)
(kgdb) bt
(kgdb) bt
#0  __curthread () at ./machine/pcpu.h:231
#1  doadump (textdump=0) at /usr/src/sys/kern/kern_shutdown.c:365
#2  0x80597d5b in db_dump (dummy=, dummy2=,
dummy3=, dummy4=) at /usr/src/sys/ddb/db_command.c:574
#3  0x80597ae6 in db_command (last_cmdp=, 
cmd_table=, dopager=) at /usr/src/sys/ddb/db_command.c:481 #4
out>0x80597814 in db_command_loop () at 
/usr/src/sys/ddb/db_command.c:534
#5  0x8059b04f in db_trap (type=, code=)
at /usr/src/sys/ddb/db_main.c:250 #6  0x80924463 in kdb_trap (type=3,
code=-61456, tf=) at /usr/src/sys/kern/subr_kdb.c:697 #7
0x80c80ab7 in trap (frame=0xfe00e485e5a0)
at /usr/src/sys/amd64/amd64/trap.c:550 #8   #9  kdb_enter
(why=0x80dd7b54 "panic", msg=) at 
/usr/src/sys/kern/subr_kdb.c:479
#10 0x808db500 in vpanic (fmt=, ap=0xfe00e485e710)
at /usr/src/sys/kern/kern_shutdown.c:851 #11 0x808db593 in panic
(fmt=0x8125bbd8  "\251\312\332\200\377\377\377\377")
at /usr/src/sys/kern/kern_shutdown.c:789 #12 0x808d65b7 in __rw_assert
(c=0xfe00111ee650, what=4, file=0x80dc5157 
"/usr/src/sys/netinet/in_pcb.c",
line=1391) at /usr/src/sys/kern/kern_rwlock.c:1426 #13 _rw_wunlock_cookie
(c=0xfe00111ee650, file=0x80dc5157 "/usr/src/sys/netinet/in_pcb.c",
line=1391) at /usr/src/sys/kern/kern_rwlock.c:362 #14 0x80a68caa in 
in_pcbfree
(inp=0xf80066058b10) at /usr/src/sys/netinet/in_pcb.c:1391 #15 
0x80b09a6e in
tcp_detach (so=, inp=)
at /usr/src/sys/netinet/tcp_usrreq.c:258 #16 tcp_usr_detach (so=)
at /usr/src/sys/netinet/tcp_usrreq.c:289 #17 0x8097c394 in sofree
(so=0xf8001988d358) at /usr/src/sys/kern/uipc_socket.c:1032 #18 
0x8097d487 in
soclose (so=0xf8001988d358) at /usr/src/sys/kern/uipc_socket.c:1126 #19
0x80885ad5 in fo_close (fp=, td=)
at /usr/src/sys/sys/file.h:348 #20 _fdrop (fp=, td=)
at /usr/src/sys/kern/kern_descrip.c:2957 #21 closef (fp=0xf80004ef4eb0,
td=0xf80019891560) at /usr/src/sys/kern/kern_descrip.c:2538 #22 
0x80882920 in
closefp (fdp=0xf80019553450, fd=12, fp=0xf80004ef4eb0, 
td=0xf80019891560,
holdleaders=0) at /usr/src/sys/kern/kern_descrip.c:1208 #23 0x80c82033 
in
syscallenter (td=0xf80019891560)
at /usr/src/sys/amd64/amd64/../../kern/subr_syscall.c:135 #24 amd64_syscall
(td=0xf80019891560, traced=0) at /usr/src/sys/amd64/amd64/trap.c:945 #25 
 #26 0x00080111adda in ?? () Backtrace stopped: Cannot 
access memory
at address 0x7fffdf3f7228 (kgdb) 




> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA512
> 
> Am Thu, 3 May 2018 12:53:05 -0700
> "K. Macy"  schrieb:
> 
> > Can you give any context on what they're doing? In addition - even on
> > a production kernel it's possible to compile in DDB to at least get a
> > backtrace. Your report only gives us enough information to know that  
> 
> Not at the moment. The immediate crash corrupted the /usr/src filesystem so I 
> can not
> recompile a kernel. Every attempt to /etc/netstart the network on the buggy 
> kernel ends
> up in a further destruction, so I stopped at this very moment and hopefully I 
> can
> copy /usr/src from a r33153 box (r333153 is for me the last working revision) 
> via USB
> flash drive and recompile the kernel. But I'll go for 

Re: Recent warnings.

2018-05-05 Thread Herbert J. Skuhra
On Sat, 05 May 2018 02:09:26 +0200, Sean Bruno wrote:
> 
> make[3]: "/usr/src/share/mk/bsd.prog.mk" line 274: warning: duplicate
> script for target "_scriptsinstall" ignored
> make[3]: "/usr/src/share/mk/bsd.prog.mk" line 274: warning: using
> previous script for "_scriptsinstall" defined here
> 
> 
> This popped up on me this week.  Anyone see what's going on?

This is obviously caused by this change:

Index: share/mk/bsd.prog.mk
===
--- share/mk/bsd.prog.mk(revision 333235)
+++ share/mk/bsd.prog.mk(revision 333236)
@@ -271,6 +271,7 @@
 SCRIPTSMODE_${script:T}?=  ${SCRIPTSMODE}
 STAGE_AS_${script:T}=  
${SCRIPTSDIR_${script:T}}/${SCRIPTSNAME_${script:T}}
 _scriptsinstall: _SCRIPTSINS_${script:T}
+   echo ">SFD>F>DF YES"
 _SCRIPTSINS_${script:T}: ${script}
${INSTALL} ${TAG_ARGS} -o ${SCRIPTSOWN_${.ALLSRC:T}} \
-g ${SCRIPTSGRP_${.ALLSRC:T}} -m ${SCRIPTSMODE_${.ALLSRC:T}} \

-- 
Herbert
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


IGNORE_OSVERSION=yes -- can't install pkg

2018-05-05 Thread Chris H

I just setup a jail from a 12-CURRENT I built awhile ago. It has no ports tree. 
So I'm attempting
to install svnlite. issuing pkg search svnlite returns
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:12:amd64/latest, 
please wait...
Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done
[12current.localhost] Installing pkg-1.10.5...
Newer FreeBSD version for package pkg:
To ignore this error set IGNORE_OSVERSION=yes
- package: 1200062
- running kernel: 1200054
Allow missmatch now?[Y/n]:

Umm, what? Should I ignore this error? If so, why is there an error at all?
I answered no. Guess I won't be able to use pkg(8) on this jail(8). :-(

--Chris


___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: OSVERSION

2018-05-05 Thread Chris H

On Fri, 04 May 2018 15:39:00 -0600 "Ian Lepore"  said


On Fri, 2018-05-04 at 15:28 -0600, Alan Somers wrote:
> On Fri, May 4, 2018 at 2:46 PM, Jeffrey Bouquet 
> wrote:
> 
> > 
> > 12.0-CURRENT r332797 GENERIC amd64

> > ..
> > make: "/usr/ports/Mk/bsd.port.mk" line 1171: Unable to
> > determine OS version. Either define OSVERSION, or
> > install /usr/include/sys/param.h...
> > ..
> > then , with param.h in place
> > 
> > ..

> > port builds, pkgdb -u, and  portsdb -u all fail with:
> > ..
> > line 1200: UNAME_r (12.0-CURRENT) and OSVERSION (12.0-CURRENT) do not
> agree
> > on major version number.
> > ..
> > Can I set that in sh or tcsh or zsh?
> > .
> > 
> Looks like you're running ports in a jail.  The best way to do that is to

> set OSVERSION in /etc/make.conf.  Some jail managers will even do that for
> you.  It should look a little like this:
> 
>  > cat /etc/make.conf

> OSVERSION+=1100122
> UNAME_ENV+= OSVERSION=${OSVERSION}
> UNAME_ENV+= UNAME_s=FreeBSD
> UNAME_ENV+= UNAME_r=11.0-RELEASE
> UNAME_ENV+= UNAME_v="${UNAME_s} ${UNAME_r}"
> .MAKEFLAGS: ${UNAME_ENV}
> MAKE_ENV+=  ${UNAME_ENV}
> CONFIGURE_ENV+= ${UNAME_ENV}
> SCRIPTS_ENV+=   ${UNAME_ENV}

If you're running a freebsd 11 jail on a freebsd 12 host, the best
solution is to set osrelease and osreldate in your jail config to
reflect the 11.x userland you want the jail to implement. Then all the
values returned by uname and various sysctls will be consistently
correct within the jail. For example, on a 10.3 host I have a jail:

fb8 {
host.hostname = "${name}.hippie.lan";
ip4.addr = 172.22.42.241;
persist = true;
devfs_ruleset = 100;
osrelease="8.4-STABLE";
osreldate= 804507;
}

-- Ian

+1
I do exactly the same in my jails to better isolate them from the host.
In fact, you can even lie about what (os)version you're using, if you
need to. :-)

--Chris

___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"



___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


[CFT] call AcpiLeaveSleepStatePrep after re-enabling interrupts

2018-05-05 Thread Andriy Gapon

I would like ask for help with testing this change
https://reviews.freebsd.org/D15306

I want to do this change because that call (actually,
AcpiHwLegacyWakePrep) does a memory allocation and ACPI namespace
evaluation. Although it is not very likely to run into any trouble, it
is still not safe to make those calls with interrupts disabled. Also,
AcpiLeaveSleepStatePrep is documented as called when interrupts are
enabled. witness(4) and malloc(9) do not currently check for a context
with interrupts disabled via intr_disable and we lack a facility for
doing that. So, those unsafe operations fly under the radar. But if
intr_disable in acpi_EnterSleepState was replaced with spinlock_enter
(which it probably should be), then witness and malloc would
immmediately complain.

The ACPI wakeup sequence is very sensitive to changes, but I consider
this change to be rather safe. What AcpiHwLegacyWakePrep essentially
does is writing a value corresponding to S0 into SLP_TYPx bits of PM1
Control Register(s). According to ACPI specifications that write should
be a NOP as SLP_EN bit is not set. Additionally, there are no accesses
to ACPI hardware and firmware between the old location of the call and
the new one. So, the move should not affect the interaction between
then OS and ACPI platform.

Index: sys/dev/acpica/acpi.c
===
--- sys/dev/acpica/acpi.c   (revision 333269)
+++ sys/dev/acpica/acpi.c   (working copy)
@@ -2975,8 +2975,6 @@ acpi_EnterSleepState(struct acpi_softc *sc, int st
if (sleep_result == 1 && state != ACPI_STATE_S4)
AcpiWriteBitRegister(ACPI_BITREG_SCI_ENABLE, ACPI_ENABLE_EVENT);

-   AcpiLeaveSleepStatePrep(state);
-
if (sleep_result == 1 && state == ACPI_STATE_S3) {
/*
 * Prevent mis-interpretation of the wakeup by power button
@@ -3005,6 +3003,8 @@ acpi_EnterSleepState(struct acpi_softc *sc, int st
/* call acpi_wakeup_machdep() again with interrupt enabled */
acpi_wakeup_machdep(sc, state, sleep_result, 1);

+   AcpiLeaveSleepStatePrep(state);
+
if (sleep_result == -1)
goto backout;


-- 
Andriy Gapon
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"