mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-12 20:39:59 +00:00
hv: Replace dynamic memory allocation for MSR bitmap
Replace pointer with static memory for msr_bitmap inside structure vm_arch. Tracked-On: #861 Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com> Reviewed-by: Anthony Xu <anthony.xu@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -292,9 +292,6 @@ int shutdown_vm(struct vm *vm)
|
||||
/* Free EPT allocated resources assigned to VM */
|
||||
destroy_ept(vm);
|
||||
|
||||
/* Free MSR bitmap */
|
||||
free(vm->arch_vm.msr_bitmap);
|
||||
|
||||
/* TODO: De-initialize I/O Emulation */
|
||||
free_io_emulation_resource(vm);
|
||||
|
||||
|
@@ -55,7 +55,7 @@ void init_msr_emulation(struct vcpu *vcpu)
|
||||
{
|
||||
uint32_t i;
|
||||
uint32_t msrs_count = ARRAY_SIZE(emulated_msrs);
|
||||
void *msr_bitmap;
|
||||
uint8_t *msr_bitmap;
|
||||
uint64_t value64;
|
||||
|
||||
ASSERT(msrs_count == IDX_MAX_MSR,
|
||||
@@ -63,12 +63,6 @@ void init_msr_emulation(struct vcpu *vcpu)
|
||||
|
||||
/*msr bitmap, just allocated/init once, and used for all vm's vcpu*/
|
||||
if (is_vcpu_bsp(vcpu)) {
|
||||
|
||||
/* Allocate and initialize memory for MSR bitmap region*/
|
||||
vcpu->vm->arch_vm.msr_bitmap = alloc_page();
|
||||
ASSERT(vcpu->vm->arch_vm.msr_bitmap != NULL, "");
|
||||
(void)memset(vcpu->vm->arch_vm.msr_bitmap, 0x0U, CPU_PAGE_SIZE);
|
||||
|
||||
msr_bitmap = vcpu->vm->arch_vm.msr_bitmap;
|
||||
|
||||
for (i = 0U; i < msrs_count; i++) {
|
||||
|
Reference in New Issue
Block a user