[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [for-4.15][PATCH v2 1/5] xen/x86: p2m: Don't map the special pages in the IOMMU page-tables


  • To: Julien Grall <julien@xxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Wed, 10 Feb 2021 12:54:05 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GZAgjDsA+4s1BTE67/NgyCiYQcMfDswFDZhm5DmIzkI=; b=B+OivFkMrVwNzlxf/APPm6kQaJtp+jbgBlmYrxycjQR9ioOzsWdGpidqbA9ppO2tUYSuE8qVDEvTdZ4ETZjenwnU2P27agLDsRDCYKXV/lV3XHULLPU2d2IQDc7UbS9pW4BsB/zsXQ7OeuvzeKHxuhqOgYLd5ESDwSvjwa+OjRLGI29HdqrCIBRAK8WlLoDN64SCQBRJM185PL40WkQP4rbKF99/dVoTIB6NwdNy7rY2uhlGzTiDRvn9EQfb1MlZQGT+d3rHolQdoGXk6c9elaOa5TilFmXhT16MmRgmoDssFMJwjl3HJfIQL+GWNiKGHpZeJPeIgFcMzy/ZJckE7g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ekKdIlzhKEvU5cagbs+zOMpbYG4cEX6WnIxaU9qfI4NGijFwO7jBP7PHzlUvxfXW/zhPXWgC8pPkfV1eIl/tu00WT/ZwZjksbPptKlts0jckSOvimqyw5st0c/tpr/JscD3w8HuUPjIoNosGRoDY1WsA6s2FEmjE5sVnc01y5eyJIocueZrFeJ1ty/SRpNsj8X+a6QtGgMTu3TSem6kN4aa7YhnBeV+n//3v16hjZj0mTkFKPwIX8AO+NPthE777OXz7DSBCILS3U2qx0a4W+761AHuQwkHdLvT17Km1dt9R7H3duvU16olFxJCXmbiDDhcbqDoemn1j9UV7WfW/6Q==
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <hongyxia@xxxxxxxxxxxx>, <iwj@xxxxxxxxxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Wed, 10 Feb 2021 11:54:22 +0000
  • Ironport-sdr: s3bHAMP/o4I+FNHgVDTCjEJvudCyhEqKRG4GSs84jgYCmhVnS71/QGavLn7uY00fB7prwf0jHA 0Z/mxWCz7sxoi7gKn2p+h69mG95N8k8BuEA1rrpkGlZRcFhWe5oXUD6TYLhOyb8EadX7yjbwQa eDwlX5ub8TWaupb6Z4WfpWOGPXHY8vQZRgavngsULhAmHzY0FDuXEYkRfhH2y5AWgcI55pPM5g Wd7eyTPQ40zBpayvZpc6djNXCscUicspBiZtektkMsqouFb8xwt4yeZk9cPKejIxT+qm4LRwU9 nK4=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Feb 10, 2021 at 11:48:40AM +0000, Julien Grall wrote:
> 
> 
> On 10/02/2021 11:45, Jan Beulich wrote:
> > On 10.02.2021 12:40, Julien Grall wrote:
> > > On 10/02/2021 11:38, Jan Beulich wrote:
> > > > On 10.02.2021 12:34, Roger Pau Monné wrote:
> > > > > On Wed, Feb 10, 2021 at 12:10:09PM +0100, Jan Beulich wrote:
> > > > > > On 10.02.2021 09:29, Roger Pau Monné wrote:
> > > > > > > I get the feeling this is just papering over an existing issue 
> > > > > > > instead
> > > > > > > of actually fixing it: IOMMU page tables need to be properly freed
> > > > > > > during early failure.
> > > > > > 
> > > > > > I take a different perspective: IOMMU page tables shouldn't
> > > > > > get created (yet) at all in the course of
> > > > > > XEN_DOMCTL_createdomain - this op is supposed to produce an
> > > > > > empty container for a VM.
> > > > > 
> > > > > The same would apply for CPU page-tables then, yet they seem to be
> > > > > created and populating them (ie: adding the lapic access page) doesn't
> > > > > leak such entries, which points at an asymmetry. Either we setup both
> > > > > tables and handle freeing them properly, or we set none of them.
> > > > 
> > > > Where would CPU page tables get created from at this early stage?
> > > 
> > > When mapping the APIC page in the P2M. I don't think you can get away
> > > with removing it completely.
> > 
> > It doesn't need putting in the p2m this early. It would be quite
> > fine to defer this until e.g. the first vCPU gets created.
> 
> It feels wrong to me to setup a per-domain mapping when initializing the
> first vCPU.
> 
> But, I was under the impression that there is plan to remove
> XEN_DOMCTL_max_vcpus. So it would only buy just a bit of time...

I was also under that impression. We could setup the lapic access page
at vlapic_init for the BSP (which is part of XEN_DOMCTL_max_vcpus
ATM).

But then I think there should be some kind of check to prevent
populating either the CPU or the IOMMU page tables at domain creation
hypercall, and so the logic to free CPU table tables on failure could
be removed.

Roger.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.