xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Markus Groß" <gross@univention.de>
To: xen-devel@lists.xensource.com
Subject: Re: libxc: correctly unmap pages after core-dumping a pv guest
Date: Mon, 23 May 2011 14:24:01 +0200	[thread overview]
Message-ID: <201105231424.01099.gross@univention.de> (raw)
In-Reply-To: <201105231342.28471.gross@univention.de>

I forgot to put [PATCH] in the subject, sorry about that.

Am Montag 23 Mai 2011 13:42:28 schrieb Markus Groß:
> Hi,
> 
> while implementing core dumping functionality for the libxl driver
> of libvirt, I discovered an issue with mapping pages of a pv guest.
> 
> After dumping the core of a pv guest the domain was not cleared up
> properly and some pages were not unmapped. This issue is similar
> to the one reported here:
> http://lists.xensource.com/archives/html/xen-devel/2011-05/msg01314.html
> 
> In xc_domain_dumpcore_via_callback in the file xc_core.c the function
> xc_core_arch_map_p2m is called to map P2M_FL_ENTRIES pages to the variable p2m.
> But to unmap the pages later, the dinfo->p2m_size has to be set accordingly.
> This was not done, instead a variable named p2m_size was set.
> This way P2M_FL_ENTRIES was always zero and the pages were left mapped.
> 
> The following patch fixes this.
> 
> Best regards,
> Markus
>  
> diff -r 7c7ef1b6f4e5 tools/libxc/xc_core.c
> --- a/tools/libxc/xc_core.c     Tue Apr 26 14:11:18 2011 +0100
> +++ b/tools/libxc/xc_core.c     Mon May 23 13:36:23 2011 +0200
> @@ -468,7 +468,6 @@
>  
>      int auto_translated_physmap;
>      xen_pfn_t *p2m = NULL;
> -    unsigned long p2m_size = 0;
>      struct xen_dumpcore_p2m *p2m_array = NULL;
>  
>      uint64_t *pfn_array = NULL;
> @@ -569,7 +568,7 @@
>          }
>  
>          sts = xc_core_arch_map_p2m(xch, dinfo->guest_width, &info, live_shinfo,
> -                                   &p2m, &p2m_size);
> +                                   &p2m, &dinfo->p2m_size);
>          if ( sts != 0 )
>              goto out;
>      }
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
> 

  reply	other threads:[~2011-05-23 12:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-23 11:42 libxc: correctly unmap pages after core-dumping a pv guest Markus Groß
2011-05-23 12:24 ` Markus Groß [this message]
2011-05-23 12:46   ` Ian Campbell
2011-05-23 13:12     ` [PATCH] " Markus Groß
2011-05-24 15:07 ` Ian Jackson
2011-05-24 16:22   ` Markus Groß
2011-05-24 17:32     ` Ian Jackson

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=201105231424.01099.gross@univention.de \
    --to=gross@univention.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).