hv: refine guest.c

- move `vcpumask2pcpumask` from `guest.c` to `vcpu.c`
- move `prepare_sos_vm_memmap` from `guest.c` to `vm.c`
- rename `guest.c` to `guest_memory.c`

Tracked-On: #2484
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Shiqing Gao
2019-02-01 13:56:17 +08:00
committed by Eddie Dong
parent be946ca8e0
commit 49623fc073
6 changed files with 81 additions and 75 deletions

View File

@@ -70,8 +70,6 @@
#define LDTR_AR (0x0082U) /* LDT, type must be 2, refer to SDM Vol3 26.3.1.2 */
#define TR_AR (0x008bU) /* TSS (busy), refer to SDM Vol3 26.3.1.2 */
void prepare_sos_vm_memmap(struct acrn_vm *vm);
/* Use # of paging level to identify paging mode */
enum vm_paging_mode {
PAGING_MODE_0_LEVEL = 0U, /* Flat */
@@ -84,8 +82,6 @@ enum vm_paging_mode {
/*
* VM related APIs
*/
uint64_t vcpumask2pcpumask(struct acrn_vm *vm, uint64_t vdmask);
int32_t gva2gpa(struct acrn_vcpu *vcpu, uint64_t gva, uint64_t *gpa, uint32_t *err_code);
enum vm_paging_mode get_vcpu_paging_mode(struct acrn_vcpu *vcpu);

View File

@@ -599,6 +599,16 @@ void schedule_vcpu(struct acrn_vcpu *vcpu);
*/
int32_t prepare_vcpu(struct acrn_vm *vm, uint16_t pcpu_id);
/**
* @brief get physical destination cpu mask
*
* get the corresponding physical destination cpu mask for the vm and virtual destination cpu mask
*
* @param[in] vm pointer to vm data structure
* @param[in] vdmask virtual destination cpu mask
*/
uint64_t vcpumask2pcpumask(struct acrn_vm *vm, uint64_t vdmask);
/**
* @}
*/