mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-21 00:38:28 +00:00
hv: io_req: refine vhm_req status setting
In spite of vhm_req status could be updated in HV and DM on different CPUs, they only change vhm_req status when they detect vhm_req status has been updated by each other. So vhm_req status will not been misconfigured. However, before HV sets vhm_req status to REQ_STATE_PENDING, vhm_req buffer filling should be visible to DM. Add a write memory barrier to guarantee this. Tracked-On: #1842 Signed-off-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
@@ -351,6 +351,12 @@ static inline void cpu_sp_write(uint64_t *stack_ptr)
|
||||
asm volatile ("movq %0, %%rsp" : : "r"(rsp));
|
||||
}
|
||||
|
||||
/* Synchronizes all write accesses to memory */
|
||||
static inline void cpu_write_memory_barrier(void)
|
||||
{
|
||||
asm volatile ("sfence\n" : : : "memory");
|
||||
}
|
||||
|
||||
/* Synchronizes all read and write accesses to/from memory */
|
||||
static inline void cpu_memory_barrier(void)
|
||||
{
|
||||
|
Reference in New Issue
Block a user