From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: KVM: x86: stop IO emulation cycle if instruction pointer is modified Date: Mon, 8 Jul 2013 18:16:35 -0300 Message-ID: <20130708211635.GA11148@amt.cnet> References: <20130705191654.GA18788@amt.cnet> <20130706074112.GA26728@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm-devel To: Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:12239 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753087Ab3GHVX7 (ORCPT ); Mon, 8 Jul 2013 17:23:59 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r68LNwS8028360 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 8 Jul 2013 17:23:59 -0400 Content-Disposition: inline In-Reply-To: <20130706074112.GA26728@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Sat, Jul 06, 2013 at 10:41:12AM +0300, Gleb Natapov wrote: > On Fri, Jul 05, 2013 at 04:16:55PM -0300, Marcelo Tosatti wrote: > > > > MMIO/PIO emulation should be interrupted if the system is restarted. > > Otherwise in progress IO emulation continues at the instruction pointer, > > even after vcpus' IP has been modified by KVM_SET_REGS. > > > > Use IP change as an indicator to reset MMIO/PIO emulation state. > > > Userspace has to return to the kernel to complete pending IO operation. > This is documented in Documentation/virtual/kvm/api.txt. If this is not > what program does it is a bug. What userspace you see the problem with? You're right, this patch should not be necessary.