From: "Jan Beulich" Subject: [PATCH] VMX: don't allow PVH to reach handle_pio() or handle_mmio() Date: Fri, 05 Dec 2014 14:06:53 +0000 Message-ID: <5481CA0D020000780004D2E8@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartEBDE33ED.2__=" Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XwtX3-0003si-Qq for xen-devel@lists.xenproject.org; Fri, 05 Dec 2014 14:06:53 +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: Kevin Tian , Eddie Dong , Jun Nakajima , Roger Pau Monne 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. --=__PartEBDE33ED.2__= Content-Type: text/plain; charset=UTF-8 Content-Length: 668 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline PVH guests are not supposed to access I/O ports they weren't given access to (there's nothing to handle emulation of such accesses). Reported-by: Roger Pau Monn=C3=A9 Signed-off-by: Jan Beulich --- Note: Only compile tested so far. --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -3082,6 +3082,9 @@ void vmx_vmexit_handler(struct cpu_user_ } case EXIT_REASON_IO_INSTRUCTION: + if ( unlikely(is_pvh_vcpu(v)) ) + goto exit_and_crash; + __vmread(EXIT_QUALIFICATION, &exit_qualification); if ( exit_qualification & 0x10 ) { --=__PartEBDE33ED.2__= Content-Type: text/plain; name="VMX-PVH-no-emulated-IO-ports.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="VMX-PVH-no-emulated-IO-ports.patch" VMX: don't allow PVH to reach handle_pio() or handle_mmio()=0A=0APVH = guests are not supposed to access I/O ports they weren't given=0Aaccess to = (there's nothing to handle emulation of such accesses).=0A=0AReported-by: = Roger Pau Monn=C3=A9=0ASigned-off-by: Jan Beulich = =0A---=0ANote: Only compile tested so far.=0A=0A--- = a/xen/arch/x86/hvm/vmx/vmx.c=0A+++ b/xen/arch/x86/hvm/vmx/vmx.c=0A@@ = -3082,6 +3082,9 @@ void vmx_vmexit_handler(struct cpu_user_=0A }=0A = =0A case EXIT_REASON_IO_INSTRUCTION:=0A+ if ( unlikely(is_pvh_vc= pu(v)) )=0A+ goto exit_and_crash;=0A+=0A __vmread(EXIT_Q= UALIFICATION, &exit_qualification);=0A if ( exit_qualification & = 0x10 )=0A {=0A --=__PartEBDE33ED.2__= 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 --=__PartEBDE33ED.2__=--