* [PATCH] ACPI: Provide a spec conform OSI interface to the BIOS
@ 2008-07-17 17:37 Thomas Renninger
2008-07-18 7:16 ` Andi Kleen
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Renninger @ 2008-07-17 17:37 UTC (permalink / raw)
To: ak; +Cc: linux-acpi, Thomas Renninger
Introduce acpi_osi=windows_false boot parameter
Introduce CONFIG_ACPI_OSI_SPEC_CONFORM config option
This will return false to _OSI("Windows XY") calls.
Signed-off-by: Thomas Renninger <trenn@suse.de>
---
Documentation/kernel-parameters.txt | 1 +
drivers/acpi/Kconfig | 12 ++++++++++++
drivers/acpi/osl.c | 28 ++++++++++++++++++++++------
3 files changed, 35 insertions(+), 6 deletions(-)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index c657339..6acfe8e 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -178,6 +178,7 @@ and is between 256 and 4096 characters. It is defined in the file
acpi_osi= [HW,ACPI] Modify list of supported OS interface strings
acpi_osi="string1" # add string1 -- only one string
acpi_osi="!string2" # remove built-in string2
+ acpi_osi="windows_false"# remove all Windows strings
acpi_osi= # disable all strings
acpi_serialize [HW,ACPI] force serialization of AML methods
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index c52fca8..5fac9c9 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -314,6 +314,18 @@ config ACPI_BLACKLIST_YEAR
Enter 0 to disable this mechanism and allow ACPI to
run by default no matter what the year. (default)
+config ACPI_OSI_WINDOWS_FALSE
+ bool "Return false for Window strings for OSI(\"string\") BIOS calls"
+ default n
+ help
+ By default Linux tries to stay transparent to Windows OSes to the
+ BIOS and returns true for all currently known Windows OS strings and
+ false for Linux.
+ With this option set, OSI will return false for Windows strings.
+ The kernel will still return false for _OSI("Linux") BIOS calls
+ by default, but eventually return true for _OSI("Linux"), depending
+ on a blacklist.
+
config ACPI_DEBUG
bool "Debug Statements"
default n
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 235a138..bf951f6 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -194,11 +194,6 @@ static int __init acpi_reserve_resources(void)
}
device_initcall(acpi_reserve_resources);
-acpi_status __init acpi_os_initialize(void)
-{
- return AE_OK;
-}
-
acpi_status acpi_os_initialize1(void)
{
kacpid_wq = create_singlethread_workqueue("kacpid");
@@ -943,7 +938,7 @@ static void __init set_osi_linux(unsigned int enable)
if (osi_linux.enable != enable) {
osi_linux.enable = enable;
printk(KERN_NOTICE PREFIX "%sed _OSI(Linux)\n",
- enable ? "Add": "Delet");
+ enable ? "Add": "Delete");
}
return;
}
@@ -972,6 +967,25 @@ void __init acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d)
return;
}
+static void __init acpi_osi_windows_false(void) {
+
+ acpi_osi_invalidate("Windows 2000");
+ acpi_osi_invalidate("Windows 2001");
+ acpi_osi_invalidate("Windows 2001 SP1");
+ acpi_osi_invalidate("Windows 2001 SP2");
+ acpi_osi_invalidate("Windows 2001.1");
+ acpi_osi_invalidate("Windows 2001.1 SP1");
+ acpi_osi_invalidate("Windows 2006");
+}
+
+acpi_status __init acpi_os_initialize(void)
+{
+#ifdef CONFIG_ACPI_OSI_WINDOWS_FALSE
+ acpi_osi_windows_false();
+#endif
+ return AE_OK;
+}
+
/*
* Modify the list of "OS Interfaces" reported to BIOS via _OSI
*
@@ -984,6 +998,8 @@ int __init acpi_osi_setup(char *str)
if (str == NULL || *str == '\0') {
printk(KERN_INFO PREFIX "_OSI method disabled\n");
acpi_gbl_create_osi_method = FALSE;
+ } else if (strcmp("windows_false", str)) {
+ acpi_osi_windows_false();
} else if (!strcmp("!Linux", str)) {
acpi_cmdline_osi_linux(0); /* !enable */
} else if (*str == '!') {
--
1.5.4.5
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] ACPI: Provide a spec conform OSI interface to the BIOS
2008-07-17 17:37 [PATCH] ACPI: Provide a spec conform OSI interface to the BIOS Thomas Renninger
@ 2008-07-18 7:16 ` Andi Kleen
2008-07-18 17:22 ` Thomas Renninger
0 siblings, 1 reply; 5+ messages in thread
From: Andi Kleen @ 2008-07-18 7:16 UTC (permalink / raw)
To: Thomas Renninger; +Cc: linux-acpi
Thomas Renninger wrote:
> Introduce acpi_osi=windows_false boot parameter
> Introduce CONFIG_ACPI_OSI_SPEC_CONFORM config option
Why are you adding the CONFIG option? In what circumstances would one
set it? If anything I think this should be a boot option only for now.
I'm not sure this is the right direction anyways, see earlier comments.
Probably needs more discussion first.
-Andi
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ACPI: Provide a spec conform OSI interface to the BIOS
2008-07-18 7:16 ` Andi Kleen
@ 2008-07-18 17:22 ` Thomas Renninger
2008-07-20 2:27 ` Len Brown
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Renninger @ 2008-07-18 17:22 UTC (permalink / raw)
To: Andi Kleen; +Cc: linux-acpi
On Friday 18 July 2008 09:16:25 am Andi Kleen wrote:
> Thomas Renninger wrote:
> > Introduce acpi_osi=windows_false boot parameter
> > Introduce CONFIG_ACPI_OSI_SPEC_CONFORM config option
>
> Why are you adding the CONFIG option?
> In what circumstances would one
> set it? If anything I think this should be a boot option only for now.
E.g. for OEMs that do not need to support all BIOSes in the world who
can just check for the config option and then know it behaves as written in
the spec and being able to support Linux and Windows through the same BIOS.
But you are right, the compile option only makes sense if acpi_osi="Windows
2006" can be used to simulate a specific Windows OS via boot param, which is
not the case.
But I want the boot param. This one makes very much sense to test BIOSes
whether they stick to the ACPI spec and work fine on Linux without Windows
simulation. Is that ok?
> Probably needs more discussion first.
I always wanted to write down the arguments again, but this takes a lot time.
Will you accept the boot param only?
Thomas
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] ACPI: Provide a spec conform OSI interface to the BIOS
2008-07-18 17:22 ` Thomas Renninger
@ 2008-07-20 2:27 ` Len Brown
2008-07-24 15:27 ` Thomas Renninger
0 siblings, 1 reply; 5+ messages in thread
From: Len Brown @ 2008-07-20 2:27 UTC (permalink / raw)
To: Thomas Renninger; +Cc: Andi Kleen, linux-acpi
On Fri, 18 Jul 2008, Thomas Renninger wrote:
> On Friday 18 July 2008 09:16:25 am Andi Kleen wrote:
> > Thomas Renninger wrote:
> > > Introduce acpi_osi=windows_false boot parameter
> > > Introduce CONFIG_ACPI_OSI_SPEC_CONFORM config option
> >
> > Why are you adding the CONFIG option?
> > In what circumstances would one
> > set it? If anything I think this should be a boot option only for now.
> E.g. for OEMs that do not need to support all BIOSes in the world who
> can just check for the config option and then know it behaves as written in
> the spec and being able to support Linux and Windows through the same BIOS.
>
> But you are right, the compile option only makes sense if acpi_osi="Windows
> 2006" can be used to simulate a specific Windows OS via boot param, which is
> not the case.
>
> But I want the boot param. This one makes very much sense to test BIOSes
> whether they stick to the ACPI spec and work fine on Linux without Windows
> simulation. Is that ok?
>
> > Probably needs more discussion first.
> I always wanted to write down the arguments again, but this takes a lot time.
> Will you accept the boot param only?
I don't see a case for this.
This workaround is needed only if there is a Linux bug.
I'd rather expose and fix that Linux bug than open
the door to sweeping it under the rug and making
Linux harder to maintain.
-Len
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ACPI: Provide a spec conform OSI interface to the BIOS
2008-07-20 2:27 ` Len Brown
@ 2008-07-24 15:27 ` Thomas Renninger
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Renninger @ 2008-07-24 15:27 UTC (permalink / raw)
To: Len Brown; +Cc: Andi Kleen, linux-acpi
On Sunday 20 July 2008 04:27:19 Len Brown wrote:
> On Fri, 18 Jul 2008, Thomas Renninger wrote:
> > On Friday 18 July 2008 09:16:25 am Andi Kleen wrote:
> > > Thomas Renninger wrote:
> > > > Introduce acpi_osi=windows_false boot parameter
> > > > Introduce CONFIG_ACPI_OSI_SPEC_CONFORM config option
> > >
> > > Why are you adding the CONFIG option?
> > > In what circumstances would one
> > > set it? If anything I think this should be a boot option only for now.
> >
> > E.g. for OEMs that do not need to support all BIOSes in the world who
> > can just check for the config option and then know it behaves as written
> > in the spec and being able to support Linux and Windows through the same
> > BIOS.
> >
> > But you are right, the compile option only makes sense if
> > acpi_osi="Windows 2006" can be used to simulate a specific Windows OS via
> > boot param, which is not the case.
> >
> > But I want the boot param. This one makes very much sense to test BIOSes
> > whether they stick to the ACPI spec and work fine on Linux without
> > Windows simulation. Is that ok?
> >
> > > Probably needs more discussion first.
> >
> > I always wanted to write down the arguments again, but this takes a lot
> > time.
> >
> > Will you accept the boot param only?
>
> I don't see a case for this.
This is part of a T61 ThinkPad BIOS:
# BIOS thinks we are running on XP or NT
If (\_OSI ("Windows 2001"))
{
Store (0x01, \WNTF)
Store (0x01, \WXPF)
Store (0x00, \WSPV)
}
If (\_OSI ("Windows 2001 SP1"))
{
Store (0x01, \WSPV)
}
If (\_OSI ("Windows 2001 SP2"))
{
Store (0x02, \WSPV)
}
# WVIS -> Bios thinks we are running on Vista
If (\_OSI ("Windows 2006"))
{
Store (0x01, \WVIS)
}
So this BIOS on Linux has all above variables set and thinks it
is running on Vista and on XP...
Later they check e.g. on (hmm, this could be a clever way to trick
current Linux implementation, having Vista and XP set should only
happen on Linux):
If (LAnd (\WXPF, LNot (\WVIS)))
{
Notify (\_SB.PCI0, Arg1)
}
Else
{
Notify (\_SB.PCI0.VID, Arg1)
}
or only:
If (VIGD)
{
If (\WVIS)
{
\VBTD ()
}
}
> This workaround is needed only if there is a Linux bug.
?!?
One intent is to use it as a boot param to identify OSI issues.
If a problem points to _OSI and things are too complicated to figure out, one
can pass acpi_osi=windows_false to test whether removing all Windows hooks
works.
It is also for research to find out how broken BIOSes are out there and
whether they run fine without Windows hooks.
> I'd rather expose and fix that Linux bug than open
> the door to sweeping it under the rug and making
> Linux harder to maintain.
Len, this (the boot param only) is to make our life (ACPI bug tracking)
easier, could you please add it.
Thanks,
Thomas
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-07-24 15:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-17 17:37 [PATCH] ACPI: Provide a spec conform OSI interface to the BIOS Thomas Renninger
2008-07-18 7:16 ` Andi Kleen
2008-07-18 17:22 ` Thomas Renninger
2008-07-20 2:27 ` Len Brown
2008-07-24 15:27 ` Thomas Renninger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox