From: Stefano Stabellini Subject: Re: [PATCH v2 4/4] x86: fix pinned cache attribute handling Date: Fri, 4 Apr 2014 15:30:38 +0100 Message-ID: References: <533583C5020000780000367B@nat28.tlf.novell.com> <533584D60200007800003697@nat28.tlf.novell.com> <533586CD02000078000036E6@nat28.tlf.novell.com> <1396013811.8670.49.camel@kazak.uk.xensource.com> <5335988F0200007800003782@nat28.tlf.novell.com> <1396018356.8670.75.camel@kazak.uk.xensource.com> <53359E7A02000078000037C8@nat28.tlf.novell.com> <53394AE90200007800003AD0@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WW58o-0001yI-Lj for xen-devel@lists.xenproject.org; Fri, 04 Apr 2014 14:30:46 +0000 In-Reply-To: <53394AE90200007800003AD0@nat28.tlf.novell.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: Jan Beulich Cc: anthony.perard@citrix.com, Ian Campbell , Ian Jackson , xen-devel , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Mon, 31 Mar 2014, Jan Beulich wrote: > >>> On 28.03.14 at 19:00, wrote: > > I miss some context here. > > What is the issue with xc_domain_pin_memory_cacheattr_range and how does > > it affect QEMU (that uses the xc_domain_pin_memory_cacheattr variety)? > > The issue is that the hypervisor (and hence libxc) interface expect the > passed range to be inclusive, yet the ending page number all the qemus > pass is one past the intended range. Thanks for the clear explanation. Is this patch what you are looking for? --- diff --git a/xen-all.c b/xen-all.c index ba34739..027e7a8 100644 --- a/xen-all.c +++ b/xen-all.c @@ -323,7 +323,7 @@ go_physmap: xc_domain_pin_memory_cacheattr(xen_xc, xen_domid, start_addr >> TARGET_PAGE_BITS, - (start_addr + size) >> TARGET_PAGE_BITS, + (start_addr + size - 1) >> TARGET_PAGE_BITS, XEN_DOMCTL_MEM_CACHEATTR_WB); snprintf(path, sizeof(path),