From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Subject: Re: [PATCH v6 11/29] xen/x86: add bitmap of enabled emulated devices Date: Wed, 23 Sep 2015 14:42:55 +0200 Message-ID: <56029E4F.80509@citrix.com> References: <1441368548-43465-1-git-send-email-roger.pau@citrix.com> <1441368548-43465-12-git-send-email-roger.pau@citrix.com> <55F95C4902000078000A33BB@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZejO2-0002Fk-V1 for xen-devel@lists.xenproject.org; Wed, 23 Sep 2015 12:43:03 +0000 In-Reply-To: <55F95C4902000078000A33BB@prv-mh.provo.novell.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: Jan Beulich Cc: Wei Liu , Ian Campbell , Stefano Stabellini , Andrew Cooper , Ian Jackson , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org El 16/09/15 a les 12.10, Jan Beulich ha escrit: >>>> On 04.09.15 at 14:08, wrote: >> --- a/xen/include/asm-x86/domain.h >> +++ b/xen/include/asm-x86/domain.h >> @@ -387,8 +387,21 @@ struct arch_domain >> bool_t mem_access_emulate_enabled; >> >> struct monitor_write_data *event_write_data; >> + >> + /* Emulated devices enabled bitmap. */ >> + uint32_t emulation_flags; >> } __cacheline_aligned; >> >> +#define has_vlapic(d) ((d)->arch.emulation_flags & XEN_X86_EMU_LAPIC) >> +#define has_vhpet(d) ((d)->arch.emulation_flags & XEN_X86_EMU_HPET) >> +#define has_vpmtimer(d) ((d)->arch.emulation_flags & XEN_X86_EMU_PMTIMER) >> +#define has_vrtc(d) ((d)->arch.emulation_flags & XEN_X86_EMU_RTC) >> +#define has_vioapic(d) ((d)->arch.emulation_flags & XEN_X86_EMU_IOAPIC) >> +#define has_vpic(d) ((d)->arch.emulation_flags & XEN_X86_EMU_PIC) >> +#define has_vpmu(d) ((d)->arch.emulation_flags & XEN_X86_EMU_PMU) >> +#define has_vvga(d) ((d)->arch.emulation_flags & XEN_X86_EMU_VGA) >> +#define has_viommu(d) ((d)->arch.emulation_flags & XEN_X86_EMU_IOMMU) > > And btw, now that I saw a few uses of these - do they really all need > to be has_v*() instead of just has_*()? Together with the macros taking > a domain pointer it's quite obvious that talk is about virtual devices... IMHO, I prefer to have the "v" prefix, because that's how they are named inside of Xen, so it's more clear that we are actually disabling them, but I'm not going to fight for it.