From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel De Graaf Subject: Re: [PATCH 10/11] xen/arch/x86: clarify domid == 0 checks Date: Mon, 15 Apr 2013 09:47:08 -0400 Message-ID: <516C04DC.7070608@tycho.nsa.gov> References: <1365800659-26040-1-git-send-email-dgdegra@tycho.nsa.gov> <1365800659-26040-11-git-send-email-dgdegra@tycho.nsa.gov> <516BDB9F02000078000CD238@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <516BDB9F02000078000CD238@nat28.tlf.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: Keir Fraser , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 04/15/2013 04:51 AM, Jan Beulich wrote: >>>> On 12.04.13 at 23:04, Daniel De Graaf wrote: >> --- a/xen/arch/x86/time.c >> +++ b/xen/arch/x86/time.c >> @@ -1928,7 +1928,7 @@ void tsc_set_info(struct domain *d, >> uint32_t tsc_mode, uint64_t elapsed_nsec, >> uint32_t gtsc_khz, uint32_t incarnation) >> { >> - if ( is_idle_domain(d) || (d->domain_id == 0) ) >> + if ( is_idle_domain(d) || is_hardware_domain(d) || is_control_domain(d) >> ) >> { >> d->arch.vtsc = 0; >> return; >> @@ -2005,7 +2005,7 @@ static void dump_softtsc(unsigned char key) >> "warp=%lu (count=%lu)\n", tsc_max_warp, tsc_check_count); >> for_each_domain ( d ) >> { >> - if ( d->domain_id == 0 && d->arch.tsc_mode == TSC_MODE_DEFAULT ) >> + if ( is_hardware_domain(d) && d->arch.tsc_mode == TSC_MODE_DEFAULT ) >> continue; >> printk("dom%u%s: mode=%d",d->domain_id, >> is_hvm_domain(d) ? "(hvm)" : "", d->arch.tsc_mode); > > I am of the opinion that the two checks should match, i.e. the > second one should also become is_hardware || is_control. But > I say this without really recalling why Dom0 is being special cased > here in the first place. > > Jan > Since this is just an output function, my best guess is to avoid displaying dom0 statistics that aren't relevant for a query that is intended for domUs, so it doesn't really matter what is tested. -- Daniel De Graaf National Security Agency