From patchwork Wed Jan 22 14:56:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 23546 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gg0-f199.google.com (mail-gg0-f199.google.com [209.85.161.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7D854203C6 for ; Wed, 22 Jan 2014 15:31:35 +0000 (UTC) Received: by mail-gg0-f199.google.com with SMTP id n5sf14911735ggj.10 for ; Wed, 22 Jan 2014 07:31:34 -0800 (PST) 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=aPApflrz2WyMA+4F1HeYEWPwQ2fFllMtxNWQeUf8dJk=; b=QIeoFV6++6sweXbi4+p7y3w86OQFdM0ypA/MUOIwiH/ZDxh4AffZmeY9jjhBYZwaiH HxOu8PY3wU1n8VYhVn9upWCTlFy8n+aeoCo+TIMzPWrYRWnG5wzEa8fEELvqXAoNBc/h tM7cWl/ih0yNDJBagb1FMCen7wZOdTG9CpEzPzgfnRgSnV7tuamK5g+cZMSkjo283G+t o9uuLD+qDE2fVAej/SG7G4hmVR7lJoJ/t1L4eZ7lqDijPt2lbB4RiHglIY7fm5c1ebQl ASA0yD+Y8BZivuT0wgS2lvc2TUXn+HuKd4y8yXkKfMDo0GuuwJMBxyLY8F2MTezE+Vsg w0yw== X-Gm-Message-State: ALoCoQlG+/mhlLimXZGufUJvzuF9LcvUz8f3qyNuo2QO5Ky+JnLjgcM3VtkdrKCh0ItsVt43Dvbe X-Received: by 10.59.12.105 with SMTP id ep9mr819275ved.9.1390404694409; Wed, 22 Jan 2014 07:31:34 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.94.167 with SMTP id dd7ls93577qeb.81.gmail; Wed, 22 Jan 2014 07:31:34 -0800 (PST) X-Received: by 10.58.12.38 with SMTP id v6mr55811veb.57.1390404694245; Wed, 22 Jan 2014 07:31:34 -0800 (PST) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id c14si4740304veu.104.2014.01.22.07.31.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 22 Jan 2014 07:31:34 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id ks9so306647vcb.11 for ; Wed, 22 Jan 2014 07:31:34 -0800 (PST) X-Received: by 10.220.178.73 with SMTP id bl9mr266300vcb.42.1390404694136; Wed, 22 Jan 2014 07:31:34 -0800 (PST) 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.220.174.196 with SMTP id u4csp192359vcz; Wed, 22 Jan 2014 07:31:33 -0800 (PST) X-Received: by 10.180.218.171 with SMTP id ph11mr20254410wic.7.1390404693076; Wed, 22 Jan 2014 07:31:33 -0800 (PST) Received: from casper.infradead.org (casper.infradead.org. [2001:770:15f::2]) by mx.google.com with ESMTPS id y2si6972553wjq.99.2014.01.22.07.31.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jan 2014 07:31:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:770:15f::2 as permitted sender) client-ip=2001:770:15f::2; Received: from merlin.infradead.org ([205.233.59.134]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W5zG2-0002CZ-PY; Wed, 22 Jan 2014 14:58:22 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W5zFy-0000pF-Bp; Wed, 22 Jan 2014 14:58:18 +0000 Received: from fw-tnat.austin.arm.com ([217.140.110.23] helo=collaborate-mta1.arm.com) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W5zFB-0000jo-OD for linux-arm-kernel@lists.infradead.org; Wed, 22 Jan 2014 14:57:31 +0000 Received: from e102391-lin.cambridge.arm.com (e102391-lin.cambridge.arm.com [10.1.209.166]) by collaborate-mta1.arm.com (Postfix) with ESMTP id 862161401AD; Wed, 22 Jan 2014 08:56:49 -0600 (CST) From: Marc Zyngier To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org Subject: [PATCH v2 07/10] ARM: KVM: fix ordering of 64bit coprocessor accesses Date: Wed, 22 Jan 2014 14:56:39 +0000 Message-Id: <1390402602-22777-8-git-send-email-marc.zyngier@arm.com> X-Mailer: git-send-email 1.8.3.4 In-Reply-To: <1390402602-22777-1-git-send-email-marc.zyngier@arm.com> References: <1390402602-22777-1-git-send-email-marc.zyngier@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140122_095730_074828_7F262A49 X-CRM114-Status: UNSURE ( 8.70 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.6 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Christoffer Dall 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+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: marc.zyngier@arm.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.180 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 Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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 --- arch/arm/kvm/coproc.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/arm/kvm/coproc.h b/arch/arm/kvm/coproc.h index c5ad7ff..1a44bbe 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; } @@ -153,4 +153,8 @@ static inline int cmp_reg(const struct coproc_reg *i1, #define is64 .is_64 = true #define is32 .is_64 = false +bool access_sctlr(struct kvm_vcpu *vcpu, + const struct coproc_params *p, + const struct coproc_reg *r); + #endif /* __ARM_KVM_COPROC_LOCAL_H__ */