Changeset View
Changeset View
Standalone View
Standalone View
head/sys/x86/iommu/intel_ctx.c
Show First 20 Lines • Show All 273 Lines • ▼ Show 20 Lines | TAILQ_FOREACH_SAFE(entry, &rmrr_entries, unroll_link, entry1) { | ||||
size = OFF_TO_IDX(entry->end - entry->start); | size = OFF_TO_IDX(entry->end - entry->start); | ||||
ma = malloc(sizeof(vm_page_t) * size, M_TEMP, M_WAITOK); | ma = malloc(sizeof(vm_page_t) * size, M_TEMP, M_WAITOK); | ||||
for (i = 0; i < size; i++) { | for (i = 0; i < size; i++) { | ||||
ma[i] = vm_page_getfake(entry->start + PAGE_SIZE * i, | ma[i] = vm_page_getfake(entry->start + PAGE_SIZE * i, | ||||
VM_MEMATTR_DEFAULT); | VM_MEMATTR_DEFAULT); | ||||
} | } | ||||
error1 = dmar_gas_map_region(domain, entry, | error1 = dmar_gas_map_region(domain, entry, | ||||
DMAR_MAP_ENTRY_READ | DMAR_MAP_ENTRY_WRITE, | DMAR_MAP_ENTRY_READ | DMAR_MAP_ENTRY_WRITE, | ||||
DMAR_GM_CANWAIT, ma); | DMAR_GM_CANWAIT | DMAR_GM_RMRR, ma); | ||||
/* | /* | ||||
* Non-failed RMRR entries are owned by context rb | * Non-failed RMRR entries are owned by context rb | ||||
* tree. Get rid of the failed entry, but do not stop | * tree. Get rid of the failed entry, but do not stop | ||||
* the loop. Rest of the parsed RMRR entries are | * the loop. Rest of the parsed RMRR entries are | ||||
* loaded and removed on the context destruction. | * loaded and removed on the context destruction. | ||||
*/ | */ | ||||
if (error1 == 0 && entry->end != entry->start) { | if (error1 == 0 && entry->end != entry->start) { | ||||
DMAR_LOCK(domain->dmar); | DMAR_LOCK(domain->dmar); | ||||
▲ Show 20 Lines • Show All 580 Lines • Show Last 20 Lines |