From: "Jan Beulich" Subject: [PATCH] x86/PVH: replace bogus assertion with conditional Date: Fri, 31 Oct 2014 10:44:09 +0000 Message-ID: <545376090200007800043E08@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartE1D4EBE9.0__=" Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xk9gf-0005Ps-T2 for xen-devel@lists.xenproject.org; Fri, 31 Oct 2014 10:44:10 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: Keir Fraser List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartE1D4EBE9.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 --- 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 =3D 0; } + else if ( unlikely(is_pvh_vcpu(curr)) ) + regs->_eax =3D -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, --=__PartE1D4EBE9.0__= Content-Type: text/plain; name="x86-HVM-32bit-hypercall-PVH.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-HVM-32bit-hypercall-PVH.patch" x86/PVH: replace bogus assertion with conditional=0A=0AWhile PVH guests = currently have to start in 64-bit mode, nothing keeps=0Athem from entering = compatibility mode via a suitable ring-0 code=0Aselector and making a = hypercall from there. Fail such attempts rather=0Athan asserting they = won't happen.=0A=0ASigned-off-by: Jan Beulich =0A=0A--- = a/xen/arch/x86/hvm/hvm.c=0A+++ b/xen/arch/x86/hvm/hvm.c=0A@@ -4876,10 = +4876,10 @@ int hvm_do_hypercall(struct cpu_user_reg=0A = regs->r8, regs->r9);=0A curr->arch.= hvm_vcpu.hcall_64bit =3D 0;=0A }=0A+ else if ( unlikely(is_pvh_vcpu(= curr)) )=0A+ regs->_eax =3D -ENOSYS; /* PVH 32bitfixme. */=0A = else=0A {=0A- ASSERT(!is_pvh_vcpu(curr)); /* PVH 32bitfixme. = */=0A-=0A HVM_DBG_LOG(DBG_LEVEL_HCALL, "hcall%u(%x, %x, %x, %x, = %x, %x)", eax,=0A (uint32_t)regs->ebx, (uint32_t)regs->= ecx,=0A (uint32_t)regs->edx, (uint32_t)regs->esi,=0A --=__PartE1D4EBE9.0__= 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 --=__PartE1D4EBE9.0__=--