From patchwork Tue Feb 14 11:38:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Fran=C3=A7ois_Ozog?= X-Patchwork-Id: 9571783 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2A74860578 for ; Tue, 14 Feb 2017 11:40:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24439280CF for ; Tue, 14 Feb 2017 11:40:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 17D2E2839B; Tue, 14 Feb 2017 11:40:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A6B9C280CF for ; Tue, 14 Feb 2017 11:40:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753849AbdBNLjG (ORCPT ); Tue, 14 Feb 2017 06:39:06 -0500 Received: from mail-wr0-f179.google.com ([209.85.128.179]:35198 "EHLO mail-wr0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752115AbdBNLip (ORCPT ); Tue, 14 Feb 2017 06:38:45 -0500 Received: by mail-wr0-f179.google.com with SMTP id c4so10115028wrd.2 for ; Tue, 14 Feb 2017 03:38:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=uBojgovtHHNepZprytHN8GI8doHYQgA+S+eYDdnqvYY=; b=jpYCNJkFjsL+yW75rH6fvrd+zk8PgPbrUCAZnA5ALAot0o2T19Yo1EALyl98gXGVBp iOGbMWnxaJHgk7cYHQ6+3jWAUj59vD8w793uor1PiLQHSeCfQQXt9pdc0/afbkP78EfW h+tFJRJmLw0ZRaqizGjMDJ5gvgSJ2hqHVamRs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=uBojgovtHHNepZprytHN8GI8doHYQgA+S+eYDdnqvYY=; b=W3Yrs1ML0m3Q13zAO7m9g1J6eUoNvHdlPGBpp9qxb30fbolKSgnOOOpCAuE4erEftC 4xAZeZW+nizq7B59KGL1bcVXXCM2PYdH0inaEwG8FCM4tr3ksp2wVT5Zw9R37MSjgGY0 rfsPjqeDyUnrTP0zxSKES8ikfeC5Gjm23Y23z27Cl6WKITTyEi9HFuOS5JrZ8/Wk21TR cjhrS4OR5k83PQ+h48vCKNrP71QkUKk1tPIpgcIpOqgNDAaICGzVnKwYflOwgWnKaAei mg6XxDf8CvoeNy+QhXyGES5eM5Sng+7Gc1xK6D0bCiC3sUHsHR7ZYzic6mCo9s5ooSOk W9Wg== X-Gm-Message-State: AMke39n9IoqtKlAvA9+BMWez+aeimKsP9/r87BoA14NmuQpkaQ8CObbH+QFZ6XYJeTGTHos9 X-Received: by 10.223.169.112 with SMTP id u103mr24154810wrc.166.1487072324111; Tue, 14 Feb 2017 03:38:44 -0800 (PST) Received: from Adainville (LStLambert-657-1-9-75.w193-252.abo.wanadoo.fr. [193.252.40.75]) by smtp.gmail.com with ESMTPSA id m83sm3112438wmc.33.2017.02.14.03.38.43 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 14 Feb 2017 03:38:43 -0800 (PST) Date: Tue, 14 Feb 2017 12:38:43 +0100 From: Francois-Frederic Ozog To: kvm@vger.kernel.org Subject: [PATCH kvmtool] kvmtool/run: Fix debug-single-step Message-ID: <20170214113843.c5mszcio4mflaqid@Adainville> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.6.2-neo (2016-08-21) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When executing with --debug-single-step option, the singlestep mode stops on VM exit. Need to rearm singlestep mode for most of the VM exit reasons (KVM_EXIT_IO, KVM_EXIT_MMIO). Signed-off-by: Francois-Frederic Ozog --- kvm-cpu.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kvm-cpu.c b/kvm-cpu.c index cc8385f..6138458 100644 --- a/kvm-cpu.c +++ b/kvm-cpu.c @@ -183,6 +183,10 @@ int kvm_cpu__start(struct kvm_cpu *cpu) if (!ret) goto panic_kvm; + + if (cpu->kvm->cfg.single_step) + kvm_cpu__enable_singlestep(cpu); + break; } case KVM_EXIT_MMIO: { @@ -202,6 +206,10 @@ int kvm_cpu__start(struct kvm_cpu *cpu) if (!ret) goto panic_kvm; + + if (cpu->kvm->cfg.single_step) + kvm_cpu__enable_singlestep(cpu); + break; } case KVM_EXIT_INTR: