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=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 A5628C433E0 for ; Thu, 4 Mar 2021 13:32:27 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 4338664F3F for ; Thu, 4 Mar 2021 13:32:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4338664F3F 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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc: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=3zPx8Fq4iG1uMb3u+ehnXPZDDgusMHBbqwfUo+HENQs=; b=oK7ezq4joXL1QY/HksgCbUaPG P55rd2+1U2jLxLh6tskEkuyVycDuH0fEUyINb8VpkeEqxKzxzrkEu5zcflyCkWQ0QWOPl3WU3aycp HQziQ9g6RNaRgk3xj3dXYIXb0o+4RVUdXqdlEmllEMtP3DyC+aijrulY+eYzkN4h4Oxr4GA9lAAOG MbrT6eP+dicm7vTpQn95tQDDx/ARdWnL8fVqlTxRmDHAkHM159b88YTS+TOp8SgvlnEuWy+WsYg8a j3AoCQ393impdgPPEVfnkwHaW7ji6jPBBahXuNXqlOc9pniVHTPuSnNPOrSYmbQVZaQuZ3A1t0tmj u2rMPyg8A==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lHo3o-008kY7-UW; Thu, 04 Mar 2021 13:30:37 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lHo3i-008kWv-Ac for linux-arm-kernel@lists.infradead.org; Thu, 04 Mar 2021 13:30:34 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id B1A1464F09; Thu, 4 Mar 2021 13:30:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614864628; bh=FymMIRsqam+0dpN/hmGDuT1YNhEM75EjBEkI76JbleM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HegIxjE8lYP01nKvJKhVLIn+GZnjgdmNm4DtaUoWKqW1GKD/dXqDfCkbX29QbVYzy JWBDxzbo7aQUygtxZeuhi0qMbIvoKfgM9uPG5tKG/331juyYenxV24j2j/CdEILIaz 3WJNk82CCNmYGOdt2l3T7HKaRn6O9h0GIrSPTlmaOqRfNvIqd7TXLKcCNUApO52L2B fWZNRGFKTZykgzFszO6gHIpGhp4viZ2uRB/loxdi4ApKdmydn9oR4hleN4DADsxoJc JCzCp5HEl+HeTQEHLx3Le5j3wYFzjmZ1HeYnnfKvd1tvvySh+gD9RXAasypc6l8icO j+u4IwPOJzAdQ== Date: Thu, 4 Mar 2021 13:30:24 +0000 From: Will Deacon To: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, cai@redhat.com, catalin.marinas@arm.com, elver@google.com, james.morse@arm.com Subject: Re: [PATCHv3] arm64: initialize per-cpu offsets earlier Message-ID: <20210304133023.GA21229@willie-the-truck> References: <20210302115335.42135-1-mark.rutland@arm.com> <20210304124510.GA20956@willie-the-truck> <20210304130835.GB54534@C02TD0UTHF1T.local> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210304130835.GB54534@C02TD0UTHF1T.local> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Thu, Mar 04, 2021 at 01:08:35PM +0000, Mark Rutland wrote: > On Thu, Mar 04, 2021 at 12:45:11PM +0000, Will Deacon wrote: > > On Tue, Mar 02, 2021 at 11:53:35AM +0000, 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). > > > > Is this still early enough now that we have the idreg overrides on the > > command-line, which are parsed from C code? > > Hmm... no, it's not, given the override code can be instrumented and > calls potentially instrumented library code too, so we can't just > prevent kcsan instrumentation of the file. > > I'll go give this a more thorough audit, since (while I had previously > convinced myself otherwise), the early KASLR bits look potentially > problematic too. Ideally, we'd be able to use KCSAN anywhere we can use KASAN and then not have to worry about the two independently. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel