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

Re: [Xen-devel] [PATCH v7 12/32] xen/x86: add bitmap of enabled emulated devices



El 15/10/15 a les 3.48, Boris Ostrovsky ha escrit:
> On 10/02/2015 11:48 AM, Roger Pau Monne wrote:
>> Introduce a bitmap in x86 xen_arch_domainconfig that allows enabling or
>> disabling specific devices emulated inside of Xen for HVM guests.
>>
> 
> ...
> 
>> diff --git a/xen/include/public/arch-x86/xen.h
>> b/xen/include/public/arch-x86/xen.h
>> index 2ecc9c9..c97a9b4 100644
>> --- a/xen/include/public/arch-x86/xen.h
>> +++ b/xen/include/public/arch-x86/xen.h
>> @@ -268,7 +268,28 @@ typedef struct arch_shared_info arch_shared_info_t;
>>    * XEN_DOMCTL_INTERFACE_VERSION.
>>    */
>>   struct xen_arch_domainconfig {
>> -    char dummy;
>> +#define _XEN_X86_EMU_LAPIC          0
>> +#define XEN_X86_EMU_LAPIC           (1U<<_XEN_X86_EMU_LAPIC)
>> +#define _XEN_X86_EMU_HPET           1
>> +#define XEN_X86_EMU_HPET            (1U<<_XEN_X86_EMU_HPET)
>> +#define _XEN_X86_EMU_PMTIMER        2
>> +#define XEN_X86_EMU_PMTIMER         (1U<<_XEN_X86_EMU_PMTIMER)
>> +#define _XEN_X86_EMU_RTC            3
>> +#define XEN_X86_EMU_RTC             (1U<<_XEN_X86_EMU_RTC)
>> +#define _XEN_X86_EMU_IOAPIC         4
>> +#define XEN_X86_EMU_IOAPIC          (1U<<_XEN_X86_EMU_IOAPIC)
>> +#define _XEN_X86_EMU_PIC            5
>> +#define XEN_X86_EMU_PIC             (1U<<_XEN_X86_EMU_PIC)
>> +#define _XEN_X86_EMU_VGA            6
>> +#define XEN_X86_EMU_VGA             (1U<<_XEN_X86_EMU_VGA)
>> +#define _XEN_X86_EMU_IOMMU          7
>> +#define XEN_X86_EMU_IOMMU           (1U<<_XEN_X86_EMU_IOMMU)
> 
> What about PIT? Should we (initially) disable it as well?
> 
> I (by mistake) enabled it in my guest and crashed the hypervisor due to
> unprotected access to vlapic in pt_update_irq(). I started fixing it but
> then realized that perhaps we shouldn't have PIT at all. Which did solve
> my problems.

Right, thanks for catching this!

> (Regardless of whether we have PIT we should probably guard
> vlapic_accept_pit_interrupt() in pit_irq_masked() with has_vlapic())

I'm not able to find any of the functions you reference in the paragraph
above in the Xen source code.

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®.