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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E4C8DCD4853 for ; Wed, 4 Sep 2024 16:21:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=xl9OFEGHv/NnJV6t3N2+FJgcaTrzIOL29rIydDulUSQ=; b=X9iAxFZ7LSmVrm OQ07EJ7QdO7GjkNZ1ngF4CF3HSrS2Q2rqytFpd4TY4QIaSaBGOA2DOseJeY1sXvxp3F9Wt1t/E0cV 5mANpwdnAgA5bf/AjEi3/cnqaocLnQcFlE+eKyhg0i+YdDc/qdFOidNLKSXRW+HDJphrQLELZzczO u19+JSzz78PNYaMBCLrVQk0dWdQ7iktLvEszLQS+icCJBu/2o1/4CA0Ku1cU7Xt4XEMMUXTSosDrq AsRKEpSQNGAl9r8EfPO4OJzZAZxWWgNtqFAPFA+n4xOMOnw16yWSzOkWt5lsigumuw0DEVo/QykI3 aPOtWc7ZEvLpSOvNyKlg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1slskt-00000005ENp-4AVO; Wed, 04 Sep 2024 16:21:15 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1slsew-00000005CjX-1YSN for kexec@lists.infradead.org; Wed, 04 Sep 2024 16:15:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725466502; 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: content-transfer-encoding:content-transfer-encoding; bh=KK5Q7TcRYNriWPROIO4QCaX8WCGFpWsvSEQyOHbxztQ=; b=Kc7XQV3g0YQjMYwqXnEG3MQ7q1uIafR26TioSvpXdtBqtlDBYqwPkc/Qalf12ZQuHpHznc bGmF5r+qg19mOPlfky7HoDVMPWBrmZ1V5jQXY8bwTx2nEbPZClWRwaOpH+TtqNejcZyXuh cQ7Zh5ZFkWSY85RMuqveueqFTGcRLGA= 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-607-nnH2wrxgNbaL0bQJd94QCg-1; Wed, 04 Sep 2024 12:13:25 -0400 X-MC-Unique: nnH2wrxgNbaL0bQJd94QCg-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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 8253F190A357; Wed, 4 Sep 2024 16:13:12 +0000 (UTC) Received: from rotkaeppchen (unknown [10.39.194.86]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9B0961955F44; Wed, 4 Sep 2024 16:13:02 +0000 (UTC) Date: Wed, 4 Sep 2024 18:12:59 +0200 From: Philipp Rudo To: Alexander Gordeev Cc: Masamitsu Yamazaki , Kazuhito Hagio , kexec@lists.infradead.org Subject: [RFA] makedumpfile: fix access to os_info for /proc/kcore Message-ID: <20240904181259.1bb5483e@rotkaeppchen> Organization: Red Hat inc. MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240904_091506_534458_A52E7AA7 X-CRM114-Status: GOOD ( 11.99 ) X-BeenThere: kexec@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+kexec=archiver.kernel.org@lists.infradead.org Hi Alex, our QE found a problem when trying to run makedumpfile with /proc/kcore on s390. For example # makedumpfile --mem-usage /proc/kcore s390x_init_vm: Can't get s390x os_info ptr. The exact options passed to makedumpfile don't matter. The error is always the same. Trying the same on a dump file created from /proc/vmcore works fine. As the function in question was introduced with you commit 6f8325d ("[PATCH v2 2/2] s390x: uncouple virtual and physical address spaces") I'm reaching out to you. Looking at /proc/kcore with crash I noticed that abs_lowcore->os_info (aka. address 0xe18) is zero. Hence the check if (!readmem(PADDR, S390X_LC_OS_INFO, &addr, sizeof(addr)) || !addr) { ERRMSG("Can't get s390x os_info ptr.\n"); return FALSE; } at the beginning of s390x_init_vm fails. My theory is that when trying to access the absolute lowcore via /proc/kcore the read gets prefixed and thus ends up in the per-cpu lowcore. As the os_info field isn't set in the per-cpu lowcore the read returns 0, triggering the error. I played around with crash trying to access the absolute lowcore via __abs_lowcore and lowcore_ptr but failed. I always ended up in the per-cpu lowcore. I also tried to get the address of os_info from the dwarf information but that only returnes a virtual address which cannot be used in the function that sets up vm... Any idea how this problem could be fixed? Thanks Philipp P.S. While looking at the function I found one nit. Right after the check mentioned above there's an other check for if (addr == 0) return TRUE; which can never be true as the !addr from above already handles this case. _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec