From patchwork Thu Jun 12 16:30:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vkamensky X-Patchwork-Id: 31848 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6883C20AE6 for ; Thu, 12 Jun 2014 16:36:00 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id uy5sf6952424obc.5 for ; Thu, 12 Jun 2014 09:35:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=beaiZTTyWIkXcKunwTOdbXfvByaVdWi2voKov2be73E=; b=kLcAS6XxYfSvlqP/q7towrb2sRw9z+on5VlRyL+jGDZpWwQrJ7v8wHHdi4bgSXuozm DqKINJbceOSu8wY0usjGBR2z+KcumMp5EVjafTyA4CPowOPtf2knFh/tujQfL0YUBEGb f+0GZRrQkmXqFDtyzHkZI3M9nCS4LyKhw/gtcIYXxJNKEu7ptPwVJOQRYdMyPttFvTo7 7TSKffmqR41+tqg+kZZG6844+D8ku7eLYDT/EWWuNSa/SqVniHIT7Dh6kb1Ye9ozrv9n QPO49mtZWyfLtFU3ccurNvc9d9evAwDCvaS2/YTSu42xvX6xAVr5ffFAHYfIt50I1G56 GjbQ== X-Gm-Message-State: ALoCoQk63QhJXsp6Wrilq0/kMuTJGPqJ4JWPsGeJHNzNAcgOQ4HURQodsQw5DEGmJhvF6sMFod50 X-Received: by 10.182.47.199 with SMTP id f7mr1324011obn.6.1402590959913; Thu, 12 Jun 2014 09:35:59 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.27.138 with SMTP id 10ls3125631qgx.9.gmail; Thu, 12 Jun 2014 09:35:59 -0700 (PDT) X-Received: by 10.52.235.97 with SMTP id ul1mr7996vdc.87.1402590959085; Thu, 12 Jun 2014 09:35:59 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id zc15si475783vdb.79.2014.06.12.09.35.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 12 Jun 2014 09:35:59 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id hy4so1090635vcb.33 for ; Thu, 12 Jun 2014 09:35:59 -0700 (PDT) X-Received: by 10.220.53.72 with SMTP id l8mr45437860vcg.16.1402590958949; Thu, 12 Jun 2014 09:35:58 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp417166vcb; Thu, 12 Jun 2014 09:35:58 -0700 (PDT) X-Received: by 10.140.108.163 with SMTP id j32mr59519926qgf.56.1402590958391; Thu, 12 Jun 2014 09:35:58 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id x9si1650490qcs.20.2014.06.12.09.35.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Jun 2014 09:35:58 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wv7wu-0001SS-VM; Thu, 12 Jun 2014 16:34:00 +0000 Received: from mail-pd0-f176.google.com ([209.85.192.176]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wv7uC-0007tI-SH for linux-arm-kernel@lists.infradead.org; Thu, 12 Jun 2014 16:31:16 +0000 Received: by mail-pd0-f176.google.com with SMTP id p10so1125619pdj.21 for ; Thu, 12 Jun 2014 09:30:52 -0700 (PDT) X-Received: by 10.66.251.233 with SMTP id zn9mr22754387pac.67.1402590652045; Thu, 12 Jun 2014 09:30:52 -0700 (PDT) Received: from kamensky-w530.cisco.com (128-107-239-235.cisco.com. [128.107.239.235]) by mx.google.com with ESMTPSA id nh8sm81278030pbc.25.2014.06.12.09.30.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Jun 2014 09:30:51 -0700 (PDT) From: Victor Kamensky To: kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org, marc.zyngier@arm.com, agraf@suse.de Subject: [PATCH v4 13/14] ARM64: KVM: set and get of sys registers in BE case Date: Thu, 12 Jun 2014 09:30:12 -0700 Message-Id: <1402590613-3341-14-git-send-email-victor.kamensky@linaro.org> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1402590613-3341-1-git-send-email-victor.kamensky@linaro.org> References: <1402590613-3341-1-git-send-email-victor.kamensky@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140612_093112_982170_8C129C48 X-CRM114-Status: GOOD ( 10.21 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.192.176 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.192.176 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record Cc: taras.kondratiuk@linaro.org, linaro-kernel@lists.linaro.org, linux-arm-kernel@lists.infradead.org, Victor Kamensky X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: victor.kamensky@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Since size of all sys registers is always 8 bytes. Current code is actually endian agnostic. Just clean it up a bit. Removed comment about little endian. Change type of pointer from 'void *' to 'u64 *' to enforce stronger type checking. Signed-off-by: Victor Kamensky Acked-by: Christoffer Dall Acked-by: Marc Zyngier --- arch/arm64/kvm/sys_regs.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index 0324458..8e65e31 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -776,17 +776,15 @@ static struct sys_reg_desc invariant_sys_regs[] = { NULL, get_ctr_el0 }, }; -static int reg_from_user(void *val, const void __user *uaddr, u64 id) +static int reg_from_user(u64 *val, const void __user *uaddr, u64 id) { - /* This Just Works because we are little endian. */ if (copy_from_user(val, uaddr, KVM_REG_SIZE(id)) != 0) return -EFAULT; return 0; } -static int reg_to_user(void __user *uaddr, const void *val, u64 id) +static int reg_to_user(void __user *uaddr, const u64 *val, u64 id) { - /* This Just Works because we are little endian. */ if (copy_to_user(uaddr, val, KVM_REG_SIZE(id)) != 0) return -EFAULT; return 0;