From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH] x86/PVH: replace bogus assertion with conditional Date: Fri, 31 Oct 2014 10:45:25 +0000 Message-ID: <54536845.2000703@citrix.com> References: <545376090200007800043E08@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5635135667108027650==" Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xk9hy-0005VW-F7 for xen-devel@lists.xenproject.org; Fri, 31 Oct 2014 10:45:30 +0000 In-Reply-To: <545376090200007800043E08@mail.emea.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 , xen-devel Cc: Keir Fraser List-Id: xen-devel@lists.xenproject.org --===============5635135667108027650== Content-Type: multipart/alternative; boundary="------------070101000007050507050404" --------------070101000007050507050404 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit On 31/10/14 10:44, Jan Beulich wrote: > While PVH guests currently have to start in 64-bit mode, nothing keeps > them from entering compatibility mode via a suitable ring-0 code > selector and making a hypercall from there. Fail such attempts rather > than asserting they won't happen. > > Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper > > --- a/xen/arch/x86/hvm/hvm.c > +++ b/xen/arch/x86/hvm/hvm.c > @@ -4876,10 +4876,10 @@ int hvm_do_hypercall(struct cpu_user_reg > regs->r8, regs->r9); > curr->arch.hvm_vcpu.hcall_64bit = 0; > } > + else if ( unlikely(is_pvh_vcpu(curr)) ) > + regs->_eax = -ENOSYS; /* PVH 32bitfixme. */ > else > { > - ASSERT(!is_pvh_vcpu(curr)); /* PVH 32bitfixme. */ > - > HVM_DBG_LOG(DBG_LEVEL_HCALL, "hcall%u(%x, %x, %x, %x, %x, %x)", eax, > (uint32_t)regs->ebx, (uint32_t)regs->ecx, > (uint32_t)regs->edx, (uint32_t)regs->esi, > > > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel --------------070101000007050507050404 Content-Type: text/html; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit
On 31/10/14 10:44, Jan Beulich wrote:
While PVH guests currently have to start in 64-bit mode, nothing keeps
them from entering compatibility mode via a suitable ring-0 code
selector and making a hypercall from there. Fail such attempts rather
than asserting they won't happen.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>


--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -4876,10 +4876,10 @@ int hvm_do_hypercall(struct cpu_user_reg
                                                    regs->r8, regs->r9);
         curr->arch.hvm_vcpu.hcall_64bit = 0;
     }
+    else if ( unlikely(is_pvh_vcpu(curr)) )
+        regs->_eax = -ENOSYS; /* PVH 32bitfixme. */
     else
     {
-        ASSERT(!is_pvh_vcpu(curr));   /* PVH 32bitfixme. */
-
         HVM_DBG_LOG(DBG_LEVEL_HCALL, "hcall%u(%x, %x, %x, %x, %x, %x)", eax,
                     (uint32_t)regs->ebx, (uint32_t)regs->ecx,
                     (uint32_t)regs->edx, (uint32_t)regs->esi,





_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

--------------070101000007050507050404-- --===============5635135667108027650== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============5635135667108027650==--