From patchwork Mon Jan 27 21:31:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?=E2=80=9CWilliam_Roche?= X-Patchwork-Id: 13951723 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B75C31917D8 for ; Mon, 27 Jan 2025 21:31:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738013502; cv=fail; b=Vrpc+X8armSqEEe8Yn+SVMNuKXBvb6XRc6TOF0hPm1FV2D7NQm+HzIaAe44Tgx77t9f2CPRmem4KlWdSSOHv/e48KdxTfU6J9C7lrxw3Y1lddZ2Px9vZYnjCzNuBEoCQrttqQtfQnifjnRn47GJweoabAqzg3wS0V7wXWGTt3jY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738013502; c=relaxed/simple; bh=fO133q1KRSen3CrQ088uCW8V3UylGdPZxHXaYU88//k=; h=From:To:Cc:Subject:Date:Message-ID:Content-Type:MIME-Version; b=ZR7/I6Vbi6RP3wD3XlpUYn56sYv9YG2HMdlnUx8zBMSd3i4V+/36b7kNHhVEng1bh36uU1elVwW52xUsKnMKcFbZelkbUI6kzUAjNqz7N9dBVP3qt+kYhB8GYuai/jmpk5Cr/jaPg2XVnrbMPAZzm1OT6RFMA3JdnPRSpRwcv6E= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=BK9jWk4s; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=U2dhenRY; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="BK9jWk4s"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="U2dhenRY" Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 50RL0s46024684; Mon, 27 Jan 2025 21:31:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=corp-2023-11-20; bh=X6hOvBW3fcSp+ALW K/hHpN8VrPAuR+8HfgtZ6g6eNx4=; b=BK9jWk4sH3/gTMXNid1y1YR50iyMwKTt 4DQZcLc2Y+oV0F3p4j/RyX00SI1KDQE89wX8Wep3R6DpI9YGQhk3UNMkKd7NhiVH fgNnbmOC8DG56yH3O6eCGLyC0MNJSHa6bTXYEB3Arb2BLqyUymA336PME6XT9pvy 6YWcLWY0kZsceT/TtOrj8usVdh4f655VzF8pAFOTLAxSh51aHqF7BDsbKfNA/X9h 7arhx+ZRr1mtBJVIZHhCOA0yGcP4wW4HN9Ac7HEbryoTOmZuEfaffuANuc+EtLLj 1YdSWAo2RgqySSWCcl8d5qG26EZsr1VPAsbN1d1aTwjYzNeteDaDTw== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 44ehpc825k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Jan 2025 21:31:25 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 50RLFbjt003407; Mon, 27 Jan 2025 21:31:25 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2049.outbound.protection.outlook.com [104.47.66.49]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 44cpd7k1b1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Jan 2025 21:31:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=q1VbPB7LC8/kZR/a3gvPHJa88l9XRitcKLviIU/SpDT4DWF8eKcB3+HPi16o9kFCywgP0DHLF/X91cszhcy3FNpUSkxvtcL2UXnTFvpqWaIG95pQejsa7YKXC15NHgNUC9TUQnYL/oJAlNY4MCH/HmpQ2wEb/ZSWrovXw7mgTAHKkVCAjn5gUsCkomL+8Af6fmDe1MU/8ECjN0qpu6k61+r3hsnncXvx3QjjvtaNPVpThusrJ0aCEZaeSDqo5THeUDGFaC4yKQGSmpJv11QunMNlyejD4BRpMnh6OYFRKE5P3r/gZ2nu2gtaSE7e6LUVLvhl2B6f9qMT+09AghXycg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=X6hOvBW3fcSp+ALWK/hHpN8VrPAuR+8HfgtZ6g6eNx4=; b=I9d9bi9ACtwLhJXfc16NL1AhkEYlignnKtWEpcyQEwvJQeDGTv6byvO3S6/IdMx40/orGQQMuJ7kb4un1dH4lPr+hay2pAJHIHj0pgehWhRAoW+HiZ4eBnL3ic9o5HbUuhnMtL5c2E+QfpBEta2SIt42I+KyTMEaf11ou7kVa5liIJIhO00Xd1utgLRxFEEdOKKnWOEJVl90mPJsghge5zZBrvdDOHM2GjzGqqxdqUEUdsP03Odk3N+hMvGN4tXNL2n5uqVeW9sbIOZKEePxg811USkzcs2FlJq5nD89z/lqazCeZDRbzJovONXqHa85mL0ZkYNTWAx+rTfg+TxBLw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=X6hOvBW3fcSp+ALWK/hHpN8VrPAuR+8HfgtZ6g6eNx4=; b=U2dhenRYYKURtHrfHoPGLvmkpkpldFrUEPH+Md/ujOBFVy4n4yge9EsJUrOmmvjpRD6iN46Exn526TLeHpvdBm+5b2KZsei/Jq8IeRebDXtNNrUzTTw+KfIp6Z3BO4k7tR+Fa6xjDxUsRxypwdDWQpssIJjzAyiCASqQNL/EP+I= Received: from CH3PR10MB7329.namprd10.prod.outlook.com (2603:10b6:610:12c::16) by PH0PR10MB4614.namprd10.prod.outlook.com (2603:10b6:510:42::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8377.23; Mon, 27 Jan 2025 21:31:21 +0000 Received: from CH3PR10MB7329.namprd10.prod.outlook.com ([fe80::f238:6143:104c:da23]) by CH3PR10MB7329.namprd10.prod.outlook.com ([fe80::f238:6143:104c:da23%6]) with mapi id 15.20.8377.021; Mon, 27 Jan 2025 21:31:21 +0000 From: =?utf-8?q?=E2=80=9CWilliam_Roche?= To: david@redhat.com, kvm@vger.kernel.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Cc: william.roche@oracle.com, peterx@redhat.com, pbonzini@redhat.com, richard.henderson@linaro.org, philmd@linaro.org, peter.maydell@linaro.org, mtosatti@redhat.com, imammedo@redhat.com, eduardo@habkost.net, marcel.apfelbaum@gmail.com, wangyanan55@huawei.com, zhao1.liu@intel.com, joao.m.martins@oracle.com Subject: [PATCH v6 0/6] Poisoned memory recovery on reboot Date: Mon, 27 Jan 2025 21:31:01 +0000 Message-ID: <20250127213107.3454680-1-william.roche@oracle.com> X-Mailer: git-send-email 2.43.5 X-ClientProxiedBy: LO2P265CA0273.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a1::21) To CH3PR10MB7329.namprd10.prod.outlook.com (2603:10b6:610:12c::16) Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR10MB7329:EE_|PH0PR10MB4614:EE_ X-MS-Office365-Filtering-Correlation-Id: 5770e521-13fc-4eae-5021-08dd3f19f103 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|7416014|376014; X-Microsoft-Antispam-Message-Info: C4qshRji3XNuVe4Rp0iwmCt1niPrZDKt4C9i/vc7synihtbx0Sba5D6BOWmTbgvaTsfUPkWslaqMaFuO/yReKoYVZgP1DQJKk6LwEL77zeisjz3mjFQ/ZhD5f4DA8sg6HnO/VOj0Xp68RtZmmEuZCMHqAQF2BOY3iXv8/r5qHK8yxZuRWodHJHNgmN69rYA/y2MVCZTHxS7k7l9Etdbw9fB6o3glAWcmWbT5TM1ew3L2REimc7e5nTCc/JsPemOFq1ynF1BOvKWvxjx2NKzFUZgfs4LUrMXVVh00N/sjbyAPEeEeK6NWKoNBPwcpYs0fA5gJk3C/RqMaKM5OYLre2kH3GSetRBtw5FNmJhg/6i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ANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH3PR10MB7329.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(7416014)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +ZOAc/UvAIXypUGALA7IaH4e+ixnaK/Iu1qlIy54/Xj5/8P88BzT5ZkskwOASIiH/N9/Lk2H8xwMUda4Ctw2VBnVPzqGsiqltwj0WtGF5inC9ky+EzejwsCOi5ppoG4jc1Gd/o36XxTDP9sFVfZJ4rM2SR9hPTSunwRadVgj5c7FvRFZc8QKukXQ5c4QPyleyP6dvx4dmmeZni5aM0H83XTqZDEZ3R25LRHLiLNFCzvGGoOtUmlFrfB8lDM+5P6/fIDJTY7maxKq3x7H/i8xmxGC8yrQ9iRASu7+qWP9KHpStKXsbJongI4IjBD6L97bTHCBeXT5Go1og8IHfyf2hyy+x5VPaMeMlNS6Ik8N4WDs5RR0ygB2L2ObCdjARxvEL9+cj0BftQ3fiAgQ36betQ1FDV4XyONuJ0Uk5K/+qL49wZp8+vHj3zIlkNet9ooswb0N5lax0WGBUbTy8SIVheDkOSjNqmUQgQK5NriBjCGpokm/bXpHCAlofgKdOyjVz4TQit8J8FyDNIyZehEQ5Bfye+iWSgc40K4PROLWyDvxvz+9VZztCF2uWE1j75YdNQz1ZpBQZxU0134r2q6QpgS0J+yE+equurEuLNKx+x5/QDJVgySCe08W/vXjBKJDI2RzxZGvh5nbWKYgP/ShDIgFw4AAI1uv9Kqs6MzfRrjKhqYzFReeugxvScOs8FM1juttjCtMxu/dA5JJTJGcWpeWTeYRhfamQ5VmQd/1yih5Qc1rVgMDOgC9TzGKPtLggYTd78anuPuKOO5CjNYFyaUW2JvLC+HgVCAaQGCD76JmLpQLd0XqqDdtS+5aCcGgA++Doswq1FL+2GYCEOfgLD5RhtjFfeOy++fWPm78Bba3r1SAnVWWZe4Nhz2sFqyv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5aoZfwhBYrLtL/UGgCzKmfkG+AVTQXloe9mjTYcb8q+mB5KcxXt17kqhrhIBKA3n+4jpHTS5F555hwLy51S+F/GbOn708Nd46k+wi3kQtXp1nIo5tLlj9zE9QjRC8PwSltOEQxMLwq2vzsCpNiZdWdCGGohp754cyCYNQygUFt/DvoikE5xnv1PjGcjGBCRmBcuScoR0LySL+sUOXQGQRxhkv+ijL+vwrLYYl7Yi6Fx8I9Ch5PrTyDp20OmjCjPaiMG853oGueEO7kUYpIJKt4LBaNy8Ev73IngUziA1u9XQxm1NoEnJCrjtteGjU4vI9a+Dz68HnWGuy+0Y2Kr16JNDcmxuCbWi8grnAM= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5770e521-13fc-4eae-5021-08dd3f19f103 X-MS-Exchange-CrossTenant-AuthSource: CH3PR10MB7329.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jan 2025 21:31:20.9079 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: gs3oaNkKaV6afMvvt28zuiQCFIwe6+5rsHwMELJa84cN26uZxqSjfk+C0n9B78K6xvM1quq+erSIFfDG1gbE/eglQFrbd64yXsjGNqPIcrk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4614 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-01-27_10,2025-01-27_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxscore=0 adultscore=0 malwarescore=0 spamscore=0 bulkscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2501270169 X-Proofpoint-GUID: XTEfQ4Q4q05dHuqkJLDI4xWBbNY78gk_ X-Proofpoint-ORIG-GUID: XTEfQ4Q4q05dHuqkJLDI4xWBbNY78gk_ From: William Roche Hello David, I'm back on this topic. --- This set of patches fixes several problems with hardware memory errors impacting hugetlbfs memory backed VMs and the generic memory recovery on VM reset. When using hugetlbfs large pages, any large page location being impacted by an HW memory error results in poisoning the entire page, suddenly making a large chunk of the VM memory unusable. The main problem that currently exists in Qemu is the lack of backend file repair before resetting the VM memory, resulting in the impacted memory to be silently unusable even after a VM reboot. In order to fix this issue, we take into account the page size of the impacted memory block when dealing with the associated poisoned page location. Using the page size information we also try to regenerate the memory calling ram_block_discard_range() on VM reset when running qemu_ram_remap(). So that a poisoned memory backed by a hugetlbfs file is regenerated with a hole punched in this file. A new page is loaded when the location is first touched. In case of a discard failure we fall back to remapping the memory location. We also have to reset the memory settings and honor the 'prealloc' attribute. This memory setting is performed by a new remap notification mechanism calling host_memory_backend_ram_remapped() function when a region of a memory block is remapped. We also enrich the messages used to report a memory error relayed to the VM, providing an identification of memory page and its size in case of a large page impacted. ---- v1 -> v2: . I removed the kernel SIGBUS siginfo provided lsb size information tracking. Only relying on the RAMBlock page_size instead. . I adapted the 3 patches you indicated me to implement the notification mechanism on remap. Thank you for this code! I left them as Authored by you. But I haven't tested if the policy setting works as expected on VM reset, only that the replacement of physical memory works. . I also removed the old memory setting that was kept in qemu_ram_remap() but this small last fix could probably be merged with your last commit. v2 -> v3: . dropped the size parameter from qemu_ram_remap() and determine the page size when adding it to the poison list, aligning the offset down to the pagesize. Multiple sub-pages poisoned on a large page lead to a single poison entry. . introduction of a helper function for the mmap code . adding "on lost large page @" to the error injection msg (notation used in qemu_ram_remap() too ). So only in the case of a large page, it looks like: Guest MCE Memory Error at QEMU addr 0x7fc1f5dd6000 and GUEST addr 0x19fd6000 on lost large page 200000@19e00000 of type BUS_MCEERR_AR injected . as we need the page_size value for the above message, I retrieve the value in kvm_arch_on_sigbus_vcpu() to pass the appropriate pointer to kvm_hwpoison_page_add() that doesn't need to align it anymore. . added a similar message for the ARM platform (removing the MCE keyword) . I also introduced a "fail hard" in the remap notification: host_memory_backend_ram_remapped() v3 -> v4: . Fixed some commit messages typos . Enhanced some code comments . Changed the discard fall back conditions to consider only anonymous memory . Fixed missing some variable name changes in intermediary patches. . Modify the error message given when an error is injected to report the case of a large page . use snprintf() to generate this message . Adding this same type of message in the ARM case too v4->v5: . Updated commit messages (for patches 1, 5 and 6) . Fixed comment typo of patch 2 . Changed the fall back function parameters to match the ram_block_discard_range() function. . Removed the unused case of remapping a file in this function . add the assert(block->fd < 0) in this function too . I merged my patch 7 with your patch 6 (we only have 6 patches now) v5->v6: . don't align down ram_addr on kvm_hwpoison_page_add() but create a new entry for each subpage reported as poisoned . introduce similar messages about memory error as discard_range() . introduce a function to retrieve more information about a RAMBlock experiencing an error than just its associated page size . file offset as an uint64_t instead of a ram_addr_t . changed ownership of patch 6/6 David Hildenbrand (2): numa: Introduce and use ram_block_notify_remap() hostmem: Factor out applying settings William Roche (4): system/physmem: handle hugetlb correctly in qemu_ram_remap() system/physmem: poisoned memory discard on reboot accel/kvm: Report the loss of a large memory page hostmem: Handle remapping of RAM accel/kvm/kvm-all.c | 13 ++- backends/hostmem.c | 189 +++++++++++++++++++++++--------------- hw/core/numa.c | 11 +++ include/exec/cpu-common.h | 11 ++- include/exec/ramlist.h | 3 + include/system/hostmem.h | 1 + system/physmem.c | 102 ++++++++++++++------ target/arm/kvm.c | 3 + 8 files changed, 231 insertions(+), 102 deletions(-)