From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH v5 12/16] x86/hvm: remove HVMIO_dispatched I/O state Date: Fri, 3 Jul 2015 16:12:40 +0100 Message-ID: <5596A668.3040207@citrix.com> References: <1435669558-5421-1-git-send-email-paul.durrant@citrix.com> <1435669558-5421-13-git-send-email-paul.durrant@citrix.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 1ZB2e3-0006d5-3i for xen-devel@lists.xenproject.org; Fri, 03 Jul 2015 15:12:51 +0000 In-Reply-To: <1435669558-5421-13-git-send-email-paul.durrant@citrix.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: Paul Durrant , xen-devel@lists.xenproject.org Cc: Keir Fraser , Jan Beulich List-Id: xen-devel@lists.xenproject.org On 30/06/15 14:05, Paul Durrant wrote: > By removing the HVMIO_dispatched state and making all pending emulations > (i.e. all those not handled by the hypervisor) use HVMIO_awating_completion, > various code-paths can be simplified. > > The completion case for HVMIO_dispatched can also be trivally removed > from hvmemul_do_io() as it was already unreachable. This is because that > state was only ever used for writes or I/O to/from a guest page and > hvmemul_do_io() is never called to complete such I/O. > > NOTE: There is one sublety in handle_pio()... The only case when > handle_pio() got a return code of X86EMUL_RETRY back from > hvmemul_do_pio_buffer() and found io_state was not > HVMIO_awaiting_completion was in the case where the domain is > shutting down. This is because all writes normally yield a return > of HVMEMUL_OKAY and all reads put io_state into > HVMIO_awaiting_completion. Hence the io_state check there is > replaced with a check of the is_shutting_down flag on the domain. > > Signed-off-by: Paul Durrant > Cc: Keir Fraser > Cc: Jan Beulich > Cc: Andrew Cooper Reviewed-by: Andrew Cooper