From patchwork Mon Aug 4 08:46:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 34806 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 60B0920F2E for ; Mon, 4 Aug 2014 08:58:34 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id m1sf38774542oag.11 for ; Mon, 04 Aug 2014 01:58:33 -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=RuCaZFiES6pVyBbdoYUM8h7Wa6xeNMQYj0g9mo2VxOo=; b=PXYiz1x1ELUiJp/s8UhtiKlhKbPTalsELdgzys+Txumfp26bjjeF8dc4GJdBf/QCYD 55AyUZ22nh26J/62Xat5UgayI5/njuZD7Jw92z6I+GBG+OBh320CYijt1jjpDRJ0gQHC wEiMhFX6WUJDlnu1t9qlp+h+ZWqiQmGx0g39hBn/Y+JloiD91Cv7fChnslWt0aEiJDDs dp3TnzkJcKESmDFvWFmb9JGn5LW90hQZG+ZyOBW5aKoSiFta3JSSTHj7ii2JGUF8ElRs dknrvmKok5Ft08FoUcD9hzQFMwgb/lIQcUrdOTsOg69UMCyKQkKzjXCiT8VGaS/Arift 4mJQ== X-Gm-Message-State: ALoCoQkLRQtoXHeywzh9SegVUcJxyzOP54AD+ZjD46mJ3aXBD9NdhljOvAX1xKVEhWdEdQ5/n9K/ X-Received: by 10.182.91.97 with SMTP id cd1mr9053075obb.33.1407142712353; Mon, 04 Aug 2014 01:58:32 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.97.52 with SMTP id l49ls2051310qge.69.gmail; Mon, 04 Aug 2014 01:58:32 -0700 (PDT) X-Received: by 10.220.190.134 with SMTP id di6mr21852211vcb.43.1407142712266; Mon, 04 Aug 2014 01:58:32 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id xa4si11570549vcb.12.2014.08.04.01.58.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Aug 2014 01:58:32 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id id10so10421136vcb.7 for ; Mon, 04 Aug 2014 01:58:32 -0700 (PDT) X-Received: by 10.220.105.201 with SMTP id u9mr22056667vco.11.1407142712174; Mon, 04 Aug 2014 01:58:32 -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.37.5 with SMTP id tc5csp288638vcb; Mon, 4 Aug 2014 01:58:31 -0700 (PDT) X-Received: by 10.66.141.76 with SMTP id rm12mr821379pab.138.1407142711287; Mon, 04 Aug 2014 01:58:31 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id ei12si8472288pdb.200.2014.08.04.01.58.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Aug 2014 01:58:31 -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 1XEE4p-00039W-Rm; Mon, 04 Aug 2014 08:57:07 +0000 Received: from mail-lb0-f174.google.com ([209.85.217.174]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XEDwj-0002H5-An for linux-arm-kernel@lists.infradead.org; Mon, 04 Aug 2014 08:48:45 +0000 Received: by mail-lb0-f174.google.com with SMTP id c11so5076107lbj.19 for ; Mon, 04 Aug 2014 01:48:23 -0700 (PDT) X-Received: by 10.152.20.105 with SMTP id m9mr17672034lae.19.1407142103352; Mon, 04 Aug 2014 01:48:23 -0700 (PDT) Received: from localhost.localdomain (188-178-240-98-static.dk.customer.tdc.net. [188.178.240.98]) by mx.google.com with ESMTPSA id px1sm26731207lbb.46.2014.08.04.01.48.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 04 Aug 2014 01:48:22 -0700 (PDT) From: Christoffer Dall To: Paolo Bonzini , Gleb Natapov Subject: [GIT PULL 38/51] ARM64: KVM: set and get of sys registers in BE case Date: Mon, 4 Aug 2014 10:46:55 +0200 Message-Id: <1407142028-31105-39-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1407142028-31105-1-git-send-email-christoffer.dall@linaro.org> References: <1407142028-31105-1-git-send-email-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140804_014845_581302_85C1C57C X-CRM114-Status: GOOD ( 10.80 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.217.174 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.217.174 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: Marc Zyngier , Victor Kamensky , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org 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: christoffer.dall@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.176 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 From: Victor Kamensky 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 Signed-off-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 34f25a5..f0cecef 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;