Date: Thu, 21 Jun 2018 21:50:00 +0000 (UTC) From: Kyle Evans <kevans@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335509 - head/sys/kern Message-ID: <201806212150.w5LLo0d3072797@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kevans Date: Thu Jun 21 21:50:00 2018 New Revision: 335509 URL: https://svnweb.freebsd.org/changeset/base/335509 Log: subr_hints: Fix acpi unit hinting (at the very least) The refactoring in r335479 overlooked the fact that the dynamic kenv can also be switched to if hintmode == 0. This is problematic because the checkmethod bits are only ever ran once, but it worked previously because the use_kenv was a global state and the first lookup would enable it if occurring after the dynamic environment has been setup. Extending our local definition of use_kenv to include all non-STATIC hintmodes as long as the dynamic_kenv is setup fixes this. We still have potential issues if the dynamic kenv comes up while we're doing an anchored search through the environment, but this is not much of a concern right now because: 1.) The dynamic environment comes up super early in boot, just after kmem 2.) This is going to get rewritten to provide a safer mechanism for the anchored searches, ensuring that we continue using the same environment chain (dynamic env or static fallback) for all anchored search invocations Reported by: mmamcy X-MFC-With: r335479 Modified: head/sys/kern/subr_hints.c Modified: head/sys/kern/subr_hints.c ============================================================================== --- head/sys/kern/subr_hints.c Thu Jun 21 21:21:16 2018 (r335508) +++ head/sys/kern/subr_hints.c Thu Jun 21 21:50:00 2018 (r335509) @@ -123,7 +123,7 @@ res_find(int *line, int *startln, { int n = 0, hit, i = 0; char r_name[32]; - int r_unit, use_kenv = (hintmode == HINTMODE_FALLBACK); + int r_unit, use_kenv = (hintmode != HINTMODE_STATIC && dynamic_kenv); char r_resname[32]; char r_value[128]; const char *s, *cp;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806212150.w5LLo0d3072797>