From patchwork Fri Dec 20 16:48:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Kamensky X-Patchwork-Id: 3390081 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 12A359F314 for ; Fri, 20 Dec 2013 16:51:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 07D3820668 for ; Fri, 20 Dec 2013 16:51:58 +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 BFE5220666 for ; Fri, 20 Dec 2013 16:51:56 +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 1Vu3Ha-00064q-Hg; Fri, 20 Dec 2013 16:50:39 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vu3HI-0001UR-1Z; Fri, 20 Dec 2013 16:50:20 +0000 Received: from mail-pd0-f172.google.com ([209.85.192.172]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vu3Gf-0001MK-NF for linux-arm-kernel@lists.infradead.org; Fri, 20 Dec 2013 16:49:43 +0000 Received: by mail-pd0-f172.google.com with SMTP id g10so2738738pdj.31 for ; Fri, 20 Dec 2013 08:49:21 -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=5EA/1lNxN4v9TliEGGgczM/wlvRJJd10vNfIPP9DfLE=; b=JP/Tndgwd983swA7TlNO/XMTstOYU6m6nkZsPNYTW9QzZEpE2APlwcJ2iwQ23NXloc PvvXWhHinrteJ1t+8R4YIGGzNQ+ezSGDEWdaXbkrQo3gWWhgO+7w4pH45K3G+lPMyOdQ 8Y1ZHkfJQf718W3li8ERXZwXg3EiXZyeX/5AqA56qUq1vM6taXq/yYp3jmR1sOzc0NF2 loTjKJmDnv2IckCwnVcjGay4wG5lEi78uI10/k8VbrZFP6p/KQYSk03dWoKM34MMN2WC ynC9zi9WxKiVWxiSDeliDzUgfNF1VgTMSlsQI+u/Ep9c5Wj11tRBbpl4o8oz1i17UAkx 0W9w== X-Gm-Message-State: ALoCoQmhdOnvyDCrykjzzap0M9ArfUEAljltIWS1R2/CBWVcnqBQdeaLf50XzZ8ODlmE8ZqQPISK X-Received: by 10.66.123.5 with SMTP id lw5mr9699026pab.83.1387558161590; Fri, 20 Dec 2013 08:49:21 -0800 (PST) Received: from kamensky-w530.hsd1.ca.comcast.net (c-24-6-79-41.hsd1.ca.comcast.net. [24.6.79.41]) by mx.google.com with ESMTPSA id nw11sm20120833pab.13.2013.12.20.08.49.20 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Fri, 20 Dec 2013 08:49:21 -0800 (PST) From: Victor Kamensky To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, marc.zyngier@arm.com, christoffer.dall@linaro.org, ben.dooks@codethink.co.uk Subject: [PATCH REPOST 4/5] ARM: kvm vgic mmio should return data in BE format in BE case Date: Fri, 20 Dec 2013 08:48:44 -0800 Message-Id: <1387558125-3460-5-git-send-email-victor.kamensky@linaro.org> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1387558125-3460-1-git-send-email-victor.kamensky@linaro.org> References: <1387558125-3460-1-git-send-email-victor.kamensky@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131220_114941_914364_9072A16E X-CRM114-Status: GOOD ( 10.03 ) X-Spam-Score: -1.9 (-) Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, taras.kondratiuk@linaro.org, Victor Kamensky , will.deacon@arm.com, andre.przywara@linaro.org, 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=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 KVM mmio in BE case assumes that data it recieves is in BE format. Vgic operates in LE, so need byteswap data in BE case. Signed-off-by: Victor Kamensky --- virt/kvm/arm/vgic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index 685fc72..7e11458 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c @@ -236,12 +236,12 @@ static void vgic_cpu_irq_clear(struct kvm_vcpu *vcpu, int irq) static u32 mmio_data_read(struct kvm_exit_mmio *mmio, u32 mask) { - return *((u32 *)mmio->data) & mask; + return le32_to_cpu(*((u32 *)mmio->data)) & mask; } static void mmio_data_write(struct kvm_exit_mmio *mmio, u32 mask, u32 value) { - *((u32 *)mmio->data) = value & mask; + *((u32 *)mmio->data) = cpu_to_le32(value) & mask; } /**