From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH] x86: re-order struct arch_domain fields Date: Wed, 4 Feb 2015 10:56:20 +0000 Message-ID: <54D1FAD4.2020800@citrix.com> References: <54BD33B902000078000568F7@mail.emea.novell.com> <54BD4449.9020906@citrix.com> <54D0A6C8020000780005C45F@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YIxdB-0006P3-7h for xen-devel@lists.xenproject.org; Wed, 04 Feb 2015 10:56:25 +0000 In-Reply-To: <54D0A6C8020000780005C45F@mail.emea.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: xen-devel , Keir Fraser List-Id: xen-devel@lists.xenproject.org On 03/02/15 09:45, Jan Beulich wrote: >>>> On 19.01.15 at 18:52, wrote: >> On 19/01/15 15:41, Jan Beulich wrote: >>> ... to reduce padding holes. While doing this I noticed vtsc_usercount >>> is a PV-only thing, so it gets moved straight to struct pv_domain. >> The vtsc_{user,kernel}count split is curious. They are both for stats >> purposes alone, but there is nothing pv specific about the usercount. >> It frankly looks as if it has been mis-implemented for HVM, despite the >> split appearing to be deliberate when it was introduced in c/s >> bf2c44f8b469. I am really not sure what to make of it. > Since I didn't hear back on my earlier response, I looked at this again: > Considering especially the explicit callers of hvm_get_guest_tsc_fixed(), > I also wonder whether the accounting for HVM makes sense in the > first place - to me, these two numbers are meant to be _only_ counting > actual emulations. Hence I first of all would think this ought to be > moved into hvm_rdtsc_intercept() (and maybe mirrored in > hvm_msr_read_intercept(), perhaps by refactoring the former to be > usable by the latter). > > In that case it would indeed make sense to keep the user count for > non-PV, as then it really makes sense to check for user/kernel mode > there. > > Jan > I agree with your analysis. Now that you point it out, the current code does look wrong. ~Andrew