[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] confused about the balloon code



Thank you for your reply

and I have got other confusions in function of increase_reservation() as follows :
static int increase_reservation(unsigned long nr_pages)
{
....
page = balloon_first_page();
for (i = 0; i < nr_pages; i++) {
BUG_ON(page == NULL);
////**********************************
frame_list[i] = page_to_pfn(page);;
////*********** my confusion
////***********frame_list[i] is set by a pfn, while in the later part of this function and in decrease_reservation() ,frame_list[i] is set by mfn,is it right?
////*********** if it is , what is the trick behind it?
////************************************

page = balloon_next_page(page);
}

set_xen_guest_handle(reservation.extent_start, frame_list);
reservation.nr_extents = nr_pages;
////**********************************************
rc = HYPERVISOR_memory_op(
XENMEM_populate_physmap, &reservation);
////************************another confusion
////************************what is the function of XENMEM_populate_physmap hypercall? ////************************ is it to allocate the mfn for the guestOS and at that time ,the frame_list[i] is mfn not the pfn as above , or what is the function?
////**************************************************

....

for (i = 0; i < nr_pages; i++) {
page = balloon_retrieve();
BUG_ON(page == NULL);

pfn = page_to_pfn(page);
BUG_ON(!xen_feature(XENFEAT_auto_translated_physmap) &&
phys_to_machine_mapping_valid(pfn));

/* Update P->M and M->P tables. */
set_phys_to_machine(pfn, frame_list[i]);
xen_machphys_update(frame_list[i], pfn);

/* Link back into the page tables if not highmem. */
if (pfn < max_low_pfn) {
int ret;
////********************************************************
ret = HYPERVISOR_update_va_mapping(
(unsigned long)__va(pfn << PAGE_SHIFT),
pfn_pte_ma(frame_list[i], PAGE_KERNEL),
0);
////***********************another confustion
////***********************what is the function of this hypercall?
////*********************** I am totally confused about it
////********************************************************
BUG_ON(ret);
}

/* Relinquish the page back to the allocator. */
ClearPageReserved(page);
set_page_count(page, 1);
__free_page(page);
}
...
}

I am confused about it
could you help me
Thanks in advance










Keir Fraser åé:
On 28/4/07 02:13, "tgh" <tianguanhua@xxxxxxxxxx> wrote:

I am confused about the scrub_pages(), what is the meaning of
scrub_pages, when should we use CONFIG_XEN_SCRUB_PAGES
could you help me

It causes the guest to zero out pages that it gives back to Xen. It's a
security option.

 -- Keir






_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.