* Bug in xc_gntshr_munmap
@ 2013-07-19 10:18 Vincent Bernardoff
2013-07-19 10:26 ` Ian Campbell
0 siblings, 1 reply; 2+ messages in thread
From: Vincent Bernardoff @ 2013-07-19 10:18 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 194 bytes --]
Hi,
On the little program attached, xc_gntshr_munmap looks like it is not
correctly un-sharing shared pages. Am I using these functions as they
are intented to ?
Thanks in advance,
Vincent
[-- Attachment #2: libxc_gntshr_bug.c --]
[-- Type: text/x-csrc, Size: 727 bytes --]
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <xenctrl.h>
int main(int argc, char** argv)
{
int ret, i;
uint32_t refs[2] = {0};
void* pages;
xc_gntshr *h = xc_gntshr_open(NULL, 0);
if (h == NULL)
{
perror("xc_gntshr_open");
exit (1);
}
for(i=0; i<10000; i++)
{
pages = xc_gntshr_share_pages(h, 0, 2, refs, 1);
if (pages == NULL)
{
fprintf(stderr, "xc_gntshr_share_pages failed at the %dth iteration.\n", i);
perror("xc_gntshr_share_pages");
exit (1);
}
if(xc_gntshr_munmap(h, pages, 2) != 0)
{
perror("xc_gntshr_munmap");
exit (1);
}
}
xc_gntshr_close(h);
}
[-- Attachment #3: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Bug in xc_gntshr_munmap
2013-07-19 10:18 Bug in xc_gntshr_munmap Vincent Bernardoff
@ 2013-07-19 10:26 ` Ian Campbell
0 siblings, 0 replies; 2+ messages in thread
From: Ian Campbell @ 2013-07-19 10:26 UTC (permalink / raw)
To: Vincent Bernardoff; +Cc: Daniel De Graaf, Marek Marczykowski, xen-devel
On Fri, 2013-07-19 at 11:18 +0100, Vincent Bernardoff wrote:
> Hi,
>
> On the little program attached, xc_gntshr_munmap looks like it is not
> correctly un-sharing shared pages. Am I using these functions as they
> are intented to ?
>
Marek Marczykowski posted some patches back in April/May about a bug in
xc_gntshr_munmap. I'd hazard a guess you are seeing the same thing.
Unfortunately those patches still had an outstanding issue and haven't
been applied yet.
Some message ids:
<517A5FE7.9050904@invisiblethingslab.com>
<20130508040327.91296310@duch.mimuw.edu.pl>
<20130508040327.951AD329@duch.mimuw.edu.pl>
and in particular the reason it isn't applied yet:
<518A57ED.5030708@tycho.nsa.gov>
Ian.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-07-19 10:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-19 10:18 Bug in xc_gntshr_munmap Vincent Bernardoff
2013-07-19 10:26 ` Ian Campbell
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.