Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2226266rdb; Mon, 20 Nov 2023 05:46:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IFeu7PrjlMZ00Nm+r1DrbsBhu11bk73klUNboj78PcSRgbkIItadTfpZASVKUwgQZxZZwQZ X-Received: by 2002:a92:6f06:0:b0:359:48ed:facf with SMTP id k6-20020a926f06000000b0035948edfacfmr7948336ilc.13.1700488018734; Mon, 20 Nov 2023 05:46:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700488018; cv=none; d=google.com; s=arc-20160816; b=fYze6jB/cDRKX+mPA+OlGJ6WV/A3rjLJy8pw98A4Y2YdJGCeR7DGF/mM1Kq1g85ylE ZQtZFql9eLqhAlHBvOp5FMd5YcR9sFrPRKDbalOthxzw7fsP86o8lsfG7FRPTjIqMLA/ aKKkeuYrleeBX6Qk3wMpfg2JMQvYmqcG7RQ5zbGz4NG0m5rokxs1wft9ijSTn4EMheNr S7O41nXMLulMheMYrDHcv2DknyjwbOuRLwuQCQN+SEFvbNHdmSBdt+GlgYXPsMDxMp5+ e/z/i0mXGcBPmXoSPhUaZkoWFqZ4Rt2PhXznerTlTmi1XXZccRHhnYAaF2vD9TUcrrc3 Jekw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature :dkim-signature:date; bh=sIDLtNcX5xP/2fRcdt4XuAP61ekbwx/J5uuozCpmqwc=; fh=7mVXELk63zaiCIV9fWGguOVRGVdjr4mtB5J4yZZCGJA=; b=Vbo9TtE5bkpLXzRVnwRjkyKrQOPTYMOU3kObXGL6GcSaKj1tp6KUJgReua+PIX5E+9 QN6SNBId7tOb1dVCTHOFu7gHCakSjNjd5mJjY2ysNxiy+ryNrrv/FyBv8Ia14b7t2vS+ xsQWahI4wCZHEspZhAU8xOsGs1Hem0c2wvl2yMIXLhwncDHnW+K0mX0QUtuHcVd8XFWM 5NA5QQje8diqf0v6giG9Hc8qwW2ChutdcLhcH5n56JqndC7uBQ3wsdN5R3SsQGet63kL 5VgTVELQvQLxWCUyHlyxhbwlkHyJrNXZVeWpw4azenqEmrR4j4I3amFRZ2c1mfj7A5VY NFCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=rq+C0U7Z; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id cb17-20020a056a02071100b00573f885c4easi8197637pgb.753.2023.11.20.05.46.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 05:46:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=rq+C0U7Z; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 6D41380764AC; Mon, 20 Nov 2023 05:46:18 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232344AbjKTNqG (ORCPT + 99 others); Mon, 20 Nov 2023 08:46:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232128AbjKTNqE (ORCPT ); Mon, 20 Nov 2023 08:46:04 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4672A9E for ; Mon, 20 Nov 2023 05:46:00 -0800 (PST) Date: Mon, 20 Nov 2023 14:45:56 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1700487958; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=sIDLtNcX5xP/2fRcdt4XuAP61ekbwx/J5uuozCpmqwc=; b=rq+C0U7ZmduqJ8mXb5DiMg0j8PC3cRXOwx8Rk87zAB2Tj37KQj3IVphCXaD4mkG6zQNVAu cimDs/RVZynGvItrYXWoVtEq5eVHJ1jf3WUcnYSiXRsIdD9W6JK4LgSuZRPN1rMeyCgt3F 7Pw04Fbbci/V7s7oWG9MMsv5haBRlOh2ctOOhy3d/IiRP9/xjEDSOUNmqDPZIvSXFGC0DD bB4Md0bpXIeqZRyepjROsZGVT3segUWDSr13rQ/3Zs90E34ZfyN+mgXHOr0DXv02vROgBw gtZSVUn58ZollmhI+klugmPy81jXEynI2I6OP65F2YCpLyh0j3yX0SdUMba62A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1700487958; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=sIDLtNcX5xP/2fRcdt4XuAP61ekbwx/J5uuozCpmqwc=; b=2qxCEwXnNYV/lk5uCO56N8CF7qvqT9vK6ClR8MqT7cG8msniVxDnW6H5Ld4/BaG8bKg4zA c3uFjcrE2KN9G7CQ== From: Sebastian Andrzej Siewior To: John Ogness Cc: Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Mukesh Ojha Subject: Re: [PATCH printk v2 1/9] printk: ringbuffer: Do not skip non-finalized records with prb_next_seq() Message-ID: <20231120134556.DkKNwy7B@linutronix.de> References: <20231106210730.115192-1-john.ogness@linutronix.de> <20231106210730.115192-2-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20231106210730.115192-2-john.ogness@linutronix.de> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Mon, 20 Nov 2023 05:46:18 -0800 (PST) based on my research this should be the most recent post of this patch. If so then On 2023-11-06 22:13:22 [+0106], John Ogness wrote: > --- a/kernel/printk/printk_ringbuffer.c > +++ b/kernel/printk/printk_ringbuffer.c > @@ -6,6 +6,7 @@ > @@ -1441,20 +1445,144 @@ bool prb_reserve_in_last(struct prb_reserved_entry *e, struct printk_ringbuffer > return false; > } > > +#ifdef CONFIG_64BIT > + > +#define __u64seq_to_ulseq(u64seq) (u64seq) > +#define __ulseq_to_u64seq(ulseq) (ulseq) > + > +#else /* CONFIG_64BIT */ > + > +static u64 prb_first_seq(struct printk_ringbuffer *rb); > + > +#define __u64seq_to_ulseq(u64seq) ((u32)u64seq) > +static inline u64 __ulseq_to_u64seq(u32 ulseq) > +{ > + u64 rb_first_seq = prb_first_seq(prb); > + u64 seq; > + > + /* > + * The provided sequence is only the lower 32 bits of the ringbuffer > + * sequence. It needs to be expanded to 64bit. Get the first sequence > + * number from the ringbuffer and fold it. > + */ > + seq = rb_first_seq - ((u32)rb_first_seq - ulseq); This needs to become seq = rb_first_seq - ((s32)((u32)rb_first_seq - ulseq)); in order to continue booting on 32bit. Otherwise, if this survives one cycle then we can deprecate all 32bit platforms. I am happy either way. Sebastian