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

Re: [Xen-devel] [PATCH v2 11/22] xen/x86: allow disabling emulated devices for HVM guests



El 01/07/15 a les 17.46, Andrew Cooper ha escrit:
> 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@xxxxxxxxxx>
>> Cc: Jan Beulich <jbeulich@xxxxxxxx>
>> Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
>> Cc: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
>> Cc: Suravee Suthikulpanit <suravee.suthikulpanit@xxxxxxx>
>> Cc: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@xxxxxxx>
>> Cc: Jun Nakajima <jun.nakajima@xxxxxxxxx>
>> Cc: Eddie Dong <eddie.dong@xxxxxxxxx>
>> Cc: Kevin Tian <kevin.tian@xxxxxxxxx>
> 
> 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 don't think using a new hypercall or hvmparam is suitable for this,
the emulators are initialized in hvm_domain_initialise which is called
by the XEN_DOMCTL_createdomain hypercall. Trying to set them before
calling XEN_DOMCTL_createdomain is impossible because there's no domain
struct yet, and adding a new hypercall to do that later seems quite
convoluted, IMHO it's best to never initialize them in the first place.

I would rather add a bitmap field to xen_arch_domainconfig in order to
describe which emulators we want to enable.

I've been also wondering why we need to introduce this now, AFAICT we
can always introduce this bitmap field later and remove
XEN_DOMCTL_CDF_noemu/DOMCRF_noemu because the DOMCTL interface is not
stable anyway.

Also, from a guest POV, how is the hw emulated local apic going to be
used? Are we going to route the interrupts from virtual devices
(netfront, blkfront) to the lapic? Or we just want it for the timer and
ditch the PV timer?

I can see that this is more interesting for a PVH/HVMlite Dom0, but
still in that case I'm not sure how a guest is supposed to interact with
it. Will the PHYSDEV hypercalls route interrupts to the emulated local
apic instead of pirqs event channels? Will we trap PCI/MSI/MSI-X
configuration and emulate it?

Roger.


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

 


Rackspace

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