From patchwork Mon Oct 7 15:48:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vkamensky X-Patchwork-Id: 20862 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4914224697 for ; Mon, 7 Oct 2013 15:48:57 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id r5sf14131859qcx.4 for ; Mon, 07 Oct 2013 08:48:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state: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=bAlRCk60wTzr4h4adoD8L0Mw5Ms+RLpKoUvBNG/fV6A=; b=itazO8PLTMsgr/INhbVOmlMd1yeBEGdSU3GYwQQaCyexAUvOMYhPgT1DtsSSIW/7eg ANFI8SugrCcfh9P1v4B9z1YBVndkQ4xgp5hJB+PJJjPEDJjOlO77Iw3/3xFVmKfOxa3t NZvQpE/DB1hPX+dY2YZWmSgI0KdPio8R8a2fjoXGVcg1+RFINObUGV8g5Tq9LPH1juVq i3510/uC1D5Lw5FrcM/HS/H1tAxXLnQSty302+Hki/XbND1QGHLz5H3CbwsqeUy1wtBD zWIH123xqIN8sf18upAACpboDs3td1zCy0LO51qPBBQpi2aecv2i6qg8mFsc0aroOjBf Sqaw== X-Received: by 10.58.196.168 with SMTP id in8mr2900706vec.11.1381160936998; Mon, 07 Oct 2013 08:48:56 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.35.10 with SMTP id d10ls2347489qej.19.gmail; Mon, 07 Oct 2013 08:48:56 -0700 (PDT) X-Received: by 10.221.51.206 with SMTP id vj14mr4769977vcb.17.1381160936849; Mon, 07 Oct 2013 08:48:56 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id lu1si7934051vcb.13.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 07 Oct 2013 08:48:56 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.175 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.175; Received: by mail-vc0-f175.google.com with SMTP id ia10so3027668vcb.34 for ; Mon, 07 Oct 2013 08:48:56 -0700 (PDT) X-Gm-Message-State: ALoCoQmAANgalop2QdbODeBpWmfWsGPVK5Styc49dBnxJdwx4Mj61hTlS5Kvf/gsuD6uNeRAwtjO X-Received: by 10.220.43.19 with SMTP id u19mr26988043vce.3.1381160936747; Mon, 07 Oct 2013 08:48:56 -0700 (PDT) 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.220.174.196 with SMTP id u4csp135163vcz; Mon, 7 Oct 2013 08:48:56 -0700 (PDT) X-Received: by 10.68.226.3 with SMTP id ro3mr31937914pbc.72.1381160935818; Mon, 07 Oct 2013 08:48:55 -0700 (PDT) Received: from mail-pb0-f52.google.com (mail-pb0-f52.google.com [209.85.160.52]) by mx.google.com with ESMTPS id fl1si23126502pab.286.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 07 Oct 2013 08:48:55 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.52 is neither permitted nor denied by best guess record for domain of victor.kamensky@linaro.org) client-ip=209.85.160.52; Received: by mail-pb0-f52.google.com with SMTP id wz12so7310434pbc.11 for ; Mon, 07 Oct 2013 08:48:55 -0700 (PDT) X-Received: by 10.66.142.193 with SMTP id ry1mr4017602pab.150.1381160935365; Mon, 07 Oct 2013 08:48:55 -0700 (PDT) Received: from kamensky-w530.hsd1.ca.comcast.net (c-24-6-79-41.hsd1.ca.comcast.net. [24.6.79.41]) by mx.google.com with ESMTPSA id rv9sm34145134pbc.4.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 07 Oct 2013 08:48:54 -0700 (PDT) From: Victor Kamensky To: will.deacon@arm.com, linux@arm.linux.org.uk, ben.dooks@codethink.co.uk, linux-arm-kernel@lists.infradead.org Cc: thomas.petazzoni@free-electrons.com, steve.mcintyre@linaro.org, patches@linaro.org, linaro-kernel@lists.linaro.org, linaro-networking@linaro.org, Victor Kamensky Subject: [PATCH v2] ARM: tlb: ASID macro should give 32bit result for BE correct operation Date: Mon, 7 Oct 2013 08:48:23 -0700 Message-Id: <1381160903-1248-2-git-send-email-victor.kamensky@linaro.org> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1381160903-1248-1-git-send-email-victor.kamensky@linaro.org> References: <1381160903-1248-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.220.175 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: , In order for ASID macro to be used as expression passed to inline asm as 'r' operand it needs to give 32 bit unsigned result, not unsigned 64bit expression. Otherwise when 64bit ASID is passed to inline assembler statement as 'r' operand (32bit) compiler behavior is not well specified. For example when __flush_tlb_mm function compiled in big endian case, and ASID is passed to tlb_op macro directly, 0 will be passed as 'mcr 15, 0, r4, cr8, cr3, {2}' argument in r4, unless ASID macro changed to produce 32 bit result. Signed-off-by: Victor Kamensky --- arch/arm/include/asm/mmu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/include/asm/mmu.h b/arch/arm/include/asm/mmu.h index 6f18da0..64fd151 100644 --- a/arch/arm/include/asm/mmu.h +++ b/arch/arm/include/asm/mmu.h @@ -16,7 +16,7 @@ typedef struct { #ifdef CONFIG_CPU_HAS_ASID #define ASID_BITS 8 #define ASID_MASK ((~0ULL) << ASID_BITS) -#define ASID(mm) ((mm)->context.id.counter & ~ASID_MASK) +#define ASID(mm) ((unsigned int)((mm)->context.id.counter & ~ASID_MASK)) #else #define ASID(mm) (0) #endif