Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1428950ybz; Fri, 1 May 2020 23:15:52 -0700 (PDT) X-Google-Smtp-Source: APiQypIKDEAsRYpDEtfeCgGDGMF6XCq2SCF8Kb9S/2auVIuyJMK5U5LXuP/b6I1CPfpvDVlNPo12 X-Received: by 2002:a17:906:a2d3:: with SMTP id by19mr6532028ejb.370.1588400151965; Fri, 01 May 2020 23:15:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588400151; cv=none; d=google.com; s=arc-20160816; b=A99YMTPv/Ybe6dHxVcrjasddLyLQSB0Ca1ep18jebkm34eN74y+xRav8U7sBHoLL54 MmyX5lMZTYIRSS2UxXmZ10ewYARDbABnJup1F0w3lOzOyV3VXYYU1WO81FNPy3XUxRpd 3xBrPATRc0JodGslUPyceQu45OuWVLSrNQWRlO4CJd1eC7toVQoehLBeinIpXxWIAdHF Bu5wBNvGhKjdcFMmWNF0tXMBFgKK0tT0ayoD/4QjN+48yhpPD3LW3Z5l7susZ7hhC6L1 klgYsr0szL9h2wKIMzPHCX+6jdlLUh7DtK3CrpSRqUzksLOF24BquTkvOn7JIshfkHA/ Y1JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=JhvioNVfM97l3WSCiP+ZrH6wOXH1bX9mQnh1D6DTF2o=; b=Sr8pkBvLpiUKUoJajll7n0k2oFfj4TEyML7rOb/xfOZyUliIQU3EjvMLjIhxc6Fu3I EtIdqbBT/HGnPda5eQVEaF4uOyzG+MVhEKJJQ9Psb7LyB6rYghSIdkdsoq6bh6lKuM5p gq0jBdQBdYsP5ikKELsGQJ/qVXUa+STty9QBpvHpJ4ZsonYy5Xo2kj410VT4yo/FCpkW sMHOY/BlGVz+EtpAY+FJ4ESGMLa5GUqBNZjASA36NqMDOb8XWQOrbM8IuwOcHd5RYwug nWY245prIEz9QrDa0uV3AD5jgjLgPlnSaWf6gLMIjQG4GbZJs/h65D4RmZUqUkEhBNAG OSfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=WUxjxADi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oo21si3026842ejb.453.2020.05.01.23.15.26; Fri, 01 May 2020 23:15:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=WUxjxADi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726762AbgEBGNc (ORCPT + 99 others); Sat, 2 May 2020 02:13:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726468AbgEBGNc (ORCPT ); Sat, 2 May 2020 02:13:32 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB378C061A0C for ; Fri, 1 May 2020 23:13:31 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id e16so9226404wra.7 for ; Fri, 01 May 2020 23:13:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JhvioNVfM97l3WSCiP+ZrH6wOXH1bX9mQnh1D6DTF2o=; b=WUxjxADivgi7evwQJxeX8FTGyQPfSbIyMxWdi09e0Gl5jNUaAviU+m7qyQa1vOYuNX Ib8FegKZZBHhLQLUq/H4Fqhkrops2Aq7ZifwGWe6RLYxu4SNEYA0wF0SapU8R+1VNEEb B1rcWhlN+jLa6I6VRM1Qi97OwvwvTCTqs+B47jxFWAtYVWqjwltT8RxVXKR0EvXHPjTi hIHTYMMqCxhzlcd+Kkt5IZRB7rYsvkMM2sjKYtGhokPyvPS0SBsnh5k137vzSJa+NLvk wbqDyl332okUupQ4LPaV7PMQEDmTNqsgX5Q4ov3vRj+GBytFtPTByPCvWM8is13zpIlq QXZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JhvioNVfM97l3WSCiP+ZrH6wOXH1bX9mQnh1D6DTF2o=; b=QVcS7X3ABBz85rysPt2Qk81gIoBJ1iJJrke/B6AbKIxdmJln61dv+LDLQfPziBCJfj hHFXEaf/4KRI0SNUPz1DxiHbmhV2RK5clhp1DlYw21KSEWDahqTmtcQsNOB1zq94YvKG YM7DzlaxiW+9npBgczYPFMF4i0NgBDmm8pkomKpzAOOXD0HXr1rmsL4Fv1ok9yh9sgLh mj/YvGJ7ebMjgzOFQcb2eZsleXPx6HCSJJqZdJYK2zybDIQKHsHAEsekQoY4aKdqRNk9 KABl7kEoRKWovO/OFW8Qg/I44cTYd7DWXwOkF8JLm9scvv6zzWowhJxuAa3yLkBABwYd +YaA== X-Gm-Message-State: AGi0PuYAQymBdfwjDfunW4thY2LpoPRDREbnLCyvwodcm5d2cfMmZVhq 3mX2cJvEYQ4/7xO030BTLTapsh5o2qe50uowbsNK/jax X-Received: by 2002:adf:b35c:: with SMTP id k28mr7648219wrd.61.1588400010329; Fri, 01 May 2020 23:13:30 -0700 (PDT) MIME-Version: 1.0 References: <20200430095325.111441-1-zong.li@sifive.com> In-Reply-To: From: Anup Patel Date: Sat, 2 May 2020 11:43:18 +0530 Message-ID: Subject: Re: [PATCH] riscv: force __cpu_up_ variables to put in data section To: Zong Li Cc: Atish Patra , linux-riscv , Palmer Dabbelt , "linux-kernel@vger.kernel.org List" , Paul Walmsley Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 2, 2020 at 11:30 AM Zong Li wrote: > > On Fri, May 1, 2020 at 2:23 AM Atish Patra wrote: > > > > On Thu, Apr 30, 2020 at 2:53 AM Zong Li wrote: > > > > > > Put __cpu_up_stack_pointer and __cpu_up_task_pointer in data section. > > > Currently, these two variables are put in bss section, there is a > > > potential risk that secondary harts get the uninitialized value before > > > main hart finishing the bss clearing. In this case, all secondary > > > harts would go through the waiting loop and enable the MMU before > > > main hart set up the page table. > > > > > > > That would be only true if you are using random booting protocol with > > SBI v0.1 implementation. > > With HSM extension in place, all the secondary cores are waiting in > > firmware. The booting core > > will bring them up one by one from cpu_up method. > > > > The HSM extension is already available in OpenSBI v0.7 and Linux > > kernel 5.7-rc1 onwards. > > If I understand correctly, the newest kernel still works with earlier > OpenSBI than v0.7 or BBL. It seems to me that we need to consider the > use cases if we don't limit it to up to OpenSBI v0.7. I think the commit description should clearly state that the issue will manifest only for random booting of multiple HARTs which means it will manifest only for BBL and OpenSBI v0.6 (or older). Regards, Anup