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: 10090387 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 276D660329 for ; Mon, 4 Dec 2017 14:07:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 112192842D for ; Mon, 4 Dec 2017 14:07:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 05CCD2877F; Mon, 4 Dec 2017 14:07:21 +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=-2.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_MED, URIBL_DBL_ABUSE_SPAM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C9A5D2858B for ; Mon, 4 Dec 2017 14:07:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fxpzX9r+IOrjtFOZ4v4+GmHALYBOiPW5ftC2EsoJHOo=; b=cOzlaoMCDWps2h 6NJOs1LMqsBTVgUMnNmjJ/SOhwdwD3T29D22SOT4r58G0BNPlMo4/CG2M63OsIhm2RVoaBobfwpke PJXkmJAJtjX0MBX7lDSsXxoGnEx0X3UP5qRBSAMwjqfmz6C2OBwJ/OFcOIhEOyqZdXoHkG2zJGZ5J NUOKEDLj+Wuweg1eQW6FI3jSSVKBR0XWbYNIGX7hLZn64pseMZDPwsd8wCAW8n0VxYMPGeQtkDWRv rtbZKR72wHwe2fNsNH6XzQ3nwFF2YrSEp8TbUrKhmro9T0C99Hr5xCtQzzi11EBSrXxmPJIXCA3P3 ZHfGP1NdV06mJruDPQRg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eLrOo-0006aK-9T; Mon, 04 Dec 2017 14:07:10 +0000 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eLrM5-0002PK-7J for linux-arm-kernel@lists.infradead.org; Mon, 04 Dec 2017 14:04:30 +0000 Received: by mail-wm0-x242.google.com with SMTP id 9so5993938wme.4 for ; Mon, 04 Dec 2017 06:04:05 -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=OzHnTBcgk7rOwTuOv+dpvfuGDiK/glS5ZW/308r75mDm0ev+UaAYMW3L2CZDI6ewMm 8dK8pyc9Hc0hHOCBC2+zwpYrZgwGaB+SGNvxrkCdDPl9fjERcCk9ur+t4vvbuRfDvx0e VpACvAJ5bkz8evos599DpC6Tobp7AOkMQm0cmiCQO/KG5FHI2uLXH3o370qvb8XKepq/ i6qSJubOkfUA0DGG1At5zyZeDzd/dothbFfGCKCFT4UECNJU/u5tdqPJH5qIfBPmoVfg DNGanjs/ZddHi6em54/tnz71s0fVjNOVhyi+IAcnrg8Si6dCeEY65eqSYZFDWOkRtkCw hVDw== X-Gm-Message-State: AJaThX4xJtg6jhrHH2P6rwX0hUV/8jjiKduPzHSfNWtDQSoX34KIwM7w xR2d1+IO/++Cgo0L5qgLIAOe5g== 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?= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171204_060421_981190_1954B693 X-CRM114-Status: GOOD ( 10.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marc Zyngier , Christoffer Dall , =?UTF-8?q?Alex=20Benn=C3=A9e?= , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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)