From: "Jan Beulich" Subject: Re: [PATCH] x86: re-order struct arch_domain fields Date: Tue, 03 Feb 2015 09:45:28 +0000 Message-ID: <54D0A6C8020000780005C45F@mail.emea.novell.com> References: <54BD33B902000078000568F7@mail.emea.novell.com> <54BD4449.9020906@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YIa30-00065Q-Tr for xen-devel@lists.xenproject.org; Tue, 03 Feb 2015 09:45:31 +0000 In-Reply-To: <54BD4449.9020906@citrix.com> 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: Andrew Cooper Cc: xen-devel , Keir Fraser List-Id: xen-devel@lists.xenproject.org >>> 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