From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: Multiple-page mem_event ring buffer? Date: Tue, 5 Mar 2013 09:21:40 -0500 Message-ID: <20130305142140.GH2589@phenom.dumpdata.com> References: <5135F162.9060909@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <5135F162.9060909@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Razvan Cojocaru Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Tue, Mar 05, 2013 at 03:21:38PM +0200, Razvan Cojocaru wrote: > Hello, > > currently my code (and all the examples I could find in the Xen > source code) uses a single page mem_event ring buffer, using code > along the lines of: > > /* Map the ring page */ > unsigned long ring_pfn; > xc_get_hvm_param(xci_, domain_, HVM_PARAM_ACCESS_RING_PFN, &ring_pfn); > > unsigned long mmap_pfn = ring_pfn; > ringPage_ = xc_map_foreign_batch(xci_, domain_, PROT_READ | PROT_WRITE, > &mmap_pfn, 1); > > if (mmap_pfn & XEN_DOMCTL_PFINFO_XTAB) { > > /* Map failed, populate ring page */ > if (xc_domain_populate_physmap_exact(xci_, domain_, > 1, 0, 0, &ring_pfn)) > return SOME_ERROR; > > mmap_pfn = ring_pfn; > ringPage = xc_map_foreign_batch(xci_, domain_, > PROT_READ | PROT_WRITE, > &mmap_pfn, 1); > > if (mmap_pfn & XEN_DOMCTL_PFINFO_XTAB) > return SOME_OTHER ERROR; > } > > Could I safely use more than one page for the ring buffer (passing > '2' as the last parameter of xc_map_foreign_batch(), and so on), or > am I limited to 1 page by design? You should be able to as many as you want. Are you hitting any particular issues? > > > Thanks, > Razvan Cojocaru > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel >