From nobody Wed Nov 27 09:55:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1699531555; cv=none; d=zohomail.com; s=zohoarc; b=Qy2JK4adH1eXx/RagLWhq8c9dO6r3EMGJD0tcaWMLZaIrxASaX9wjoXqQr50vH2W7xaqU+65TLFKvFLIVSXVIFLHgyznL4Gh1Sqntw+Ntbgc/h+r6lRMcNvUXuqlgkHy+xjN2+o7XSse7YX1t2JM8fxtzu1HEQuSeClCMd/z8Wo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699531555; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=RPIFRsyhinFNvqnbr2d6wZNBquqGfrU0XeHbSZix9NQ=; b=FVqoEemJICZs5OIKwztH5W8L7HBzKpqasjAYpp2ZSoyGC9S+wfVaPUcC/kHdhBPn3bjffKuSm5jt2t0J1gyRyDQs4SX68RRFEpRmli8bUbwLYfw1ETegtXNb6GWPA7G19IesR7+37vSxPBoEhZVYRYd185rrij3Y4lsT1aCgCCo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1699531555443435.13360892434775; Thu, 9 Nov 2023 04:05:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r13mf-00055Q-Op; Thu, 09 Nov 2023 07:05:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r13mT-0004ZB-VB; Thu, 09 Nov 2023 07:05:09 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r13mM-0002WH-5y; Thu, 09 Nov 2023 07:05:02 -0500 Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A9Bwtf9030822; Thu, 9 Nov 2023 12:04:54 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3u8xr6rxxs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Nov 2023 12:04:53 +0000 Received: from m0353725.ppops.net (m0353725.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3A9C1H0B012143; Thu, 9 Nov 2023 12:04:53 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3u8xr6rxxg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Nov 2023 12:04:53 +0000 Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3A9B4FxS019248; Thu, 9 Nov 2023 12:04:52 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3u7w243htn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Nov 2023 12:04:52 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3A9C4oax46400168 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 9 Nov 2023 12:04:50 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BD06220049; Thu, 9 Nov 2023 12:04:50 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8E2DF2004D; Thu, 9 Nov 2023 12:04:50 +0000 (GMT) Received: from a46lp67.. (unknown [9.152.108.100]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 9 Nov 2023 12:04:50 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pp1; bh=RPIFRsyhinFNvqnbr2d6wZNBquqGfrU0XeHbSZix9NQ=; b=kIXANLK7qeJ3ywTGuJo/tslbn4uoPXwBa2eiT02J8r07cnLOOphxuAgV73xBI2L1sOm8 ZDchEENNiWnpF4n+kv5UuMvA0QAMz5gkpTrzRt2yuz4J6FhdcUgsXwcbXY6MhFxBZZJI XJkLRpiXSNeGAT2Iua3DtoaZiZtiSydD5qvw0C5PLQtDrjglYzNuZsEtiedQcN3Ewwwc 4/LeclNrCIWv/we2t8m6MfHuC7hhWbAL6iyej78hYhD/q75UXZgCYmC5BLIX0hHsm9Aj mCHfynuTj/POM8jdmmgrG/Y04CFAT0t59w9dT5wKW4CC4QgRWS4kA8TjKGNStPtURVnN ZQ== From: Janosch Frank To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, marcandre.lureau@redhat.com, thuth@redhat.com, imbrenda@linux.ibm.com Subject: [PATCH v2 1/3] target/s390x/dump: Remove unneeded dump info function pointer init Date: Thu, 9 Nov 2023 12:04:41 +0000 Message-Id: <20231109120443.185979-2-frankja@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231109120443.185979-1-frankja@linux.ibm.com> References: <20231109120443.185979-1-frankja@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: B5JyoDSr4S2lDWubvXrKhuHhNtf0YqLu X-Proofpoint-GUID: Cs3gKGF0K3EqrvYju2vj4UHXwCrUAeVc X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-09_10,2023-11-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 phishscore=0 suspectscore=0 mlxscore=0 lowpriorityscore=0 priorityscore=1501 malwarescore=0 impostorscore=0 bulkscore=0 clxscore=1015 mlxlogscore=542 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311090089 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=148.163.158.5; envelope-from=frankja@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1699531557347100003 dump_state_prepare() now sets the function pointers to NULL so we only need to touch them if we're going to use them. Signed-off-by: Janosch Frank Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Thomas Huth --- target/s390x/arch_dump.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/target/s390x/arch_dump.c b/target/s390x/arch_dump.c index 51a2116515..bdb0bfa0e7 100644 --- a/target/s390x/arch_dump.c +++ b/target/s390x/arch_dump.c @@ -448,10 +448,6 @@ int cpu_get_dump_info(ArchDumpInfo *info, info->arch_sections_add_fn =3D *arch_sections_add; info->arch_sections_write_hdr_fn =3D *arch_sections_write_hdr; info->arch_sections_write_fn =3D *arch_sections_write; - } else { - info->arch_sections_add_fn =3D NULL; - info->arch_sections_write_hdr_fn =3D NULL; - info->arch_sections_write_fn =3D NULL; } return 0; } --=20 2.34.1 From nobody Wed Nov 27 09:55:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1699531559; cv=none; d=zohomail.com; s=zohoarc; b=UyHaO+rZA+aioQKBY+b3UmMxO6q3J+0ZCfqn7bwH1zAWP4wZc42CGRhQZl6WawJrZYymFxUrZB1W6tVX84kY+TauEizJaOsOlD74UHTZIQd3NXfs2YfMD9KBMTd7Ogs/U1wExTCyExg/0jNOVesahtbDPgksGqVhT+ndFhceeEo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699531559; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Pm6zNoxgAtph0avcGykXQsEHPA+dJ2pIBItVsC+q7fc=; b=Eb0uLamyaI4yu9llqfN2Yiw+62gYl0v/0z7YLSfVV0JckddFk9g8hZ8L/RLGXDipVvkqGFIluK84ZKw4u0oNyRbd6TSdeO1pkMGJvfxwZiBpAzTV7bkwpg8atMubGnlKBeJhcCVC7yi1rckKWAQyOAoFRmRWLHrMcNmBXNzmMb8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1699531559156931.5248971392932; Thu, 9 Nov 2023 04:05:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r13mj-0005Si-8j; Thu, 09 Nov 2023 07:05:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r13mO-0004WS-FK; Thu, 09 Nov 2023 07:05:07 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r13mM-0002WN-5u; Thu, 09 Nov 2023 07:05:00 -0500 Received: from pps.filterd (m0353723.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A9BsprU018309; Thu, 9 Nov 2023 12:04:54 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3u8xyd0cqg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Nov 2023 12:04:54 +0000 Received: from m0353723.ppops.net (m0353723.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3A9BtEMm019926; Thu, 9 Nov 2023 12:04:53 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3u8xyd0cq8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Nov 2023 12:04:53 +0000 Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3A9B12pd028310; Thu, 9 Nov 2023 12:04:53 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3u7w22kk7g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Nov 2023 12:04:52 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3A9C4pUl13501168 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 9 Nov 2023 12:04:51 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F3E7D20040; Thu, 9 Nov 2023 12:04:50 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C499A2004B; Thu, 9 Nov 2023 12:04:50 +0000 (GMT) Received: from a46lp67.. (unknown [9.152.108.100]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 9 Nov 2023 12:04:50 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=Pm6zNoxgAtph0avcGykXQsEHPA+dJ2pIBItVsC+q7fc=; b=FBr/mwS7/96VUSk+0UNyr4DPqcLH9LNodgk0SAJ2Ri/+5AVelOWePCFOefdDOhvKNAkm TvgxL4UBFYhOyv3W/Ki8HtE1wxr0DKRjWJOlvJury0TTnf7k5B3eAdeg2Za6ulWq/vuB AkPRgJk8ABuP/eoSMT+HgXpTK20L72poD0nVMh/px+sjEGRKA53jeUD4uMT7tdQ/ssXR W4taeNqKdsCvzBXI42B76B/0fFz7crHCQA6vvVoJH9EejM+H+RgeuoQYvV+SIPOqM8Pj nhztKqT7jjvPYJHMuUj8DgLl21nUFaSPZPmU+kPuHxnGfqrAxNjPssp0B/c0CqWEMgLV VQ== From: Janosch Frank To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, marcandre.lureau@redhat.com, thuth@redhat.com, imbrenda@linux.ibm.com Subject: [PATCH v2 2/3] dump: Add arch cleanup function Date: Thu, 9 Nov 2023 12:04:42 +0000 Message-Id: <20231109120443.185979-3-frankja@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231109120443.185979-1-frankja@linux.ibm.com> References: <20231109120443.185979-1-frankja@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: nO6g0Sx6On8ED3Js7PDM8g8QS5jDaDO0 X-Proofpoint-ORIG-GUID: XmTniXYMAhcV2XJ4pxyZjnzzjZkyxp9N X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-09_10,2023-11-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 bulkscore=0 mlxlogscore=572 adultscore=0 lowpriorityscore=0 phishscore=0 priorityscore=1501 impostorscore=0 malwarescore=0 mlxscore=0 suspectscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311090089 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=148.163.158.5; envelope-from=frankja@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1699531559365100005 Content-Type: text/plain; charset="utf-8" Some architectures (s390x) need to cleanup after a failed dump to be able to continue to run the vm. Add a cleanup function pointer and call it if it's set. Signed-off-by: Janosch Frank Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Thomas Huth --- dump/dump.c | 4 ++++ include/sysemu/dump-arch.h | 1 + 2 files changed, 5 insertions(+) diff --git a/dump/dump.c b/dump/dump.c index d355ada62e..9eeb7ab453 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -96,6 +96,10 @@ uint64_t cpu_to_dump64(DumpState *s, uint64_t val) =20 static int dump_cleanup(DumpState *s) { + if (s->dump_info.arch_cleanup_fn) { + s->dump_info.arch_cleanup_fn(s); + } + guest_phys_blocks_free(&s->guest_phys_blocks); memory_mapping_list_free(&s->list); close(s->fd); diff --git a/include/sysemu/dump-arch.h b/include/sysemu/dump-arch.h index 59bbc9be38..743916e46c 100644 --- a/include/sysemu/dump-arch.h +++ b/include/sysemu/dump-arch.h @@ -24,6 +24,7 @@ typedef struct ArchDumpInfo { void (*arch_sections_add_fn)(DumpState *s); uint64_t (*arch_sections_write_hdr_fn)(DumpState *s, uint8_t *buff); int (*arch_sections_write_fn)(DumpState *s, uint8_t *buff); + void (*arch_cleanup_fn)(DumpState *s); } ArchDumpInfo; =20 struct GuestPhysBlockList; /* memory_mapping.h */ --=20 2.34.1 From nobody Wed Nov 27 09:55:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1699531530; cv=none; d=zohomail.com; s=zohoarc; b=mZTw+Q8ciB0easGMEai/Uung0Zq90GLJ0SL5xX3yQY1fXvIcZcQv3zTvYtEeHAuX/vIRjuOZorkyB3xe20LktRR4DT1c0UtnFXbOCBVWVjJ2GJtNUBVbEWeoNsFDV1vSgiB4fmrKIXPALGD84VKA21Z5w2EKpFLxmvW3Fz8uk/o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699531530; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0lQy95n5WPkpSfzDoVeg/I1Cmtx5niSWs63LQGRbx10=; b=GL01LwT2Pp9pPKGYKqQ/U1eqBcKciPq+629B0J/Kl8R2PadiAayBnvXc6nTLHYrRC5Tsh4hFnlpV9DgmxxVhKlZBrMHNO8FsVf61qIJXCejj7DwZkhhtVHwzy0g0FUj8IDJwnW5VbvLyY49pDJucSioQyCG+NbaISAjs5Y0y97M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1699531530240123.9344575313055; Thu, 9 Nov 2023 04:05:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r13me-0004xk-93; Thu, 09 Nov 2023 07:05:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r13mQ-0004Xs-36; Thu, 09 Nov 2023 07:05:07 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r13mL-0002WP-SC; Thu, 09 Nov 2023 07:05:01 -0500 Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A9C09ic012176; Thu, 9 Nov 2023 12:04:54 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3u8y1x05by-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Nov 2023 12:04:54 +0000 Received: from m0353724.ppops.net (m0353724.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3A9C1S9D019682; Thu, 9 Nov 2023 12:04:53 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3u8y1x05bp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Nov 2023 12:04:53 +0000 Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3A9BV2ZW019429; Thu, 9 Nov 2023 12:04:52 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3u7w243htp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Nov 2023 12:04:52 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3A9C4pRu13501170 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 9 Nov 2023 12:04:51 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2A19F20040; Thu, 9 Nov 2023 12:04:51 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 05C4120049; Thu, 9 Nov 2023 12:04:51 +0000 (GMT) Received: from a46lp67.. (unknown [9.152.108.100]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 9 Nov 2023 12:04:50 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=0lQy95n5WPkpSfzDoVeg/I1Cmtx5niSWs63LQGRbx10=; b=M6KsZbraa20r0qD4gfXtmTeGb4U7qDNtbohnHVV7cXkSHVfdk4FKVFgoNrtY0ujRV5cn lK14bJGxyz196tytR6kC9lNN5dkXpqDus9kZ4AFhsnnRUp90YW+8hANVxP0MgFt+fQh4 90X2X9t3Jp8PZ6iuUJR0JZA9B5WcgQlSo3uH7YkFdwftBmFsiI/FbJrcI1s4S0A+sGIg mgEHJQZc12kWEGOVCFM4dFEGPMTcSFd1HoqdFeHjws2C2PlP2c01UAuVL04JmCkJbS9B vOm0XfWpdIf1VjhKngdmStyEfDbUeiQNqwX6x42sfModds4gz/BKiGh9q3xKXvqudNbN Mw== From: Janosch Frank To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, marcandre.lureau@redhat.com, thuth@redhat.com, imbrenda@linux.ibm.com Subject: [PATCH v2 3/3] target/s390x/arch_dump: Add arch cleanup function for PV dumps Date: Thu, 9 Nov 2023 12:04:43 +0000 Message-Id: <20231109120443.185979-4-frankja@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231109120443.185979-1-frankja@linux.ibm.com> References: <20231109120443.185979-1-frankja@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: RnN4wKB-yHKeTFhqGN0USggsHkwy1_kD X-Proofpoint-ORIG-GUID: TVDv9DeR3tbkSiIo4m695IRiaONuzXQj X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-09_10,2023-11-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 bulkscore=0 impostorscore=0 spamscore=0 lowpriorityscore=0 mlxlogscore=918 clxscore=1015 phishscore=0 adultscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311090089 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=148.163.158.5; envelope-from=frankja@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1699531531277100001 Content-Type: text/plain; charset="utf-8" PV dumps block vcpu runs until dump end is reached. If there's an error between PV dump init and PV dump end the vm will never be able to run again. One example of such an error is insufficient disk space for the dump file. Let's add a cleanup function that tries to do a dump end. The dump completion data is discarded but there's no point in writing it to a file anyway if there's a possibility that other PV dump data is missing. Signed-off-by: Janosch Frank Reviewed-by: Claudio Imbrenda Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Thomas Huth --- target/s390x/arch_dump.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/target/s390x/arch_dump.c b/target/s390x/arch_dump.c index bdb0bfa0e7..7e8a1b4fc0 100644 --- a/target/s390x/arch_dump.c +++ b/target/s390x/arch_dump.c @@ -433,6 +433,22 @@ static int arch_sections_write(DumpState *s, uint8_t *= buff) return 0; } =20 +static void arch_cleanup(DumpState *s) +{ + g_autofree uint8_t *buff =3D NULL; + int rc; + + if (!pv_dump_initialized) { + return; + } + + buff =3D g_malloc(kvm_s390_pv_dmp_get_size_completion_data()); + rc =3D kvm_s390_dump_completion_data(buff); + if (!rc) { + pv_dump_initialized =3D false; + } +} + int cpu_get_dump_info(ArchDumpInfo *info, const struct GuestPhysBlockList *guest_phys_blocks) { @@ -448,6 +464,7 @@ int cpu_get_dump_info(ArchDumpInfo *info, info->arch_sections_add_fn =3D *arch_sections_add; info->arch_sections_write_hdr_fn =3D *arch_sections_write_hdr; info->arch_sections_write_fn =3D *arch_sections_write; + info->arch_cleanup_fn =3D *arch_cleanup; } return 0; } --=20 2.34.1