From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH v6 11/29] xen/x86: add bitmap of enabled emulated devices Date: Wed, 23 Sep 2015 13:46:31 +0100 Message-ID: <56029F27.7090101@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> <56029E4F.80509@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252"; Format="flowed" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZejRU-0002Qc-5B for xen-devel@lists.xenproject.org; Wed, 23 Sep 2015 12:46:36 +0000 In-Reply-To: <56029E4F.80509@citrix.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: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= , Jan Beulich Cc: Ian Jackson , xen-devel@lists.xenproject.org, Wei Liu , Ian Campbell , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On 23/09/15 13:42, Roger Pau Monn=E9 wrote: > 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_L= APIC) >>> +#define has_vhpet(d) ((d)->arch.emulation_flags & XEN_X86_EMU_H= PET) >>> +#define has_vpmtimer(d) ((d)->arch.emulation_flags & XEN_X86_EMU_P= MTIMER) >>> +#define has_vrtc(d) ((d)->arch.emulation_flags & XEN_X86_EMU_R= TC) >>> +#define has_vioapic(d) ((d)->arch.emulation_flags & XEN_X86_EMU_I= OAPIC) >>> +#define has_vpic(d) ((d)->arch.emulation_flags & XEN_X86_EMU_P= IC) >>> +#define has_vpmu(d) ((d)->arch.emulation_flags & XEN_X86_EMU_P= MU) >>> +#define has_vvga(d) ((d)->arch.emulation_flags & XEN_X86_EMU_V= GA) >>> +#define has_viommu(d) ((d)->arch.emulation_flags & XEN_X86_EMU_I= OMMU) >> 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. I personally think it is clearer having the v in the name. ~Andrew