From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH 18/18] PVH xen: introduce vmx_pvh.c Date: Wed, 10 Jul 2013 08:20:39 +0100 Message-ID: <51DD276702000078000E3BE0@nat28.tlf.novell.com> References: <1372118507-16864-1-git-send-email-mukesh.rathor@oracle.com> <1372118507-16864-19-git-send-email-mukesh.rathor@oracle.com> <51C991F502000078000E04E5@nat28.tlf.novell.com> <20130627183501.25bafddd@mantra.us.oracle.com> <51CD742902000078000E17D0@nat28.tlf.novell.com> <20130705183124.32d043f5@mantra.us.oracle.com> <51DA94F502000078000E328E@nat28.tlf.novell.com> <20130708160955.64bd62fb@mantra.us.oracle.com> <20130708170155.628f0ed2@mantra.us.oracle.com> <51DBD86C02000078000E37B2@nat28.tlf.novell.com> <20130709173310.76132081@mantra.us.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20130709173310.76132081@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: Mukesh Rathor Cc: xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 10.07.13 at 02:33, Mukesh Rathor wrote: > On Tue, 09 Jul 2013 08:31:24 +0100 > "Jan Beulich" wrote: > >> >>> On 09.07.13 at 02:01, Mukesh Rathor >> >>> wrote: >> > On Mon, 8 Jul 2013 16:09:55 -0700 >> > Mukesh Rathor wrote: >> > >> >> On Mon, 08 Jul 2013 09:31:17 +0100 >> >> "Jan Beulich" wrote: > ....... >> Fine with me, except (as said before) ... >> >> > --- a/xen/arch/x86/hvm/hvm.c >> > +++ b/xen/arch/x86/hvm/hvm.c >> > @@ -4642,6 +4642,14 @@ enum hvm_intblk >> > nhvm_interrupt_blocked(struct vcpu *v) return >> > hvm_funcs.nhvm_intr_blocked(v); } >> > >> > +bool_t hvm_kernel_mode(const struct vcpu *v) >> > +{ >> > + struct segment_register seg; >> > + >> > + hvm_get_segment_register((struct vcpu *)v, x86_seg_ss, &seg); >> >> .. for this cast. > > Like I said in prev email, changing the cast is very hard, as it trickles > down all the way to vcpu_runnable thru SVM and VMX and would need changing > vcpu_runnable itself and all callers of it. So, I can either leave the cast, > or better just remove "const" from the sole caller using it, please LMK: At first I wanted to say this is a no-go, but in fact you can't have hvm_get_segment_register() have a const vcpu pointer: On VMX, if v != current, this may involve a vcpu_pause, and that one _can't_ have a const pointer passed. Thus casting away the constness above is actively wrong without an assertion proving v == current (the validity of which would depend on whether this is used in the context switch path). Hence sadly I have to agree to you removing the const from vcpu_show_registers()' only parameter, no matter how wrong that looks. Jan