From patchwork Tue May 31 02:54:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 68857 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp1695876qge; Mon, 30 May 2016 19:55:53 -0700 (PDT) X-Received: by 10.55.80.136 with SMTP id e130mr29715524qkb.55.1464663353626; Mon, 30 May 2016 19:55:53 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id x20si28568380qka.79.2016.05.30.19.55.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 May 2016 19:55:53 -0700 (PDT) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7ZpI-0000UH-45; Tue, 31 May 2016 02:54:40 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7ZpG-0000TT-UP for xen-devel@lists.xen.org; Tue, 31 May 2016 02:54:39 +0000 Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id 34/8A-23272-EECFC475; Tue, 31 May 2016 02:54:38 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrAIsWRWlGSWpSXmKPExsVyMfTARt23f3z CDbbfUrBY8nExiwOjx9Hdv5kCGKNYM/OS8isSWDPmb9rPXnCRq+Lg12uMDYwdnF2MXBxCApMY JVa8PMQI4rAIzGOWuHj4GwuIIyHQzyrx9vt3ti5GTiAnRuJ97ykou1Li0csb7F2MHEDtShIdE yogJv1mlPjz7y8LSA2bgIrE9zf9rBD1ZhLnT85kArFFBKQlrn2+zAhiMwtkStz4MhFsjrBAiM SUPxogYRYBVYnl7YfAWnkFLCQedi5gghijJPHqyjGw8ZwClhK/2g6yg9hCQDWvp79jn8AouIC RYRWjenFqUVlqka6lXlJRZnpGSW5iZo6uoaGJXm5qcXFiempOYlKxXnJ+7iZGYLgxAMEOxv4p zocYJTmYlER5rX77hAvxJeWnVGYkFmfEF5XmpBYfYpTh4FCS4GUFhq+QYFFqempFWmYOMPBh0 hIcPEoivI9BWnmLCxJzizPTIVKnGI05tvy+tpaJY9vUe2uZhFjy8vNSpcR5X4GUCoCUZpTmwQ 2CReQlRlkpYV5GoNOEeApSi3IzS1DlXzGKczAqCfM+A5nCk5lXArfvFdApTECnxGeAnVKSiJC SamB0jr3bs2SG/JFE8fAcpR/XNlTnBV3gMCiKEvxfpeX3bJfZr69WnhMlEz8ErH/l6fC38Ovq q5lbXr2o8EuJTbLuEmPc6PVww+zqGXonqlYtDvtTyZt4R727+/h7z5xQwSOTL029xf68I/25c ru73suXmmJrk2vPF4Z22Z8okvZ6fzLC0rNqH4sSS3FGoqEWc1FxIgBwYXltwwIAAA== X-Env-Sender: wei.chen@linaro.org X-Msg-Ref: server-4.tower-27.messagelabs.com!1464663276!43919248!1 X-Originating-IP: [209.85.192.177] X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50 X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 13509 invoked from network); 31 May 2016 02:54:37 -0000 Received: from mail-pf0-f177.google.com (HELO mail-pf0-f177.google.com) (209.85.192.177) by server-4.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 31 May 2016 02:54:37 -0000 Received: by mail-pf0-f177.google.com with SMTP id g64so69670436pfb.2 for ; Mon, 30 May 2016 19:54:37 -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=N1RxO4/ail4hNnuMuoLkeqxwUTMarMsTGf3r3zKs59M=; b=EH8wNLaaRngXnOeehjEGfhJgORU/L9NqCqbifpTLOG8JA3gdrbV+tPNK91ZEauNkZH 30u269AXnHYLxyPb3FvU0iHTUpPXxn6IiStwExHUmPQa+0UqIduK3pTc9NHy3PgzmSlV Ne8fzE9skMukQ6Lp0tPhMnK7EpFFanZd4zuag= 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=N1RxO4/ail4hNnuMuoLkeqxwUTMarMsTGf3r3zKs59M=; b=BLDfJ8hl5XkFg++aXqW5YjGSKgVLZVBy6RfvFfMELoQ9pyfIxCyT1GzYnwDpRYksqe 1zmXQls6GNYuj3xa/HCSMUMFmRHa+vXIyuTrNKGgwkDd+j+1jQ6vwCa5MrheEqTeCrKG EyDrvhp1WQ23ryOT95FUJeefoCc17mPvoiae8vjlm73ciMsRLCb3n8FMD8Hlp8Hi8GhL E3EjFgJh3TmKNmCkFzN3LtdYLsoQq9ppcdvMldFHxbpi+xhfOldium+rtZbbzShuy6jU 9McEf1eJhTpwrmXeBpC6Rwls/9XuV+CWioknL99McA5ydPS4GibmDCnaitmrYoBdifB4 Ihiw== X-Gm-Message-State: ALyK8tIbF8BdQPwLnLZV4oUEIp5Fg8uQUrOS1f116Kh2wfu0JvTDNO3iQjSUmD7IE9SNo5zo X-Received: by 10.98.63.216 with SMTP id z85mr50029582pfj.53.1464663275595; Mon, 30 May 2016 19:54:35 -0700 (PDT) Received: from localhost.members.linode.com ([2400:8900::f03c:91ff:fe56:1324]) by smtp.gmail.com with ESMTPSA id n190sm35879825pfn.23.2016.05.30.19.54.33 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 30 May 2016 19:54:35 -0700 (PDT) From: Wei Chen X-Google-Original-From: Wei Chen To: xen-devel@lists.xen.org Date: Tue, 31 May 2016 10:54:12 +0800 Message-Id: <20160531025414.15539-3-Wei.Chen@linaro.org> X-Mailer: git-send-email 2.9.0.rc0 In-Reply-To: <20160531025414.15539-1-Wei.Chen@linaro.org> References: <20160531025414.15539-1-Wei.Chen@linaro.org> Cc: julien.grall@arm.com, sstabellini@kernel.org, Wei Chen , steve.capper@arm.com Subject: [Xen-devel] [PATCH v4 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" 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 Reviewed-by: Julien Grall --- v3-->v4: Add missed Reviewed-by tag. 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)