From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Subject: Re: [PATCH v7 12/32] xen/x86: add bitmap of enabled emulated devices Date: Fri, 30 Oct 2015 13:00:25 +0100 Message-ID: <56335BD9.30804@citrix.com> References: <1443800943-17668-1-git-send-email-roger.pau@citrix.com> <1443800943-17668-13-git-send-email-roger.pau@citrix.com> <561F05F9.5090807@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Zs8MC-0006jI-Nx for xen-devel@lists.xenproject.org; Fri, 30 Oct 2015 12:00:33 +0000 In-Reply-To: <561F05F9.5090807@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Boris Ostrovsky , xen-devel@lists.xenproject.org Cc: Wei Liu , Ian Campbell , Stefano Stabellini , George Dunlap , Andrew Cooper , Ian Jackson , Jan Beulich List-Id: xen-devel@lists.xenproject.org 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.