From patchwork Mon May 30 06:10:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 9140281 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BC31260467 for ; Mon, 30 May 2016 06:13:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AFC022807E for ; Mon, 30 May 2016 06:13:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A46FC28212; Mon, 30 May 2016 06:13:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9C39A2807E for ; Mon, 30 May 2016 06:13:24 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7GQ7-0008Nq-Kj; Mon, 30 May 2016 06:11:23 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7GQ6-0008NP-5g for xen-devel@lists.xen.org; Mon, 30 May 2016 06:11:22 +0000 Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id F7/20-28468-989DB475; Mon, 30 May 2016 06:11:21 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrIIsWRWlGSWpSXmKPExsVyMfTAJt2Om97 hBv+uWFks+biYxYHR4+ju30wBjFGsmXlJ+RUJrBmbZq1nLfjFWXF/mUwD426OLkYuDiGBiYwS s+asZwNxWATmMUu8eP+AHcSREOhnldixYDtLFyMnkBMjsehgEzOEXSnx5N8E1i5GDqB2JYmOC RUQk34xSnTN2cIEUsMmoCLx/U0/K0S9mcT5kzPB4iIC0hLXPl9mBLGZBTIlbnyZyA5iCwuESF x/8QfMZhFQlXjz5weYzStgITH1bwMTxBwliVdXjoHdwylgKTF/wRuwOUJANX+nX2WbwCi4gJF hFaNGcWpRWWqRrqGZXlJRZnpGSW5iZo6uoYGpXm5qcXFiempOYlKxXnJ+7iZGYMAxAMEOxvOn PQ8xSnIwKYnyunF4hwvxJeWnVGYkFmfEF5XmpBYfYpTh4FCS4GW7AZQTLEpNT61Iy8wBhj5MW oKDR0mE9+J1oDRvcUFibnFmOkTqFKMxx5bf19YycWybem8tkxBLXn5eqpQ47wmQUgGQ0ozSPL hBsJi8xCgrJczLCHSaEE9BalFuZgmq/CtGcQ5GJWHe2yBTeDLzSuD2vQI6hQnoFLNzXiCnlCQ ipKQaGE1D2A4+8Nq/8PjbQksDxZC+qZO2l9o2G+ROfhPUxdF38mjongN/Ijujq/YHJ1ybGr9r 06GHe37lNzKWfFky81x+u/JnW4vLijPfbGTxW/6g+vIxP8N/W+dJustvNS+eMjNqy8pf67RuT 82M4Z6Z9tBhIm/gtCtWOu/XyCx1fffheVCcZnHEZxYlluKMREMt5qLiRABAVNIxxAIAAA== X-Env-Sender: wei.chen@linaro.org X-Msg-Ref: server-15.tower-206.messagelabs.com!1464588679!30150510!1 X-Originating-IP: [209.85.192.178] X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50 X-StarScan-Received: X-StarScan-Version: 8.34; banners=-,-,- X-VirusChecked: Checked Received: (qmail 39346 invoked from network); 30 May 2016 06:11:20 -0000 Received: from mail-pf0-f178.google.com (HELO mail-pf0-f178.google.com) (209.85.192.178) by server-15.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 30 May 2016 06:11:20 -0000 Received: by mail-pf0-f178.google.com with SMTP id 62so17040943pfd.1 for ; Sun, 29 May 2016 23:11:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2V0dqe37oqZyZ2Wm8o1WAqDjOZ+Wdm52/53UUgq13Pk=; b=NFQgUn/2tQhIPlqtdT30tSHf7dUywuiupS5O0zwfektHrb+nHXLWzJVLs/1nOSn5Bi eyBL1xDiz9gGqhrmVMBDnWM0dBsemQmPTFmrydZbxbYXZ4lhVJNl7JEA9tTi8cho7L62 vWOV8NvtSb563vKj12QoQndLAFTDSKiUxj5mo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2V0dqe37oqZyZ2Wm8o1WAqDjOZ+Wdm52/53UUgq13Pk=; b=cI4IQCqMs5K6e8eqQYLpV8Pp05BBNCsXPt8MSYlKXd6Ra6pvXEaZUGFzBCUdg4BmQr 1GoULD49+M3lNCkAl7gRO99FjQgXH6TGRbA4Bl875srSAAjckrfKsZPGE+vl5WydYcxg guklVc/gMf/ksBKDDWQ8VnQLQJxXYdvXv5FFqbYCR5yHFbccKK92NUrTCZLHoIcL7jzg j8b4ivgqg8Hd7lHODp6m1ipda/M2KFQdLzuZtqUI+LQ/scrHCut0IhguMeqJmOsgvaCo rlFGXIlmdBX1Txv0rFMaEgLsT/jGisInpMP0QLxznEbD2YCzGs0U9gXH1sDbVvL2sdAG W/eQ== X-Gm-Message-State: ALyK8tLVR4duXIRYcxJbRoLKVDaqIAx/Wnof/ldBDnHVlLDspeWUXlM1RW3W8nzQhCl7IPDI X-Received: by 10.98.152.92 with SMTP id q89mr44075209pfd.40.1464588679152; Sun, 29 May 2016 23:11:19 -0700 (PDT) Received: from localhost.members.linode.com ([2400:8900::f03c:91ff:fe56:1324]) by smtp.gmail.com with ESMTPSA id r86sm29679366pfb.21.2016.05.29.23.11.17 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 29 May 2016 23:11:18 -0700 (PDT) From: Wei Chen X-Google-Original-From: Wei Chen To: xen-devel@lists.xen.org Date: Mon, 30 May 2016 14:10:48 +0800 Message-Id: <20160530061050.10771-3-Wei.Chen@linaro.org> X-Mailer: git-send-email 2.9.0.rc0 In-Reply-To: <20160530061050.10771-1-Wei.Chen@linaro.org> References: <20160530061050.10771-1-Wei.Chen@linaro.org> Cc: julien.grall@arm.com, sstabellini@kernel.org, Wei Chen , steve.capper@arm.com Subject: [Xen-devel] [PATCH v3 2/4] xen/arm: Make AFFINITY_MASK generate correct mask for level3 X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP The original affinity shift bits algorithm in AFFINITY_MASK is buggy, it could not generate correct affinity shift bits of level3. The macro MPIDR_LEVEL_SHIFT can calculate level3 affinity shift bits correctly. We use this macro in AFFINITY_MASK to generate correct mask for level3. Signed-off-by: Wei Chen --- v2-->v3: Update version numnber. v1-->v2: Add Julien's reviewed-by. --- xen/include/asm-arm/processor.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h index 7de9c8e..b4cce7e 100644 --- a/xen/include/asm-arm/processor.h +++ b/xen/include/asm-arm/processor.h @@ -21,7 +21,6 @@ #define MPIDR_HWID_MASK _AC(0xffffff,U) #define MPIDR_INVALID (~MPIDR_HWID_MASK) #define MPIDR_LEVEL_BITS (8) -#define AFFINITY_MASK(level) ~((_AC(0x1,U) << ((level) * MPIDR_LEVEL_BITS)) - 1) /* @@ -37,6 +36,8 @@ #define MPIDR_AFFINITY_LEVEL(mpidr, level) \ ((mpidr >> MPIDR_LEVEL_SHIFT(level)) & MPIDR_LEVEL_MASK) +#define AFFINITY_MASK(level) ~((_AC(0x1,UL) << MPIDR_LEVEL_SHIFT(level)) - 1) + /* TTBCR Translation Table Base Control Register */ #define TTBCR_EAE _AC(0x80000000,U) #define TTBCR_N_MASK _AC(0x07,U)