From patchwork Wed Feb 12 05:57:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Kamensky X-Patchwork-Id: 3634361 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6F959BF13A for ; Wed, 12 Feb 2014 06:01:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4E1002015D for ; Wed, 12 Feb 2014 06:01:00 +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 61B692014A for ; Wed, 12 Feb 2014 06:00:59 +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 1WDSqt-0006Fn-Hm; Wed, 12 Feb 2014 05:59:20 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WDSqW-0006fB-IO; Wed, 12 Feb 2014 05:58:56 +0000 Received: from mail-oa0-f50.google.com ([209.85.219.50]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WDSqJ-0006bK-Qh for linux-arm-kernel@lists.infradead.org; Wed, 12 Feb 2014 05:58:44 +0000 Received: by mail-oa0-f50.google.com with SMTP id n16so10556832oag.9 for ; Tue, 11 Feb 2014 21:58:22 -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=BD2PGjDmIKv0zkR9hyqS4rX/cBcBu04w9T8UhhgSj0o=; b=l6nnrs6tFtzcIHpx9HmMzFvYApEPuf0KMTMtT5levnc9cFE1LTHuXcvtQYuvBwl/EZ /KiVB9D3XrhloU2s80e33DRR6YvgVEM+/VJQ/SIF82DPIEj1mfvQKEMT2j8CceP5FGUE c65U6QWtz6C8lGSO9+HY4tNzcqoojxHeotjR+9+0/8rVNLgyaVyD9ggRMh5D0utWsEe3 gqvy3zJOqlzywS/WqouEGKuaVG/aIN/2NtdsTQDvhWbvXOStH2O9/eCZuH5eDMyNSiHZ bK29BnZ8nJo/nYOkjvN4hv9DKBPTYv4pKJyef/I/DuZWPeGWTao6pRG66+dHR5/g1vRj QxFQ== X-Gm-Message-State: ALoCoQkXUQqO1qr9sKUXqMwvXFDtBkXh7o1VvWGsQ2kKjYxT3YJ4SWOTH2ev7jt2ps4/f7wBIbqF X-Received: by 10.60.93.102 with SMTP id ct6mr24153061oeb.12.1392184700632; Tue, 11 Feb 2014 21:58:20 -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.17 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Tue, 11 Feb 2014 21:58:20 -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 4/5] ARM64: KVM: vgic_elrsr and vgic_eisr need to be byteswapped in BE case Date: Tue, 11 Feb 2014 21:57:22 -0800 Message-Id: <1392184643-6108-5-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_005843_916047_AEE5E661 X-CRM114-Status: UNSURE ( 7.28 ) 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 On arm64 'u32 vgic_eisr[2];' and 'u32 vgic_elrsr[2]' are accessed as one 'unsigned long *' bit fields, which has 64bit size. So we need to swap least significant word with most significant word when code reads those registers from h/w. Signed-off-by: Victor Kamensky --- arch/arm64/kvm/hyp.S | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm64/kvm/hyp.S b/arch/arm64/kvm/hyp.S index 104216c..667293f 100644 --- a/arch/arm64/kvm/hyp.S +++ b/arch/arm64/kvm/hyp.S @@ -415,10 +415,17 @@ CPU_BE( rev w11, w11 ) str w4, [x3, #VGIC_CPU_HCR] str w5, [x3, #VGIC_CPU_VMCR] str w6, [x3, #VGIC_CPU_MISR] +#ifndef CONFIG_CPU_BIG_ENDIAN str w7, [x3, #VGIC_CPU_EISR] str w8, [x3, #(VGIC_CPU_EISR + 4)] str w9, [x3, #VGIC_CPU_ELRSR] str w10, [x3, #(VGIC_CPU_ELRSR + 4)] +#else + str w7, [x3, #(VGIC_CPU_EISR + 4)] + str w8, [x3, #VGIC_CPU_EISR] + str w9, [x3, #(VGIC_CPU_ELRSR + 4)] + str w10, [x3, #VGIC_CPU_ELRSR] +#endif str w11, [x3, #VGIC_CPU_APR] /* Clear GICH_HCR */