Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5290643yba; Wed, 10 Apr 2019 16:06:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVWrNUTcgvE0B6roPkbt1IjeXdVHL+sgq3w3/JFrvAvO6F6PM3W+/65p8N9g20egwzu9bG X-Received: by 2002:a17:902:6949:: with SMTP id k9mr46501244plt.59.1554937561672; Wed, 10 Apr 2019 16:06:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554937561; cv=none; d=google.com; s=arc-20160816; b=B9D+ISDSqsuW49/cHDpN6vpSd/gNNwIq1dyt8+ORR7sYkGXgmqsB9xiQ2aCFOaakES npHZwdRQYkwh31jIpx6OQVr36cGqu+Gnn2lIDiWEmtUj7qozRYIOws/za7QTziiSe2wi bOoP44o8najkCZeihowYlsq++/HgpCj2xtbcIknKBl2MFeIlZi38gc4kJEK3jJnb3Tmj f6oi3IPJ9BrdV2Fy9fNuS/cI3lLBouyGRAUlTdFNgtEG6ibqHb1bPQfQ0DD3HlE/Uwo4 eJV2vceDwqAY9LCx8JbEJe3o51VbdyQFOaaQqTD0gcTqLwVxPeYdv2ugui6sHedl3oyZ JpXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr:dkim-signature; bh=52zLlJVKruU4i+DZTj4nhyquvnwg/8hcDzFtSc+6Y7s=; b=PHKZIXLVaG4jqY3ah1IlDerzSUgIeZdvLnWz4F2VfhNqUmw0kg9jG0mi4gZ6ihg7+H C7vixqgwLBOKotKFrmQvaER0zCHjjReMNWQdYxN/wSnwlNtplYqEzPnBk0gvKltvMFdE 4whQqo8BQL513XVeMixt9Rw+JDX1l81HOGOe2Q7RcCU0img7imY6ere9CHpxoYFHgY1A DYc1t538OV/bIKGecDHMm6xXgf1DatMTXO0JY8zEoxGp7WFA6nNiWKkDWLHHBIu2jHrD QFDcJfyMPYuv+lu8vASb5CRViYQaJFqUmGbNfhkpp9pZyK3X4S6L+6YG3nDvXLcAOkDN 4/9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b="YVNM7/Wo"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d24si32665387pls.271.2019.04.10.16.05.46; Wed, 10 Apr 2019 16:06:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b="YVNM7/Wo"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726738AbfDJXFB (ORCPT + 99 others); Wed, 10 Apr 2019 19:05:01 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:61696 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725982AbfDJXFA (ORCPT ); Wed, 10 Apr 2019 19:05:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1554937501; x=1586473501; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/x+jL+kPuh7mg6eMR2Nwf6ik4gO5nqwDyzrx7ofC4os=; b=YVNM7/WozhorDuY1hXz2MSDRs5tsvjWYEx5nmCcW79kcVMxEFqKlGzbn aqES9Y6nCLn48u6M74yJbkVIHoLru1RCdSSPiIo7qL5ao3ZGi1xU2gpaS laoQoJgGC4o1m1qcn7nMgziTAyyEHtHrrk8oQVgVXZQHfq5xP+8ESkS2S nqYqQpD6QLMAMLswFWG7Vi5aONONIttqEpCOrk3xrU7qbtGwDrpLetkFe UxvuS1LFqab/FhW2aeE9nLfJj61BxcHm1na5hzVRrToi0rirduz+14kkP eNmfvFEcJXNyP6aW0+kYgruTrAcBscv2KWiIRWCVSAFoP6/hLRusXOV37 w==; X-IronPort-AV: E=Sophos;i="5.60,335,1549900800"; d="scan'208";a="110531206" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 11 Apr 2019 07:05:00 +0800 IronPort-SDR: TGn41lHAy93Pk/h1qH/PI/EaVhW6Jw/UbmsYeyJ+zdK2xlaBQd+hLxQxJ0ygjla/z9K/tKoAod +TERW/K0jxGEhqFVSIClQs1Nr0LDWrO6OigvexZMcv9dwqsEryZ0DqM7skgHmnP+vA5rq+yI1l Ftc7TmUlVX4+WUoLiSzV4iBGPQXWFr/wgs+nLlHL3MP09l1Jcbwq9/giDk6wjLNWKJfcebeONI ov8+OR2Xdo+CUzWZvRh/nO54UWnq8dhf/jWgEuD72uG24qTNri0JiNM8LOwKJGvNuBAs4eRGa+ WlYhAYsU/d9eGp1rR0jub/p2 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 10 Apr 2019 15:41:52 -0700 IronPort-SDR: ZsHMd7rSmer4yMsGq+pWheMFS8QBalwNLIJKk+UiMBz0JIeI6qp4vryMi/b0aLq4o9VhbQH/NF Wv/a8KEdXuXeOc33WEpE7NhCCsufSFng2oK7YuCSzBJHUIigAwfSwFqLAG+g9yRiMEOmCKzU3H Y8puD+pbOuSRbipKi0yZONgdepAZX5HDgeIbIQoTDEGQ0modJhBreYVdlW3rxYW9AvEw7XFkHZ d5bqhkXwclCMvRczdB3lhF5Gao0dWphTqgSbqaAjFqbDPpElq9QtpbhHOPQwDVQATPnjAMySjI lAA= Received: from jedi-01.sdcorp.global.sandisk.com (HELO jedi-01.int.fusionio.com) ([10.11.143.218]) by uls-op-cesaip01.wdc.com with ESMTP; 10 Apr 2019 16:04:58 -0700 From: Atish Patra To: linux-kernel@vger.kernel.org Cc: Atish Patra , Albert Ou , Andreas Schwab , Anup Patel , Dmitriy Cherkasov , Johan Hovold , linux-riscv@lists.infradead.org, Palmer Dabbelt , Paul Walmsley Subject: [PATCH v2 1/4] RISC-V: Add RISC-V specific arch_match_cpu_phys_id Date: Wed, 10 Apr 2019 16:04:40 -0700 Message-Id: <20190410230443.15729-2-atish.patra@wdc.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190410230443.15729-1-atish.patra@wdc.com> References: <20190410230443.15729-1-atish.patra@wdc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org OF/DT core has a hook for architecture specific logical cpuid to hartid mapping. By implementing this, we can pass the logical cpu id to cpu node parsing functions. Signed-off-by: Atish Patra --- arch/riscv/kernel/smp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/riscv/kernel/smp.c b/arch/riscv/kernel/smp.c index 0c41d07ec281..94db72662f60 100644 --- a/arch/riscv/kernel/smp.c +++ b/arch/riscv/kernel/smp.c @@ -70,6 +70,11 @@ void riscv_cpuid_to_hartid_mask(const struct cpumask *in, struct cpumask *out) for_each_cpu(cpu, in) cpumask_set_cpu(cpuid_to_hartid_map(cpu), out); } + +bool arch_match_cpu_phys_id(int cpu, u64 phys_id) +{ + return phys_id == cpuid_to_hartid_map(cpu); +} /* Unsupported */ int setup_profiling_timer(unsigned int multiplier) { -- 2.21.0