From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vincent Bernardoff Subject: Bug in xc_gntshr_munmap Date: Fri, 19 Jul 2013 11:18:27 +0100 Message-ID: <51E91273.5050000@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070102070806040300070701" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org --------------070102070806040300070701 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit 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 --------------070102070806040300070701 Content-Type: text/x-csrc; name="libxc_gntshr_bug.c" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="libxc_gntshr_bug.c" #include #include #include #include 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); } --------------070102070806040300070701 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --------------070102070806040300070701--