From patchwork Mon Dec 4 14:03:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10090337 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 E633560329 for ; Mon, 4 Dec 2017 14:04:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EED8B2899A for ; Mon, 4 Dec 2017 14:04:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E38A428D1D; Mon, 4 Dec 2017 14:04:10 +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=-4.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,URIBL_DBL_ABUSE_SPAM 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 7FE012899A for ; Mon, 4 Dec 2017 14:04:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754380AbdLDOEI (ORCPT ); Mon, 4 Dec 2017 09:04:08 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:41891 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754173AbdLDOEF (ORCPT ); Mon, 4 Dec 2017 09:04:05 -0500 Received: by mail-wm0-f67.google.com with SMTP id g75so6045998wme.0 for ; Mon, 04 Dec 2017 06:04:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=christofferdall-dk.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BLgRLNNq6cAHYqdI5qtAl7ldP1z8EDXcJ7wIKMwITqk=; b=SKolD/bTbkd0H6BvfyArMHpwySPBLQ9ZZMsOvd/Siik8CnR+R2twDUPcNkedaOSq9h 4kGI7xGMsjhwtp+Gc4VXduj6fC9cTsTbAMkeQGVEk3eRR8tTQDcSXJo0MAQVFb6Kznec DCSiDbwE8ck6FA8+HmSd83AWg/j1vibIueQzFFOBRHvFOSaZeR0HqZXZIBUGRiv5wz/m W0yzMVqQc+99gjQyY0v3o7wPwH1Shl6kKc/rq2EgX59ZsQeqiJ9aLL2r2yMaR68/ELmW +QZUZz8xfZT1XkdtKNT9EXcCdSg+au0np8O8DB8z5eupi8R7RBfNZnrN3duoqMR7mMh/ z/jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=BLgRLNNq6cAHYqdI5qtAl7ldP1z8EDXcJ7wIKMwITqk=; b=pimdxkOek/kwxqkat7BAa+zehtWEmPG9gvOTqvCfQ5xNlkFxVWlTWIIrp8g7vjswg0 ckLrJjh7+SubXIQAnc87SW6KlWyfWuwBhFIgCvydQspOq6F9fgn31OsjstfwSEZcrpDR +UXkI8Z49DKsQNgNXXgeLmrc6oGw58ZVkpgjSWxgDAeecT3HLQDMiu6jYB0iGk9l9nAi BaBrxhM6fk5JGctzUZ+ZecJUh7qbRfNqwHXmK9fkCK876LTVU68nruNk0z4ixaltfisx 31GuV+V22H7GAwq8xyn+13F6/WGTJh40rdYDK6U6KWOF8JNOOKJfYODGeKnpUpnldg50 C5Iw== X-Gm-Message-State: AJaThX53IdfQggHyuiKljOroPbFBUVq+IrnCIdY4+XNdE7IbWiDJF2ct FktwShHDaXVBztaUiPd6haPUkw== X-Google-Smtp-Source: AGs4zMbAkcvABD4g3GenRaeXxuFVJSxQi9yBJQRHnLMbMSuB3r5siwTm/NZM/oOCCjK7gHrybEVA9Q== X-Received: by 10.28.28.5 with SMTP id c5mr7458821wmc.115.1512396244226; Mon, 04 Dec 2017 06:04:04 -0800 (PST) Received: from localhost.localdomain (x50d2404e.cust.hiper.dk. [80.210.64.78]) by smtp.gmail.com with ESMTPSA id g7sm22794279wra.38.2017.12.04.06.04.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 04 Dec 2017 06:04:03 -0800 (PST) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Cc: linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, Marc Zyngier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Christoffer Dall Subject: [PULL 12/19] kvm: arm64: handle single-step of userspace mmio instructions Date: Mon, 4 Dec 2017 15:03:41 +0100 Message-Id: <20171204140348.21965-10-cdall@kernel.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171204135637.21620-1-cdall@kernel.org> References: <20171204135637.21620-1-cdall@kernel.org> MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Alex Bennée The system state of KVM when using userspace emulation is not complete until we return into KVM_RUN. To handle mmio related updates we wait until they have been committed and then schedule our KVM_EXIT_DEBUG. The kvm_arm_handle_step_debug() helper tells us if we need to return and sets up the exit_reason for us. Signed-off-by: Alex Bennée Signed-off-by: Christoffer Dall --- virt/kvm/arm/arm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c index a6524ff27de4..322c570d211e 100644 --- a/virt/kvm/arm/arm.c +++ b/virt/kvm/arm/arm.c @@ -628,6 +628,9 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) ret = kvm_handle_mmio_return(vcpu, vcpu->run); if (ret) return ret; + if (kvm_arm_handle_step_debug(vcpu, vcpu->run)) + return 0; + } if (run->immediate_exit)