From: Ian Campbell Subject: Re: [PATCH] arm: xen: foreign mapping PTEs are special. Date: Fri, 6 Dec 2013 17:54:46 +0000 Message-ID: <1386352486.25188.20.camel@kazak.uk.xensource.com> References: <1386172328-11925-1-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Vozc3-0003PQ-Hf for xen-devel@lists.xenproject.org; Fri, 06 Dec 2013 17:54:51 +0000 In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: xen-devel@lists.xenproject.org, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Fri, 2013-12-06 at 17:48 +0000, Stefano Stabellini wrote: > On Wed, 4 Dec 2013, Ian Campbell wrote: > > These mappings are in fact special and require special handling in privcmd, > > which already exists. Failure to mark the PTE as special on arm64 causes all sorts of bad PTE fun. > > > > x86 already gets this correct. > > Yes, but x86 does that for PV guests, not for autotranslate guests (for > which the function return -EINVAL). > > Given that in the ARM case we are changing the p2m underneath, why do we > also need to mark them special? It's not about the p2m, it's about the handling in privcmd wrt setup and teardown of the stage one mapping which goes along with the p2m manipulations. Without this the normal rmap counting kicks in and complains about the mapcount being -1. It's possible that we could handle this by implementing vma fault handling for the privcmd driver, but that would mean a lot more book keeping (e.g. to know if the ioctl has been made for a particular address or not) and would mean we diverged more from the pv paths. Ian.