Latest ACPI update removed some essential configuration

* The global lock, needed for hw <-> os to sync, was a no op.
  This means that OS and HW could read and write to same value
  at the same time, causing garbled data and crashes. This is easiest
  to see in battery status, where battery values and OEM name would
  become garbage. It also causes instability and failure to shutdown

* ACPI used 64 bit addressing (which it normally should) on 32 bit.
  This would cause page faults as it would jump to incorrect addresses
This commit is contained in:
Fredrik Holmqvist 2017-12-30 19:17:58 +01:00
parent 699b4bbab9
commit 7d93e79a04

View File

@ -181,6 +181,11 @@ struct mutex;
#define ACPI_MACHINE_WIDTH 64
#else
#define ACPI_MACHINE_WIDTH 32
/* TODO: Temporary fix for #12377
DO NOT REMOVE as otherwise we get address overflows
Use 32 bit addresses to match addr_t for now.
*/
#define ACPI_32BIT_PHYSICAL_ADDRESS
#endif
@ -192,6 +197,21 @@ struct mutex;
#define ACPI_FLUSH_CPU_CACHE() __asm __volatile("wbinvd");
/* Based on FreeBSD's due to lack of documentation
DO NOT REMOVE, the fallback is no ops, which means
HW <-> OS sync is not done => garbled data..
*/
extern int AcpiOsAcquireGlobalLock(uint32 *lock);
extern int AcpiOsReleaseGlobalLock(uint32 *lock);
#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) do { \
(Acq) = AcpiOsAcquireGlobalLock((uint32 *)&((GLptr)->GlobalLock)); \
} while (0)
#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) do { \
(Acq) = AcpiOsReleaseGlobalLock((uint32 *)&((GLptr)->GlobalLock)); \
} while (0)
#else /* _KERNEL_MODE */
/* Host-dependent types and defines for user-space ACPICA */