Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Apr 2016 10:39:28 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        Warner Losh <imp@freebsd.org>, src-committers <src-committers@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>,  "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r297954 - in head/sys: boot/efi/loader/arch/amd64 boot/i386/libi386 x86/acpica
Message-ID:  <CANCZdfoCZwAxpNLqxO48h_24gSByprnfEB67TnCyt9me3MnD1g@mail.gmail.com>
In-Reply-To: <20160414172239.G13791@besplex.bde.org>
References:  <201604140459.u3E4xpYv038183@repo.freebsd.org> <20160414172239.G13791@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Apr 14, 2016 at 1:56 AM, Bruce Evans <brde@optusnet.com.au> wrote:

> On Thu, 14 Apr 2016, Warner Losh wrote:
>
> Log:
>>  Deprecate using hints.acpi.0.rsdp to communicate the RSDP to the
>>  system. This uses the hints mechnanism. This mostly works today
>>  because when there's no static hints (the default), this value can be
>>  fetched from the hint. When there is a static hints file, the hint
>>  passed from the boot loader to the kernel is ignored, but for the BIOS
>>  case we're able to find it anyway. However, with UEFI, the fallback
>>  doesn't work, so we get a panic instead.
>>
>
> The new static_hints.disabled option allows overriding static hints.  The
> override global, so hints generally have to be duplicated in both static
> hints and /boot/device.hints, like they are or should be in the example
> source files.
>
>  Switch to acpi.rsdp and use TUNABLE_ULONG_FETCH instead. Continue to
>>  generate the old values to allow for transitions. In addition, fall
>>  back to the old method if the new method isn't present.
>>
>
> This only works if there is no static env (the default).  The new
> static_env.disabled option allows overriding static env.
>

Correct. Static environments are generally not used in x86.


> I used to have this problem with all 50-100 hints and tunables that I
> use.  static hints and env killed everything in /boot config files,
> and also killed all additions and changes in loader.  This rarely
> mattered since I rarely use loader, and I keep the /boot files in sync
> with static hints and env, but it required a kernel recompile or editing
> the kernel binary to change anything.  Editing the kernel binary is
> actually fairly easy.  It needs an editor that doesn't clobber binary
> data, but the editor doesn't need to dispay or have search capability
> for binary data since the hints and env string are text.
>
> ...
>> Modified: head/sys/x86/acpica/OsdEnvironment.c
>>
>> ==============================================================================
>> --- head/sys/x86/acpica/OsdEnvironment.c        Thu Apr 14 04:54:47 2016
>>       (r297953)
>> +++ head/sys/x86/acpica/OsdEnvironment.c        Thu Apr 14 04:59:51 2016
>>       (r297954)
>> ...
>> @@ -59,6 +60,16 @@ acpi_get_root_from_loader(void)
>> {
>>         long acpi_root;
>>
>> +       if (TUNABLE_ULONG_FETCH("acpi.rsdp", &acpi_root))
>> +               return (acpi_root);
>> +
>> +       /*
>> +        * The hints mechanism is unreliable (it fails if anybody ever
>> +        * compiled in hints to the kernel). It has been replaced
>> +        * by the tunable method, but is used here as a fallback to
>> +        * retain maximum compatibility between old loaders and new
>> +        * kernels. It can be removed after 11.0R.
>> +        */
>>         if (resource_long_value("acpi", 0, "rsdp", &acpi_root) == 0)
>>                 return (acpi_root);
>>
>
> Having 2 mechanisms stupid.  It basically gives more than 2 ways of
> foot shooting by using 2 spellings of the same variable (both easy to
> forget or misspell in interactive use) and possibly not supporting all
> combinations.  Despite its verboseness, the above doesn't detect
> inconsistent settings or document the precedence for inconsistent
> settings anywhere uses can see it.  It documents planned breakage for
> 1 of the mechanisms.


The second method will be deleted in the fullness of time. If I delete it
now, I break the upgrade path.

Warner



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfoCZwAxpNLqxO48h_24gSByprnfEB67TnCyt9me3MnD1g>