From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH] KVM: x86: Fix guest single-stepping while interruptible Date: Mon, 19 Oct 2009 16:52:39 -0200 Message-ID: <20091019185239.GF14227@amt.cnet> References: <4ADAFAFC.2010603@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , kvm-devel To: Jan Kiszka Return-path: Received: from mx1.redhat.com ([209.132.183.28]:40755 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756612AbZJSSxL (ORCPT ); Mon, 19 Oct 2009 14:53:11 -0400 Content-Disposition: inline In-Reply-To: <4ADAFAFC.2010603@web.de> Sender: kvm-owner@vger.kernel.org List-ID: On Sun, Oct 18, 2009 at 01:24:44PM +0200, Jan Kiszka wrote: > Commit 705c5323 opened the doors of hell by unconditionally injecting > single-step flags as long as guest_debug signaled this. This doesn't > work when the guest branches into some interrupt or exception handler > and triggers a vmexit with flag reloading. > > Fix it by saving cs:rip when user space requests single-stepping and > restricting the trace flag injection to this guest code position. > > Signed-off-by: Jan Kiszka > --- > > arch/x86/include/asm/kvm_host.h | 4 +++ > arch/x86/kvm/x86.c | 47 +++++++++++++++++++++++---------------- > 2 files changed, 32 insertions(+), 19 deletions(-) Applied, thanks.