Xen 
 
Home About Xen.org Xen Xen Summit Wiki Mailing List Bug Tracker Xen Downloads
 
   
 

xen-devel

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

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] confused about the balloon code
From: tgh <tianguanhua@xxxxxxxxxx>
Date: Sat, 28 Apr 2007 17:06:16 +0800
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Sat, 28 Apr 2007 02:05:06 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C258C16F.67E4%Keir.Fraser@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <C258C16F.67E4%Keir.Fraser@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.7 (Windows/20060909)
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