Received: by 10.192.165.148 with SMTP id m20csp74925imm; Tue, 24 Apr 2018 17:32:00 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/uRVi1zfziXPpkEFhAFKwt7FlB7ed9XvOS3UsN6nk4Dw/IXQ29V9OeQEcgrFBif659PwjX X-Received: by 10.99.159.25 with SMTP id g25mr21299799pge.288.1524616320410; Tue, 24 Apr 2018 17:32:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524616320; cv=none; d=google.com; s=arc-20160816; b=XZdY3ig/MYw/m0FxKcRenuuNATdUgap094PLybCQnZXtL2EN2JLJe+R072qsCZL5Ek zpcSP5EA/BIvyy0ZYZkvquzqfF2/RNbms9wwM+ZJsrrXp19p/2CltnF0Hrxg9CYsngYt aAyKV8d/UljO89c/gL4G1hoIaDvFtIbeIyUBwXUvcVkWxCAk0o938gHLUGYr87ranDFJ d1ElQdOZi+sLrvL3CxxnU+L57BKnIS4HUGBcn/EAghTPhci+lvqUgnMSEOud9SpqqzVx uVD7oK5kw5smEWGd2lKL8mc82jOfzGg4jEoKEx5YTLcXnvz9VIg7BTD2MHmFX7S4C7ed TKkw== 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 :arc-authentication-results; bh=j2R1S7NSZbrdkd4DcpITH3YRaZ2bcH2ceL7yKmRJchc=; b=jIqxJwpdSc8gt++lHxh93flR9JZp7d7OWwthxAhr8QPufiAEZjphGA8hxHaIfvQYJ3 1fAGK+IgoX9yWNNqGC0yNjWJfBNFG3cR318nEnq2bNN7eA+HF3CdVXR8ZsqiST0uBNmw lH9IEpLqSCEBlUtdqg/Wti4NHZ8GzT6gpQI4Um/lvc3tNvZRMK1z+JrjzndLFbOVkk6t MKE0SBTVe9KUbbbRBgASzDsYWnFNHFwNK1L6dgjBMjix76Ek7Zh8nx2PHT1zLtAhaUMK Gs5FoPfhIGXeJdWd1buZ2IgHfnZyfBTpu4jUzqnJ5oCsbqXYs3x/f212d/HuBvpHQq8w lDdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=QwqdYY7P; 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 q13si12360798pgp.533.2018.04.24.17.31.45; Tue, 24 Apr 2018 17:32:00 -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=QwqdYY7P; 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 S1751350AbeDYA35 (ORCPT + 99 others); Tue, 24 Apr 2018 20:29:57 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:40897 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750997AbeDYA3w (ORCPT ); Tue, 24 Apr 2018 20:29:52 -0400 Received: by mail-pf0-f195.google.com with SMTP id f189so4538017pfa.7 for ; Tue, 24 Apr 2018 17:29:52 -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=j2R1S7NSZbrdkd4DcpITH3YRaZ2bcH2ceL7yKmRJchc=; b=QwqdYY7Pk2zAqJL91RWbx9lVwrfSaccMSxwthGCU/jLpINsulAFh2XCIYk0HfyrfkQ 1ZmShnJ3Sdk/liP5oEeuzM5yosxMktWagAAivV//93Jp0PRiXEjNYq0pPk68vpwtJl5q wTsQg3cGWy6eFe5g+/zSpM9dVVg+qlIvSvJlPCjMuiArBJTGMuwCnbKrqy6yD2xydMWf XzHYn42w80QM1qnV3QC7mDIA8CvFCB8rKCpR2HSRO22CAU7jWCadCuIkrqhZesgflbZO VjZ6lmR8dkX1H8vvksnAUjd0zNpzxZPm8+IC7FwMSbbEGP2DIK1GxaQS1vnntm3Rk0j1 dKKQ== 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=j2R1S7NSZbrdkd4DcpITH3YRaZ2bcH2ceL7yKmRJchc=; b=mpLnzB56sjBrjC6QIk62+N/T884cGR2QuLIkI9GcTmMoIGwkW+wmlj6NTzLRgbRgDL DKUf+72U7E9lSFK+9RVE94uOzm+0HD+kEndmDZ1rl/KaDJaqPGNH5a+yVarBpq9Hx0DD 0g2jOUpTw7jYDJEahnLa693A1GKQLwH4Qpxpp/0SzZVzsaALGliuD9Vy6IpioeUrzS8C 5JhQr0ewfCZIhPWlGeQLgwZrBS5dPv+8UZG1CXlddH9xjiiSE6EaPQXYs/jKUKP/gHlf WH3kAbzukdiFooPDP8jOMWz3T9RSWSaBSJ3HUpyW08aqd4cHv52tZt309cMLAaYCmLRx Rx0w== X-Gm-Message-State: ALQs6tA8NWyRyScgvnvq1emrZTgAmnOArcLQAs4xp0a/UdJpQ5JpEWrU t/4vXcL0Wi2mpGbbn7ay65TV/w== X-Received: by 2002:a17:902:591e:: with SMTP id o30-v6mr26535336pli.309.1524616191785; Tue, 24 Apr 2018 17:29:51 -0700 (PDT) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id r84sm2554268pfa.125.2018.04.24.17.29.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Apr 2018 17:29:51 -0700 (PDT) Date: Tue, 24 Apr 2018 17:29:51 -0700 (PDT) X-Google-Original-Date: Tue, 24 Apr 2018 17:22:50 PDT (-0700) Subject: Re: [PATCH v5 0/2] perf: riscv: Preliminary Perf Event Support on RISC-V In-Reply-To: <054df682-c002-23ba-075b-a38c9085260c@wdc.com> CC: alankao@andestech.com, albert@sifive.com, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, sols@sifive.com, corbet@lwn.net, linux-riscv@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, greentime@andestech.com, nickhu@andestech.com From: Palmer Dabbelt To: atish.patra@wdc.com 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 Tue, 24 Apr 2018 15:16:16 PDT (-0700), atish.patra@wdc.com wrote: > On 4/24/18 12:44 PM, Palmer Dabbelt wrote: >> On Tue, 24 Apr 2018 12:27:26 PDT (-0700), atish.patra@wdc.com wrote: >>> On 4/24/18 11:07 AM, Atish Patra wrote: >>>> On 4/19/18 4:28 PM, Alan Kao wrote: >>>> However, I got an rcu-stall for the test "47: Event times". >>>> # ./perf test -v 47 >>> Got it working. The test tries to attach the event to CPU0 which doesn't >>> exist in HighFive Unleashed. Changing it to cpu1 works. >>> >>> diff --git a/tools/perf/tests/event-times.c b/tools/perf/tests/event-times.c >>> index 1a2686f..eb11632f 100644 >>> --- a/tools/perf/tests/event-times.c >>> +++ b/tools/perf/tests/event-times.c >>> @@ -113,9 +113,9 @@ static int attach__cpu_disabled(struct perf_evlist >>> *evlist) >>> struct cpu_map *cpus; >>> int err; >>> >>> - pr_debug("attaching to CPU 0 as enabled\n"); >>> + pr_debug("attaching to CPU 1 as disabled\n"); >>> >>> - cpus = cpu_map__new("0"); >>> + cpus = cpu_map__new("1"); >>> if (cpus == NULL) { >>> pr_debug("failed to call cpu_map__new\n"); >>> return -1; >>> @@ -142,9 +142,9 @@ static int attach__cpu_enabled(struct perf_evlist >>> *evlist) >>> struct cpu_map *cpus; >>> int err; >>> >>> - pr_debug("attaching to CPU 0 as enabled\n"); >>> + pr_debug("attaching to CPU 1 as enabled\n"); >>> >>> - cpus = cpu_map__new("0"); >>> + cpus = cpu_map__new("1"); >>> if (cpus == NULL) { >>> pr_debug("failed to call cpu_map__new\n"); >>> return -1; >>> >>> >>> Palmer, >>> Would it be better to officially document it somewhere that CPU0 doesn't >>> exist in the HighFive Unleashed board ? >>> I fear that there will be other standard tests/code path that may fail >>> because of inherent assumption of cpu0 presence. >> >> I think the best way to fix this is to just have BBL (or whatever the >> bootloader is) renumber the CPUs so they're contiguous and begin with 0. > > Do you mean BBL will update the device tree that kernel eventually parse > and set the hart id? > Sounds good to me unless it acts as a big hack in future boot loaders. Right now the machine-mode and supervisor-mode hart IDs are logically separate: the bootloader just provides the hart ID as a register argument when starting the kernel. BBL already needs to enumerate the harts by looking through the device tree for various other reasons (at least to mask off the harts that Linux doesn't support), so it's not that much effort to just maintain a mapping from supervisor-mode hart IDs to machine-mode hart IDs. I have some patches floating around that do this, but appear to do it incorrectly enough that nothing boots so maybe I'm missing something that makes this complicated :).