Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19618160rwd; Wed, 28 Jun 2023 11:40:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7mHpx0h6WazpajcqUd/79xTESOieD1pvKTe7vLi8acEhNOdZJiJHt4Wna6BY06uvL/47OI X-Received: by 2002:a17:903:22cf:b0:1b8:16c7:a786 with SMTP id y15-20020a17090322cf00b001b816c7a786mr8223956plg.4.1687977621666; Wed, 28 Jun 2023 11:40:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687977621; cv=none; d=google.com; s=arc-20160816; b=UAnEHRfKDQeRbJnffet//qSvw14mWSUHNixL5ZajRwW1/yyT9r9S5m9VZiY1iCX15L GHg3YziYM2GxSeirRhfQa3UppAkBIXdBoDMxkT39rZaw/u3piTmLwdVnVTax93uN5m7k xwWjUfyRDpP1B80ftDehBoXY5p9PPE5XwVm3ZRovYph12wL8iaIXdvNdUaXP3Zol5ndL 1P+XN0fxz16gbxfXf55GlsP6IrKo0vQeU4jWzLdPaYhvCgVA3hvhNW0uapAwerZqQewW yrqJGA7W/aZMw6UC6HdOdw8u34AvTLMywh03Nnf4GnW5Ea+09vNV2G3dXB8DDZNDKf9/ W7pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=xRSiq7Rafs7M34eS/OFYDfhULalnpTg/cuwzQtHQsco=; fh=HXZfgVHVJ3oTrJzinH9kZp4c+VmeQo77baCYhOIXqLs=; b=Av6+bs1BgxSufmj/qJF/jrQgAxyjM4xltv6sFWg+dzTga9tPsr5AskDb2qBluApj/S /GU/QOmUF1NwOcxqRV1COlndNvAFCdpDMfMOVnHLf4303PIM6aPTnHqsXJOOitbN3gFk mZv13TfCqk3AN+fqMPZ4Hv6bXcPxqrpXw4yIJfUG+la2IE4JJK/q+aJtH/NRZxXtEOhz 1upMQC0rEuN8zDcSXGZ9RzoPf0nrz8pu4L95nhU2OsyAEi2eYdERuqJeWE0ARa/0r4L4 TPP+UAWAbgl9wbUA/mYxFTkxz4jR/6E4iPIYmQAnTeYMMD2OV2zQkMYfQ854a2Fz7FaT JKcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=PI7udsyR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k8-20020a170902c40800b001b0163c9715si10270725plk.318.2023.06.28.11.40.08; Wed, 28 Jun 2023 11:40:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=PI7udsyR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231520AbjF1SLs (ORCPT + 99 others); Wed, 28 Jun 2023 14:11:48 -0400 Received: from fanzine2.igalia.com ([213.97.179.56]:48490 "EHLO fanzine2.igalia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231454AbjF1SLj (ORCPT ); Wed, 28 Jun 2023 14:11:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=xRSiq7Rafs7M34eS/OFYDfhULalnpTg/cuwzQtHQsco=; b=PI7udsyRTWNT8t+lHm0W16OI4g J97xeLtgbkhh1mHAe5gwSWFMp86rdK/uaIbJTtcZ+mOeqVutW0fIhcFbUqNF6P3r3Cjf0XFeXxcUS YzTOHvSu5ktbw+xBeHhcls4xox+GNOBN+OEvQAaUQetZW+0bRHaZvGvTqx4vhtH2QwoUJ7/18MKti 48n6AqfUMNXP8P44ZCU1sX6qPX+a1Y6WofIysKnLTPbOZpQ5e+pMxTYr1ylDgq70sq6FsTo8GqPFd jhybfi4Xdj8YZ9JC81fQrNswIIYN6++urXGn4BxDkF5s9vpYBLwnIBwHdydNW7BucOU8Frzc9t8e0 3Ci83m7Q==; Received: from [179.232.147.2] (helo=[192.168.0.5]) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_128_GCM:128) (Exim) id 1qEZdd-005N4W-0I; Wed, 28 Jun 2023 20:11:33 +0200 Message-ID: <28718037-ccf1-c36b-4eb6-716c518ca98f@igalia.com> Date: Wed, 28 Jun 2023 15:12:10 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH] pstore: ramoops: support pmsg size larger than kmalloc limitation Content-Language: en-US To: Yuxiao Zhang Cc: Kees Cook , Greg KH , Tony Luck , linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, wak@google.com References: <2023062832-barrier-strenuous-9499@gregkh> <20230628171055.1312737-1-yuxiaozhang@google.com> From: "Guilherme G. Piccoli" In-Reply-To: <20230628171055.1312737-1-yuxiaozhang@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/06/2023 19:10, Yuxiao Zhang wrote: > Thanks for reviewing the patch. > > On 28 Jun 2023 07:30:16 +0200, Greg KH wrote: >> What is that max size? > > The max size is arch dependent, it should be 2^(PAGE_SIZE+MAX_ORDER). In our environment it is 4M. > >> what in-kernel user is hitting this in the pstore implementation? > > We are trying to use pmsg to hold a core dump file, so we have pmsg-size=32M and thus hit this issue. > > Other than us, here is one I found that trying to save dmesg beyond kmalloc limitaton: > https://lore.kernel.org/lkml/b2d66d9f-15a6-415c-2485-44649027a1d5@igalia.com/T/ Hi Yuxiao Zhang, thanks for the improvement! And also, thanks for mentioning the thread above - I tested your patch today and was soon to write you this message heh So, first of all, the patch works for the Steam Deck case - kernel 6.4 with or without your patch behaved the same, i.e., pstore/ramoops worked and it was possible to collect the dmesg. But when I tried to increase the record size in ramoops, I got this error: https://termbin.com/b12e This is the same error as mentioned in the thread above. And it happens when I try to bump the record size to 4MB, the biggest working value is still 2MB. Maybe a missing spot, which remained using kmalloc() instead of the virtual variant? Also - Kees certainly knows that way better, but - are we 100% sure that the region for pstore can be non-contiguous? For some reason, I always thought this was a requirement - grepping the code, I found this (wrong?) comment: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/pstore/zone.c#n3 Cheers, Guilherme