Skip to content

Commit 1d4e0b3

Browse files
kirylrafaeljw
authored andcommitted
ACPICA: Hardware: Do not flush CPU cache when entering S4 and S5
ACPICA commit 3dd7e1f3996456ef81bfe14cba29860e8d42949e According to ACPI 6.4, Section 16.2, the CPU cache flushing is required on entering to S1, S2, and S3, but the ACPICA code flushes the CPU cache regardless of the sleep state. Blind cache flush on entering S5 causes problems for TDX. Flushing happens with WBINVD that is not supported in the TDX environment. TDX only supports S5 and adjusting ACPICA code to conform to the spec more strictly fixes the issue. Link: acpica/acpica@3dd7e1f3 Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 0acf24a commit 1d4e0b3

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

drivers/acpi/acpica/hwesleep.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ acpi_status acpi_hw_extended_sleep(u8 sleep_state)
104104

105105
/* Flush caches, as per ACPI specification */
106106

107-
ACPI_FLUSH_CPU_CACHE();
107+
if (sleep_state < ACPI_STATE_S4) {
108+
ACPI_FLUSH_CPU_CACHE();
109+
}
108110

109111
status = acpi_os_enter_sleep(sleep_state, sleep_control, 0);
110112
if (status == AE_CTRL_TERMINATE) {

drivers/acpi/acpica/hwsleep.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ acpi_status acpi_hw_legacy_sleep(u8 sleep_state)
110110

111111
/* Flush caches, as per ACPI specification */
112112

113-
ACPI_FLUSH_CPU_CACHE();
113+
if (sleep_state < ACPI_STATE_S4) {
114+
ACPI_FLUSH_CPU_CACHE();
115+
}
114116

115117
status = acpi_os_enter_sleep(sleep_state, pm1a_control, pm1b_control);
116118
if (status == AE_CTRL_TERMINATE) {

drivers/acpi/acpica/hwxfsleep.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,6 @@ acpi_status acpi_enter_sleep_state_s4bios(void)
162162
return_ACPI_STATUS(status);
163163
}
164164

165-
ACPI_FLUSH_CPU_CACHE();
166-
167165
status = acpi_hw_write_port(acpi_gbl_FADT.smi_command,
168166
(u32)acpi_gbl_FADT.s4_bios_request, 8);
169167
if (ACPI_FAILURE(status)) {

0 commit comments

Comments
 (0)