8.2. Flushing Caches¶
To support the C3 power state without using the ARB_DIS feature, the hardware must provide functionality to flush and invalidate the processors’ caches (for an IA processor, this would be the WBINVD instruction). To support the S1, S2 or S3 sleeping states, the hardware must provide functionality to flush the platform caches. Flushing of caches is supported by one of the following mechanisms:
Processor instruction to write back and invalidate system caches (WBINVD instruction for IA processors).
Processor instruction to write back but not invalidate system caches (WBINVD instruction for IA processors and some chipsets with partial support; that is, they don’t invalidate the caches).
The ACPI specification expects all platforms to support the local CPU instruction for flushing system caches (with support in both the CPU and chipset), and provides some limited “best effort” support for systems that don’t currently meet this capability. The method used by the platform is indicated through the appropriate FADT fields and flags indicated in this section.
ACPI specifies parameters in the FADT that describe the system’s cache capabilities. If the platform properly supports the processor’s write back and invalidate instruction (WBINVD for IA processors), then this support is indicated to OSPM by setting the WBINVD flag in the FADT.
If the platform supports neither of the first two flushing options, then OSPM can attempt to manually flush the cache if it meets the following criteria:
A cache-enabled sequential read of contiguous physical memory of not more than 2 MB will flush the platform caches.
There are two additional FADT fields needed to support manual flushing of the caches:
FLUSH_SIZE, typically twice the size of the largest cache in the system.
FLUSH_STRIDE, typically the smallest cache line size in the system.