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 779A9D11183 for ; Mon, 4 Nov 2024 06:21:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C49A76B007B; Mon, 4 Nov 2024 01:21:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BFB456B0082; Mon, 4 Nov 2024 01:21:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AC1076B0083; Mon, 4 Nov 2024 01:21:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 8F0146B007B for ; Mon, 4 Nov 2024 01:21:23 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 1FCA71208F7 for ; Mon, 4 Nov 2024 06:21:23 +0000 (UTC) X-FDA: 82747414050.01.036817D Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf06.hostedemail.com (Postfix) with ESMTP id CB81A180007 for ; Mon, 4 Nov 2024 06:20:58 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=C5nfLtGx; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf06.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1730701223; a=rsa-sha256; cv=none; b=8HwUBCJNZaR5xre1A1/3E3bdLZRQn2Tt/wbdtxm6I5EC1+jhKi+/hqa95lA3wOVZIUVlSN h5UFsEMF0V8OHy19PybxFs7GBHM4LMR8+3lgcAE5woLrKZN0foUeYQphWuIVje2PVIhojk h4O65Ul3TEuVnx7GCXgh+yJUbB7BUHk= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=C5nfLtGx; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf06.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1730701223; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=/Yt6e01JiHs6xDUFc4KUXQd8i1elq2u0nXKuucFyQGQ=; b=i9fe3/7RKc5ulmy6q7wCzKasT5fGlmNEN4omQRN8kbLol7Fsfi0ju8YWGYlWz/80jApAIx n9n+sfji/eoQ1zUKAewMs3sQJAOHDxJ5U2V64pqFwS6mp8nCquSu8xetlH4KCdep0LgWzJ jtA8q9S+cBas1yVkPEeA029dB2ZaHDs= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730701280; 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=/Yt6e01JiHs6xDUFc4KUXQd8i1elq2u0nXKuucFyQGQ=; b=C5nfLtGxsFHw+kCR4Io+aPSPNXA28rScFPcj4q+oa91Snmr4y5FMvfG5XImTGPkgV284JT R2hJCqOCUjttUjZ1atgBQDsfMDmc/EIuH6Mxc2tznvZ7+0EjoPn4yht0UtiY2Z95kcWiA6 2f6EQdmcR1PKOeUcYq613TEbo3rqZMQ= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-49-b2Wj_TLPNE6Ox6N8IQMnvg-1; Mon, 04 Nov 2024 01:21:16 -0500 X-MC-Unique: b2Wj_TLPNE6Ox6N8IQMnvg-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A026619560B4; Mon, 4 Nov 2024 06:21:13 +0000 (UTC) Received: from localhost (unknown [10.72.112.78]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DA7C11956052; Mon, 4 Nov 2024 06:21:10 +0000 (UTC) Date: Mon, 4 Nov 2024 14:21:06 +0800 From: Baoquan He To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-s390@vger.kernel.org, virtualization@lists.linux.dev, kvm@vger.kernel.org, linux-fsdevel@vger.kernel.org, kexec@lists.infradead.org, Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , "Michael S. Tsirkin" , Jason Wang , Xuan Zhuo , Eugenio =?iso-8859-1?Q?P=E9rez?= , Vivek Goyal , Dave Young , Thomas Huth , Cornelia Huck , Janosch Frank , Claudio Imbrenda , Eric Farman , Andrew Morton Subject: Re: [PATCH v1 00/11] fs/proc/vmcore: kdump support for virtio-mem on s390 Message-ID: References: <20241025151134.1275575-1-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241025151134.1275575-1-david@redhat.com> X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Rspam-User: X-Rspamd-Queue-Id: CB81A180007 X-Rspamd-Server: rspam01 X-Stat-Signature: 7tjbird7y87bsac1damnicad9p4hppmh X-HE-Tag: 1730701258-910579 X-HE-Meta: U2FsdGVkX18AfQu6Ner2X/kBP13d5P/SD1boIgQRLh1faiyvIqvEIjD7Zg/G4CJ6ZqhoVwVJMwDB/hC17779O4lJDFJr56xk2uanxy8W7Tq56R295EtiGVUsZK/gINipnNLUfz7+HIBFMDVkFQSez+BgqJXQo7DTLS+3BjcUkD6TPZ/DSnhqEkn+MPCnLHX9tlbZfOzsj/W3ObYnIlCvnzC6LF6splbSWRO28jSIxVctr3/iH0b3jluhGNuuCU6pr0neMahqcEjiJrJxhd0W1hx/+4iUM7Q3gFw2e+QzWzn/cYLPJF8mGXmDgp6qKGybwjW62KPtsMDtRTlvEvq9wqo7U6c9jTnFUOyhA6KbIR9emswXqzeIl09pW4PSWKGb4TujW0IKbSHbSXR4L/711l2Uhk9I5C1g78ttgj4jJpVdR7ja+ZjL4LOnaEv9G54pWWv36PkBTxUV1l0PN5EL1EsH2QFiy77donSpuTZiCQQxREh1QP997aPZFC3Nw7o+XBcQKn1SViZA56Dff2K8QRA34cbvyik8MxH7jnP+pIWO8Sn88QC/FpTpazUnCCXx9TkWldABjGOxt1MY6WAb3jgWFk+V6csdoK6oDy5GPEda5icry2toVlpGFM0YIHJ3Ifv1NNeYy5uZS6TCniL/tYJc9M9GKUsOnubWLd/KQ7H5WIFI6N5ZqD5czF/dqKaAyCmFfUMSktfdULRqZ+eZ11N/BFOlhbgsq5g0OolorvKJ9dvUufTFZOhFrJxvE6wAyUs79yW4MzOhK33C0i60oiEGQgiYDXuMibBL9kKPwyFJl8qKI+DKBXk5WHjx+FNlc0l7KyAD/o5M0vEn8TL2j/CMoKClOfKz9M2+JzfPQL4OmnrfcRzebEQhr7TTczTV9xuiVXSdbxkoZ4RgvWS3ybpoTn1fJGAX0KZ8ypIKWYCmQQDb620iUQTH8UM3VFJHYmDX397mqZr6fIgN3sY HJeNSo/H TSAXjWefeI5lRkPGfF9wYlDqBGAOxnxi4V1Zxj6sUDjshWbQpel2IXq+NOaZEwe02zNPdfXazyRny75Pw3AH72VGgjggXN+ORy1uXZ9oaS6cTwjWYaqrnO0xBve2Bou6Mw9ey1jJ7vcSUM5G0qFF2eLZoTbz7LZiqAuRqe6SMAMUFn1DYeYdjLMWT6vYenyOE5G30FCLtlUEmF4xkGpCu11TPLH0ZVsqxrMEwmyG6py1kQEcyFcwncKFhtmr8dCahK2t232aKgMN9wejsse69DSO+forvdzgLGrGCJw9+zaxo1sDWYlq7lyI+AJu53g50QS3gYnob/16arvPqA3s2rsMnOOVM+dX5l4Hn 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 10/25/24 at 05:11pm, David Hildenbrand wrote: > This is based on "[PATCH v3 0/7] virtio-mem: s390 support" [1], which adds > virtio-mem support on s390. > > The only "different than everything else" thing about virtio-mem on s390 > is kdump: The crash (2nd) kernel allocates+prepares the elfcore hdr > during fs_init()->vmcore_init()->elfcorehdr_alloc(). Consequently, the > crash kernel must detect memory ranges of the crashed/panicked kernel to > include via PT_LOAD in the vmcore. > > On other architectures, all RAM regions (boot + hotplugged) can easily be > observed on the old (to crash) kernel (e.g., using /proc/iomem) to create > the elfcore hdr. > > On s390, information about "ordinary" memory (heh, "storage") can be > obtained by querying the hypervisor/ultravisor via SCLP/diag260, and > that information is stored early during boot in the "physmem" memblock > data structure. > > But virtio-mem memory is always detected by as device driver, which is > usually build as a module. So in the crash kernel, this memory can only be > properly detected once the virtio-mem driver started up. > > The virtio-mem driver already supports the "kdump mode", where it won't > hotplug any memory but instead queries the device to implement the > pfn_is_ram() callback, to avoid reading unplugged memory holes when reading > the vmcore. > > With this series, if the virtio-mem driver is included in the kdump > initrd -- which dracut already takes care of under Fedora/RHEL -- it will > now detect the device RAM ranges on s390 once it probes the devices, to add > them to the vmcore using the same callback mechanism we already have for > pfn_is_ram(). > > To add these device RAM ranges to the vmcore ("patch the vmcore"), we will > add new PT_LOAD entries that describe these memory ranges, and update > all offsets vmcore size so it is all consistent. > > Note that makedumfile is shaky with v6.12-rcX, I made the "obvious" things > (e.g., free page detection) work again while testing as documented in [2]. > > Creating the dumps using makedumpfile seems to work fine, and the > dump regions (PT_LOAD) are as expected. I yet have to check in more detail > if the created dumps are good (IOW, the right memory was dumped, but it > looks like makedumpfile reads the right memory when interpreting the > kernel data structures, which is promising). > > Patch #1 -- #6 are vmcore preparations and cleanups Thanks for CC-ing me, I will review the patch 1-6, vmcore part next week.