From patchwork Fri Apr 24 05:27:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 47509 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3A98D20553 for ; Fri, 24 Apr 2015 05:31:50 +0000 (UTC) Received: by lbbrr5 with SMTP id rr5sf8854158lbb.3 for ; Thu, 23 Apr 2015 22:31:49 -0700 (PDT) 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:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=jxZejDjIcdIXp8WKUQm1surQ7KHL9Ib6rZSSwmCgT30=; b=G0pNeucC/Q+XPsuxn4AOjIQLYZu7J8ut6jTCS9H0uM2ZjDcUFMd1z8lDYIWDz1wyVE 0b4wM04murL2/Ahxo9Nw4+bht31kD7irY2dsQkOwqG5Htt/i8xptwMob8SlhgVM/JliN oJSNpK6T6kEJENr960isOphu3+GwC3BMZpFcSi2Kud++2UhGFGR2DEsAWWCJwU9CnD8o wjn/97Eru0AlZAztXy61Lg/NLUp024AclFer35r6/BOhqxLvJOAY7HA7ywKbHZissgCw fPG7EJbI4juW2a1AJCiS08Wd2FUiqBrSkCqzZwEtDODgZtyDq/2vvN4pSjlWN0TyzBZv Oh7Q== X-Gm-Message-State: ALoCoQmIgrXjKPsXVwzzTSGbKFeo3AY18OBgutrS8nK1qq0dA400MilbtdcUGP1It+e7xecNy9aC X-Received: by 10.112.13.200 with SMTP id j8mr3194938lbc.14.1429853509173; Thu, 23 Apr 2015 22:31:49 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.203.133 with SMTP id kq5ls414424lac.102.gmail; Thu, 23 Apr 2015 22:31:49 -0700 (PDT) X-Received: by 10.112.167.73 with SMTP id zm9mr5386886lbb.89.1429853509030; Thu, 23 Apr 2015 22:31:49 -0700 (PDT) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id xg7si7478888lbb.48.2015.04.23.22.31.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Apr 2015 22:31:49 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by lbcga7 with SMTP id ga7so28615186lbc.1 for ; Thu, 23 Apr 2015 22:31:48 -0700 (PDT) X-Received: by 10.152.8.78 with SMTP id p14mr5453153laa.19.1429853508903; Thu, 23 Apr 2015 22:31:48 -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.112.67.65 with SMTP id l1csp977764lbt; Thu, 23 Apr 2015 22:31:48 -0700 (PDT) X-Received: by 10.70.35.171 with SMTP id i11mr2907412pdj.103.1429853507117; Thu, 23 Apr 2015 22:31:47 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bd10si15800741pdb.178.2015.04.23.22.31.45; Thu, 23 Apr 2015 22:31:47 -0700 (PDT) Received-SPF: none (google.com: stable-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754524AbbDXFbp (ORCPT + 2 others); Fri, 24 Apr 2015 01:31:45 -0400 Received: from mail-oi0-f51.google.com ([209.85.218.51]:34901 "EHLO mail-oi0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754529AbbDXFbp (ORCPT ); Fri, 24 Apr 2015 01:31:45 -0400 Received: by oign205 with SMTP id n205so32387303oig.2 for ; Thu, 23 Apr 2015 22:31:44 -0700 (PDT) X-Received: by 10.60.149.166 with SMTP id ub6mr5789550oeb.41.1429853504669; Thu, 23 Apr 2015 22:31:44 -0700 (PDT) Received: from localhost ([167.160.116.36]) by mx.google.com with ESMTPSA id cd3sm6014299oec.2.2015.04.23.22.31.42 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 23 Apr 2015 22:31:43 -0700 (PDT) From: shannon.zhao@linaro.org To: stable@vger.kernel.org Cc: jslaby@suse.cz, christoffer.dall@linaro.org, shannon.zhao@linaro.org, Marc Zyngier Subject: [PATCH for 3.12.y stable 24/63] ARM: KVM: fix ordering of 64bit coprocessor accesses Date: Fri, 24 Apr 2015 13:27:22 +0800 Message-Id: <1429853281-6136-25-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1429853281-6136-1-git-send-email-shannon.zhao@linaro.org> References: <1429853281-6136-1-git-send-email-shannon.zhao@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: stable@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: shannon.zhao@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.217.169 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 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Marc Zyngier commit 547f781378a22b65c2ab468f235c23001b5924da upstream. Commit 240e99cbd00a (ARM: KVM: Fix 64-bit coprocessor handling) added an ordering dependency for the 64bit registers. The order described is: CRn, CRm, Op1, Op2, 64bit-first. Unfortunately, the implementation is: CRn, 64bit-first, CRm... Move the 64bit test to be last in order to match the documentation. Signed-off-by: Marc Zyngier Reviewed-by: Christoffer Dall Acked-by: Catalin Marinas Signed-off-by: Shannon Zhao --- arch/arm/kvm/coproc.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/kvm/coproc.h b/arch/arm/kvm/coproc.h index c5ad7ff..8dda870 100644 --- a/arch/arm/kvm/coproc.h +++ b/arch/arm/kvm/coproc.h @@ -135,13 +135,13 @@ static inline int cmp_reg(const struct coproc_reg *i1, return -1; if (i1->CRn != i2->CRn) return i1->CRn - i2->CRn; - if (i1->is_64 != i2->is_64) - return i2->is_64 - i1->is_64; if (i1->CRm != i2->CRm) return i1->CRm - i2->CRm; if (i1->Op1 != i2->Op1) return i1->Op1 - i2->Op1; - return i1->Op2 - i2->Op2; + if (i1->Op2 != i2->Op2) + return i1->Op2 - i2->Op2; + return i2->is_64 - i1->is_64; }