xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Kevin Tian <kevin.tian@intel.com>,
	Jan Beulich <jbeulich@suse.com>,
	Jun Nakajima <jun.nakajima@intel.com>,
	Eddie Dong <eddie.dong@intel.com>,
	Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	xen-devel@lists.xenproject.org,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [PATCH v2 11/22] xen/x86: allow disabling emulated devices for HVM guests
Date: Wed, 1 Jul 2015 17:48:21 +0100	[thread overview]
Message-ID: <559419D5.5010901@citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1507011708210.17378@kaball.uk.xensource.com>

On 01/07/15 17:13, Stefano Stabellini wrote:
> On Wed, 1 Jul 2015, Andrew Cooper wrote:
>> On 01/07/15 16:51, Boris Ostrovsky wrote:
>>> On 07/01/2015 11:46 AM, Andrew Cooper wrote:
>>>> On 01/07/15 15:46, Roger Pau Monne wrote:
>>>>> Introduce a new DOMCTL flag that can be used to disable device
>>>>> emulation
>>>>> inside of Xen for HVM guests. The following emulated devices are
>>>>> disabled
>>>>> when the XEN_DOMCTL_CDF_noemu is used: hpet, pmtimer, rtc, ioapic,
>>>>> lapic,
>>>>> pic and pmu. Also all the MMIO handlers are disabled.
>>>>>
>>>>> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
>>>>> Cc: Jan Beulich <jbeulich@suse.com>
>>>>> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
>>>>> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>>>>> Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
>>>>> Cc: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>
>>>>> Cc: Jun Nakajima <jun.nakajima@intel.com>
>>>>> Cc: Eddie Dong <eddie.dong@intel.com>
>>>>> Cc: Kevin Tian <kevin.tian@intel.com>
>>>> I would be hesitant to have a blanket change like this.
>>>>
>>>> Consider APICV/AVIC.  For performance reasons, we absolutely want HVM
>>>> and PVH to make use of them, as they are substantially more efficient
>>>> using hardware support than evening using plain evtchn hypercalls.
>>>>
>>>> However, the flipside is that we must provide an LAPIC emulation to
>>>> cover the bits which hardware cannot virtualise.
>>>>
>>>> As a random idea, how about having a new hypercall or hvmparam which
>>>> provides a bitmap of permitted emulators?  This would allow far finer
>>>> grain control over what is and isn't available to a domain.
>>> I think we also need to decide on which subsets of emulators we are
>>> going to support, otherwise test matrix will become pretty big. For
>>> example, initially we may want to allow all (for what we now call HVM)
>>> or none (PVH).
>> Right, but that can currently be enforced with an "if ( arg != 0 && arg
>> != ~0 ) return -EOPNOTSUPP;" in the hypercall handler for now.
>>
>> It still leaves us with the ability to add in LAPIC emulation in the
>> future by changing the auditing.  A blanket "no emulation" boolean is
>> very much harder to relax in the future.
> APICV is a bit of a special case, because it is partially virtualized in
> hardware.

Not in the slightest.  It is *exactly* the same as existing hardware
virt.  Hardware does most of the work, but occasionally needs to break
into Xen to mange thing.  The difference is that we don't call some of
the existing vmexits "emulating an x86 cpu", despite this being what is
actually happening.

> But in general, considering that the whole purpose of PVH as DomU is
> security

Says who?  An entirely reasonable alternate opinion is "HVM without the
emulation overhead".

> , as a Xen user, I would not want any emulators running with PVH
> guests. Otherwise I might as well run PV on HVM.

That is fine from a security point of view, but is not shared by most
users Xen.

Most users of Xen want to squeeze every ounce of performance out of the
hardware they paid $$$ for, and won't mind exposing an LAPIC
implementation to a PVH guest, seeing as the same implementation is
available to windows or existing PVHVM guests.

(when eventually supported), offering host administrators a choice
between more security or more performance is perfectly ok, but designing
PVH to be secure at the deliberate detriment of performance is unacceptable.

> Being able to enable/disable specific emulators sounds more future
> proof, but in practice it is likely to lead to many broken non default
> configs.

Not if Xen has a sensible audit for combinations (which is precisely
what I suggested).

~Andrew

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

  reply	other threads:[~2015-07-01 16:48 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-01 14:45 [PATCH v2 00/22] Introduce HVM without dm and new boot ABI Roger Pau Monne
2015-07-01 14:45 ` [PATCH v2 01/22] libxc: split x86 HVM setup_guest into smaller logical functions Roger Pau Monne
2015-07-01 14:45 ` [PATCH v2 02/22] libxc: unify xc_dom_p2m_{host/guest} Roger Pau Monne
2015-07-01 14:45 ` [PATCH v2 03/22] libxc: introduce the notion of a container type Roger Pau Monne
2015-07-01 14:45 ` [PATCH v2 04/22] libxc: introduce a domain loader for HVM guest firmware Roger Pau Monne
2015-07-01 14:45 ` [PATCH v2 05/22] libxc: make arch_setup_meminit a xc_dom_arch hook Roger Pau Monne
2015-07-01 14:45 ` [PATCH v2 06/22] libxc: make arch_setup_boot{init/late} xc_dom_arch hooks Roger Pau Monne
2015-07-01 14:46 ` [PATCH v2 07/22] xen/x86: fix arch_set_info_guest for HVM guests Roger Pau Monne
2015-07-01 14:46 ` [PATCH v2 08/22] libxc: introduce a xc_dom_arch for hvm-3.0-x86_32 guests Roger Pau Monne
2015-07-01 14:46 ` [PATCH v2 09/22] libxl: switch HVM domain building to use xc_dom_* helpers Roger Pau Monne
2015-07-01 14:46 ` [PATCH v2 10/22] libxc: remove dead HVM building code Roger Pau Monne
2015-07-01 14:46 ` [PATCH v2 11/22] xen/x86: allow disabling emulated devices for HVM guests Roger Pau Monne
2015-07-01 15:25   ` Paul Durrant
2015-07-01 15:34     ` Roger Pau Monné
2015-07-01 15:39       ` Paul Durrant
2015-07-01 15:46   ` Andrew Cooper
2015-07-01 15:51     ` Boris Ostrovsky
2015-07-01 16:01       ` Andrew Cooper
2015-07-01 16:13         ` Stefano Stabellini
2015-07-01 16:48           ` Andrew Cooper [this message]
2015-07-02 11:49             ` Stefano Stabellini
2015-07-02 13:34               ` Boris Ostrovsky
2015-07-02  9:06     ` Roger Pau Monné
2015-07-10 18:54       ` Konrad Rzeszutek Wilk
2015-07-01 14:46 ` [PATCH v2 12/22] elfnotes: intorduce a new PHYS_ENTRY elfnote Roger Pau Monne
2015-07-03 10:36   ` David Vrabel
2015-07-03 10:52     ` Roger Pau Monné
2015-07-01 14:46 ` [PATCH v2 13/22] lib{xc/xl}: allow creating domains without emulated devices Roger Pau Monne
2015-07-01 14:46 ` [PATCH v2 14/22] xen: allow HVM guests to use XENMEM_memory_map Roger Pau Monne
2015-07-01 14:46 ` [PATCH v2 15/22] xen/x86: allow HVM guests to use hypercalls to bring up vCPUs Roger Pau Monne
2015-07-01 14:46 ` [PATCH v2 16/22] xenconsole: try to attach to PV console if HVM fails Roger Pau Monne
2015-07-01 14:46 ` [PATCH v2 17/22] libxc: change the position of the special pages Roger Pau Monne
2015-07-01 14:46 ` [PATCH v2 18/22] libxc/xen: introduce HVM_PARAM_CMDLINE_PFN Roger Pau Monne
2015-07-01 14:46 ` [PATCH v2 19/22] libxc/xen: introduce HVM_PARAM_FIRST_FREE_PFN Roger Pau Monne
2015-07-01 14:46 ` [PATCH v2 20/22] libxc/xen: introduce HVM_PARAM_MODLIST_PFN Roger Pau Monne
2015-07-01 14:46 ` [PATCH v2 21/22] libxl: set correct nic type for HVM guests without a device model Roger Pau Monne
2015-07-01 14:46 ` [PATCH v2 22/22] lib{xc/xl}: allow the creation of HVM domains with a kernel Roger Pau Monne
2015-07-03  1:59 ` [PATCH v2 00/22] Introduce HVM without dm and new boot ABI Yang Hongyang
2015-07-03  7:02   ` Roger Pau Monné

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=559419D5.5010901@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=Aravind.Gopalakrishnan@amd.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=eddie.dong@intel.com \
    --cc=jbeulich@suse.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=roger.pau@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=suravee.suthikulpanit@amd.com \
    --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 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).