Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1571855ybz; Sat, 2 May 2020 02:55:31 -0700 (PDT) X-Google-Smtp-Source: APiQypLZ+FeFKmKxFk9tJRZFJ0q4uD0P+Nsm8FpNZ3mvvk+nuqMDFod3+gjjXWEdCUBq1Qv2oU+s X-Received: by 2002:a05:6402:17e3:: with SMTP id t3mr6790768edy.203.1588413331206; Sat, 02 May 2020 02:55:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588413331; cv=none; d=google.com; s=arc-20160816; b=0Invv8msrotbn+Ko0E0SJzntGf1wL/SsM5CZYAzy82pBnfKIE5O26wVRoFDaAHejsP yJ0m8EAHyjSS3xx3azNMXxkxWqXAQtB+nSYJuSc/2uPtn7j8hyBUwgSzqfrdG8WzQ4JQ 6KpU+CQGpsVOUWuulRiryfVzICquhau6hdsnGqmsMHwijZLmm8UyByYQEbZ1XDmOSjZt b+Ef+i9vvZkcs+l635VluZEgfDdgkRIO9sEFLh+1emC+CoGhm3Hr54CfJZEwghjgv7D0 yDONg7axyfOUcoElPHnJckkhJ4HcxDuA+Ys12mSKWMnBWDssrTPMm5/8b2D6KN1XhOAN pjBw== 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=uoBzoBQB4BVIuqFQUVFVcE1WM4gIMhxIJSSV4i2CqWs=; b=sN9m4L5v9FPnI6Qmlo5e5a4gr6l54b1dc4VC1GrBBxLGHRV2gBhJ8jRfOX3V8ZTp/z skDvnn4YgTG5qTbYOVZBWInWgNr6t82Vdy3XtYQE5M+FrBw31ehDNQaTC8FgLqoZrARt SonYaYWeb/JYsuWJbfTWgJdi5MxocFRbWNtKsfpl0GABOCjFzX/8Z/p2coYupf/SosFS z8vpA+fEJXaB3SbKUNOJGLZXqdcVGZXaJjj6D8wwIm6WPOUnZ69DWJ4FWWKbXHANr+IL 0SDq+5Q1nw38DDKHd2PBI20x/FRLBq8deCbBAIxLrYc97dJGeUJNeXTYFz61DH0UqIwC aQGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=U9FDisrU; 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 l27si3231513ejc.524.2020.05.02.02.54.36; Sat, 02 May 2020 02:55:31 -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=@sifive.com header.s=google header.b=U9FDisrU; 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 S1726809AbgEBJtm (ORCPT + 99 others); Sat, 2 May 2020 05:49:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726548AbgEBJtl (ORCPT ); Sat, 2 May 2020 05:49:41 -0400 Received: from mail-ot1-x341.google.com (mail-ot1-x341.google.com [IPv6:2607:f8b0:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 631DCC061A0C for ; Sat, 2 May 2020 02:49:41 -0700 (PDT) Received: by mail-ot1-x341.google.com with SMTP id e20so4539947otk.12 for ; Sat, 02 May 2020 02:49:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uoBzoBQB4BVIuqFQUVFVcE1WM4gIMhxIJSSV4i2CqWs=; b=U9FDisrUMhsDhFo44hGWbKStvuHwnO7Ntpk9HnRp28d+d6A0g7J+T0Ot8hMaxegKcI zTMb4gClyG7Fl+FyOvTUNXH83lgnSUX1BNVa3mMWrISD/7N/goU7SgK72Gi4IuqpPaQk lrlaGqbu6wWBFcwWFONxzEg/HWO/sHW8xSV4R9kW7XlJy/N3LPPSr9mrVzge7yuosNEH xsPYJknKxdO4zjRB9elXwFs0kRHmfCHJINLqRAKg1MMVY/P2ahe5YmBT8k2K3uuTRKZ9 kTqflJoP+MAflNexI0ijWBACdd/Z+0dGEySL6AfPcJBJSLSeKJVuAi33w4W9EgddNG8x wPBw== 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=uoBzoBQB4BVIuqFQUVFVcE1WM4gIMhxIJSSV4i2CqWs=; b=JUwlxB0HSJIDmTIL1tts5QlswFx9aCWJRWZ/D648TiU9Cs4kiYcxZDRnTB5GNSe9Wv ihyE9c2mfjjh4iXXCrh/4huSfYHa5TcUvWNRTUzigR57DLqe+dc5xze9E0IG7jzA+2oz O440eawW9F30hOK0ZDdnIg28N6EIIMVRuC1p37WiTAZLFTmdQY7KK/ZOD8zWnbQAHAPO R4XHcgEuAnE+H5PKQ1VG7gkXC1PDK7dcGCjPyq4/4j0OENm/S/SS8ixKbBb+dYpGHlFC 5zwDOYenMTZgP6GQmuVcTtSXjO9elfGaP1MxZCf1mGtFlaIF9WjbgwWqEWYLANx6tc5g SJhw== X-Gm-Message-State: AGi0PubrC6o3bnjW5rKbWOxOe5MGVY3xAtP0GMNoRpZ5B+JwjQYenGZ7 WFXfy0H9KKqfTiZmR7j158umqX2PXbX8c1PKWBLBOYxK X-Received: by 2002:a9d:7dd8:: with SMTP id k24mr6910351otn.33.1588412980814; Sat, 02 May 2020 02:49:40 -0700 (PDT) MIME-Version: 1.0 References: <20200430095325.111441-1-zong.li@sifive.com> In-Reply-To: From: Zong Li Date: Sat, 2 May 2020 17:49:30 +0800 Message-ID: Subject: Re: [PATCH] riscv: force __cpu_up_ variables to put in data section To: Anup Patel 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 2:13 PM Anup Patel wrote: > > 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). > OK. Let me modify the description. Thanks. > Regards, > Anup