From: Al Stone <ahs3@redhat.com>
To: Matthew Garrett <matthew.garrett@nebula.com>, linux-acpi@vger.kernel.org
Cc: rjw@rjwysocki.net, lenb@kernel.org, linux-kernel@vger.kernel.org,
Matthew Garrett <mjg59@srcf.ucam.org>
Subject: Re: [PATCH] ACPI: Adjust the return value of _REV on x86
Date: Mon, 16 Mar 2015 14:34:24 -0600 [thread overview]
Message-ID: <55073E50.3010309@redhat.com> (raw)
In-Reply-To: <1426150247-18309-1-git-send-email-matthew.garrett@nebula.com>
On 03/12/2015 02:50 AM, Matthew Garrett wrote:
> The ACPI spec describes _REV as:
>
> "This predefined object evaluates to the revision of the ACPI Specification
> that the specified \_OS implements"
>
> We've been assuming that this should increment as ACPICA gains support for
> new versions of the spec. Unfortunately, Windows always reports "2" for this
> value and vendors are now using this as a means to tell whether a system is
> running Windows or Linux. From an HP Envy 15:
>
> If (LOr (LEqual (_REV, 0x03), LEqual (_REV, 0x05)))
>
> From a Dell XPS 13:
>
> If ((_REV == 0x05))
>
> In both cases, the systems then alter hardware initialisation paths and
> device capability reporting. As written, this makes no sense - ACPI
> maintains backwards compatibility, so the appropriate test would be >=
> rather than ==. On closer examination, the HP code uses the same
> initialisation paths as would be used if the system responded to
> _OSI("Linux"), and as such the evidence is overwhelmingly that vendors are
> using this to alter system behaviour when Linux is detected.
>
> Since we aim to be compatible with Windows, this tends to break things. The
> ideal solution would be to wait for an _OSI() query matching Windows and
> then change behaviour, but Windows responds to _REV with 2 even before that
> and so vendors might simply change the order of queries in order to continue
> IDing Linux. The easiest thing for us to do is just to change the value on
> X86 and leave a comment describing why everything is so awful.
>
> Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>
> ---
> include/acpi/acconfig.h | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
> index 03aacfb..cebb8a7 100644
> --- a/include/acpi/acconfig.h
> +++ b/include/acpi/acconfig.h
> @@ -112,9 +112,19 @@
> *
> *****************************************************************************/
>
> -/* Version of ACPI supported */
> -
> +/*
> + * Version of ACPI supported. This is a sad story. Windows reports a _REV of
> + * 2 regardless of the spec version implemented. Some vendors are using _REV
> + * as a way to distinguish between Windows and Linux, and are breaking systems
> + * in the process. We can't guarantee that they'll call _OSI before checking
> + * _REV, so hardcode this to 2 on x86 systems right now and leave it at the
> + * appropriate spec value for everybody else.
> + */
> +#ifdef CONFIG_X86
> +#define ACPI_CA_SUPPORT_LEVEL 2
> +#else
> #define ACPI_CA_SUPPORT_LEVEL 5
> +#endif
>
> /* Maximum count for a semaphore object */
>
>
More a philosophical question -- the patch seems fine to me, personally, and
for arm64, we have to have >= 5 anyway -- but would it make sense to just not
acknowledge _REV and deprecate it from the kernel and the spec? I'm already
trying to get rid of _OSI because of such silliness and force requests to _OSC
where they should be (granted, it will take some time...).
It just seems to be that there should be some consequences to the vendors when
they do things like this, and while I'm not that keen to break existing things,
maybe that's what needs to happen to make the point.
--
ciao,
al
-----------------------------------
Al Stone
Software Engineer
Red Hat, Inc.
ahs3@redhat.com
-----------------------------------
next prev parent reply other threads:[~2015-03-16 20:34 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-12 8:50 [PATCH] ACPI: Adjust the return value of _REV on x86 Matthew Garrett
2015-03-14 19:58 ` Jason Ekstrand
2015-03-16 23:21 ` Jason Ekstrand
2015-03-23 12:04 ` Matt Fleming
2015-03-24 5:50 ` Mario Limonciello
2015-03-24 9:17 ` Liam Girdwood
2015-03-24 14:41 ` Mario Limonciello
2015-03-24 15:24 ` Matt Fleming
2015-03-24 17:22 ` Mario Limonciello
2015-03-24 18:01 ` Matthew Garrett
2015-03-24 19:53 ` Mario Limonciello
2015-03-24 20:00 ` Matthew Garrett
2015-03-24 20:02 ` Rafael J. Wysocki
2015-03-24 20:21 ` Mario Limonciello
2015-03-16 20:34 ` Al Stone [this message]
2015-03-16 21:01 ` Matthew Garrett
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55073E50.3010309@redhat.com \
--to=ahs3@redhat.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew.garrett@nebula.com \
--cc=mjg59@srcf.ucam.org \
--cc=rjw@rjwysocki.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).