xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Tamas K Lengyel <tamas.k.lengyel@gmail.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>,
	Xen-devel <xen-devel@lists.xen.org>,
	Volodymyr Babchuk <vlad.babchuk@gmail.com>,
	Andrii Anisov <andrii.anisov@gmail.com>,
	Oleksandr Tyshchenko <olekstysh@gmail.com>,
	"Andrushchenko, Oleksandr" <andr2000@gmail.com>,
	Julien Grall <julien.grall@arm.com>,
	nd@arm.com, Artem Mygaiev <joculator@gmail.com>
Subject: Re: [ARM] SMC (and HVC) handling in hypervisor
Date: Tue, 14 Feb 2017 13:14:31 -0700	[thread overview]
Message-ID: <CABfawhkfLC++cXZYYsrNpt8byJ2qfva8iyJn3xJ6dGeHswzk5A@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.10.1702141039120.6418@sstabellini-ThinkPad-X260>

On Tue, Feb 14, 2017 at 12:11 PM, Stefano Stabellini
<sstabellini@kernel.org> wrote:
> On Tue, 14 Feb 2017, Julien Grall wrote:
>> > > >   10. Domains on which the monitor privileged call feature is enabled
>> > > >   (which is by default disabled for all domains) should not be able to
>> > > >   issue firmware calls via SMCs/HVCs so that such calls reach the
>> > > >   firmware directly. Xen should not bounce such calls to the firmware on
>> > > >   behalf of the domain. Xen should not alter the state of the domain
>> > > >   automatically (ie. incrementing PC). These calls should be exclusively
>> > > >   transfered to the monitor subscriber for further processing.
>> > > >   Hypercalls, virtual PSCI calls, virtual CPU services calls and virtual
>> > > >   ARM architecture service calls remain unaffected.
>> > > >
>> > > > Does that work for you?
>> > >
>> > > It works iff hypercalls, virtual psci calls and virtual CPU services
>> > > can be denied with XSM. If that's not the case, then no, in that case
>> > > all those HVC calls that would be bounced to the firmware need to be
>> > > hooked into the monitor system as well. Ideally as soon as they are
>> > > being introduced to the Xen codebase.
>> >
>> > I don't think we have XSM hooks for all of those today, but I think
>> > everybody would agree that it is be a good idea to have them.
>>
>> I disagree here. If you add XSM hook in vPSCI, it means you will allow the
>> user to deny CPU bring up. In this case, what is the point to have a guest
>> with multiple CPUs?
>>
>> Regarding forwarding to the monitor app, this is very similar to MMIO region
>> emulated by either Xen or QEMU (in x86 case) they cannot be forwarded. Are you
>> going to add XSM in the MMIO emulation too? Are you going to emulate the
>> vITS/vGIC/vUART/pl011 in the monitor app?
>
> Let's talk about your two concerns separately, because they are
> separate points.
>
>
> I won't go into the merits of the comparison between firmware calls and
> x86 MMIO region emulation. However, I think that forwarding firmware
> calls events to the monitor is fine. It allows new potential use-cases
> for Xen, without affecting any of the current use-cases, given that
> firmware calls forwarding would need to be enabled separately.
>
> In regards to XSM hooks for vPSCI, after looking at the code, it is true
> that there aren't any XSM hooks even for the corresponding PV vcpu_op
> hypercalls (used for PV guests on x86). Introducing them might not be as
> obvious as I thought. But I don't think we actually need XSM for this.
>
>
> Firstly, we need to distinguish between SMC/HVC calls that result in
> platform and TEE calls (the main topic of this thread), and SMC/HVC
> calls that result in virtual PSCI CPU operations and Xen hypercalls
> (do_trap_psci and do_trap_hypercall). The first set of calls is bounced
> to the firmware, while the second set of calls is emulated/virtualized.
>
> Clearly, the first set of calls would need to be forwarded to the
> monitor. I don't think that the second set of calls need to be forwarded
> or filtered, because they actually do not result in any firmware calls.
> Once the user enables "firmware calls forwarding to the monitor", we
> could just leave the virtual PSCI cpu ops and hypercalls implemented as
> they are today. We just need to write down in a document what SMC/HVC
> calls get forwarded to the monitor once the user enabled the appropriate
> option.

Correct, calls that are emulated by Xen itself don't need to be
forwarded to the monitor app.

Tamas

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

  reply	other threads:[~2017-02-14 20:14 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-11  0:14 [ARM] SMC (and HVC) handling in hypervisor Volodymyr Babchuk
2017-02-13 16:20 ` Tamas K Lengyel
2017-02-13 16:29   ` Volodymyr Babchuk
2017-02-13 16:37     ` Tamas K Lengyel
2017-02-13 16:37   ` Julien Grall
2017-02-13 16:59     ` Tamas K Lengyel
2017-02-13 18:06       ` Julien Grall
2017-02-13 19:54         ` Tamas K Lengyel
2017-02-13 21:13           ` Stefano Stabellini
2017-02-13 21:32             ` Tamas K Lengyel
2017-02-13 21:54               ` Stefano Stabellini
2017-02-13 22:11                 ` Tamas K Lengyel
2017-02-13 22:14                   ` Stefano Stabellini
2017-02-14 18:06                     ` Julien Grall
2017-02-14 18:52                       ` Tamas K Lengyel
2017-02-14 19:11                       ` Stefano Stabellini
2017-02-14 20:14                         ` Tamas K Lengyel [this message]
2017-02-23 18:16                         ` Julien Grall
2017-02-28 13:51 ` Julien Grall
2017-03-01 14:13   ` Volodymyr Babchuk
2017-03-01 16:09     ` Julien Grall
2017-03-01 16:18       ` Julien Grall
2017-03-01 16:47       ` Volodymyr Babchuk
2017-03-02 17:54 ` Volodymyr Babchuk
2017-03-02 20:24   ` 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=CABfawhkfLC++cXZYYsrNpt8byJ2qfva8iyJn3xJ6dGeHswzk5A@mail.gmail.com \
    --to=tamas.k.lengyel@gmail.com \
    --cc=andr2000@gmail.com \
    --cc=andrii.anisov@gmail.com \
    --cc=edgar.iglesias@xilinx.com \
    --cc=joculator@gmail.com \
    --cc=julien.grall@arm.com \
    --cc=nd@arm.com \
    --cc=olekstysh@gmail.com \
    --cc=sstabellini@kernel.org \
    --cc=vlad.babchuk@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).