From patchwork Wed May 25 02:09:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 9134585 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 49099607D8 for ; Wed, 25 May 2016 02:11:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35EA7280A3 for ; Wed, 25 May 2016 02:11:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2A60528176; Wed, 25 May 2016 02:11:47 +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 D2AB528176 for ; Wed, 25 May 2016 02:11:46 +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 1b5OGV-0001Mz-3C; Wed, 25 May 2016 02:09:43 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5OGU-0001Mn-AS for xen-devel@lists.xen.org; Wed, 25 May 2016 02:09:42 +0000 Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id 68/0E-19679-56905475; Wed, 25 May 2016 02:09:41 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprBIsWRWlGSWpSXmKPExsVyMfTABt1UTtd wgwv32CyWfFzM4sDocXT3b6YAxijWzLyk/IoE1oyFh24zFmzkrJhz8CN7A+Mf9i5GLg4hgcmM EtN2f2EDcVgE2pkl3p5eygriSAi8Y5E4036OuYuRA8iJkTh3IaeLkRPIrJb4s3wRC0hYSEBJo mNCBcSgX4wSZ/6tYAapYRNQkfj+pp8Vot5M4vzJmUwgtoiAtMS1z5cZQWxmgUyJG18msoPYwg KBEv93H2EBsVkEVCV+TD8EVs8r4CzxePp9Jog5chInj01mncDIv4CRYRWjenFqUVlqka6hXlJ RZnpGSW5iZo6uoYGpXm5qcXFiempOYlKxXnJ+7iZGYPjUMzAw7mBs6nU+xCjJwaQkynvwiUu4 EF9SfkplRmJxRnxRaU5q8SFGGQ4OJQneZA7XcCHBotT01Iq0zBxgIMOkJTh4lER4Q0HSvMUFi bnFmekQqVOMxhxbfl9by8Sxbeq9tUxCLHn5ealS4ryBIKUCIKUZpXlwg2ARdolRVkqYl5GBgU GIpyC1KDezBFX+FaM4B6OSMO8ckCk8mXklcPteAZ3CBHSK/xdnkFNKEhFSUg2Mzb/vZ/xcnHl hRsrfJUcsOrY4qTU2Svw1jbv1d9fEjdYdyaI/1jpPfJP8ZPaOF8fThXM39LyapLVkz7rdCY+e 7KquSHJMSVz9bqG8QMtJt+f9LdfnzllyLP3c25tTrnG9P8/18UxzVY6MgF/sD3OBwIiZgWnZB T9nOW8Jq5mtcOHwk5kOKmXmq5RYijMSDbWYi4oTAScGW+urAgAA X-Env-Sender: wei.chen@linaro.org X-Msg-Ref: server-15.tower-206.messagelabs.com!1464142179!29362701!1 X-Originating-IP: [209.85.192.176] 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 48152 invoked from network); 25 May 2016 02:09:40 -0000 Received: from mail-pf0-f176.google.com (HELO mail-pf0-f176.google.com) (209.85.192.176) by server-15.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 25 May 2016 02:09:40 -0000 Received: by mail-pf0-f176.google.com with SMTP id c189so12845932pfb.3 for ; Tue, 24 May 2016 19:09:40 -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; bh=WDQN/HEdXfXc2zeZpro1ZWYPIdLUQg9lzfIH68eWasg=; b=d6NtoYSvac15MT8hh5UKdxpQaJEMjlhQ/ak75MSpadaPrGHhAxygRmJaZmABNnzI7V H2ZUyh5AAUNdJPZF/tga3vuYNGhA13o8xSPhEWtHID4DCsgogUBtmRp8/2bON96+1ccF Q7VfETk0fMF+Lxi0NBIe0ByG/HGJew22lKk6s= 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; bh=WDQN/HEdXfXc2zeZpro1ZWYPIdLUQg9lzfIH68eWasg=; b=VlNWTGPugrq4rPEzae3MfINSUvzxiqWVmHnQT0b+U7QDTNKZbfDsX6DQjWiGKNaPbE pBFtYQcWkk0ofqa+NjU9BHTVfilof1yIGijd2fpR/7Xh15GZHb7lyKPplfz9E3Emsqug 4dk3w4prH1yuFzbJT10OcF+MOPWiFWIRTnoCN3gbbbzSfq+XTYkotfhyFAOjLh8woT3v 2z2rWRcwXN1HPbHtJUbhw1HUHjIryS+IrpbhhC6Hv1LTOQM7LjKXepwi8ATBHVrWw1gk qCtM469lcBw64QivlkHoYR7aZePPNlU4o2f5lc89CMueakhvJB0NiLAfH6cuPjPIVbZm 2niw== X-Gm-Message-State: ALyK8tLZJQGUs7+Tq78OpYtxI1Vpr60HnXpNOIm4wLwOMuEU3M+VyKgTkpBeGVSJGVDuJR3Z X-Received: by 10.98.104.133 with SMTP id d127mr2061697pfc.112.1464142179492; Tue, 24 May 2016 19:09:39 -0700 (PDT) Received: from localhost.members.linode.com ([2400:8900::f03c:91ff:fe56:1324]) by smtp.gmail.com with ESMTPSA id o87sm27555900pfa.75.2016.05.24.19.09.37 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 May 2016 19:09:39 -0700 (PDT) From: Wei Chen X-Google-Original-From: Wei Chen To: xen-devel@lists.xen.org Date: Wed, 25 May 2016 10:09:35 +0800 Message-Id: <1464142175-32724-1-git-send-email-Wei.Chen@linaro.org> X-Mailer: git-send-email 1.9.1 Cc: julien.grall@arm.com, sstabellini@kernel.org, Wei Chen , steve.capper@arm.com Subject: [Xen-devel] [PATCH 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 Reviewed-by: Julien Grall --- 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)