khypervisor
v1
|
Go to the source code of this file.
Functions | |
lpaed_t * | vmm_vmid_ttbl (vmid_t vmid) |
hvmm_status_t | vmm_set_vmid_ttbl (vmid_t vmid, lpaed_t *ttbl) |
void | vmm_stage2_enable (int enable) |
void | vmm_init (void) |
void vmm_init | ( | void | ) |
Definition at line 339 of file vmm.c.
{ /* * Initializes Translation Table for Stage2 Translation (IPA -> PA) */ int i; HVMM_TRACE_ENTER(); for( i = 0; i < NUM_GUESTS_STATIC; i++ ) { _vmid_ttbl[i] = 0; } _vmid_ttbl[0] = &_ttbl_guest0[0]; _vmid_ttbl[1] = &_ttbl_guest1[0]; /* * VA: 0x00000000 ~ 0x3FFFFFFF, 1GB * PA: 0xA0000000 ~ 0xDFFFFFFF guest_bin_start * PA: 0xB0000000 ~ 0xEFFFFFFF guest2_bin_start */ guest_memory_md0[0].pa = (uint64_t) ((uint32_t) &guest_bin_start); guest_memory_md1[0].pa = (uint64_t) ((uint32_t) &guest2_bin_start); vmm_init_ttbl(&_ttbl_guest0[0], &guest_mdlist0[0]); vmm_init_ttbl(&_ttbl_guest1[0], &guest_mdlist1[0]); vmm_init_mmu(); HVMM_TRACE_EXIT(); }
hvmm_status_t vmm_set_vmid_ttbl | ( | vmid_t | vmid, |
lpaed_t * | ttbl | ||
) |
Definition at line 397 of file vmm.c.
{ uint64_t vttbr; /* * VTTBR.VMID = vmid * VTTBR.BADDR = ttbl */ vttbr = read_vttbr(); #if 0 /* ignore message due to flood log message */ uart_print( "current vttbr:" ); uart_print_hex64(vttbr); uart_print("\n\r"); #endif vttbr &= ~(VTTBR_VMID_MASK); vttbr |= ((uint64_t)vmid << VTTBR_VMID_SHIFT) & VTTBR_VMID_MASK; vttbr &= ~(VTTBR_BADDR_MASK); vttbr |= (uint32_t) ttbl & VTTBR_BADDR_MASK; write_vttbr(vttbr); vttbr = read_vttbr(); #if 0 /* ignore message due to flood log message */ uart_print( "changed vttbr:" ); uart_print_hex64(vttbr); uart_print("\n\r"); #endif return HVMM_STATUS_SUCCESS; }
void vmm_stage2_enable | ( | int | enable | ) |
lpaed_t* vmm_vmid_ttbl | ( | vmid_t | vmid | ) |
Definition at line 373 of file vmm.c.
{ lpaed_t *ttbl = 0; if ( vmid < NUM_GUESTS_STATIC ) { ttbl = _vmid_ttbl[vmid]; } return ttbl; }