File tree Expand file tree Collapse file tree 3 files changed +3
-11
lines changed Expand file tree Collapse file tree 3 files changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -292,9 +292,6 @@ int shutdown_vm(struct vm *vm)
292
292
/* Free EPT allocated resources assigned to VM */
293
293
destroy_ept (vm );
294
294
295
- /* Free MSR bitmap */
296
- free (vm -> arch_vm .msr_bitmap );
297
-
298
295
/* TODO: De-initialize I/O Emulation */
299
296
free_io_emulation_resource (vm );
300
297
Original file line number Diff line number Diff line change @@ -55,20 +55,14 @@ void init_msr_emulation(struct vcpu *vcpu)
55
55
{
56
56
uint32_t i ;
57
57
uint32_t msrs_count = ARRAY_SIZE (emulated_msrs );
58
- void * msr_bitmap ;
58
+ uint8_t * msr_bitmap ;
59
59
uint64_t value64 ;
60
60
61
61
ASSERT (msrs_count == IDX_MAX_MSR ,
62
62
"MSR ID should be matched with emulated_msrs" );
63
63
64
64
/*msr bitmap, just allocated/init once, and used for all vm's vcpu*/
65
65
if (is_vcpu_bsp (vcpu )) {
66
-
67
- /* Allocate and initialize memory for MSR bitmap region*/
68
- vcpu -> vm -> arch_vm .msr_bitmap = alloc_page ();
69
- ASSERT (vcpu -> vm -> arch_vm .msr_bitmap != NULL , "" );
70
- (void )memset (vcpu -> vm -> arch_vm .msr_bitmap , 0x0U , CPU_PAGE_SIZE );
71
-
72
66
msr_bitmap = vcpu -> vm -> arch_vm .msr_bitmap ;
73
67
74
68
for (i = 0U ; i < msrs_count ; i ++ ) {
Original file line number Diff line number Diff line change @@ -88,6 +88,8 @@ enum vm_state {
88
88
struct vm_arch {
89
89
/* I/O bitmaps A and B for this VM, MUST be 4-Kbyte aligned */
90
90
uint8_t io_bitmap [CPU_PAGE_SIZE * 2 ];
91
+ /* MSR bitmap region for this VM, MUST be 4-Kbyte aligned */
92
+ uint8_t msr_bitmap [CPU_PAGE_SIZE ];
91
93
92
94
uint64_t guest_init_pml4 ;/* Guest init pml4 */
93
95
/* EPT hierarchy for Normal World */
@@ -99,7 +101,6 @@ struct vm_arch {
99
101
void * sworld_eptp ;
100
102
void * m2p ; /* machine address to guest physical address */
101
103
void * tmp_pg_array ; /* Page array for tmp guest paging struct */
102
- void * msr_bitmap ; /* MSR bitmap page base address for this VM */
103
104
struct acrn_vioapic vioapic ; /* Virtual IOAPIC base address */
104
105
struct acrn_vpic vpic ; /* Virtual PIC */
105
106
/**
You can’t perform that action at this time.
0 commit comments