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

[Xen-devel] Re: [Xen-changelog] Linux scrubs memory before returnign it to Xen, or transferring it to


  • To: Xen Development List <xen-devel@xxxxxxxxxxxxxxxxxxxxx>
  • From: Rik van Riel <riel@xxxxxxxxxx>
  • Date: Sat, 18 Sep 2004 13:01:24 -0400 (EDT)
  • Delivery-date: Sat, 18 Sep 2004 18:03:04 +0100
  • List-id: List for Xen developers <xen-devel.lists.sourceforge.net>

On Sat, 18 Sep 2004, BitKeeper Bot wrote:

> diff -Nru a/linux-2.4.27-xen-sparse/arch/xen/drivers/balloon/balloon.c 
> b/linux-2.4.27-xen-sparse/arch/xen/drivers/balloon/balloon.c
> --- a/linux-2.4.27-xen-sparse/arch/xen/drivers/balloon/balloon.c      
> 2004-09-18 07:00:25 -04:00
> +++ b/linux-2.4.27-xen-sparse/arch/xen/drivers/balloon/balloon.c      
> 2004-09-18 07:00:25 -04:00
> @@ -104,8 +104,20 @@
>      {
>       unsigned long mfn = phys_to_machine_mapping[*currp];
>          curraddr = (unsigned long)page_address(mem_map + *currp);
> +        /* Blow away page contents for security, and also p.t. ref if any. */
>       if ( curraddr != 0 )
> +        {
> +            scrub_pages(curraddr, 1);
>              queue_l1_entry_update(get_ptep(curraddr), 0);
> +        }
> +#ifdef CONFIG_XEN_SCRUB_PAGES
> +        else
> +        {
> +            void *p = kmap(&mem_map[*currp]);
> +            scrub_pages(p, 1);
> +            kunmap(&mem_map[*currp]);
> +        }
> +#endif

Since scrub_pages() becomes a NOOP when the config option
is not set, why the additional #ifdef in the source code ?

-- 
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan




-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel


 


Rackspace

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