From: "Jan Beulich" Subject: Re: [V10 PATCH 08/23] PVH xen: Introduce PVH guest type and some basic changes. Date: Wed, 07 Aug 2013 08:14:28 +0100 Message-ID: <52020FF402000078000E9CFD@nat28.tlf.novell.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" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20130806162646.6c55bf47@mantra.us.oracle.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: George Dunlap , Mukesh Rathor Cc: "keir.xen@gmail.com" , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org >>> On 07.08.13 at 01: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()." But I think George really was after you pointing out where down the call tree the real need for this arises (i.e. why that call tree can't instead have const-s added). Jan