From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [V10 PATCH 08/23] PVH xen: Introduce PVH guest type and some basic changes. Date: Wed, 7 Aug 2013 10:14:17 +0100 Message-ID: <52020FE9.4020408@eu.citrix.com> References: <1374631171-15224-1-git-send-email-mukesh.rathor@oracle.com> <1374631171-15224-9-git-send-email-mukesh.rathor@oracle.com> <5200FE6402000078000E99A1@nat28.tlf.novell.com> <20130806162646.6c55bf47@mantra.us.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20130806162646.6c55bf47@mantra.us.oracle.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: Mukesh Rathor Cc: "keir.xen@gmail.com" , "xen-devel@lists.xensource.com" , Jan Beulich List-Id: xen-devel@lists.xenproject.org On 07/08/13 00:26, Mukesh Rathor wrote: > On Tue, 6 Aug 2013 13:06:37 +0100 > George Dunlap wrote: > >> On Tue, Aug 6, 2013 at 12:47 PM, Jan Beulich >> wrote: >>>>>> On 06.08.13 at 13:29, George Dunlap >>>>>> wrote: >>>> On Wed, Jul 24, 2013 at 2:59 AM, Mukesh Rathor >>>> wrote: >>>>> --- a/xen/arch/x86/x86_64/traps.c >>>>> +++ b/xen/arch/x86/x86_64/traps.c >>>>> @@ -141,7 +141,7 @@ void show_registers(struct cpu_user_regs >>>>> *regs) } >>>>> } >>>>> >>>>> -void vcpu_show_registers(const struct vcpu *v) >>>>> +void vcpu_show_registers(struct vcpu *v) >>>> Rather than doing this (which could potentially mask a bug in which >>>> something actually *does* get changed), wouldn't it make more >>>> sense to make hvm_kernel_mode (and hvm_get_segment_register) be >>>> const? >>> That's what I suggested first too, but which turned out not to >>> work: Down the call tree there is a use of v where a pointer to >>> non-const is required (iirc in VMX specific code). >> Then the changelog should say that, preferably the exact function >> where non-const is needed, so people know why that's necessary without >> having to do their own looking. > And the changelog does say it: > > "Note, we drop the const qualifier from vcpu_show_registers() to > accomodate the hvm function call in guest_kernel_mode()." I said *exact function*. guest_kernel_mode() doesn't need it non-const; it needs it because of a function that it calls. That in turn doesn't need it non-const either -- it needs it because of the next one down. Who *actually* needs vcpu to be non-const, way down at the bottom? That's what I need to know to understand why we can't just change each of those functions to const all the way down. -George