From mboxrd@z Thu Jan 1 00:00:00 1970 From: tgh Subject: Re: confused about the balloon code Date: Sat, 28 Apr 2007 17:06:16 +0800 Message-ID: <46330E88.90201@ncic.ac.cn> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Thank you for your reply and I have got other confusions in function of increase_reservation() as=20 follows : static int increase_reservation(unsigned long nr_pages) { .... page =3D balloon_first_page(); for (i =3D 0; i < nr_pages; i++) { BUG_ON(page =3D=3D NULL); ////********************************** frame_list[i] =3D page_to_pfn(page);; ////*********** my confusion ////***********frame_list[i] is set by a pfn, while in the later part of=20 this function and in decrease_reservation() ,frame_list[i] is set by=20 mfn,is it right? ////*********** if it is , what is the trick behind it? ////************************************ page =3D balloon_next_page(page); } set_xen_guest_handle(reservation.extent_start, frame_list); reservation.nr_extents =3D nr_pages; ////********************************************** rc =3D HYPERVISOR_memory_op( XENMEM_populate_physmap, &reservation); ////************************another confusion ////************************what is the function of=20 XENMEM_populate_physmap hypercall? ////************************ is it to allocate the mfn for the guestOS=20 and at that time ,the frame_list[i] is mfn not the pfn as above , or=20 what is the function? ////************************************************** .... for (i =3D 0; i < nr_pages; i++) { page =3D balloon_retrieve(); BUG_ON(page =3D=3D NULL); pfn =3D 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 =3D 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 =E5=86=99=E9=81=93: > On 28/4/07 02:13, "tgh" wrote: > > =20 >> 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 >> =20 > > It causes the guest to zero out pages that it gives back to Xen. It's a > security option. > > -- Keir > > > > > =20