HV: Add flush_address_space API.
flush_address_space is used to flush address space by clflushopt instruction. Signed-off-by: Jack Ren <jack.ren@intel.com> Signed-off-by: Yuan Liu <yuan1.liu@intel.com> Reviewed-by: Li, Fei1 <fei1.li@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
6fd397e82b
commit
f81585eb3d
|
@ -294,3 +294,16 @@ void init_paging(void)
|
|||
/* set ptep in sanitized_page point to itself */
|
||||
sanitize_pte((uint64_t *)sanitized_page);
|
||||
}
|
||||
|
||||
/*
|
||||
* @pre: addr != NULL && size != 0
|
||||
*/
|
||||
void flush_address_space(void *addr, uint64_t size)
|
||||
{
|
||||
uint64_t n = 0UL;
|
||||
|
||||
while (n < size) {
|
||||
clflushopt((char *)addr + n);
|
||||
n += CACHE_LINE_SIZE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -150,6 +150,18 @@ void flush_vpid_single(uint16_t vpid);
|
|||
* @return None
|
||||
*/
|
||||
void flush_vpid_global(void);
|
||||
|
||||
/**
|
||||
* @brief Flush address space
|
||||
*
|
||||
* @param[in] addr the specified virtual address
|
||||
*
|
||||
* @param[in] size the specified size to flush
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
void flush_address_space(void *addr, uint64_t size);
|
||||
|
||||
/**
|
||||
* @brief Guest-physical mappings and combined mappings invalidation
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue