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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52E0EC021A2 for ; Tue, 11 Feb 2025 16:14:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DAA2B6B0092; Tue, 11 Feb 2025 11:14:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CFF906B0093; Tue, 11 Feb 2025 11:14:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BA0606B0095; Tue, 11 Feb 2025 11:14:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 9C6226B0092 for ; Tue, 11 Feb 2025 11:14:46 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 3F6E0A0498 for ; Tue, 11 Feb 2025 16:14:46 +0000 (UTC) X-FDA: 83108162172.15.BB98DE4 Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) by imf06.hostedemail.com (Postfix) with ESMTP id 2DC18180013 for ; Tue, 11 Feb 2025 16:14:44 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=soleen-com.20230601.gappssmtp.com header.s=20230601 header.b=aKauRWUz; spf=pass (imf06.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.160.178 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com; dmarc=pass (policy=none) header.from=soleen.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1739290484; a=rsa-sha256; cv=none; b=lQI3vk5Fgdsq4aotfqhLokccaO2kdOYwpbaUG7YFCzqXdXzjpnOdq/QF/Q7tIodiJK7aQh kfqkxUCa9fdDCU7SQrnH3F/VCFKLYjzWz9yu5PKzkvxJTcQ5C6DhSOs3xsWNjNy98Czh4F q0ZX9SgV01+FX3qMoXw/fXXKGYo0/Ac= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=soleen-com.20230601.gappssmtp.com header.s=20230601 header.b=aKauRWUz; spf=pass (imf06.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.160.178 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com; dmarc=pass (policy=none) header.from=soleen.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1739290484; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=f00g8h93qQX8OTMUbXqv3cBNa5BjAh6ZTXb5qUHVm6k=; b=GObiT/bjPdPZzGVXBRgjSxPikuTHa8i4AU109EjtqkJNHAmz+mkEaBdJK8hC/sf/xa0HP+ xORBo7UfeQRf0UWuHF/dZF+46aQG514cJfNJ1mIJvDIopFSUyjk+kZZOx0X/CbGBFIs/2B mOEl+CdtcAspkq/Xbt65g5M0pRRN/Jc= Received: by mail-qt1-f178.google.com with SMTP id d75a77b69052e-4718d989c1cso39571151cf.2 for ; Tue, 11 Feb 2025 08:14:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen-com.20230601.gappssmtp.com; s=20230601; t=1739290483; x=1739895283; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=f00g8h93qQX8OTMUbXqv3cBNa5BjAh6ZTXb5qUHVm6k=; b=aKauRWUzF5IW6TjaLE4Au3Y4HoEN1BOHU5FbE33W0JJMHfeXt78j1QWt8NovYFPUL6 DR9nfacOoou8W0v4SBdRXYsK6V8fGnVC8Add6BJQkmfEZEXIqc8f9QkIhkHQ1cC2B8wT BEqc9QeCRTevTuILxGllM5SV4QF4xY/siKlL7/wDjroAGmJB2Md4E0Hw28JSEnK1lveT qL+Qz3GDOuJ1LQt3QLuhlC+GayQ6FzQB+phf+W1zZUAYEHMUn7bwcLzKOcn1+DBrC4Mb +dyhRJuLmlsP81kv4Z2uvto4E50M9sHN65UBp8yc7VIaBfOpBYYZgE3pkggwasRmYfTH Y2sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739290483; x=1739895283; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=f00g8h93qQX8OTMUbXqv3cBNa5BjAh6ZTXb5qUHVm6k=; b=Qk0k0HcJz0tLNKD8j461i3HTAx0X9o3GDgBl/57BLyQfJuiTX1A8zN+yyvwrLUnFhP RHAoF+RPgskD5bl2anMD03zC/5wzWmKDHdEHjryS7PLWG88d4Z/XQOTqll0lB9QF8sJg olevAjxKwJDImkOKsB2+wDlEFaA9c+IalkMsK2Yv74rKwKNzUIwgj7xsKnxAdXF1P9bk OxVPWbg8JOV4QXrNfWqEztKhLkgV55h4tb8gGTBGOGSOE+ikxR8zrt1fIn5GPEswlkA0 lWAWd6F/5qekDr9MlUtDzvyZ8htykzoOBhk6fQ6cUURiqFj4UVpbEjondgYkBbfI6tJk j0Jg== X-Forwarded-Encrypted: i=1; AJvYcCULlsnPmo6LtOg1T16MWp+sJ8FjHesbvPlj/hXLsednMSCZ8e3WVBFE8cUgblkm4VFW87WmDVnQbw==@kvack.org X-Gm-Message-State: AOJu0Yy8LyX9bR6qPU30MLJII6KYS5tw9zxlswwrgvlA3KeP+feZf/Yi pXwvGoROqu95AtHTtC0Fdu50eqyCsQWNJ/PSfrlgih/DBbwGpENMslTAjwI63KoPsmegdkIyA3A 3fQETKXz5IqLT4XfGylKUaNYwEREfzdTwC/vUrQ== X-Gm-Gg: ASbGnctH2Rx68Lr5yBEAAHdb2E0H2z9RnmkO4piYe1fuPWIg83Dm528tpnFxYyOX7jv 69/iyz+2CHtoq8g6N8efas75/bA5xTbFVUvxREBreZSfT0hNs8B2VhCA5Ah8zAoyZPrbKAg== X-Google-Smtp-Source: AGHT+IFV/2SwK8xAi9MTHEKrLCagsybkvEOxgGEB7IziCVbPaPZ5quI5gxUrWQ8mdomSEUM9RDcaJ8/FU9MUgrz9PW4= X-Received: by 2002:ac8:7d86:0:b0:462:c14f:d13f with SMTP id d75a77b69052e-47167ae2791mr311026341cf.41.1739290483262; Tue, 11 Feb 2025 08:14:43 -0800 (PST) MIME-Version: 1.0 References: <20250206132754.2596694-1-rppt@kernel.org> <20250206132754.2596694-6-rppt@kernel.org> <20250210202220.GC3765641@nvidia.com> <20250211124943.GC3754072@nvidia.com> In-Reply-To: <20250211124943.GC3754072@nvidia.com> From: Pasha Tatashin Date: Tue, 11 Feb 2025 11:14:06 -0500 X-Gm-Features: AWEUYZnZrdGQlINhll4ZCmxy4_MiFjWVL9mBm_3F0LCmRscyspW8dY4HAyEeygc Message-ID: Subject: Re: [PATCH v4 05/14] kexec: Add Kexec HandOver (KHO) generation helpers To: Jason Gunthorpe Cc: Mike Rapoport , linux-kernel@vger.kernel.org, Alexander Graf , Andrew Morton , Andy Lutomirski , Anthony Yznaga , Arnd Bergmann , Ashish Kalra , Benjamin Herrenschmidt , Borislav Petkov , Catalin Marinas , Dave Hansen , David Woodhouse , Eric Biederman , Ingo Molnar , James Gowans , Jonathan Corbet , Krzysztof Kozlowski , Mark Rutland , Paolo Bonzini , "H. Peter Anvin" , Peter Zijlstra , Pratyush Yadav , Rob Herring , Rob Herring , Saravana Kannan , Stanislav Kinsburskii , Steven Rostedt , Thomas Gleixner , Tom Lendacky , Usama Arif , Will Deacon , devicetree@vger.kernel.org, kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 2DC18180013 X-Stat-Signature: kebxogxkohbog9g4cqtssyj6dmwtzcqj X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1739290484-699860 X-HE-Meta: U2FsdGVkX1939BHwzhQGPjIL0y92NotEOq5O7o3M3ib67j61J4AT6BpXMcbBA+qj7Q8h+ouZLnBLAEA71OGgZRv6+CV83TO38lFHN4WxLLAuNTrJyvV2TM4e7iLburlO4QQHJgbN6b/KSNalBahdXPYvO56k1FwB9SBNiTzxyMzEN8zOcSnfDRwtDxZ7vN5hMbbxDolzblDI0ySKuMaFW9eQIJewh09pxV5vopS6CmOV1EUa9LDM0e4yH6kyW/aK7QANBx9Eea1CnSmLjS4WXQOvXyQriVeAqcd0S/Nl6oxQBCMREfy7ExCVe06m8eF7uGUvUWKCR07VgizotGmtcNikM7yFhY8uWRq0IqSQtOv8DsiNCCWTtXLXRAGqJSaYBo3/NYwztxrQLklAO6lgY9PDPRsqe8IYu+cmUTBicA5dohvKFJIDxP4AA30Fc6sR+n9zdadDRHLBUp1TrNb4yFFE3cNkD3ZtU6OhzXh+3iyiipuQ7HskWfzwrQAzyKnEr+o8+i20R4yXmJj65YSFFbwIvXODytnvwghobnSxTuy+J2L2xa4JBpZyYrS/i4oNSSYcTcQB3F5XLFK+ERPDp5VjhB5ZER8nXGcGDDNThhYfMsxTWnTheARTpzRcxjTZCReoLTK8Q/1sBE1KW0NDGkutd0FSLVlpLrCMMZV7rgOyu0li380uaYmLLR8HQHNBRFQ9ywefENLp5Pbs01HEmz4iA9dmcJ+RFCmd+owL7V5n1v3uHs1RgntPUy6feP6oYcbFW5hvJYpJBz5u2WJVaKSHRZTUhbhhaO2hOTnWGwRUQo5hk1q8JWhYIIRs9LrKx/ZU8wYvcbK5Ym869AT2drxq3VRt1cvZdRPhUSNbDuZ90Hq0n0PvDPu6J2zqVZyrwIkNtJZeONEYPFjv62cZF2KfndkxR/R4Hp4tUnrmuyZeKF3U65PMfbf+W5eQ8mZbzzv6YhAlXk2+LxEo6ab gIsv48z+ Th1GCsx1xrIIq2Vd2nv0BP9W9QpeN7K4eklhr3awHMl9F0TsiSVrw5C3X4aUFNFezIbB9jyQyd4EhbhscuFSe55TAjT8U3IsgoHNj9kSt+leIT1ih8KGtvGOA7dxRCNWLPaXWoLnM53wZBx3FjBOsDO8kK8jGIdl00FL35L5tKSv1/GoZyaGTHA0KPejw5aBFv1UZ58+E8FpX3v2IE4+Jt/mMC3EG0MrJxovqoqORD/ZyzZGEUIpR7I44WV8LGqBg/712EYKFFbJCrPAkhllw4nNiLZ2AjktVRQoyHhH5UCQnJF0P6XtJzsnjbhewWt1LXdg6KiZlQ+kxbjILokEcUIl9GXUmTHM6MZslJjwc5b6FF4XoNk61l3K26Q== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, Feb 11, 2025 at 7:49=E2=80=AFAM Jason Gunthorpe wr= ote: > > On Mon, Feb 10, 2025 at 03:58:00PM -0500, Pasha Tatashin wrote: > > > > > > > +What: /sys/kernel/kho/dt_max > > > > +Date: December 2023 > > > > +Contact: Alexander Graf > > > > +Description: > > > > + KHO needs to allocate a buffer for the DT that gets > > > > + generated before it knows the final size. By default,= it > > > > + will allocate 10 MiB for it. You can write to this fi= le > > > > + to modify the size of that allocation. > > > > > > Seems gross, why can't it use a non-contiguous page list to generate > > > the FDT? :\ > > > > We will consider some of these ideas in the future version. I like the > > idea of using preserved memory to carry sparse KHO tree: i.e FDT over > > sparse memory, maybe use the anchor page to describe how it should be > > vmapped into a virtually contiguous tree in the next kernel? > > Yeah, but this is now permanent uAPI that has to be kept forever. I Agree, what I meant in the future patch version is before it gets merged. I should have been more clear. > think you should not add this when there are enough ideas on how to > completely avoid it. Thinking about it some more, I'm actually leaning towards keeping things as they are, instead of going with a sparse FDT. With a sparse KHO-tree, we'd be kinda trying to fix something that should be handled higher up. All userspace preservable memory (like emulated pmem with devdax/fsdax and also pstore for logging) can already survive cold reboots with modified firmware Google and Microsoft do this. Similarly, the firmware could give the kernel the KHO-tree (generated by firmware or from the previous kernel) to keep stuff like telemetry, oops messages, time stamps etc. KHO should not be considered explicitly as a mechanism to carry device serialization data, the KHO should be a standard and simple way to pass kernel data between reboots. The more complex state can be built on top of it, for example guestmemfs, could preserve terabytes of data and have only one node in the KHO tree. > > Jason