Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/xen/balloon/balloon.c
Show First 20 Lines • Show All 230 Lines • ▼ Show 20 Lines | for (i = 0; i < nr_pages; i++) { | ||||
if ((page = vm_page_alloc(NULL, 0, | if ((page = vm_page_alloc(NULL, 0, | ||||
VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | | VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | | ||||
VM_ALLOC_ZERO)) == NULL) { | VM_ALLOC_ZERO)) == NULL) { | ||||
nr_pages = i; | nr_pages = i; | ||||
need_sleep = 1; | need_sleep = 1; | ||||
break; | break; | ||||
} | } | ||||
if ((page->flags & PG_ZERO) == 0) { | |||||
/* | |||||
* Zero the page, or else we might be leaking | |||||
* important data to other domains on the same | |||||
* host. Xen doesn't scrub ballooned out memory | |||||
* pages, the guest is in charge of making | |||||
* sure that no information is leaked. | |||||
*/ | |||||
alc: I would not delete this comment. Instead, move it up before the allocation. | |||||
markjAuthorUnsubmitted Done Inline ActionsI handled this comment in the new patch series (where I again had deleted the comment). markj: I handled this comment in the new patch series (where I again had deleted the comment). | |||||
pmap_zero_page(page); | |||||
} | |||||
frame_list[i] = (VM_PAGE_TO_PHYS(page) >> PAGE_SHIFT); | frame_list[i] = (VM_PAGE_TO_PHYS(page) >> PAGE_SHIFT); | ||||
TAILQ_INSERT_HEAD(&ballooned_pages, page, plinks.q); | TAILQ_INSERT_HEAD(&ballooned_pages, page, plinks.q); | ||||
bs.balloon_low++; | bs.balloon_low++; | ||||
} | } | ||||
set_xen_guest_handle(reservation.extent_start, frame_list); | set_xen_guest_handle(reservation.extent_start, frame_list); | ||||
reservation.nr_extents = nr_pages; | reservation.nr_extents = nr_pages; | ||||
▲ Show 20 Lines • Show All 164 Lines • Show Last 20 Lines |
I would not delete this comment. Instead, move it up before the allocation.