All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org, hongyxia@amazon.co.uk,
	iwj@xenproject.org, Julien Grall <jgrall@amazon.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>
Subject: Re: [for-4.15][PATCH v2 1/5] xen/x86: p2m: Don't map the special pages in the IOMMU page-tables
Date: Wed, 10 Feb 2021 16:53:24 +0100	[thread overview]
Message-ID: <14ed7349-4af7-9882-af1f-08c1739cbf5f@suse.com> (raw)
In-Reply-To: <YCP6x9ApfJQuhALl@Air-de-Roger>

On 10.02.2021 16:24, Roger Pau Monné wrote:
> On Wed, Feb 10, 2021 at 02:12:38PM +0100, Jan Beulich wrote:
>> On 10.02.2021 12:54, Roger Pau Monné wrote:
>>> On Wed, Feb 10, 2021 at 11:48:40AM +0000, Julien Grall wrote:
>>>> 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.
>>
>> I can spot paging_final_teardown() on an error path there, but I
>> don't suppose that's what you mean? I guess I'm not looking in
>> the right place (there are quite a few after all) ...
> 
> Well, I assume some freeing of the EPT page tables must happen on
> error paths, or else we would be leaking them like IOMMU tables are
> leaked currently?

Well, you can't eliminate paging_final_teardown() from that
error path because it frees internal structures. It _also_
sets HAP's / shadow's allocation to zero, so has the side
effect of freeing why may have been CPU page tables.

Jan


  reply	other threads:[~2021-02-10 15:53 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-09 15:28 [for-4.15][PATCH v2 0/5] xen/iommu: Collection of bug fixes for IOMMU teadorwn Julien Grall
2021-02-09 15:28 ` [for-4.15][PATCH v2 1/5] xen/x86: p2m: Don't map the special pages in the IOMMU page-tables Julien Grall
2021-02-09 20:19   ` Paul Durrant
2021-02-10  8:29   ` Roger Pau Monné
2021-02-10  8:50     ` Julien Grall
2021-02-10  9:34       ` Julien Grall
2021-02-10 11:10     ` Jan Beulich
2021-02-10 11:34       ` Roger Pau Monné
2021-02-10 11:38         ` Jan Beulich
2021-02-10 11:40           ` Julien Grall
2021-02-10 11:45             ` Jan Beulich
2021-02-10 11:48               ` Julien Grall
2021-02-10 11:54                 ` Roger Pau Monné
2021-02-10 13:12                   ` Jan Beulich
2021-02-10 15:24                     ` Roger Pau Monné
2021-02-10 15:53                       ` Jan Beulich [this message]
2021-02-10 13:08                 ` Jan Beulich
2021-02-10 11:26   ` Jan Beulich
2021-02-15 11:38     ` Julien Grall
2021-02-15 12:36       ` Jan Beulich
2021-02-15 12:54         ` Julien Grall
2021-02-15 13:14           ` Jan Beulich
2021-02-17 11:21             ` Julien Grall
2021-02-09 15:28 ` [for-4.15][PATCH v2 2/5] xen/iommu: Check if the IOMMU was initialized before tearing down Julien Grall
2021-02-09 20:22   ` Paul Durrant
2021-02-17 11:25     ` Julien Grall
2021-02-09 15:28 ` [for-4.15][PATCH v2 3/5] xen/iommu: iommu_map: Don't crash the domain if it is dying Julien Grall
2021-02-09 20:28   ` Paul Durrant
2021-02-09 21:14     ` Julien Grall
2021-02-10 14:14       ` Jan Beulich
2021-02-10 14:58         ` Julien Grall
2021-02-10 15:56           ` Jan Beulich
2021-02-09 15:28 ` [for-4.15][PATCH v2 4/5] xen/iommu: x86: Don't leak the IOMMU page-tables Julien Grall
2021-02-09 20:33   ` Paul Durrant
2021-02-10 14:32   ` Jan Beulich
2021-02-10 15:04     ` Julien Grall
2021-02-10 16:12       ` Jan Beulich
2021-02-17 11:49         ` Julien Grall
2021-02-17 12:57           ` Jan Beulich
2021-02-10 14:44   ` Jan Beulich
2021-02-09 15:28 ` [for-4.15][PATCH v2 5/5] xen/iommu: x86: Clear the root page-table before freeing the page-tables Julien Grall
2021-02-09 20:36   ` Paul Durrant
2021-02-10  2:21   ` Tian, Kevin
2021-02-17 13:54     ` Julien Grall
2021-02-10 14:39   ` Jan Beulich
2021-02-09 16:47 ` [for-4.15][PATCH v2 0/5] xen/iommu: Collection of bug fixes for IOMMU teadorwn Ian Jackson
2021-02-17 11:33   ` Julien Grall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14ed7349-4af7-9882-af1f-08c1739cbf5f@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=hongyxia@amazon.co.uk \
    --cc=iwj@xenproject.org \
    --cc=jgrall@amazon.com \
    --cc=julien@xen.org \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.