From: Mukesh Rathor Subject: Re: [V0 PATCH 3/6] AMD-PVH: call hvm_emulate_one instead of handle_mmio Date: Mon, 25 Aug 2014 18:53:46 -0700 Message-ID: <20140825185346.108bacb1@mantra.us.oracle.com> References: <1408153996-16425-1-git-send-email-mukesh.rathor@oracle.com> <1408153996-16425-4-git-send-email-mukesh.rathor@oracle.com> <53F72E69020000780002C9C6@mail.emea.novell.com> <20140822115237.23f514e8@mantra.us.oracle.com> <53FAFD8E020000780002D06A@mail.emea.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 1XM5xQ-0005NZ-0N for xen-devel@lists.xenproject.org; Tue, 26 Aug 2014 01:54:00 +0000 In-Reply-To: <53FAFD8E020000780002D06A@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 Cc: xen-devel@lists.xenproject.org, boris.ostrovsky@oracle.com, keir@xen.org, Aravind.Gopalakrishnan@amd.com List-Id: xen-devel@lists.xenproject.org On Mon, 25 Aug 2014 08:10:38 +0100 "Jan Beulich" wrote: > >>> On 22.08.14 at 20:52, wrote: > > On Fri, 22 Aug 2014 10:50:01 +0100 > > "Jan Beulich" wrote: > >> Also - how come at least the use of the function in VMX's > >> EXIT_REASON_IO_INSTRUCTION handling is no problem for PVH, > >> but SVM's VMEXIT_IOIO one is? > > > > Yup, missed that one. That would need to be addressed. > > > > I guess the first step would be to do a non-pvh patch to fix calling > > handle_mmio for non-mmio purposes. Since, it applies to both > > vmx/svm, perhaps an hvm function. Let me do that first, and then > > pvh can piggyback on that. > > Problem being that INS and OUTS can very well address MMIO > on the memory side of the operation (while right now > hvmemul_rep_{ins,outs}() fail such operations, this merely means > they'd get emulated one by one instead of accelerated as multiple > ops in one go). > > Also looking at handle_mmio() once again - it being just a relatively > thin wrapper around hvm_emulate_one(), can you remind me again > what in this small function it was that breaks on PVH? It would seem handle_mmio -> hvmemul_do_io -> hvm_mmio_intercept(), last one is fatal as not all handlers are safe for pvh. We had discussed creating pvh_mmio_handlers[] parallel to hvm_mmio_handlers[], which for now would be empty, but can be expanded in future. Then hvm_mmio_intercept() will chose one or the other depending on is_pvh. Or, I could just skip hvm_mmio_handlers if pvh in hvm_mmio_intercept(), and pvh_mmio_handlers[] can be added in future. Either way. With above change, we can remove !pvh assert from handle_mmio, and leave svm/vmx code unchanged (so it will keep calling handle_mmio). This would greatly help amd domU patches since time seems to be running short. thanks mukesh