From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [Patch v4] x86/traps: improvements to {rd, wr}msr_hypervisor_regs() Date: Tue, 8 Oct 2013 10:32:26 +0100 Message-ID: <5253D12A.70808@citrix.com> References: <5252D51402000078000F943A@nat28.tlf.novell.com> <1381153604-30042-1-git-send-email-andrew.cooper3@citrix.com> <5253E3E802000078000F97CC@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VTTeZ-0003zv-AA for xen-devel@lists.xenproject.org; Tue, 08 Oct 2013 09:32:31 +0000 In-Reply-To: <5253E3E802000078000F97CC@nat28.tlf.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 , Paul Durrant , Keir Fraser List-Id: xen-devel@lists.xenproject.org On 08/10/13 09:52, Jan Beulich wrote: >>>> On 07.10.13 at 15:46, Andrew Cooper wrote: >> --- a/xen/arch/x86/traps.c >> +++ b/xen/arch/x86/traps.c >> @@ -595,55 +595,50 @@ DO_ERROR_NOCODE(TRAP_copro_error, coprocessor_error) >> DO_ERROR( TRAP_alignment_check, alignment_check) >> DO_ERROR_NOCODE(TRAP_simd_error, simd_coprocessor_error) >> >> +/* >> + * Returns 0 if not handled, and non-0 for error. (The calling semantics are >> + * in need of some work) >> + */ >> int rdmsr_hypervisor_regs(uint32_t idx, uint64_t *val) >> { > The comment here still isn't in line with the existing callers. Non- > zero means success afaict. There simply is no path resulting in > an error here so far. > >> + switch ( idx - base ) >> { >> - case 0: >> + case 0: /* Write hypercall page. Reads are invalid. Hand a #GP back. */ >> { >> *val = 0; >> - break; >> + return 1; > And the above means that there's no #GP being "handed back" > here either. > > Jan > /sigh - Quite right. I misread the where the breaks were going in the callers. ~Andrew