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 1F24ED6DDEC for ; Fri, 15 Nov 2024 09:49:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 78DD96B0089; Fri, 15 Nov 2024 04:49:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 73E3C6B008A; Fri, 15 Nov 2024 04:49:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 62D396B008C; Fri, 15 Nov 2024 04:49:10 -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 478FE6B0089 for ; Fri, 15 Nov 2024 04:49:10 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id E6AE881529 for ; Fri, 15 Nov 2024 09:49:09 +0000 (UTC) X-FDA: 82787854968.15.B77686D Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf14.hostedemail.com (Postfix) with ESMTP id DD8F0100004 for ; Fri, 15 Nov 2024 09:48:17 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=GboblNsl; spf=pass (imf14.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1731663910; 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=e5/Gv1K21sheGKIrlLPLsT5HVFSu0SIwMyx7mgZQnuI=; b=8jX1FZPR6FbJjRAZ6d6VVU3K/y2M7Gkh8+U8ktA8AwYpgr8+FmhtSAXwfBlmhv6+fmKMzY pqZrF/TKDJ+FKYQSyIdFr/QWs2FtbTxOQawWkheRuAwd7yMIQykw3craumW87MVIVVapsx uNIhtNIPX9NsXuyCBjsk7W2dF0Z1OYk= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=GboblNsl; spf=pass (imf14.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731663910; a=rsa-sha256; cv=none; b=XzOFZBlZpuDLfp74p8RnDauU6mn2/huLTg92Fx6FS4PEsoP8N5N4xs+tQaW69MGKEP50Ej b5j9dkYjMrgBbegj2FFCLxRGVXD9NmzsflqQczkZ2k7oMsVDaU9EUcaGAewI/Jr4q77d6d nuXctUlNsKgNJzwU+hegocMKsyc2Y6Y= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731664147; 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=e5/Gv1K21sheGKIrlLPLsT5HVFSu0SIwMyx7mgZQnuI=; b=GboblNslEO9AJtSq4jN//JCSaiCO6lHIOmgGANpzVQz13xa+fL8NuTeEzFPjQ5xeakAmEi vfLm7yhCgQ9mTznl+JOFc19QpjGLwsG0XUpY8ozW1ZVlupk1F0Y2pMLqYTpWFNWw06JaCl ppiqsS6vL5JkKNQGVuLIU+ANGi0FA9E= Received: from mx-prod-mc-05.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-348-YdO3XG1bNzqs4Bb4j1wJcg-1; Fri, 15 Nov 2024 04:49:02 -0500 X-MC-Unique: YdO3XG1bNzqs4Bb4j1wJcg-1 X-Mimecast-MFC-AGG-ID: YdO3XG1bNzqs4Bb4j1wJcg Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DE9CB1955E92; Fri, 15 Nov 2024 09:48:59 +0000 (UTC) Received: from localhost (unknown [10.72.113.10]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3935D3003B71; Fri, 15 Nov 2024 09:48:58 +0000 (UTC) Date: Fri, 15 Nov 2024 17:48:53 +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: X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: DD8F0100004 X-Stat-Signature: jdixz688x9x7jrheuyfr3rhmak4o9ey6 X-Rspam-User: X-HE-Tag: 1731664097-189786 X-HE-Meta: U2FsdGVkX1+HUqdY5ymT7Eqc3SBXNBDN5XY+SkBjI0fhxvbJG/vOvr81TARL25bkZ5PZDP8nwpQaoM0r+sxXw9YavZIan81NsjQDGtwRWDwZmdQx9ffsEFeavgOJlTh0uU016KUHk+8AruvcaOKkCr+fd0ey7c2SLbgYF8PqwgwW6pwkHkTRpjsWE9Q3QFayufQDGON2c/72xhe7OogX4P5Jrgnbv7yaKTP5lqfvq8CT+4bTWFqGPJR3kw9lLk2svKwcaR4vOa+uUTPddNWU4HdGX5zxWoNRowVz5AiNxyoyI8EMeRyUh0H8pElNUm+YvyGbOTIXhz/tssR5OEDjMniGvok1VbdbXwG77UxBSrtzdRJD/BJtB0i0J+I1xDUlEf/22rbcmh+ypr23MXSjWRhO7yy9Db/vkLV/ivgGc4WtsyMW8fF+ImpBzFA/efS0BGNIwi3mVYYMsPYmuYk/eBmJvDObGIqTrUWnjMSBQz2nQGSEJ7Prl+XLXY5S1boJbdPP+T2ZhuhgKpELVTWR5H7J3GJUaN7vay03xomPx4BGqBrDXIy5N9nztywnjD6Rucal8PAMKCU2BTvqdN9oH1U6ApP4nEFNFXgclzhpcx5YflrjFpS3OwY7rtjs6rYDz89bUJN2+xoRnDbo9JgTKO7TiyHXmqedSH1nOj0+jDvuqdKz0x4lucgS8I53I03ZnB5O+nESFX35iDg8DwvS7zEsfnwG0JQrf/1F6mY+viJHpJRuWGU/eEH3qWJQfKWsoP5NqPdpdcmcQbkdoy08EoX61LwXfcIi3hLdtvuwQc9RygbqMGvJOgeYtyd+vJfzV55Fk7kxwC5Y4Scfu9Dzj5wHGmRScXx9Tetp6P0Spmg9JHgjb/HPTCNnH07sqS1ycaOJ0Neq//3zLnnE8nmEo1lWnFYfjD5nBlTi6GXThjGkSH9f+hlI1LRsFm+8ni3ZBeLPutigGBCbRXWMWOr P4+9+YqH zusuMuqs7RfKq6lGtCcPte6+/QoO9/+AUb0pVsb6VwTKQ5zA1hQ3Q4nAtIr7Ua6GRXNlrMYMVtGiagnrY47e6E05AKRrGfAxo3o0dlQI9I8GMrJRPuA1yw9Fi/qWdRuLt9h1CcP0I6OXi/g+D0HzytZvn+INa1gg3l42T7Dk84mQQgcqXEh7Ff52r8os7uYZc7gZWcAVnKnIyoClqGzO6F2qwiG8AhAEfKNTX3gg5tl6D9zzWVcbdpmz1FmnsFaDPe2rkypSW4oWZ/CQwRnialBlUiuaSwZjoNFxYJY10hbj79VOrogQi5ZtGoLaSwXG3a8dUHBUqyhSPxl9bQC+/K/KBZJ+0+Nb6UDfw 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 11/15/24 at 09:55am, David Hildenbrand wrote: > On 15.11.24 09:46, Baoquan He wrote: > > 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 > > ~~~~~~~~~~~ > > Is it 1st kernel or 2nd kernel? > > Usually we call the 1st kernel as panicked kernel, crashed kernel, the > > 2nd kernel as kdump kernel. > > It should have been called "kdump (2nd) kernel" here indeed. > > > > 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(). > > > > Do you mean on s390 virtio-mem memory region will be detected and added > > to vmcore in kdump kernel when virtio-mem driver is initialized? Not > > sure if I understand it correctly. > > Yes exactly. In the kdump kernel, the driver gets probed and registers the > vmcore callbacks. From there, we detect and add the device regions. I see now, thanks for your confirmation.