Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp295823ybl; Tue, 7 Jan 2020 19:39:51 -0800 (PST) X-Google-Smtp-Source: APXvYqwkm1gdpvIUhV/HX1XmDwYUvn1O8jp9q5FCX6wKjWDujc+s1TjkXEilUFrbQQihOLjQTwkL X-Received: by 2002:aca:889:: with SMTP id 131mr1387201oii.3.1578454790890; Tue, 07 Jan 2020 19:39:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578454790; cv=none; d=google.com; s=arc-20160816; b=j3+dvI8kPhjmWsRmMXgpj13khoNTLkJ2x9f5zt+JymkAozIUVRXAfPamzj7jNfsD5H LZy5ZVMIpJKC4QU4eNq6KuWgeJU5/Nep8RFgLBfvGoYyNlwD4OO07GtxmerMoTOMfwje tD8wiPJnjqcHjr3IWBc2QDBrrKsk5L8/h17ad9W/XCfmDvNhugTREiGkrF5wlJht2N4a TPWKSgxI/1WhDu65IMjRXxD7qq7iiIh5MBMr5Hn7+UmQRAPJkY+/1Y7Gph819/XSFyZI WCy259wl94xL0cILOpGVqxhTsSiJS+3rM/5VFJpc7md8/Wbln/ONDFX8g2KqSy0Fph6T 8bYg== 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=ySbkX+4r5a6zzWgSuzqB+vjv/GamaAVWkn0vznIPTa4=; b=Q3j5cyW55RFG7qPW0GSEf7iyn3d6Fqz1wA7rVgNOPRuMrsVx5K8HfuxVcC4I3pxWem AeP+9Y39ffBQdzDU/MFXtI6KvYvKnT8aXDQCFqIQywnDn4QjCOCjMVZoQvVDRxlnbEWH pcM/TyHHH4BOvrXqRQNbtCWX3Z4xlHf5X/m085MtYSJq7pitL783GYSNozgKrgqHWWJI 6JF6z8O9eR0JoxvmDjoP0OjCgFkB9pXAi3gRhdBIaV4tkWMoLLMhqBgCkrBjuXm1xN4j 7fxgGYuRqr1be0HJMiIDIpyZra4EIZmEHVPGtKok54AwsZNx83ZpKgfPxxbOphrfmoRb gEyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=coiwODIR; 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 c19si1137897otn.7.2020.01.07.19.39.23; Tue, 07 Jan 2020 19:39:50 -0800 (PST) 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=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=coiwODIR; 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 S1726333AbgAHDgx (ORCPT + 99 others); Tue, 7 Jan 2020 22:36:53 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:43972 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726142AbgAHDgw (ORCPT ); Tue, 7 Jan 2020 22:36:52 -0500 Received: by mail-wr1-f67.google.com with SMTP id d16so1786073wre.10 for ; Tue, 07 Jan 2020 19:36:51 -0800 (PST) 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=ySbkX+4r5a6zzWgSuzqB+vjv/GamaAVWkn0vznIPTa4=; b=coiwODIRqSIDkJCbI5ezwrW7yd5BZTJJju0W/SVfgKIapZG5FEoUrpHuV89f9c8UVL vzjVJCnAa4hhXxBnHmvVUsgyk9NxiTdBpuJykKNSNawkAa1WbF9a7XlUSziREksjZnDv PHcnwBktmROK/gtIkV8Rw9FgkNXn6GnwwJ3b3M+4HHlOS/5ZZI0tZK1eCXLD0TSWt2vX 7xSnBO1VuPi+pQz9peXHYrkcndjxykktnFdkFecKIY9DUjSj6mn7GIbYY7uCnG0yz+xW E3q8chVkBY1R5CXRreYWmMMkJKhx+xPtmHOxvarMxHaSus/OS8uqgct3RFkGgrFkp+ox n0Qw== 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=ySbkX+4r5a6zzWgSuzqB+vjv/GamaAVWkn0vznIPTa4=; b=e+MZKxv4/y3PnbtLJ2EGPH5SiuE9JuNKxmyxr5WBDOXasCXfbrH0gEUGBMJKcF8Pjy Vp5llkqBMO3aJs/Z8gqGfjrygLCzs13chsA8pZC6Nu5iUfoM34whG6Uq7fT+4y+rDqF3 Q5uDbwg8mhMrGxvF0RPuBVuf7uHOw9qtE/mAEmQc54DFrX1yxTxQLSK1qaeYGQcNTWH8 dmSu3DPv9fRvgETcWcnGfTtaHedbGjYco+N9XMo89WzerQQMeFcoGeQmEVAYSE/MEpVV 9k55w4qgAKVHBuLg2Jg8dxND9TJCpLjEQZDMZsrd5GqVv6hrfs5IJ8eUZ7jV1bMD+M+5 rkKg== X-Gm-Message-State: APjAAAW520I9AXPBGc2A7+RrHkHOLbrL9L15i/pU9HAKoWaBtM59XHoR A/DPuU5guxt0sBIYfTHtWQTWj3r9jnH+Qrww0Nft0Q== X-Received: by 2002:adf:d850:: with SMTP id k16mr1938797wrl.96.1578454610421; Tue, 07 Jan 2020 19:36:50 -0800 (PST) MIME-Version: 1.0 References: <20200108024035.17524-1-greentime.hu@sifive.com> In-Reply-To: <20200108024035.17524-1-greentime.hu@sifive.com> From: Anup Patel Date: Wed, 8 Jan 2020 09:06:38 +0530 Message-ID: Subject: Re: [PATCH v2] riscv: to make sure the cores in .Lsecondary_park To: Greentime Hu Cc: Greentime Hu , greentime@kernel.org, Paul Walmsley , Palmer Dabbelt , linux-riscv , "linux-kernel@vger.kernel.org List" 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 Wed, Jan 8, 2020 at 8:10 AM Greentime Hu wrote: > > The code in secondary_park is currently placed in the .init section. The > kernel reclaims and clears this code when it finishes booting. That > causes the cores parked in it to go to somewhere unpredictable, so we > move this function out of init to make sure the cores stay looping there. > > Signed-off-by: Greentime Hu > --- > arch/riscv/kernel/head.S | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) > > diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S > index f8f996916c5b..276b98f9d0bd 100644 > --- a/arch/riscv/kernel/head.S > +++ b/arch/riscv/kernel/head.S > @@ -217,11 +217,6 @@ relocate: > tail smp_callin > #endif > > -.align 2 > -.Lsecondary_park: > - /* We lack SMP support or have too many harts, so park this hart */ > - wfi > - j .Lsecondary_park > END(_start) > > #ifdef CONFIG_RISCV_M_MODE > @@ -303,6 +298,13 @@ ENTRY(reset_regs) > END(reset_regs) > #endif /* CONFIG_RISCV_M_MODE */ > > +.section ".text", "ax",@progbits > +.align 2 > +.Lsecondary_park: > + /* We lack SMP support or have too many harts, so park this hart */ > + wfi > + j .Lsecondary_park > + > __PAGE_ALIGNED_BSS > /* Empty zero page */ > .balign PAGE_SIZE > -- > 2.17.1 > LGTM. Reviewed-by: Anup Patel Regards, Anup