From patchwork Wed Feb 12 05:57:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Kamensky X-Patchwork-Id: 3634351 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C6F0E9F3B2 for ; Wed, 12 Feb 2014 06:00:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DF9E12014A for ; Wed, 12 Feb 2014 06:00:25 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0D5392015D for ; Wed, 12 Feb 2014 06:00:25 +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 1WDSqc-00067A-5S; Wed, 12 Feb 2014 05:59:02 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WDSqM-0006e2-NF; Wed, 12 Feb 2014 05:58:46 +0000 Received: from mail-oa0-f47.google.com ([209.85.219.47]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WDSqC-0006aO-43 for linux-arm-kernel@lists.infradead.org; Wed, 12 Feb 2014 05:58:37 +0000 Received: by mail-oa0-f47.google.com with SMTP id m1so10411886oag.34 for ; Tue, 11 Feb 2014 21:58:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WHcY+oiEMLV52e+eGi3Loae5PucVT0zKcYE0VaLXLzk=; b=MH/yE0k2M/xNmyK+Nb9+QgHeQ1f31DmRbky/sdeWmLvGPqLG9hfeDTAYMbXuxqR0bK NfK9H3VzROLUErH7zUy9zCV5pxeRe1dt7B6zST4kgTYK0O1pb3ByIuPcnI2Gb+b0olDV CXS7ujEtqzyv2857MktQ+rXexy/+mKFoXmo4n8QUnQKXq9UeFOn/yQHJk6WejJQ5VHKJ YkWlAbUvoxRb0Ce9P1pHoMUYZw9ORV94uP/PpNcIHIfXZz7tWyuS5LUU0xnyEyPnhSoz Fq9Wh5vB1RhR0F9DL0zoIPAxyyDNUGVmIuHnC+q4FWFlah+QRP+WTXw/22AxQTV0YQhs B/iw== X-Gm-Message-State: ALoCoQk6+esKRdsBprpou0Y5JYg0hqb5O06yJmMWqtyWnPYwbbSvpZKrcyD60Erx7AOwuYUvT7+e X-Received: by 10.182.122.133 with SMTP id ls5mr235052obb.52.1392184694502; Tue, 11 Feb 2014 21:58:14 -0800 (PST) Received: from kamensky-w530.cisco.com (128-107-239-233.cisco.com. [128.107.239.233]) by mx.google.com with ESMTPSA id tr7sm63581349oec.0.2014.02.11.21.58.08 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Tue, 11 Feb 2014 21:58:13 -0800 (PST) From: Victor Kamensky To: kvmarm@lists.cs.columbia.edu, marc.zyngier@arm.com, christoffer.dall@linaro.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/5] ARM64: KVM: store kvm_vcpu_fault_info est_el2 as word Date: Tue, 11 Feb 2014 21:57:21 -0800 Message-Id: <1392184643-6108-4-git-send-email-victor.kamensky@linaro.org> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1392184643-6108-1-git-send-email-victor.kamensky@linaro.org> References: <1392184643-6108-1-git-send-email-victor.kamensky@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140212_005836_278878_10DC3D48 X-CRM114-Status: UNSURE ( 8.16 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.4 (/) Cc: linaro-kernel@lists.linaro.org, Victor Kamensky , taras.kondratiuk@linaro.org, will.deacon@arm.com, andre.przywara@linaro.org, ben.dooks@codethink.co.uk, Dave.Martin@arm.com, rmk@arm.linux.org.uk 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 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,KHOP_BIG_TO_CC, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP esr_el2 field of struct kvm_vcpu_fault_info has u32 type. It should be stored as word. Current code works in LE case because existing puts least significant word of x1 into esr_el2, and it puts most significant work of x1 into next field, which accidentally is OK because it is updated again by next instruction. But existing code breaks in BE case. Signed-off-by: Victor Kamensky Acked-by: Christoffer Dall --- arch/arm64/kvm/hyp.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kvm/hyp.S b/arch/arm64/kvm/hyp.S index 3b47c36..104216c 100644 --- a/arch/arm64/kvm/hyp.S +++ b/arch/arm64/kvm/hyp.S @@ -801,7 +801,7 @@ el1_trap: mrs x2, far_el2 2: mrs x0, tpidr_el2 - str x1, [x0, #VCPU_ESR_EL2] + str w1, [x0, #VCPU_ESR_EL2] str x2, [x0, #VCPU_FAR_EL2] str x3, [x0, #VCPU_HPFAR_EL2]