From patchwork Sun May 12 18:58:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 2555831 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id DD421DF215 for ; Sun, 12 May 2013 18:59:36 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UbbUZ-0000Il-7u; Sun, 12 May 2013 18:59:31 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UbbUW-0006pO-4n; Sun, 12 May 2013 18:59:28 +0000 Received: from mail-pa0-f50.google.com ([209.85.220.50]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UbbUS-0006p5-OY for linux-arm-kernel@lists.infradead.org; Sun, 12 May 2013 18:59:25 +0000 Received: by mail-pa0-f50.google.com with SMTP id fb10so4067648pad.9 for ; Sun, 12 May 2013 11:59:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=nbaQYTXam8Bo4PGXeIRTxInzGYr08S0oCkKIjGFDFcE=; b=SInp9c5fJDCV9OFMSiRHcV6LLptSM56VbuuSF5w+ZtDudLAp/pRMyqka8DS1d17klK j0901ZpVX2o6yuhuQnrPHqwbQkjp+icnu3R39pjUCdD5DmyCQ1wOdIwjYaleULLnJBso h/EuALaFsHgvGljh02z8+lsHUeXOsKOp2Lsp0NL6IvXMLTX41Fo4dsMN54F+r6Ttitr+ 4Sxa07z37knJ6P1jjhk73w7qMRGWt2cQxUoxsSlJD+RffHm3uAKxqDDH5f+lHeC/y8Rc f0BQyKZa7nGIfsqYK2ddOql8rXF7AzxFm+w+p4meYqLzpRAoLQL7IfdwBqJ5YWfcdJ75 ZSCA== X-Received: by 10.68.197.195 with SMTP id iw3mr25873852pbc.177.1368385142047; Sun, 12 May 2013 11:59:02 -0700 (PDT) Received: from localhost.localdomain (c-67-169-183-77.hsd1.ca.comcast.net. [67.169.183.77]) by mx.google.com with ESMTPSA id cq1sm10989121pbc.13.2013.05.12.11.59.01 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 12 May 2013 11:59:01 -0700 (PDT) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu Subject: [PATCH] ARM: KVM: Handle loads from I/O addresses to PC Date: Sun, 12 May 2013 11:58:55 -0700 Message-Id: <1368385135-60584-1-git-send-email-cdall@cs.columbia.edu> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQm3kAPF5oqiCW1sRzuZ1pGvMtAlEYVtE+ybs40sAps0/noK7its79hIU7PoC8a1BiR1hKE8 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130512_145924_952326_6052B050 X-CRM114-Status: UNSURE ( 9.77 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.220.50 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Marc Zyngier , Catalin Marinas , Christoffer Dall , linux-arm-kernel@lists.infradead.org, Peter Maydell X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org If a VM does something like this: ldr pc, [r0] @ r0 is an I/O address Then simply let that value load into the PC on kvm_handle_mmio_return overwriting the PC value set from kvm_skip_instr. Signed-off-by: Christoffer Dall --- arch/arm/kvm/mmio.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/arch/arm/kvm/mmio.c b/arch/arm/kvm/mmio.c index 72a12f2..b8e06b7 100644 --- a/arch/arm/kvm/mmio.c +++ b/arch/arm/kvm/mmio.c @@ -86,12 +86,6 @@ static int decode_hsr(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, sign_extend = kvm_vcpu_dabt_issext(vcpu); rt = kvm_vcpu_dabt_get_rd(vcpu); - if (kvm_vcpu_reg_is_pc(vcpu, rt)) { - /* IO memory trying to read/write pc */ - kvm_inject_pabt(vcpu, kvm_vcpu_get_hfar(vcpu)); - return 1; - } - mmio->is_write = is_write; mmio->phys_addr = fault_ipa; mmio->len = len;