All of lore.kernel.org
 help / color / mirror / Atom feed
From: tgh <tianguanhua@ncic.ac.cn>
To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: xen-devel@lists.xensource.com
Subject: Re: confused about the balloon code
Date: Sat, 28 Apr 2007 17:06:16 +0800	[thread overview]
Message-ID: <46330E88.90201@ncic.ac.cn> (raw)
In-Reply-To: <C258C16F.67E4%Keir.Fraser@cl.cam.ac.uk>

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@ncic.ac.cn> 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
>
>
>
>
>   

  reply	other threads:[~2007-04-28  9:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-29 16:05 P2M Top Level Page Table Huang2, Wei
2007-03-29 16:41 ` Keir Fraser
2007-03-29 16:46   ` Huang2, Wei
2007-03-29 17:39     ` Keir Fraser
2007-04-28  1:13 ` confused about the balloon code tgh
2007-04-28  8:16   ` Keir Fraser
2007-04-28  9:06     ` tgh [this message]
2007-04-28 18:04     ` Kaushik Barde
2007-04-28 18:37       ` Keir Fraser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46330E88.90201@ncic.ac.cn \
    --to=tianguanhua@ncic.ac.cn \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.