Received: by 2002:ab2:5d18:0:b0:1ef:7a0f:c32d with SMTP id j24csp306251lqk; Sat, 9 Mar 2024 10:51:27 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWXJIrg0O1EallH/iPnlmclqC2OmypZmsiyQ/So6ddFB75pvZgR0u5IlnVRIjH2cw7Rbs5P3mLPvU3QtgVWBZ73Rn8k1ULTjwfU/rDUvQ== X-Google-Smtp-Source: AGHT+IFCMgGZuxgmZUjFrpuwKH8xc0vehx+E04TgApoN9qLmZ/rqZbMaachWzOBOL/5BJI5F8RJv X-Received: by 2002:a05:620a:810:b0:788:400f:e3c1 with SMTP id s16-20020a05620a081000b00788400fe3c1mr3133558qks.38.1710010287038; Sat, 09 Mar 2024 10:51:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1710010287; cv=pass; d=google.com; s=arc-20160816; b=WRvw6VWzruRsBfBB9rkp08bRavBu6ItrzZSaFkNQjal14IGwzr6UBV2zWvwNljrw6W DUtsxh0U/XlRVca5sEuUJ19kCDpUc368UWgl3LF5AmlapWI9na46pG8v20pHK6rRL+s3 HBe6X689kOmvITU9kQVDfLb2p+1yvu0fToRx7ZDuakWSihj4n4Cocjmq4OevX0sI0bfQ AvvC14kekthE3oyZhfUrqFEAifXHL97sJDIaaL2WolB6wp5MkFuVfSvcc0ctK+p43ff5 YhhJ9tVD4Mv28W/rUKP9Z21wZTjfAqS7hMhsXIP6syxAY8D1cs7XjN3AVuVTNiUDrYzd HW5w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=KFscdxlW/TjZ/pD4zl9xWw0rXSdhkn1zA5GrSU+eTOE=; fh=51iOSiMy7EQqljLDXLkeBgzt7ahLRcy+u1E50n3STos=; b=GSrdqhWMJhtY6skiBOBV/VQ5aoenASpaXbMJw6V9pEu4PJp07wN7FnWO3G+pQ8Vq/8 3KMpZcTsppOaCYrbVYixIcU/9opO/93F71CLncFnvhHjfsWBse/vYR4hTkJfic9/T86j KFTsuaNvKEJRNM3VRS1y3DBEKX+dZOHnccjlPB9db1K4EnxCNiwtTTjPXaza7zZjB2y5 SOgjlaMYS4diZuLbmsZTAqSziguQjq2vtkq4n16OjNRFfL2aEUCpof/zE/+ypnCk6DRK gnYk+CCUQYTIfQl6yCtHzhF2KPqMMMkEnzIvRg2Od/txNr1DdmHh+Q50/9hxxtJiZJH5 Ei7A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-98019-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98019-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id t6-20020a05620a034600b0078828612296si1990432qkm.559.2024.03.09.10.51.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Mar 2024 10:51:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-98019-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-98019-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98019-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id BCE6C1C20E7D for ; Sat, 9 Mar 2024 18:51:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 29B494C610; Sat, 9 Mar 2024 18:51:22 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A5A2416FF30; Sat, 9 Mar 2024 18:51:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710010281; cv=none; b=qUjcw/sT73oxjiy5nPKjF7dxVV0bRp+8wnN2d1rLVv3d4uIc5R8uS11aQ2U+/unnzkjHCpYD9rVssggFmZ4OIvFhKmeDr/sOyBousXAieJulJoPiZXLL9iMSfcWV9NcM7/4Xx8Tqi+dWaw/Z3V5HgMNF8UVIXTXmv82giVwuVpY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710010281; c=relaxed/simple; bh=RU7c3Ybwu4VytLTCKkoUrNCeajIFFkwaiL3jPhLJEgE=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=j9XduKBVXdZ4XaEjPaPm4lT61kHUchqSjoN5US2Z53I8zzN2TGnrCn5M6qIIS9ywlU2sm618vPZ9MF1GFEdkhYfqP8NZ/YK5YUl9rPOJqNwM1RX2EV17WDpBwzB7DPPOOEatKQRhKQ+vOx+m0rekhBwP0fKz98rH5kYbTjYre5c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3BEBC433F1; Sat, 9 Mar 2024 18:51:18 +0000 (UTC) Date: Sat, 9 Mar 2024 13:51:16 -0500 From: Steven Rostedt To: Kees Cook Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Joel Fernandes , Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Vincent Donnefort , Daniel Bristot de Oliveira , Ingo Molnar , Peter Zijlstra , suleiman@google.com, Thomas Gleixner , Vineeth Pillai , Youssef Esmat , Beau Belgrave , Alexander Graf , Baoquan He , Borislav Petkov , "Paul E. McKenney" , David Howells Subject: Re: [PATCH 0/8] tracing: Persistent traces across a reboot or crash Message-ID: <20240309135116.40f65cee@rorschach.local.home> In-Reply-To: <202403091016.5CDF0E2EE@keescook> References: <20240306015910.766510873@goodmis.org> <202403091016.5CDF0E2EE@keescook> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sat, 9 Mar 2024 10:27:47 -0800 Kees Cook wrote: > On Tue, Mar 05, 2024 at 08:59:10PM -0500, Steven Rostedt wrote: > > This is a way to map a ring buffer instance across reboots. > > As mentioned on Fedi, check out the persistent storage subsystem > (pstore)[1]. It already does what you're starting to construct for RAM > backends (but also supports reed-solomon ECC), and supports several > other backends including EFI storage (which is default enabled on at > least Fedora[2]), block devices, etc. It has an existing mechanism for > handling reservations (including via device tree), and supports multiple > "frontends" including the Oops handler, console output, and even ftrace > which does per-cpu recording and event reconstruction (Joel wrote this > frontend). Mathieu was telling me about the pmem infrastructure. This patch set doesn't care where the memory comes from. You just give it an address and size, and it will do the rest. > > It should be pretty straight forward to implement a new frontend if the > ftrace one isn't flexible enough. It's a bit clunky still to add one, > but search for "ftrace" in fs/pstore/ram.c to see how to plumb a new > frontend into the RAM backend. > > I continue to want to lift the frontend configuration options up into > the pstore core, since it would avoid a bunch of redundancy, but this is > where we are currently. :) Thanks for the info. We use pstore on ChromeOS, but it is currently restricted to 1MB which is too small for the tracing buffers. From what I understand, it's also in a specific location where there's only 1MB available for contiguous memory. I'm looking at finding a way to get consistent memory outside that range. That's what I'll be doing next week ;-) But this code was just to see if I could get a single contiguous range of memory mapped to ftrace, and this patch set does exactly that. > > -Kees > > [1] CONFIG_PSTORE et. al. in fs/pstore/ https://docs.kernel.org/admin-guide/ramoops.html > [2] https://www.freedesktop.org/software/systemd/man/latest/systemd-pstore.service.html > Thanks! -- Steve