From patchwork Thu May 26 07:58:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 68675 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp268668qge; Thu, 26 May 2016 01:00:53 -0700 (PDT) X-Received: by 10.159.54.162 with SMTP id p31mr4404093uap.80.1464249653004; Thu, 26 May 2016 01:00:53 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id 93si8744737uab.19.2016.05.26.01.00.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 May 2016 01:00:52 -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 1b5qCX-0007Rg-Cu; Thu, 26 May 2016 07:59:29 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5qCW-0007R3-0m for xen-devel@lists.xen.org; Thu, 26 May 2016 07:59:28 +0000 Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id F6/6D-05902-FDCA6475; Thu, 26 May 2016 07:59:27 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrPIsWRWlGSWpSXmKPExsVyMfSOme69NW7 hBp1n5CyWfFzM4sDocXT3b6YAxijWzLyk/IoE1owLmzYyF5zlr/ixzquB8TJPFyMXh5DAJEaJ GRc3MII4LALzmCVmf2ljBXEkBPpZJc6s2wLkcAI5MRKTJ39hhLArJZ7vncjUxcgB1K4k0TGhA mLST0aJ9tZ3LCA1bAIqEt/f9EP1mkmcPzmTCcQWEZCWuPb5MtgcZoFMiRtfJrKD2MICwRK3z7 Ywg8xkEVCVWL2dDyTMK2AhsfXANWaIMUoSr64cAxvPKWAp8aO5FywuBFSz5PFsxgmMggsYGVY xqhenFpWlFuka6SUVZaZnlOQmZuboGhqY6uWmFhcnpqfmJCYV6yXn525iBAYbAxDsYPz+x+kQ oyQHk5Ior7i4W7gQX1J+SmVGYnFGfFFpTmrxIUYZDg4lCd6S1UA5waLU9NSKtMwcYNjDpCU4e JREeJ+DpHmLCxJzizPTIVKnGI05tvy+tpaJY9vUe2uZhFjy8vNSpcR5V4OUCoCUZpTmwQ2Cxe MlRlkpYV5GoNOEeApSi3IzS1DlXzGKczAqCfPuBpnCk5lXArfvFdApTECn+H9xBjmlJBEhJdX AaH5urqLjwco8EfktKQsmuvJEca1M+PNZeLLv3bO7zx6+8XcD2790BuZXZ6qmpr25w3jqr4nm 65qHek8SH082KHx97KCLhX3/5DVm/Hc9oq/68bgG5wrf8Yl73S93eUNbxDRhDdtN2SlftsVcu Vu3/BDfYQ/m3fzMGQ8iP69Wn89+5eNv8XUs/UosxRmJhlrMRcWJAAy9hObCAgAA X-Env-Sender: wei.chen@linaro.org X-Msg-Ref: server-4.tower-206.messagelabs.com!1464249565!41703868!1 X-Originating-IP: [209.85.220.54] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.34; banners=-,-,- X-VirusChecked: Checked Received: (qmail 13425 invoked from network); 26 May 2016 07:59:26 -0000 Received: from mail-pa0-f54.google.com (HELO mail-pa0-f54.google.com) (209.85.220.54) by server-4.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 26 May 2016 07:59:26 -0000 Received: by mail-pa0-f54.google.com with SMTP id eu11so18249931pad.3 for ; Thu, 26 May 2016 00:59:26 -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=yCUlk3ZN4ZhLaHE3b6/7FjivHYQJDutPzulEW8EdrzE=; b=Qd+aWzbYDDsyyhlp7RBtBWB8rRCD+Add8EytpFGwH9Z+ajuqQV9YU+UQPS3QJqup+Z Vu43vkh3gAdDrurPqOcZ2SeJjxhG6WkGTy1U/8/iyYeYZp/zHe64dhQYRchnngRHS1V0 +xyd/xVj0x28/TMY1AZssYE8Z7f3eFxz7C4qw= 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=yCUlk3ZN4ZhLaHE3b6/7FjivHYQJDutPzulEW8EdrzE=; b=O5HknZoyLJhpUnp4dA4gLX4+GQm6/K79/vKVqWB+lskuAgR1CrkIi/YT1hoHJeIv0d hUrOp6Sofdf0fmpYiDrassAXJ8Xajp0cuEW0YFpq8lcuvIULRagu/jRkqm/GawUNnV1C YF9kMTkIQ2akSUYKgNfrTo0vZvDC91sAB795lNf7KoE1llNhN2SBSMJzKX0EyWX3mzbS WY/IHaD0G6V5CnmN7pjOcWfjM2ecKidg7UxRLbqfll/LfikB6e4qb1HMHlq+oNWFmsRb P6P1li0DFpdx6CizxJev+HjB0chDpCHmvN1ey3kvvie97pXHdklTxcTYz/bGZuxCTYsJ mGpg== X-Gm-Message-State: ALyK8tL4xex1DHH/CzvSOlNd+UO/K+Uzep/AJqCsYjd/895V4MWTw4adDwGtBkN3UCXOsgYF X-Received: by 10.66.50.105 with SMTP id b9mr12069004pao.122.1464249564946; Thu, 26 May 2016 00:59:24 -0700 (PDT) Received: from localhost.members.linode.com ([2400:8900::f03c:91ff:fe56:1324]) by smtp.gmail.com with ESMTPSA id v27sm3686855pfi.49.2016.05.26.00.59.23 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 May 2016 00:59:24 -0700 (PDT) From: Wei Chen X-Google-Original-From: Wei Chen To: xen-devel@lists.xen.org Date: Thu, 26 May 2016 15:58:42 +0800 Message-Id: <20160526075843.25236-4-Wei.Chen@linaro.org> X-Mailer: git-send-email 2.9.0.rc0 In-Reply-To: <20160526075843.25236-1-Wei.Chen@linaro.org> References: <20160526075843.25236-1-Wei.Chen@linaro.org> Cc: julien.grall@arm.com, sstabellini@kernel.org, Wei Chen , steve.capper@arm.com Subject: [Xen-devel] [PATCH v2 3/4] xen:arm: arm64: Add correct MPIDR_HWID_MASK value for ARM64 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" Currently, MPIDR_HWID_MASK is using the bit definition of AArch32 MPIDR. >From ARMv8 ARM we can see there are 4 levels of affinity on AArch64 whilst AArch32 has only 3. So, this value is not correct when Xen is running on AArch64. Now, we use the value 0xff00ffffff for this macro on AArch64. But neither of this value and its bitwise invert value can be used in mov instruction with the encoding of {imm16:shift} or {imms:immr}. So we have to use ldr to load the bitwise invert value to register. The details of mov immediate encoding are listed in ARMv8 ARM C4.2.5. Signed-off-by: Wei Chen --- v2: Address Julien's comments 1. Fix typos in commit messages. 2. Explain valid MPIDR_HWID_MASK value in AArch64. 3. Simply explain mov immediate encoding. --- xen/arch/arm/arm64/head.S | 2 +- xen/include/asm-arm/processor.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S index d5831f2..3090beb 100644 --- a/xen/arch/arm/arm64/head.S +++ b/xen/arch/arm/arm64/head.S @@ -270,7 +270,7 @@ common_start: tbz x0, _MPIDR_SMP, 1f /* Multiprocessor extension not supported? */ tbnz x0, _MPIDR_UP, 1f /* Uniprocessor system? */ - mov x13, #(~MPIDR_HWID_MASK) + ldr x13, =(~MPIDR_HWID_MASK) bic x24, x0, x13 /* Mask out flags to get CPU ID */ 1: diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h index b4cce7e..284ad6a 100644 --- a/xen/include/asm-arm/processor.h +++ b/xen/include/asm-arm/processor.h @@ -18,7 +18,11 @@ #define MPIDR_SMP (_AC(1,U) << _MPIDR_SMP) #define MPIDR_AFF0_SHIFT (0) #define MPIDR_AFF0_MASK (_AC(0xff,U) << MPIDR_AFF0_SHIFT) +#ifdef CONFIG_ARM_64 +#define MPIDR_HWID_MASK _AC(0xff00ffffff,UL) +#else #define MPIDR_HWID_MASK _AC(0xffffff,U) +#endif #define MPIDR_INVALID (~MPIDR_HWID_MASK) #define MPIDR_LEVEL_BITS (8)