From: "Jan Beulich" Subject: Re: [PATCH RFC] xen/pvh: use a custom IO bitmap for PVH hardware domains Date: Tue, 14 Apr 2015 11:31:24 +0100 Message-ID: <552D089C0200007800071D59@mail.emea.novell.com> References: <1428497829-21845-1-git-send-email-roger.pau@citrix.com> <552CE55C.4040603@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Yhy7r-0001I9-Vc for xen-devel@lists.xenproject.org; Tue, 14 Apr 2015 10:31:28 +0000 In-Reply-To: <552CE55C.4040603@citrix.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: =?UTF-8?Q?Roger=20Pau=20Monn=C3=A9?= Cc: Kevin Tian , Suravee Suthikulpanit , Andrew Cooper , Eddie Dong , Aravind Gopalakrishnan , Jun Nakajima , xen-devel@lists.xenproject.org, Boris Ostrovsky List-Id: xen-devel@lists.xenproject.org >>> On 14.04.15 at 12:01, wrote: > I have one question about the current IO port handling for PVH guests > (DomU and Dom0). There's some code right now in vmx_vmexit_handler > (EXIT_REASON_IO_INSTRUCTION) that's kind PVH specific: > > if ( exit_qualification & 0x10 ) > { > /* INS, OUTS */ > if ( unlikely(is_pvh_vcpu(v)) /* PVH fixme */ || > !handle_mmio() ) > hvm_inject_hw_exception(TRAP_gp_fault, 0); > } > else > { > /* IN, OUT */ > uint16_t port = (exit_qualification >> 16) & 0xFFFF; > int bytes = (exit_qualification & 0x07) + 1; > int dir = (exit_qualification & 0x08) ? IOREQ_READ : IOREQ_WRITE; > > if ( handle_pio(port, bytes, dir) ) > update_guest_eip(); /* Safe: IN, OUT */ > } > > Is there any need for DomUs to access the IO ports? I know that FreeBSD > will poke at some of them during boot to scan for devices, but I'm not > sure if we could just make them noops in the PVH case and simply return > garbage. The PVH special case quoted above is there only to prevent reaching handle_mmio(). The non-string "else" path was enabled solely on the basis that it was possible to be made work without much extra effort. And while (without pass-through) it shouldn't be needed for PVH DomU-s, it also should do no harm. Jan