Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/vmm/amd/svm.c
Show First 20 Lines • Show All 554 Lines • ▼ Show 20 Lines | svm_vminit(struct vm *vm, pmap_t pmap) | ||||
if (svm_sc->msr_bitmap == NULL) | if (svm_sc->msr_bitmap == NULL) | ||||
panic("contigmalloc of SVM MSR bitmap failed"); | panic("contigmalloc of SVM MSR bitmap failed"); | ||||
svm_sc->iopm_bitmap = contigmalloc(SVM_IO_BITMAP_SIZE, M_SVM, | svm_sc->iopm_bitmap = contigmalloc(SVM_IO_BITMAP_SIZE, M_SVM, | ||||
M_WAITOK, 0, ~(vm_paddr_t)0, PAGE_SIZE, 0); | M_WAITOK, 0, ~(vm_paddr_t)0, PAGE_SIZE, 0); | ||||
if (svm_sc->iopm_bitmap == NULL) | if (svm_sc->iopm_bitmap == NULL) | ||||
panic("contigmalloc of SVM IO bitmap failed"); | panic("contigmalloc of SVM IO bitmap failed"); | ||||
svm_sc->vm = vm; | svm_sc->vm = vm; | ||||
svm_sc->nptp = (vm_offset_t)vtophys(pmap->pm_pml4); | svm_sc->nptp = (vm_offset_t)vtophys(pmap->pm_pmltop); | ||||
/* | /* | ||||
* Intercept read and write accesses to all MSRs. | * Intercept read and write accesses to all MSRs. | ||||
*/ | */ | ||||
memset(svm_sc->msr_bitmap, 0xFF, SVM_MSR_BITMAP_SIZE); | memset(svm_sc->msr_bitmap, 0xFF, SVM_MSR_BITMAP_SIZE); | ||||
/* | /* | ||||
* Access to the following MSRs is redirected to the VMCB when the | * Access to the following MSRs is redirected to the VMCB when the | ||||
▲ Show 20 Lines • Show All 2,091 Lines • Show Last 20 Lines |