From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9D66C433E7 for ; Fri, 9 Oct 2020 10:48:28 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6F65922277 for ; Fri, 9 Oct 2020 10:48:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="0DJJ0LLA"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="YChSfeUO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6F65922277 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=J+L5VlqHwTvaze2ZOSKOOzEvS/MuOYnk3O4g4LqNJ3I=; b=0DJJ0LLAdHQCVR+tpKSu5+tMT Zo+POroIhpPavg+bRoblRId1HfilYWR20wrhxodM8stuoPR5SFvr/rmPweoVaevfEdsM79N4bb7eL gHeZq3IwNrhB9Actmfzb6jXTfKqOa0Y9zUXyxZAp4EVK7km+ySdtJ/Df0e47QpkG/EzuxooakMMQF 67dm0b+yxvlu1iQKEqTr9G6/QOCaHxna5Cb5f9IbyEHhMqSCTkN5nIcgk292gN2pVqm2Sx5BEwrma Z4kzOlWeBRbrP5NU/eWpwQK1Q2JjNGvYwHeWWyYbqn3E68RSf7h8zxxeOLkEUfMkYNOsy4U7bjx8f hRucJsGZQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQpvT-00059F-Oh; Fri, 09 Oct 2020 10:47:03 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQpvR-00058n-4w for linux-arm-kernel@lists.infradead.org; Fri, 09 Oct 2020 10:47:02 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BA82D22277; Fri, 9 Oct 2020 10:46:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602240420; bh=Gf2W8jYt3DtnBYYucCqJsDpl5G5pvyAUr06Pl+n+E3E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YChSfeUOmVMAK6nZghBlMUuFS73LrlG9zAQcAvvWJmXSPMQkp3rgLqTWhZHjgM+hB C+zDovAXy4KE5fNZPFQf2HhJKr0f02+HQWwbbYyLjRx6E2laNW0/15j3Kv76rzvv/3 MTNsIoysrxX2WCgosDIRzeSR9R0POe01dSw9f2Zs= Date: Fri, 9 Oct 2020 11:46:55 +0100 From: Will Deacon To: Mark Rutland Subject: Re: [PATCHv2] arm64: initialize per-cpu offsets earlier Message-ID: <20201009104654.GA29783@willie-the-truck> References: <20201005164303.21389-1-mark.rutland@arm.com> <711bc57a314d8d646b41307008db2845b7537b3d.camel@redhat.com> <20201009085115.GC29594@willie-the-truck> <20201009094318.GA87530@C02TD0UTHF1T.local> <20201009102438.GB87530@C02TD0UTHF1T.local> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201009102438.GB87530@C02TD0UTHF1T.local> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201009_064701_862927_CCC40806 X-CRM114-Status: GOOD ( 29.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stephen Rothwell , Qian Cai , Catalin Marinas , Linux Kernel Mailing List , Linux Next Mailing List , James Morse , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Oct 09, 2020 at 11:24:38AM +0100, Mark Rutland wrote: > On Fri, Oct 09, 2020 at 10:43:18AM +0100, Mark Rutland wrote: > > Hi Qian, > > > > On Fri, Oct 09, 2020 at 09:51:15AM +0100, Will Deacon wrote: > > > On Thu, Oct 08, 2020 at 09:18:24PM -0400, Qian Cai wrote: > > > > On Mon, 2020-10-05 at 17:43 +0100, Mark Rutland wrote: > > > > > The current initialization of the per-cpu offset register is difficult > > > > > to follow and this initialization is not always early enough for > > > > > upcoming instrumentation with KCSAN, where the instrumentation callbacks > > > > > use the per-cpu offset. > > > > > > > > > > To make it possible to support KCSAN, and to simplify reasoning about > > > > > early bringup code, let's initialize the per-cpu offset earlier, before > > > > > we run any C code that may consume it. To do so, this patch adds a new > > > > > init_this_cpu_offset() helper that's called before the usual > > > > > primary/secondary start functions. For consistency, this is also used to > > > > > re-initialize the per-cpu offset after the runtime per-cpu areas have > > > > > been allocated (which can change CPU0's offset). > > > > > > > > > > So that init_this_cpu_offset() isn't subject to any instrumentation that > > > > > might consume the per-cpu offset, it is marked with noinstr, preventing > > > > > instrumentation. > > > > > > > > > > Signed-off-by: Mark Rutland > > > > > Cc: Catalin Marinas > > > > > Cc: James Morse > > > > > Cc: Will Deacon > > > > > > > > Reverting this commit on the top of today's linux-next fixed an issue that > > > > Thunder X2 is unable to boot: > > > > > > > > .config: https://gitlab.com/cailca/linux-mm/-/blob/master/arm64.config > > > > Sorry about this. :/ > > > > Will, to save you reading all the below, I think the right thing to do > > for now is to revert this. > > > > Looking at the assembly, task_cpu() gets instrumented (which puts this > > patch on dodgy ground generally and I think warrants the revert), but as > > it's instrumented with KASAN_INLINE that doesn't immediately explain the > > issue since the shadow should be up and so we shouldn't call the report > > function. I'll dig into this some more. > > Ok; that's my fault due to trying to do this before kasan_early_init. > > I see what's going on now. If you're happy to take a fixup instead of a > revert, patch below. Otherwise I'll a complete patch atop of the revert > after rc1. For now, I've reverted the patch on for-next/core and redone the tag. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel