From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH 6/7] xen: Allow hardare domain != dom0 Date: Fri, 11 Apr 2014 10:13:25 +0100 Message-ID: <5347CE550200007800007E5E@nat28.tlf.novell.com> References: <1395921128-7086-1-git-send-email-dgdegra@tycho.nsa.gov> <1395921128-7086-7-git-send-email-dgdegra@tycho.nsa.gov> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1395921128-7086-7-git-send-email-dgdegra@tycho.nsa.gov> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: dgdegra@tycho.nsa.gov Cc: Keir Fraser , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >>> On 27.03.14 at 12:52, wrote: I was about to commit this, but further changes are needed (along with fixing the typo in the title): > --- a/xen/arch/x86/setup.c > +++ b/xen/arch/x86/setup.c > @@ -84,6 +84,8 @@ unsigned long __initdata highmem_start; > size_param("highmem-start", highmem_start); > #endif > > +integer_param("hardware_dom", hardware_domid); This should be moved alongside the definition of the symbol in common code, and be enclosed in "#ifdef CONFIG_LATE_HWDOM". And docs/misc/xen-command-line.markdown wants an entry for it. > --- a/xen/include/xen/sched.h > +++ b/xen/include/xen/sched.h > @@ -45,6 +45,7 @@ DEFINE_XEN_GUEST_HANDLE(vcpu_runstate_info_compat_t); > > /* A global pointer to the hardware domain (usually DOM0). */ > extern struct domain *hardware_domain; > +extern domid_t hardware_domid; > > #ifndef CONFIG_COMPAT > #define BITS_PER_EVTCHN_WORD(d) BITS_PER_XEN_ULONG > @@ -794,7 +795,7 @@ void watchdog_domain_destroy(struct domain *d); > * (that is, this would not be suitable for a driver domain) > * - There is never a reason to deny dom0 access to this > */ > -#define is_hardware_domain(_d) ((_d)->domain_id == 0) > +#define is_hardware_domain(d) ((d)->domain_id == hardware_domid) This macro should imo evaluate to true for Dom0 until the hardware domain go created, i.e. you should compare _d with hardware_domain rather than their IDs. With that the definition of hardware_domid can then also be moved inside the #ifdef requested above. Jan