From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34262) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TUuzR-0005U7-59 for qemu-devel@nongnu.org; Sun, 04 Nov 2012 02:51:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TUuzP-0006Qe-Qv for qemu-devel@nongnu.org; Sun, 04 Nov 2012 02:51:29 -0500 Received: from smtp1-g21.free.fr ([2a01:e0c:1:1599::10]:58643) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TUuzP-0006QW-7N for qemu-devel@nongnu.org; Sun, 04 Nov 2012 02:51:27 -0500 Message-ID: <50961E77.9050805@reactos.org> Date: Sun, 04 Nov 2012 08:51:19 +0100 From: =?ISO-8859-1?Q?Herv=E9_Poussineau?= MIME-Version: 1.0 References: <50961086.4000704@web.de> In-Reply-To: <50961086.4000704@web.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] kvmvapic: Fix TB invalidation after instruction patching List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: Blue Swirl , qemu-devel , David Gibson Jan Kiszka a =E9crit : > From: Jan Kiszka > > Since 0b57e287, cpu_memory_rw_debug already triggers a TB invalidation= . > As it doesn't (and cannot) set is_cpu_write_access=3D1 but "consumes" = the > currently executed TB, the tb_invalidate_phys_page_range call from > patch_instruction didn't work anymore. > > Fix this by open-coding the required bits to restore the CPU state fro= m > the current TB position before patching and resume execution on the > patched instruction afterward. > > Signed-off-by: Jan Kiszka > --- > Tested-by: Herv=E9 Poussineau However, I had to initialize current_pc, current_cs_base and=20 current_flags to 0 to prevent uninitialized warning. (GCC 4.7.1, KVM disabled by configure) Regards, Herv=E9