mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-21 16:57:20 +00:00
hv: Add split-lock emulation for xchg
xchg may also cause the #AC for split-lock check. This patch adds this emulation. 1. Kick other vcpus of the guest to stop execution if the guest has more than one vcpu. 2. Emulate the xchg instruction. 3. Notify other vcpus (if any) to restart execution. Tracked-On: #5605 Signed-off-by: Jie Deng <jie.deng@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -95,6 +95,21 @@ int32_t copy_to_gpa(struct acrn_vm *vm, void *h_ptr, uint64_t gpa, uint32_t size
|
||||
*/
|
||||
int32_t copy_from_gva(struct acrn_vcpu *vcpu, void *h_ptr, uint64_t gva,
|
||||
uint32_t size, uint32_t *err_code, uint64_t *fault_addr);
|
||||
/**
|
||||
* @brief Copy data to VM GVA space from HV address space
|
||||
*
|
||||
* @param[in] vcpu The pointer that points to vcpu data structure
|
||||
* @param[in] h_ptr The pointer that returns the start HV address
|
||||
* of HV memory region which data will be copied to
|
||||
* @param[out] gva The start GVA address of GVA memory region which data
|
||||
* is stored in
|
||||
* @param[in] size The size (bytes) of GVA memory region which data is
|
||||
* stored in
|
||||
* @param[out] err_code The page fault flags
|
||||
* @param[out] fault_addr The GVA address that causes a page fault
|
||||
*/
|
||||
int32_t copy_to_gva(struct acrn_vcpu *vcpu, void *h_ptr, uint64_t gva,
|
||||
uint32_t size, uint32_t *err_code, uint64_t *fault_addr);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
@@ -84,6 +84,7 @@ struct instr_emul_vie {
|
||||
struct instr_emul_vie_op op; /* opcode description */
|
||||
|
||||
uint64_t dst_gpa; /* saved dst operand gpa. Only for movs */
|
||||
uint64_t gva; /* saved gva for instruction emulation */
|
||||
};
|
||||
|
||||
struct instr_emul_ctxt {
|
||||
@@ -92,5 +93,6 @@ struct instr_emul_ctxt {
|
||||
|
||||
int32_t emulate_instruction(struct acrn_vcpu *vcpu);
|
||||
int32_t decode_instruction(struct acrn_vcpu *vcpu);
|
||||
bool is_current_opcode_xchg(struct acrn_vcpu *vcpu);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user