All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Christoph Egger <chegger@amazon.de>
Cc: Frediano Ziglio <frediano.ziglio@citrix.com>,
	Miguel Clara <miguelmclara@gmail.com>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH] tools/misc/xencov.c: Use MAP_WIRED on NetBSD
Date: Fri, 31 May 2013 12:25:19 +0100	[thread overview]
Message-ID: <1369999519.5199.99.camel@zakaz.uk.xensource.com> (raw)
In-Reply-To: <51A74A37.5070502@amazon.de>

On Thu, 2013-05-30 at 14:46 +0200, Christoph Egger wrote:
> tools/xencov: MAP_LOCKED is Linux specific. NetBSD's equivalent is MAP_WIRED.

It looks to me as if xencov.c's shouldn't be using mmap in the first
place. It should be using the libxc hypercall buffer code.

I think xencov.c should be using xc_hypercall_buffer_alloc(_pages) and
gcov_get_info should be xc_gcov_get_info & inside libxc not open coded
in this tool. Not least because of its abuse of the GUEST_HANDLE
interface (going directly at .p instead of using xen_set_guest_handle(),
which is forbidden).

Frediano, do you have time to sort this out?

NB On Linux the hypercall buffers currently turn into MAP_PRIVATE|
MAP_ANONYMOUS|MAP_LOCKED but on netbsd it is just xc_memalign.
Presumably netbsd doesn't have to worry about the hypercall buffer being
unmapped/swapped/paged/etc under its feet? Or if it does it needs to be
fixed in libxc...

Thanks,
Ian.

> From: Miguel Clara <miguelmclara@gmail.com>
> Signed-off-by: Christoph Egger <chegger@amazon.de>
> 
> diff -r f1fa13daf4b7 -r 97a4f7e36a8f tools/misc/xencov.c
> --- a/tools/misc/xencov.c	Fri May 10 13:45:02 2013 +0000
> +++ b/tools/misc/xencov.c	Thu May 30 12:40:13 2013 +0000
> @@ -26,6 +26,11 @@
>  #include <err.h>
>  #include <sys/mman.h>
>  
> +#ifdef __NetBSD__
> +/* MAP_LOCKED is Linux specific. MAP_WIRED is NetBSD's equivalent. */
> +#define MAP_LOCKED MAP_WIRED
> +#endif
> +
>  static xc_interface *gcov_xch = NULL;
>  
>  static void gcov_init(void)

  reply	other threads:[~2013-05-31 11:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-30 12:46 [PATCH] tools/misc/xencov.c: Use MAP_WIRED on NetBSD Christoph Egger
2013-05-31 11:25 ` Ian Campbell [this message]
2013-06-11 13:46   ` Frediano Ziglio
2013-06-12  9:21     ` Ian Campbell
2013-06-12 12:02       ` Frediano Ziglio
2013-06-12 12:14         ` Ian Campbell
2013-06-12 13:13           ` George Dunlap
2013-06-12 13:16             ` Ian Campbell
2013-06-12 15:25             ` Frediano Ziglio
2013-06-27 11:31             ` Ian Campbell
2013-06-13  9:47         ` Egger, Christoph

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=1369999519.5199.99.camel@zakaz.uk.xensource.com \
    --to=ian.campbell@citrix.com \
    --cc=chegger@amazon.de \
    --cc=frediano.ziglio@citrix.com \
    --cc=miguelmclara@gmail.com \
    --cc=xen-devel@lists.xen.org \
    /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.