From patchwork Fri Dec 20 07:26:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Kamensky X-Patchwork-Id: 3386181 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 5B6A4C0D4A for ; Fri, 20 Dec 2013 07:30:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7A2D6206AD for ; Fri, 20 Dec 2013 07:30:01 +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 49D4E2068D for ; Fri, 20 Dec 2013 07:30:00 +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 1VtuVr-0003rx-5s; Fri, 20 Dec 2013 07:28:47 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VtuVc-0000qw-Gn; Fri, 20 Dec 2013 07:28:32 +0000 Received: from mail-pb0-f46.google.com ([209.85.160.46]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VtuV5-0000le-Jq for linux-arm-kernel@lists.infradead.org; Fri, 20 Dec 2013 07:28:00 +0000 Received: by mail-pb0-f46.google.com with SMTP id md12so2235924pbc.19 for ; Thu, 19 Dec 2013 23:27:38 -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=PqyXClzlG/z4BUuTBMOUQcQNa+zTNCFiyKy+zc8DOAStD71ZiEqVXwZ6sL0RUW3VBH a52w5qmtc2pEvHQyzqmOBA0VFcdEzDIvuGJiBQvhRGpWFIDVMMB/190Z3kqh/dioDatR rKkuX3kX7AlYUkkYNncL1uT8/GLXgNzc150UdtmYUni2objzXemUEDUCMOAIulbyFjLg ErUxB7FqImq4TgiLJlsvSrrWT2Pb9MsqNlVYKs5Y0VftkNJGaxTOajKizfUWO9OU8X6L yn2aAJLtQRT74cyC0eHW/r+2IdOV7ORAiaWXIj4g4Y2v99EYYoHi2SBkjCs/y5KLHfdx XnpQ== X-Gm-Message-State: ALoCoQma6N+3Up+W7dgmAa/eUCW04KQy028Ea9bwF+0opLQ22PZXFMt64brrieXqP0OQyn4WF8ag X-Received: by 10.67.14.231 with SMTP id fj7mr6569822pad.115.1387524458109; Thu, 19 Dec 2013 23:27:38 -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 ic7sm12147339pbc.29.2013.12.19.23.27.36 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Thu, 19 Dec 2013 23:27:37 -0800 (PST) From: Victor Kamensky To: linux-arm-kernel@lists.infradead.org, marc.zyngier@arm.com, christoffer.dall@linaro.org, ben.dooks@codethink.co.uk Subject: [PATCH 4/5] ARM: kvm vgic mmio should return data in BE format in BE case Date: Thu, 19 Dec 2013 23:26:58 -0800 Message-Id: <1387524419-4216-5-git-send-email-victor.kamensky@linaro.org> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1387524419-4216-1-git-send-email-victor.kamensky@linaro.org> References: <1387524419-4216-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_022759_804474_A253E976 X-CRM114-Status: GOOD ( 10.52 ) X-Spam-Score: -2.6 (--) 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; } /**