Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1420716imm; Fri, 28 Sep 2018 18:47:52 -0700 (PDT) X-Google-Smtp-Source: ACcGV621AxOnwbdg4q2cLBYOd0mUOplh4fPTjjmKWr+XFHzSYIRPTYj/Jd7ZgCu3QixTQveS6Dgk X-Received: by 2002:a62:c60e:: with SMTP id m14-v6mr1204593pfg.40.1538185672095; Fri, 28 Sep 2018 18:47:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538185672; cv=none; d=google.com; s=arc-20160816; b=D6MkuM6hlLMTI4t+cq3CXhm+6WByM8KCQXG0DjKe1ZVmF8wKCzsH0yDIOwYR8uzImd OMtMWm0ysoG0HVAumhOiLiCVnv3k2xtcJOoujOz+rteYb14pBR4bHGlyaqOO2ZgEkW5L Tgdmh/prsbY3x2UApkg8arxnHrSVFBWGQoSJrwZWygji5uKcYSZ51Ogk/c4ERw1LXsGC dae4lHYAxTj74WoqOC8vQ85nbjOj3eHeIhIc4Pnh0cYqytgIf7uH2VwF96kJIugqGLwo qTQmuKfHT6s4j0IYPNB0MMtACkz7qvHWLPb8ui3ITg3fSKnqFJlpl3T9Rd91UDJ9UyKa bK9g== 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 :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=+fuGy+pifrRZFj/cFZF/CSeVl9uFYeegfIF9yaeB2zg=; b=zZDdaNYXtvy8GwSYio5opqfmRX3uzjpXSIG6FoVAn05k8VMcpxq5dGyh9NAE9ata4W xbj0hFyXTBgy3mvm0K5qFCWluZ7t1T9+HsCXaSJCUInmndiPqlxAyI/iKpZKzkXaeW6u ldzWaYbNbnYOS8LoqmVg5qiVbJgCoHRnfeofvA4jtX6pk4MaVWRplLZ5MFmpggNqqGxR xO2KVysnheuuWgM9evHSCTv4BIlurXotnICyKvKFgEtr22e0CUaxRXuseZC6tTRLzg19 xrNL2c2FKUofFBQUntEoVRa7XW+mdkaVikra65P+TY+fTcgrxTjPU/o1PoSKPaidL3sV 81yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=bdgMqlpA; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v18-v6si6177839pgi.421.2018.09.28.18.47.37; Fri, 28 Sep 2018 18:47:52 -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=pass header.i=@sifive.com header.s=google header.b=bdgMqlpA; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727484AbeI2IMj (ORCPT + 99 others); Sat, 29 Sep 2018 04:12:39 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:40590 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726617AbeI2IMj (ORCPT ); Sat, 29 Sep 2018 04:12:39 -0400 Received: by mail-pg1-f193.google.com with SMTP id n31-v6so5622419pgm.7 for ; Fri, 28 Sep 2018 18:46:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=+fuGy+pifrRZFj/cFZF/CSeVl9uFYeegfIF9yaeB2zg=; b=bdgMqlpAMNX//TL3q2S0Ijv+ZbJwfamvgvdFpDq/pZM7s6c77h+0vHNv1ZR9SeV7tx zFE9M4hI7uCoIbHaBeujmFMk1rtmyPs1R7SAx3z34+erUuV+xOlEqHL+/Y9RpIgCz8l4 U0SUrfrvs5dc7SN5T0j04RVp1KoNDNIOLJ48cUEElKU22BPToRROZoxPiVEXK/7blfU3 DL7OCsv9VmBXdhX2BEdcfu8yex07g5ucn9m8q4fePiGMWbhwc5gehkajE9UkMLAFlF+R 2UJe6b+Q3Rl5O2hmKnv+oshXtcySzcbEQ10XB79+QIfy4ipLa0dI0V5ezWJHrPPsrAgB 4N9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=+fuGy+pifrRZFj/cFZF/CSeVl9uFYeegfIF9yaeB2zg=; b=H9KOYTXt0ip79GG3nJiqP7UBbJHoaZb1k62T6vNq986rROExM0eoIGz1oghgyHQYkE UhVcelvCEbFJWCM2fnggLYGuiiasg4yUknbGN1jgGkiU5RUwzBYAp15il0KFbSQ38BwJ kCEVZcfdxE6fMusL6nmisxR6CeMIxyECRWh4Kbed8wB0T5oKPJXFYodRfGRub0K7Jv3i 4/Y+myHpxnV8ZTt5y9PAwp/wEadQaqsTsYk94aEOA+95Bed0ewyROtRb8Rugg67Wan8r dHsKHwpHioL0Y9i8L3QobM16m9HhIQx5MYV96NrUCPyFT+F9lfwHgMd6AIWNf1MR1PzJ LK/A== X-Gm-Message-State: ABuFfoiP/pccHyK17usQqvFbu3tOs4548YaftP544pPsl5psJIVnxjX/ Y1WKkTB4iCa2hR6tC4OrMnsprg== X-Received: by 2002:a63:2c01:: with SMTP id s1-v6mr1027381pgs.367.1538185571029; Fri, 28 Sep 2018 18:46:11 -0700 (PDT) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id j184-v6sm9432085pge.77.2018.09.28.18.46.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Sep 2018 18:46:09 -0700 (PDT) Date: Fri, 28 Sep 2018 18:46:09 -0700 (PDT) X-Google-Original-Date: Fri, 28 Sep 2018 18:44:32 PDT (-0700) Subject: Re: [PATCH] RISC-V: Show CPU ID and Hart ID separately in /proc/cpuinfo In-Reply-To: <20180912143822.21948-1-anup@brainfault.org> CC: aou@eecs.berkeley.edu, atish.patra@wdc.com, Christoph Hellwig , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, anup@brainfault.org From: Palmer Dabbelt To: anup@brainfault.org Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 12 Sep 2018 07:38:22 PDT (-0700), anup@brainfault.org wrote: > Currently, /proc/cpuinfo show logical CPU ID as Hart ID which > is in-correct. This patch shows CPU ID and Hart ID separately > in /proc/cpuinfo using cpuid_to_hardid_map(). > > With this patch, contents of /proc/cpuinfo looks as follows: > cpu : 0 > hart : 1 > isa : rv64imafdcsu > mmu : sv48 > > cpu : 1 > hart : 0 > isa : rv64imafdcsu > mmu : sv48 > > cpu : 2 > hart : 3 > isa : rv64imafdcsu > mmu : sv48 > > cpu : 3 > hart : 2 > isa : rv64imafdcsu > mmu : sv48 > > Signed-off-by: Anup Patel > --- > arch/riscv/kernel/cpu.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c > index f0f0ec2737b7..7c1342e242e6 100644 > --- a/arch/riscv/kernel/cpu.c > +++ b/arch/riscv/kernel/cpu.c > @@ -87,7 +87,8 @@ static int c_show(struct seq_file *m, void *v) > NULL); > const char *compat, *isa, *mmu; > > - seq_printf(m, "hart\t: %lu\n", cpu_id); > + seq_printf(m, "cpu\t: %lu\n", cpu_id); > + seq_printf(m, "hart\t: %lu\n", cpuid_to_hardid_map(cpu_id)); > if (!of_property_read_string(node, "riscv,isa", &isa) > && isa[0] == 'r' > && isa[1] == 'v') I like this, but it doesn't appear to apply. Do you mind sending something against Linus' master? Then I should be able to sort it out. Thanks!