hv: prevent WBINVD after psram is initialized

Prevent WBINVD to be called after psram is initialized,
otherwise the content of pSRAM will be destroyed.

Tracked-On: #5330

Signed-off-by: Qian Wang <qian1.wang@intel.com>
This commit is contained in:
Qian Wang 2020-09-27 16:41:22 +08:00 committed by wenlingz
parent 928bc38bf6
commit af62d57567

View File

@ -150,9 +150,11 @@ void flush_address_space(void *addr, uint64_t size);
*/
void invept(const void *eptp);
extern volatile bool psram_is_initialized;
static inline void cache_flush_invalidate_all(void)
{
asm volatile (" wbinvd\n" : : : "memory");
if (psram_is_initialized == false)
asm volatile (" wbinvd\n" : : : "memory");
}
static inline void clflush(const volatile void *p)