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: vkamensky X-Patchwork-Id: 22666 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f199.google.com (mail-ie0-f199.google.com [209.85.223.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5672323FC0 for ; Fri, 20 Dec 2013 07:27:40 +0000 (UTC) Received: by mail-ie0-f199.google.com with SMTP id lx4sf8756714iec.10 for ; Thu, 19 Dec 2013 23:27:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=5EA/1lNxN4v9TliEGGgczM/wlvRJJd10vNfIPP9DfLE=; b=nMJ6kuEXJGTGbAWKpjbOIpRwBGfrBaTojnwvJMipIK07xahF4BPqYqqceOQZI/obX8 6I54eQIj0GOJelq5RefQQfyAFX3vLCkZuDu6jR0zsaTsNaZc0+J2d93LKo9NiB+Ly9Zl X2HEuy29QFOwkLcUUzVu4l3IMwa3HA03c0GeNz+7kajvcmTXo8or/zqNW5tgzWjL1vZy JKy7Kb8BUT8CiRnBsXc5gvFdjVSK2BUzt4ixzcYcN/cgZfb2V7s/OnNrGh6gVArnU5gm nTc1P0tisnehekHLSr2uGeWnoPokyCCm8Vhk11G4qAJhkBOPwFQsVi+N8nZsrMSOyOmi +Ezg== X-Gm-Message-State: ALoCoQlT8hRYNk6HK0oucWXuPeiuBy3Qah1HaGjJe3XyGb3b4L8o5up3+aMM+b+dE3SY9vnD/zck X-Received: by 10.182.24.134 with SMTP id u6mr2699355obf.24.1387524459621; Thu, 19 Dec 2013 23:27:39 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.2.41 with SMTP id 9ls624206qer.99.gmail; Thu, 19 Dec 2013 23:27:39 -0800 (PST) X-Received: by 10.58.246.136 with SMTP id xw8mr22754vec.41.1387524459515; Thu, 19 Dec 2013 23:27:39 -0800 (PST) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id a15si1301458vew.45.2013.12.19.23.27.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Dec 2013 23:27:39 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.177; Received: by mail-ve0-f177.google.com with SMTP id db12so1269400veb.36 for ; Thu, 19 Dec 2013 23:27:39 -0800 (PST) X-Received: by 10.52.244.15 with SMTP id xc15mr18240vdc.52.1387524459440; Thu, 19 Dec 2013 23:27:39 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.59.13.131 with SMTP id ey3csp40813ved; Thu, 19 Dec 2013 23:27:38 -0800 (PST) X-Received: by 10.67.23.164 with SMTP id ib4mr6841936pad.42.1387524458573; Thu, 19 Dec 2013 23:27:38 -0800 (PST) Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by mx.google.com with ESMTPS id g6si4527086pbd.84.2013.12.19.23.27.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Dec 2013 23:27:38 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.45 is neither permitted nor denied by best guess record for domain of victor.kamensky@linaro.org) client-ip=209.85.220.45; Received: by mail-pa0-f45.google.com with SMTP id fb1so2275040pad.4 for ; Thu, 19 Dec 2013 23:27:38 -0800 (PST) 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 Cc: rmk@arm.linux.org.uk, will.deacon@arm.com, Dave.Martin@arm.com, andre.przywara@linaro.org, taras.kondratiuk@linaro.org, patches@linaro.org, linaro-kernel@lists.linaro.org, Victor Kamensky 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: victor.kamensky@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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; } /**