From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1A6CE3ACA60 for ; Wed, 4 Mar 2026 11:23:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772623425; cv=none; b=otHz8cBR5bTZo1jfMxWRMorpNygK8Pe06160a1/mvuR/5L2Qweef+tSnTE8K48flpp8XC9hYicPWkQm3BMSf2mN5DrQ4vCGLWP/4pMDBSYFNisEu7xYijHB0foNn0KhNGSg5z/NB6VHmvDEzRYWtHf3Eu57LM/nsGAs3q5YORxk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772623425; c=relaxed/simple; bh=M10XbYztuklpVC0yacSPWXPpQoo003EH+hfGf48BpR4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KIGNAe2GnMgKZrAAl5q5BLTmAKJvHPchAIPWbjryrJZADx8GRNlfJ5TvAy8M69IF92YI/g9AxeYrn3qE0AWbpoNANmuU+s4VptAvQkQ/qKXhqWc6vnXur5wesHgzb956KAjZQFPIIfisp+r5zjc95i2OyDsjEV+5LM5hXHkylwg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=Ha00N4xq; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="Ha00N4xq" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-48375f10628so45073945e9.1 for ; Wed, 04 Mar 2026 03:23:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1772623422; x=1773228222; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=QsPWhQRnRBZhO6KZxSKo3Nkp5kgtgVBf3BcJ9YTOOm0=; b=Ha00N4xqjoqXIb5WxewC+zibsY6YLXZBvkEXAJzv9LyEq0ld9VvoyFsEMQ4U1iE/1B vGfAjBXAhEhG9sjoST8wKQI6ymSwLfBWYMNo1XfI+TeWoZYw2w7isAVpzAI/inmyG4xt 32bzvML7Hj0DScxtwXoB6yVBXHVdG65kfEXfas1GA61HWQdfCVlltEhEFq6Zlugre7S1 Dq2T0E2nNrXz7XU9FalhHeO8lJjwJ1fptxNIi24R+/U7nYHqPimBuJ/4ZJ0E2wqXNUYw BGZ9RIjT1Qi7e/rQWw9sJ05z8fA4bNsFrZEYwdBi/nTdyjOQBOqrU5RKaE3lwH5ybRdL qqsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772623422; x=1773228222; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QsPWhQRnRBZhO6KZxSKo3Nkp5kgtgVBf3BcJ9YTOOm0=; b=qyUjjUeWijeD8MITdb5pxddy0AnJ/8ebz+nJPq7XN4WfruEIeQBwBLOE9aETk6/Cqy Dqg3sDG71m68P7trJx5flUq8AnNN9p9uOWL/HwjMZBkP5+0hKqCsaoBvqBCIv2edDtoT wDMQhdym2aUL8Rv0cA3aApIcPUeb9ybneVEYfJsG3c9t0Nr45e+IYwQGtLEPPc/RFfVd T5Vw6OfkPlgXgqcCWQp1IVx7fuwoDxbl8I9aBByldjRfI5kU9Z2RZyBmtcAReEogPjbl pCTmAwfT+SxX58+eZAmtNnbMWZcIXbvWkKI3HNUzhQ6VPUkqZPLqNgyL69IZ8TqibmAB 7P/g== X-Forwarded-Encrypted: i=1; AJvYcCXIrrSpc3iYYuqi/VXIclx+OpuG1xa6jsV1QaK834bIKlXbrVFJf1DGI2vgOVlcyio435b0C1p82FwJB9s=@vger.kernel.org X-Gm-Message-State: AOJu0YxInSxfdjgZ73qp742youLvDnumEjTLMnOkesC0+4Zo59m3U6P1 3w8BFQjiPrrKNjGrFd8v9S0eJAzvFHeR39Gp99YK5SQRY8ggUZEL/1HXj9X224e9j3o= X-Gm-Gg: ATEYQzyT0OXR4/2xb2w1t0k32GtUN3M4YrmlXdDORLTHXJ64LSPumK7fQUlUeMWeUgi hPSxcra+2DXh5snNij+m8pCoFLWbBdkfmeQEgNkuEx+tYA0ozam1KLpqM87XF54qhXk8lun1kid wtk3UlPOFYSH+co4hv94ZixzWvvklVv93GmD6EojJg+aidx6rVNdCdGw4MhpRsD/7VwwBkSHruX qpQBoQZiHqx7a9vUtALIjqlDVM67cCF65YMAHRNgoT64ZPSWwFWO0NUe8sK8pSJ3+I/0MTLUp19 yrGvwPONhmxitG+m6KiwZKRd7/86LQb/eEJ5LbMfARHQhUpd1dry5HwN4splrNNKqBD1ye8+Ikg xSbl19Nbpd2cBnV2/7srOhk2K8rQLxxOzyDIlv5Ly8DvMvXLF+LhH+wxJKHtUf8M0eOLS/ciBCm 7yxhsj/pnYh7ZbxUsGDYXTpIGl9spBgEL0Oa8x X-Received: by 2002:a05:600c:45c6:b0:479:2f95:5179 with SMTP id 5b1f17b1804b1-485198491ebmr25769235e9.15.1772623422396; Wed, 04 Mar 2026 03:23:42 -0800 (PST) Received: from pathway.suse.cz ([176.114.240.130]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-439ae0e7abasm28929528f8f.23.2026.03.04.03.23.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Mar 2026 03:23:41 -0800 (PST) Date: Wed, 4 Mar 2026 12:23:40 +0100 From: Petr Mladek To: Tim Bird Cc: rostedt@goodmis.org, john.ogness@linuxtronix.de, senozhatsky@chromium.org, francesco@valla.it, geert@linux-m68k.org, linux-embedded@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] printk: fix zero-valued printk timestamps in early boot Message-ID: References: <39b09edb-8998-4ebd-a564-7d594434a981@bird.org> <20260210234741.3262320-1-tim.bird@sony.com> 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-Disposition: inline In-Reply-To: <20260210234741.3262320-1-tim.bird@sony.com> On Tue 2026-02-10 16:47:41, Tim Bird wrote: > During early boot, printk timestamps are reported as zero before > kernel timekeeping starts (e.g. before time_init()). This > hinders boot-time optimization efforts. This period is about 400 > milliseconds for many current desktop and embedded machines > running Linux. > > Add support to save cycles during early boot, and output correct > timestamp values after timekeeping is initialized. get_cycles() > is operational on arm64 and x86_64 from kernel start. Add code > and variables to save calibration values used to later convert > cycle counts to time values in the early printks. Add a config > to control the feature. > > This yields non-zero timestamps for printks from the very start > of kernel execution. The timestamps are relative to the start of > the architecture-specified counter used in get_cycles > (e.g. the TSC on x86_64 and cntvct_el0 on arm64). > > All timestamps reflect time from processor power-on instead of > time from the kernel's timekeeping initialization. > > Signed-off-by: Tim Bird It looks good to me and seems to work fine. Feel free to use: Reviewed-by: Petr Mladek Tested-by: Petr Mladek See a note below. > --- a/init/main.c > +++ b/init/main.c > @@ -104,6 +104,7 @@ > #include > #include > #include > +#include JFYI, I have tried this patch on top of the current Linus' tree (v7.0-rc2+) and it conflicted with the commit 499f86de4f8c34e19 ("init/main: read bootconfig header with get_unaligned_le32()") which added here: #include > #include > > #include Best Regards, Petr