Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4738397ybl; Mon, 13 Jan 2020 19:51:32 -0800 (PST) X-Google-Smtp-Source: APXvYqxDEcUfsF7I81K0vonJwhLx22Xpeuzshoc9W5anuH9Bipd7EzDG+ot3VXfhqNUEkDqIT3Nh X-Received: by 2002:aca:d502:: with SMTP id m2mr14613377oig.41.1578973892537; Mon, 13 Jan 2020 19:51:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578973892; cv=none; d=google.com; s=arc-20160816; b=SLqhw2XRiMmomaB5pz7HT52t1KlJdTWGxuwrRn4gFg0coJxAjioHDYoyQWeq+shZAh kpKlkvSMJexLHF1Kd1QPkodNnk3ZsfYxt1iInQCXvRL9Fzjsdvg080BjMIEmq3YlYDWs OGFv7gKqFjjjLmqM6EuFHieLPOaSCt9QhbUAtvGMtwgSKatP8AMyZcVyhRMQHPu/D4gg WXMrm9E+lSD9r/lp/7OnCXqhjuBwegSQK0Iw9yrVv9UFfR7tpyfXVe5D+ymxhB5Bzxbb abE+fcrto1A9GwHS/4iR9h0VBrMqBKuMArd7ZsRQ6rb+NtOvFy2+WS4UIP26hhUgkBLN 8/0w== 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=CTJ2coo4RHoH/lJGEL6/xkagWbBVDH7gBcZR8SjOkz8=; b=oUEHdScnW3jloI0KZHMrFSAdhfa29+FF8P022nL4hMmqHrnBmw/cX19FmkS5jpXi/U 1Ut4j9S9gOymJAstFxtqboGP42vPWAwwAFMvdRVcYW/IA4SBr6oDzpAQhSIB1LHk2qlU fUABnXADnAQ01gVaaHPe70bgifTuaawfn2VFgpK0YEP/YFxfeLSK9Ge9jZ5tGzgxcsU4 ElH3hJo6n2E/NTzcAm2GcOjAOAzjZ7Yhaf7vqSJWJeOVkC4LyDvyaQ6VbGr4oAjcWLEf sUn3KoMx80u3qTUD/cRhYFo2n0bTcWxThiDZQjaTWI44kuczNpDvBRNL2xHQZrFNeuQd oBlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=nQc8qxdX; 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 c19si8741148oto.129.2020.01.13.19.51.21; Mon, 13 Jan 2020 19:51:32 -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=@sifive.com header.s=google header.b=nQc8qxdX; 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 S1729451AbgANDse (ORCPT + 99 others); Mon, 13 Jan 2020 22:48:34 -0500 Received: from mail-qk1-f193.google.com ([209.85.222.193]:43477 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729366AbgANDse (ORCPT ); Mon, 13 Jan 2020 22:48:34 -0500 Received: by mail-qk1-f193.google.com with SMTP id t129so10884172qke.10 for ; Mon, 13 Jan 2020 19:48:33 -0800 (PST) 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=CTJ2coo4RHoH/lJGEL6/xkagWbBVDH7gBcZR8SjOkz8=; b=nQc8qxdX/AeOVnGOFlRCgCYp1v+Q9S3HUvIYqgb2rMKCYn9H5NsgVRHIHo5c7toLey TL4BEKQxXsuUYLj7+4+xMp3q50jmsSvEjvG+9J0yvLmS8T2iQrpzs2qY9wRhbRKmCJxn qhL8WI1HWHG9fPkkH8HxV/eOlqTHBINXjp0kFBOeruRYTz/qagED/LKtJMr+FJECKcye axHnG/a53UeioPdkcDOXPDm5WZygoCFWZYwZpEcMGe9FJhkcook5Z5qNfC7miQ2HUWte nB5mIAF0jz0sjypPQprD8RerGyQAys+ZI5JkALp+Xx77+fFJp+XHYzq6w+NKG6SkW/jn 6+lA== 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=CTJ2coo4RHoH/lJGEL6/xkagWbBVDH7gBcZR8SjOkz8=; b=IXbyat4n5aa4v4W3LDn2hBav3asH+POG2t11+1RDx6kLCUPGA5CokdCr4cdSXENxQY 45k3JT97dbeB1C7cTwn96kzVLawce/QkdfTjg1wQnHu9lb534KSbTaEwPuXJL9T9A1cx 9DPU+EhbsWEED33HUnMJFmS8B1keefjhIzMg0V3Pa/uLhu3Eki0bnZuQKppWGU/CVUC2 Adsm2+tX/pi83x7wn/mO2lUfgCcqKWdJXfNrVd/m8xIdXEhYduKcC59t/qLg1CPJgvfB LkWcJM4+S42r+8G5CyPNAmt1xH1sofnEabF/AWUMaqWi7tHdd0Z2cjYWJqkYpIAQklrN HJTw== X-Gm-Message-State: APjAAAWj25i9vD4vTdgAso4RtvG+kkjXokbjpptilSew2R9dkIP5DVw6 FpW25MVj6k+unmZg1uuZKcp5HZuT76C3uN+misYMmg== X-Received: by 2002:ae9:c018:: with SMTP id u24mr19621044qkk.339.1578973713171; Mon, 13 Jan 2020 19:48:33 -0800 (PST) MIME-Version: 1.0 References: <20200109031516.29639-1-greentime.hu@sifive.com> In-Reply-To: From: Greentime Hu Date: Tue, 14 Jan 2020 11:48:21 +0800 Message-ID: Subject: Re: [PATCH v3] riscv: make sure the cores stay looping in .Lsecondary_park To: Paul Walmsley Cc: Gt , greentime@kernel.org, Palmer Dabbelt , linux-riscv , Linux Kernel Mailing List , Andreas Schwab , Anup Patel 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 Hi Paul, On Mon, Jan 13, 2020 at 2:12 AM Paul Walmsley wrote: > > Hi Greentime, > > On Thu, 9 Jan 2020, Paul Walmsley wrote: > > > On Thu, 9 Jan 2020, 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 > > > Reviewed-by: Anup Patel > > > > Thanks, the following is what's been queued for v5.5-rc. > > During final testing, when building the kernel with an initramfs, I hit > the following linker error: > > LD .tmp_vmlinux1 > arch/riscv/kernel/head.o: in function `.L0 ':(.init.text+0x5c): relocation truncated to fit: R_RISCV_JAL against `.Lsecondary_park' > make[1]: *** [Makefile:1079: vmlinux] Error 1 > make: *** [Makefile:326: __build_one_by_one] Error 2 > > Could you take a look at this? I think it is because the sections are too far for bqeu to jump and the config I used just small enough for it to jump so I didn't see this bug. Sorry about that. I tried this fix to boot in Unleashed board. #ifdef CONFIG_SMP li t0, CONFIG_NR_CPUS - bgeu a0, t0, .Lsecondary_park + blt a0, t0, .Lgood_cores + tail .Lsecondary_park +.Lgood_cores: #endif