On 11/25/2013 11:01 AM, Al Stone wrote:
On 11/25/2013 10:45 AM, Matthew Garrett wrote:
On Mon, Nov 25, 2013 at 10:43:27AM -0700, Al Stone wrote:
On 11/25/2013 08:30 AM, Matthew Garrett wrote:
Is ACPI_REDUCED_HARDWARE supposed to indicate support for the reduced hardware profile, or that the platform *only* implements the reduced hardware profile?
From what I can see in ACPICA, ACPI_REDUCED_HARDWARE indicates the platform *only* implements the reduced hardware profile. This *seems* to be consistent with the specification -- see 3.11.1, second bullet, for example:
Ok, so a kernel built without ACPI_REDUCED_HARDWARE would still support the reduced hardware profile?
Let me check on that. The reduced hardware profile is a pretty strict subset, and I think I can see a way where I could force selecting the reduced HW profile on boot if the kernel has been built *without* ACPI_REDUCED_HARDWARE. What I am not convinced of is that all of the proper guards are in place in ACPICA -- I trust that they have been, but I would like to double check.
If I can get that to work properly, I'll add it to this patch set.
I thought I could get this to work, but I am going to have to defer to the ACPICA upstream folks. For the time being, I think that all of the architectures that want to use ACPI in either legacy mode or in stripped down reduced HW mode will have to use different kernels, one for each mode. I thought there might be enough safety checks to allow the kernel to boot in legacy mode and switch into reduced HW at boot, but there are not, in my opinion. I don't see a way to make the switch *and* maintain conformance with the spec without significant change to ACPICA itself.
For example, enforcing that various functions are not allowed while in reduced HW mode could be done by a check of the reduced HW flag on entry. If it is set, return the value the function would have returned had it been stubbed out for reduced HW mode. This is simple enough but to do so would require modifying at least 29 functions in ACPICA, by my count, not something upstream is particularly keen on -- nor am I. I'd rather step back and work with ACPICA over the longer term and see if there's some way to get this functionality implemented properly instead of trying to bolt it on somehow.
...if by "not supported" one takes that to mean "does not exist when compiled." I can look at the ACPICA code again, just the same; perhaps there is some reasonable way to at least select one or the other at boot as the first step, and then allow switching between modes as a later step.
I don't think you'd ever want to switch after init time. There's a flag in the FADT that indicates whether a system is implementing the reduced hardware profile or not.
Agreed. I could see it as something to use when experimenting perhaps, but I think just allowing the switch at boot would cover the majority of the use cases.