16.2. Flushing Caches¶
Before entering the S1, S2 or S3 sleeping states, OSPM is responsible for flushing the system caches. ACPI provides a number of mechanisms to flush system caches. These include:
Using a native instruction (for example, the IA-32 architecture WBINVD instruction) to flush and invalidate platform caches.
WBINVD_FLUSH flag set (1) in the FADT indicates the system provides this support level.
Using the IA-32 instruction WBINVD to flush but not invalidate the platform caches.
WBINVD flag set (1) in the FADT indicates the system provides this support level.
The manual flush mechanism has two caveats:
Largest cache is 1 MB in size (FLUSH_SIZE is a maximum value of 2 MB).
No victim caches (for which the manual flush algorithm is unreliable).
Processors with built-in victim caches will not support the manual flush mechanism and are therefore required to support the WBINVD mechanism to use the S2 or S3 state.
The manual cache-flushing mechanism relies on the two FADT fields:
FLUSH_SIZE. Indicates twice the size of the largest cache in bytes.
FLUSH_STRIDE. Indicates the smallest line size of the caches in bytes.
The cache flush size value is typically twice the size of the largest cache size, and the cache flush stride value is typically the size of the smallest cache line size in the platform. OSPM will flush the system caches by reading a contiguous block of memory indicated by the cache flush size.