From owner-svn-src-all@freebsd.org Thu Apr 14 16:39:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 916C4ADA040 for ; Thu, 14 Apr 2016 16:39:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ig0-x235.google.com (mail-ig0-x235.google.com [IPv6:2607:f8b0:4001:c05::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 628A91CD9 for ; Thu, 14 Apr 2016 16:39:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ig0-x235.google.com with SMTP id ui10so96470492igc.1 for ; Thu, 14 Apr 2016 09:39:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=To0P4yQombfNbUssNbnMWuaPRzsaI6SimE/H1NX/E6Y=; b=updYngVSoG6a2ms0del8nqvXjamrtt3iKJVD8MPuSFP6zDA0rZ/8H4IvITfeEfN3yj Y1XpUJdOPThsb7lC9vTvh/L9yOxettXGxbeEWt7lGAL4atIITb+K3jrln7JSAJK+Gymr K0vjauW8JHAUgERGkFmc3iUuGWlseyNqezkFYKQL7By4hASD47NrQkIPaQRuPbvjEjEx bHX4LQ63ZHuNrmcCKMAWtqtnVo12po/T3a4CKeax2UDmNWd82KBSAg1jIEltOaDrvsVO F8gnfXhHeO8kBru8CiIaM3iMfcIr9uojc9g0D67ZExoD/DjfCdreY5TJHSaSnFIh/3Qq 78TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=To0P4yQombfNbUssNbnMWuaPRzsaI6SimE/H1NX/E6Y=; b=BU7vxo/FkDLZC5MJ7eh/sxuNojlPurwCh+y9bAFLR0ktVOdX2Tu9wJSmXttvmP0PJL gD7AfYNPOdaaQM7vFPpim4Bsui/aZ3zsSSMPrnHDyDREi3hlSkPGPIvHGfVpWwF1o2u0 nRXL3ms5zsnrjzmbTZCs+06qNNT09yiIeJfXhX9WPd5DpWW/mndi2foBQDubNPRLMrUp uZrf8BJeoWUNmMxYZVOM2kvcwpDOExbCOYv5trjtTFiXyfDpZISYH5ncoJG0c2LIcK8I YM/I+EJpVwA3NrQbPo4/8Z8KK/6HGA4hpYIVxjGiI/r5WpNryYnWELMROGzdSiRFZp1J /2Dw== X-Gm-Message-State: AOPr4FWx+08/hHzEK0Yfj0RL0Fj38p97q5hFxClkQig/Oc+XyunHzFCYU1GaPtGMturIKm/ykY9GRzHG1+B0Iw== MIME-Version: 1.0 X-Received: by 10.50.108.108 with SMTP id hj12mr17650869igb.57.1460651968595; Thu, 14 Apr 2016 09:39:28 -0700 (PDT) Sender: wlosh@bsdimp.com Received: by 10.36.194.3 with HTTP; Thu, 14 Apr 2016 09:39:28 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <20160414172239.G13791@besplex.bde.org> References: <201604140459.u3E4xpYv038183@repo.freebsd.org> <20160414172239.G13791@besplex.bde.org> Date: Thu, 14 Apr 2016 10:39:28 -0600 X-Google-Sender-Auth: PVjbLmK1aktCnZ_VHMYec0oBTak Message-ID: Subject: Re: svn commit: r297954 - in head/sys: boot/efi/loader/arch/amd64 boot/i386/libi386 x86/acpica From: Warner Losh To: Bruce Evans Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 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: Thu, 14 Apr 2016 16:39:29 -0000 On Thu, Apr 14, 2016 at 1:56 AM, Bruce Evans 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