All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: Tamas K Lengyel <tamas.k.lengyel@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
	Sergej Proskurin <proskurin@sec.in.tum.de>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH v2 00/25] arm/altp2m: Introducing altp2m to ARM.
Date: Wed, 3 Aug 2016 18:45:43 +0100	[thread overview]
Message-ID: <6cb59e22-2b02-665e-d619-95c4bd894dbe@arm.com> (raw)
In-Reply-To: <CABfawhkLPs_jtTwFxqyAGhwbroTV9V6kA0sppXTG4gM6L5xxBQ@mail.gmail.com>



On 03/08/16 18:43, Tamas K Lengyel wrote:
> On Wed, Aug 3, 2016 at 11:30 AM, Andrew Cooper
> <andrew.cooper3@citrix.com> wrote:
>> On 03/08/16 17:51, Julien Grall wrote:
>>>
>>>
>>> On 03/08/16 17:42, Tamas K Lengyel wrote:
>>>> On Wed, Aug 3, 2016 at 10:24 AM, Julien Grall <julien.grall@arm.com>
>>>> wrote:
>>>>> Hi Tamas,
>>>>>
>>>>>
>>>>> On 03/08/16 17:01, Tamas K Lengyel wrote:
>>>>>>
>>>>>> On Wed, Aug 3, 2016 at 8:08 AM, Julien Grall <julien.grall@arm.com>
>>>>>> wrote:
>>>>>>>
>>>>>>> Hello Sergej,
>>>>>>>
>>>>>>> Please try to reply to all when answering on the ML. Otherwise the
>>>>>>> answer
>>>>>>> may be delayed/lost.
>>>>>>>
>>>>>>> On 03/08/16 13:45, Sergej Proskurin wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>> The interesting part about #VE is that it allows to handle certain
>>>>>>>> violations (currently limited to EPT violations -- future
>>>>>>>> implementations might introduce also further violations) inside
>>>>>>>> of the
>>>>>>>> guest, without the need to explicitly trap into the VMM. Thus,
>>>>>>>> #VE allow
>>>>>>>> switching of different memory views in-guest. Because of this, I
>>>>>>>> also
>>>>>>>> agree that event channels would suffice in our case, since we do not
>>>>>>>> have sufficient hardware support on ARM and would need to trap
>>>>>>>> into the
>>>>>>>> VMM anyway.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> The cost of doing an hypercall on ARM is very small compare to x86
>>>>>>> (~1/3
>>>>>>> of
>>>>>>> the number of x86 cycles) because we don't have to save all the state
>>>>>>> every
>>>>>>> time. So I am not convinced by the argument of limiting the number of
>>>>>>> trap
>>>>>>> to the hypervisor and allow a guest to play with altp2m on ARM.
>>>>>>>
>>>>>>> I will have to see a concrete example before going forward with
>>>>>>> the event
>>>>>>> channel.
>>>>>>
>>>>>>
>>>>>> It is out-of-scope for what we are trying to achieve with this series
>>>>>> at this point. The question at hand is really whether the atp2m switch
>>>>>> and gfn remapping ops should be exposed to the guest. Without #VE -
>>>>>> which we are not implementing - setting the mem_access settings from
>>>>>> within the guest doesn't make sense so restricting access there is
>>>>>> reasonable.
>>>>>>
>>>>>> As I outlined, the switch and gfn remapping can have legitimate
>>>>>> use-cases by themselves without any mem_access bits involved. However,
>>>>>> it is not our use-case so we have no problem restricting access there
>>>>>> either. So the question is whether that's the right path to take here.
>>>>>> At this point I'm not sure there is agreement about it or not.
>>>>>
>>>>>
>>>>> Could you give a legitimate use case of gfn remapping from the
>>>>> guest? And
>>>>> explain how it would work with only this patch series.
>>>>>
>>>>> From my perspective, and after the numerous exchange in this thread,
>>>>> I do
>>>>> not think it is wise to expose this interface to the guest on ARM.
>>>>> The usage
>>>>> is very limited but increase the surface attack. So I will not ack a
>>>>> such
>>>>> choice, however I will not nack it.
>>>>>
>>>>
>>>> Since the interface would be available only for domains where they
>>>> were explicitly created with altp2m=1 flag set I think the exposure is
>>>> minimal.
>>>>
>>>> As for a use-case, I don't have a real world example as it's not how
>>>> we use the system. But as I pointed out eairlier I could imagine the
>>>> gfn remapping be used to protect kernel memory areas against
>>>> information disclosure by only switching to the accessible altp2m view
>>>> when certain conditions are met. What I mean is that a certain gfn
>>>> could be remapped to a dummy mfn by default and only switched to the
>>>> accessible view when necessary. How much extra protection that would
>>>> add and under what condition is up for debate but IMHO it is a
>>>> legitimate experimental use - and altp2m is an experimental system.
>>>
>>> A such solution may give you a lots of headache with the cache.
>>>
>>>>
>>>> Whether it's worth to have such an interface or not I'm not sure, I'm
>>>> OK with going either way on this, but since it's available on x86 I
>>>> think it would make sense to have feature parity - even if only
>>>> partially for now.
>>>
>>> As I mentioned a couple of times, we do not introduce features on ARM
>>> just because they exists on x86. We introduce them after careful think
>>> about how they could benefits ARM and the usage.
>>>
>>> Nothing prevents a follow-up series to allow the guest accessing
>>> altp2m operation by default because the interface is already there.
>>>
>>> Stefano, do you have any opinions on this?
>>
>> From my point of view, feature parity with x86 is only important if the
>> feature is equally capable, and this thread has shown that this is not
>> the case.
>>
>> IMO, the choice is between:
>>
>> 1) Don't expose altp2m to guests, or
>> 2) Make a para-virtual version of #VE for ARM guests, and expose the
>> full guest interface.
>>
>> I am not fussed either way, but with my Security Team hat on, exposing
>> half an interface which can't usefully be used had has no current
>> usecase is a recipe for bugs with an XSA/CVE attached to them, and
>> therefore extra paperwork for me or someone else to do.
>>
>
> Well, if there are latent XSA/CVE issues with just half the interface
> I don't see how doing the full interface would avoid that. But fair
> enough, if Stefano agrees we can close this issue and just introduce a
> new set of domctl's.

The whole discussion of this series was to defer the exposition of 
altp2m HVMOP to the guest until we find a usage. I.e a simple:

xsm_hvm_altp2m_op(XSM_PRIV/XSM_DM_PRIV, d);

So why do you want to re-invent a new interface here?

Regards,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-08-03 17:45 UTC|newest]

Thread overview: 159+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-01 17:10 [PATCH v2 00/25] arm/altp2m: Introducing altp2m to ARM Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 01/25] arm/altp2m: Add first altp2m HVMOP stubs Sergej Proskurin
2016-08-03 16:54   ` Julien Grall
2016-08-04 16:01     ` Sergej Proskurin
2016-08-04 16:04       ` Julien Grall
2016-08-04 16:22         ` Sergej Proskurin
2016-08-04 16:51           ` Julien Grall
2016-08-05  6:55             ` Sergej Proskurin
2016-08-09 19:16     ` Tamas K Lengyel
2016-08-10  9:52       ` Julien Grall
2016-08-10 14:49         ` Tamas K Lengyel
2016-08-11  8:17           ` Julien Grall
2016-08-11 14:41             ` Tamas K Lengyel
2016-08-12  8:10               ` Julien Grall
2016-08-01 17:10 ` [PATCH v2 02/25] arm/altp2m: Add HVMOP_altp2m_get_domain_state Sergej Proskurin
2016-08-01 17:21   ` Andrew Cooper
2016-08-01 17:34     ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 03/25] arm/altp2m: Add struct vttbr Sergej Proskurin
2016-08-03 17:04   ` Julien Grall
2016-08-03 17:05     ` Julien Grall
2016-08-04 16:11       ` Sergej Proskurin
2016-08-04 16:15         ` Julien Grall
2016-08-06  8:54           ` Sergej Proskurin
2016-08-06 13:20             ` Julien Grall
2016-08-06 13:48               ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 04/25] arm/altp2m: Move hostp2m init/teardown to individual functions Sergej Proskurin
2016-08-03 17:40   ` Julien Grall
2016-08-05  7:26     ` Sergej Proskurin
2016-08-05  9:16       ` Julien Grall
2016-08-06  8:43         ` Sergej Proskurin
2016-08-06 13:26           ` Julien Grall
2016-08-06 13:50             ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 05/25] arm/altp2m: Rename and extend p2m_alloc_table Sergej Proskurin
2016-08-03 17:57   ` Julien Grall
2016-08-06  8:57     ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 06/25] arm/altp2m: Cosmetic fixes - function prototypes Sergej Proskurin
2016-08-03 18:02   ` Julien Grall
2016-08-06  9:00     ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 07/25] arm/altp2m: Add altp2m init/teardown routines Sergej Proskurin
2016-08-03 18:12   ` Julien Grall
2016-08-05  6:53     ` Sergej Proskurin
2016-08-05  9:20       ` Julien Grall
2016-08-06  8:30         ` Sergej Proskurin
2016-08-09  9:44       ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 08/25] arm/altp2m: Add HVMOP_altp2m_set_domain_state Sergej Proskurin
2016-08-03 18:41   ` Julien Grall
2016-08-06  9:03     ` Sergej Proskurin
2016-08-06  9:36     ` Sergej Proskurin
2016-08-06 14:18       ` Julien Grall
2016-08-06 14:21       ` Julien Grall
2016-08-11  9:08       ` Julien Grall
2016-08-01 17:10 ` [PATCH v2 09/25] arm/altp2m: Add altp2m table flushing routine Sergej Proskurin
2016-08-03 18:44   ` Julien Grall
2016-08-06  9:45     ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 10/25] arm/altp2m: Add HVMOP_altp2m_create_p2m Sergej Proskurin
2016-08-03 18:48   ` Julien Grall
2016-08-06  9:46     ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 11/25] arm/altp2m: Add HVMOP_altp2m_destroy_p2m Sergej Proskurin
2016-08-04 11:46   ` Julien Grall
2016-08-06  9:54     ` Sergej Proskurin
2016-08-06 13:36       ` Julien Grall
2016-08-06 13:51         ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 12/25] arm/altp2m: Add HVMOP_altp2m_switch_p2m Sergej Proskurin
2016-08-04 11:51   ` Julien Grall
2016-08-06 10:13     ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 13/25] arm/altp2m: Make p2m_restore_state ready for altp2m Sergej Proskurin
2016-08-04 11:55   ` Julien Grall
2016-08-06 10:20     ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 14/25] arm/altp2m: Make get_page_from_gva " Sergej Proskurin
2016-08-04 11:59   ` Julien Grall
2016-08-06 10:38     ` Sergej Proskurin
2016-08-06 13:45       ` Julien Grall
2016-08-06 16:58         ` Sergej Proskurin
2016-08-11  8:33           ` Julien Grall
2016-08-01 17:10 ` [PATCH v2 15/25] arm/altp2m: Extend __p2m_lookup Sergej Proskurin
2016-08-04 12:04   ` Julien Grall
2016-08-06 10:44     ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 16/25] arm/altp2m: Make p2m_mem_access_check ready for altp2m Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 17/25] arm/altp2m: Cosmetic fixes - function prototypes Sergej Proskurin
2016-08-04 12:06   ` Julien Grall
2016-08-06 10:46     ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 18/25] arm/altp2m: Add HVMOP_altp2m_set_mem_access Sergej Proskurin
2016-08-04 14:19   ` Julien Grall
2016-08-06 11:03     ` Sergej Proskurin
2016-08-06 14:26       ` Julien Grall
2016-08-01 17:10 ` [PATCH v2 19/25] arm/altp2m: Add altp2m_propagate_change Sergej Proskurin
2016-08-04 14:50   ` Julien Grall
2016-08-06 11:26     ` Sergej Proskurin
2016-08-06 13:52       ` Julien Grall
2016-08-06 17:06         ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 20/25] arm/altp2m: Add altp2m paging mechanism Sergej Proskurin
2016-08-04 13:50   ` Julien Grall
2016-08-06 12:51     ` Sergej Proskurin
2016-08-06 14:14       ` Julien Grall
2016-08-06 17:28         ` Sergej Proskurin
2016-08-04 16:59   ` Julien Grall
2016-08-06 12:57     ` Sergej Proskurin
2016-08-06 14:21       ` Julien Grall
2016-08-06 17:35         ` Sergej Proskurin
2016-08-10  9:32         ` Sergej Proskurin
2016-08-11  8:47           ` Julien Grall
2016-08-11 17:13             ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 21/25] arm/altp2m: Add HVMOP_altp2m_change_gfn Sergej Proskurin
2016-08-04 14:04   ` Julien Grall
2016-08-06 13:45     ` Sergej Proskurin
2016-08-06 14:34       ` Julien Grall
2016-08-06 17:42         ` Sergej Proskurin
2016-08-11  9:21           ` Julien Grall
2016-08-01 17:10 ` [PATCH v2 22/25] arm/altp2m: Adjust debug information to altp2m Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 23/25] arm/altp2m: Extend libxl to activate altp2m on ARM Sergej Proskurin
2016-08-02 11:59   ` Wei Liu
2016-08-02 14:07     ` Sergej Proskurin
2016-08-11 16:00       ` Wei Liu
2016-08-15 16:07         ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 24/25] arm/altp2m: Extend xen-access for " Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 25/25] arm/altp2m: Add test of xc_altp2m_change_gfn Sergej Proskurin
2016-08-02  9:14   ` Razvan Cojocaru
2016-08-02  9:50     ` Sergej Proskurin
2016-08-01 18:15 ` [PATCH v2 00/25] arm/altp2m: Introducing altp2m to ARM Julien Grall
2016-08-01 19:20   ` Tamas K Lengyel
2016-08-01 19:55     ` Julien Grall
2016-08-01 20:35       ` Sergej Proskurin
2016-08-01 20:41       ` Tamas K Lengyel
2016-08-02  7:38         ` Julien Grall
2016-08-02 11:17           ` George Dunlap
2016-08-02 15:48             ` Tamas K Lengyel
2016-08-02 16:05               ` George Dunlap
2016-08-02 16:09                 ` Tamas K Lengyel
2016-08-02 16:40                 ` Julien Grall
2016-08-02 17:01                   ` Tamas K Lengyel
2016-08-02 17:22                   ` Tamas K Lengyel
2016-08-02 16:00           ` Tamas K Lengyel
2016-08-02 16:11             ` Julien Grall
2016-08-02 16:22               ` Tamas K Lengyel
2016-08-01 23:14   ` Andrew Cooper
2016-08-02  7:34     ` Julien Grall
2016-08-02 16:08       ` Andrew Cooper
2016-08-02 16:30         ` Tamas K Lengyel
2016-08-03 11:53         ` Julien Grall
2016-08-03 12:00           ` Andrew Cooper
2016-08-03 12:13             ` Julien Grall
2016-08-03 12:18               ` Andrew Cooper
2016-08-03 12:45                 ` Sergej Proskurin
2016-08-03 14:08                   ` Julien Grall
2016-08-03 14:17                     ` Sergej Proskurin
2016-08-03 16:01                     ` Tamas K Lengyel
2016-08-03 16:24                       ` Julien Grall
2016-08-03 16:42                         ` Tamas K Lengyel
2016-08-03 16:51                           ` Julien Grall
2016-08-03 17:30                             ` Andrew Cooper
2016-08-03 17:43                               ` Tamas K Lengyel
2016-08-03 17:45                                 ` Julien Grall [this message]
2016-08-03 17:51                                   ` Tamas K Lengyel
2016-08-03 17:56                                     ` Julien Grall
2016-08-03 18:11                                       ` Tamas K Lengyel
2016-08-03 18:16                                         ` Julien Grall
2016-08-03 18:21                                           ` Tamas K Lengyel
2016-08-04 11:13                                             ` George Dunlap
2016-08-08  4:44                                               ` Tamas K Lengyel

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=6cb59e22-2b02-665e-d619-95c4bd894dbe@arm.com \
    --to=julien.grall@arm.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=proskurin@sec.in.tum.de \
    --cc=sstabellini@kernel.org \
    --cc=tamas.k.lengyel@gmail.com \
    --cc=xen-devel@lists.xen.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.