From nobody Sat Nov 23 21:19:20 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; arc=pass (i=1 dmarc=pass fromdomain=oracle.com); dmarc=fail(p=reject dis=none) header.from=oracle.com ARC-Seal: i=2; a=rsa-sha256; t=1730975041; cv=pass; d=zohomail.com; s=zohoarc; b=jn4HYL61dZGGzeNiR1YuIflBbXCssHNHEJuShrrnyhsltEehyNTT53D2V42vO1hRi4aOlk2sjLwXKA3JaqpQIkkYfhag4fssvyju7L73pfXsUA7Fs/jDpiJUHYXpz4l9AdDWBaOFKSBNDfs2cbtP34vHnM3kZV2N958iLSc57A0= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1730975041; 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=BtL4wPizEP8e0OJHbaX12oEPFzRBndiK9nPlM1//Xp8=; b=lXsRNDMAIh4g8KiH6quxcRUmU7QqkNczh5oGJ70qX0+d26kNTbpb7rI+BS8sCEb7+RlStSXTRzYA0zFi5VVyM13KwsPzDk3vXGg4YrMtPeDy9ChR6pWZ+VvOmk8gTXQl5EDqP4wGxGUNzK7dJQMQ3xxb/jYScPqx4AhyaeTvIKw= ARC-Authentication-Results: i=2; 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; arc=pass (i=1 dmarc=pass fromdomain=oracle.com); dmarc=fail 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 1730975041049324.46759633533816; Thu, 7 Nov 2024 02:24:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8zeE-0008N5-R2; Thu, 07 Nov 2024 05:21:54 -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 1t8ze9-0008LS-54; Thu, 07 Nov 2024 05:21:49 -0500 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t8ze4-0001xl-Ps; Thu, 07 Nov 2024 05:21:47 -0500 Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4A71fdCC031344; Thu, 7 Nov 2024 10:21:36 GMT Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42nb0cj52q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 10:21:36 +0000 (GMT) Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4A78xK2T005030; Thu, 7 Nov 2024 10:21:35 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2044.outbound.protection.outlook.com [104.47.55.44]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 42p87d7d4u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 10:21:35 +0000 Received: from CH3PR10MB7329.namprd10.prod.outlook.com (2603:10b6:610:12c::16) by DM6PR10MB4187.namprd10.prod.outlook.com (2603:10b6:5:210::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.19; Thu, 7 Nov 2024 10:21:33 +0000 Received: from CH3PR10MB7329.namprd10.prod.outlook.com ([fe80::f238:6143:104c:da23]) by CH3PR10MB7329.namprd10.prod.outlook.com ([fe80::f238:6143:104c:da23%3]) with mapi id 15.20.8137.018; Thu, 7 Nov 2024 10:21:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=BtL4wPizEP8e0OJHbaX12oEPFzRBndiK9nPlM1//Xp8=; b= Rm82Yfge6gPmunN+UOk+wKfIb6S/r1/4nfsalpBsrwJNpwQVKGhghsLmM4zizvhN YQZglXNE4+zl0YMybfZ/EmLNL6yxIt+eUm1slgN8pxrgRNtck0gWwhBnGY0kGX/N 9hwwoGflhEtyJjbT63L6zrvf7BPV6Fh16qlhTQGKNO4mk+NU47wXlhFtlGsamg2w jtACSXyE+T8WfhGs/m5Gg1QpBakm/r/DtJ5OaFzQfyOGJiCf29ZgYHzyF72gND5J gkzt3WjTYijsHrFpV7fd6rYefrGqz1mPjKRjpCLx6eGZS3jajRXfbg2FntHxJjZZ fWXg9lAe80NzNEiGUIw5nA== ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kjS6eZALuq9m4oEzFwBb6UUUdrO43v0+rWBALCJDMtfoX4XwGrQR6oKDMbxnYMspijRPGaEl/Y57J0hKlHNT6D0ttaHfKHZHALo7EhfvzwtHiOg5o6UL6rmxxxYXC5bbKFFUwNnvzi3zB1JgFUKu6SW0d+nNn0RFxmO0/Ibw4NkIP3g7POXTwPgQzrtEJSjwfQtRBXhtv59EXlKUPnEEw3UnoV3ofhNkcD1LCIvgumVBc77/pWqSUIj7tOhciLkxRngJK3HnUJtf5Y/0ioc6WdfCwunWiPL8QJcjtVzxz1mapV936wRkoHZK3hChPVWuNMQUpY820nft7FbAEud1ug== 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=BtL4wPizEP8e0OJHbaX12oEPFzRBndiK9nPlM1//Xp8=; b=KJ8H70Q9BuiPgvbwRCpQIfEefhUn86UAmzWTsN0q11wPxWGacJ4xz6JrxC8ysZWuz5qjb435lSh518Vdyyj1WEUVCIbL3URYD/16JKd1tQg8YPyws2mQIXAbLBVDdi/ouptSUKEDjfIwuHrFZdcCeM27e/h2BUgqoqBEp+N8qNNpdIUImw8pcanhSUDcdhaFDODjPceZcG8S1ujGMiMOcbWYiRDUVipPfxRmLEZ2AGBSFuSOOyeXssKGZuSubxVd3AbdtM98qsOKspabRMtloCvyPvzOFv0N7sXbv9w0tUuUPh8p8QCRit32QqEkVb0CXsYRnVTMpisUMRFp4OC2Xg== 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=BtL4wPizEP8e0OJHbaX12oEPFzRBndiK9nPlM1//Xp8=; b=gEU9DWoeJX9nAHihwcmCnww3IbQGcw9nbpLB5AbhaLRYTJO9u7pMf9k8RkJnxdyUI+Jw4eG3csvZ5r/fiRY6UOnV3coWNY+ubVl9LPFGZC9hXxbyGmN+Zzc283euta3uqJttNwEEa+7vrQWO7E8nyOrgxEy/WI43/24r6sNxOfY= From: =?UTF-8?q?=E2=80=9CWilliam=20Roche?= 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 v2 2/7] system/physmem: poisoned memory discard on reboot Date: Thu, 7 Nov 2024 10:21:21 +0000 Message-ID: <20241107102126.2183152-3-william.roche@oracle.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241107102126.2183152-1-william.roche@oracle.com> References: <20241107102126.2183152-1-william.roche@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: BYAPR08CA0038.namprd08.prod.outlook.com (2603:10b6:a03:117::15) To CH3PR10MB7329.namprd10.prod.outlook.com (2603:10b6:610:12c::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR10MB7329:EE_|DM6PR10MB4187:EE_ X-MS-Office365-Filtering-Correlation-Id: b744f9cd-151c-4a52-f139-08dcff15f3e7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|7416014|366016|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?I2ulV84fBQRWB5I6RJHMnQ4npJdbC0xmQgjBbMFQhh9+ch9QMi8cY2Dlvr4T?= =?us-ascii?Q?Hk9BZy8nsARBdqwEbNt1G9Stbz3Wf8PS2o7fwpkzdvxjjEXFet+xruRUEUIn?= =?us-ascii?Q?uDpRSZXM+zpB1qari4PL9SOK7c6ir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C8MaOSYxrLKtBQVzsrqFZc5KpYDwN15RV0AXZ9FnoZ9qnQxIWHoP?= =?us-ascii?Q?MdYU96JT+CWlhl43JPx2WB3qmeaa8ouIPgWnPzwfq4pjfp9q9CZFKkf5uy/x?= =?us-ascii?Q?4+WlqcXVScSlTUkqCLjjvCA4A+oAmzIhKp4K0Rycn7RaoGBN5TpF5OnGJHXW?= =?us-ascii?Q?PaMb6HI6D/cP5OjVM/RoOHMUhq3rPy4qokpEWq+YaBO20kMtyMOF5h2Us03i?= =?us-ascii?Q?fmo2OjwQr2tv6ejTetL50+ZtjP2Qn1AssnG5+khZ5LVZugNWwtvANQaAGXrd?= =?us-ascii?Q?syZ6I9GIGITc5VON5SAv2Lq4?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH3PR10MB7329.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(7416014)(366016)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?bvcYdh0+FIzr23oLIurpM2MuIytWJMT+rywYuqqbSxtK6MtI5V7/kPhbzTXg?= =?us-ascii?Q?4n7ATdbWFwShG5NWt5J5AnVDk7uTIIToiJQmJYKXFsoxI0IiBXJTOGkaeyYA?= =?us-ascii?Q?Sw0uIqLh+RQC1W/oqW5Kt6pME3hbmA/4b4Jxte80QjgoyCRrC6gbq+C+47j9?= =?us-ascii?Q?hKaNACfTOij8L1OWdOZGaEGrKkn29FTjbt4Aiyfai8mVnimq8NXx2NGmvnSm?= =?us-ascii?Q?8pjoGxTGUPc+WDBq9Ck64FB+UzdGBKvNwZI8HQ+BIVhsEdocd2SLARiI0Gxy?= =?us-ascii?Q?SucB+eXnY2u6RCB5/I63c+A9wyrHCruORTIwb+0KZIuPWB6q3qrm8ZqZz1cJ?= =?us-ascii?Q?eYggY+u8l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=?us-ascii?Q?7l/3x5IbWJYNnM1p1NJX708kNvlgdl5AoqHc5cj45zQD3VwAB1JoJloG6AY3?= =?us-ascii?Q?PSZ6sdvIEGvpNuhKtjBB6ePzzHmmDl2j0RWmqWbmiA0sm9aPbzVZcpbUjL8I?= =?us-ascii?Q?HqTwMllusekiqwUETuh8chk5ZGsjR/ev0bUGury0+vicggrn1Pt6xhez/AtU?= =?us-ascii?Q?MXrXszfmOA6h3/d2KLSdEWYfr85m2s2EMfS48q2f4jcfRQD0Om6q5hvu24cl?= =?us-ascii?Q?m2FhxkPooqmmcj7hQxKlAzUAsiSp3dnK37JfejcT+zG9Mh+dHUJDoj2rZNrT?= =?us-ascii?Q?WHxxDOUJ/xn1d+y/ScySvC/z9/IBP7xYD5q/P2zIzahl/hP+Upiq+azpwTAB?= =?us-ascii?Q?EA=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: sEsbYBwMgxCwaTepzL9qSfBqy4Rols7vZEd1lvxbPRJuWu9BJypSosO+lHQmnYSdAU+YC289yfWxnOggxbrkP774ZfU2i7txbtWp7GvyFOuLfqiuUSyf7XrM6jYZY5DcceASog9RhOmI5TdtA6JBumJX4DWUWQd+FYyxBz+SxdO/BMXRWS2L11fm8huEu4Yvla4M7KqfozecyenMR1mNbZYOhB9Yuex1evagu5zvNw9p3Q1yxxNZwED4YJ+zv1iwbhjCKfImSV95h4w7vKF7YDG0RaWcP2m2GM/f83awBibiH0omKRQfLAhtNZRCEygtjXNCGvZqCIat33Wfa8NM3YvRKVSmHFmZLGtqd1exVAXR4dB7z2HgDiPxo4D9x448Ux933cYTc0bUambtExf4YSEDehXlYfAjyEbPSehna3kEvpaAaeo7sUWCWFCc1Ce3SgD8XsRrj3yGNO/2oa49BS07pJbFusbPZ1Ht0hTsWmJJi7JUPUmGQAIqB+XZG9HMNMskXx+fGs2UVoG1C4RseU79F30oStgQfimCsr30xlFjg5OrjJxG+SLMTmgpsptOT9/t4Vbt/qhNVrsMKfzKOPFj8nDC47MzKINaSgRCKn8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b744f9cd-151c-4a52-f139-08dcff15f3e7 X-MS-Exchange-CrossTenant-AuthSource: CH3PR10MB7329.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 10:21:33.3101 (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: W7QemIw/xA459E4XAbGpZNKXNqWXNLsXcwEUBsGNFTrXHfADqPqo8WPJO1JEy0ChFg7DunNN8S69MJSPi4YozmYA3s45W54hK9igm5imkn8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4187 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-11-07_01,2024-11-06_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 adultscore=0 spamscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2411070079 X-Proofpoint-ORIG-GUID: SAPm_RPyCR6wuzyL5wjnVSBmpwdAYm92 X-Proofpoint-GUID: SAPm_RPyCR6wuzyL5wjnVSBmpwdAYm92 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=205.220.165.32; envelope-from=william.roche@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, TVD_PH_BODY_ACCOUNTS_PRE=0.001 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 @oracle.onmicrosoft.com) X-ZM-MESSAGEID: 1730975041396116600 Content-Type: text/plain; charset="utf-8" From: William Roche We take into account the recorded page sizes to repair the memory locations, calling ram_block_discard_range() to punch a hole in the backend file when necessary and regenerate a usable memory. Fall back to unmap/remap the memory location(s) if the kernel doesn't support the madvise calls used by ram_block_discard_range(). Hugetlbfs poison case is also taken into account as a hole punch with fallocate will reload a new page when first touched. Signed-off-by: William Roche --- system/physmem.c | 50 +++++++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/system/physmem.c b/system/physmem.c index 750604d47d..dfea120cc5 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -2197,27 +2197,37 @@ void qemu_ram_remap(ram_addr_t addr, ram_addr_t len= gth) } else if (xen_enabled()) { abort(); } else { - flags =3D MAP_FIXED; - flags |=3D block->flags & RAM_SHARED ? - MAP_SHARED : MAP_PRIVATE; - flags |=3D block->flags & RAM_NORESERVE ? MAP_NORESERVE : = 0; - prot =3D PROT_READ; - prot |=3D block->flags & RAM_READONLY ? 0 : PROT_WRITE; - if (block->fd >=3D 0) { - area =3D mmap(vaddr, length, prot, flags, block->fd, - offset + block->fd_offset); - } else { - flags |=3D MAP_ANONYMOUS; - area =3D mmap(vaddr, length, prot, flags, -1, 0); - } - if (area !=3D vaddr) { - error_report("Could not remap addr: " - RAM_ADDR_FMT "@" RAM_ADDR_FMT "", - length, addr); - exit(1); + if (ram_block_discard_range(block, offset + block->fd_offs= et, + length) !=3D 0) { + if (length > TARGET_PAGE_SIZE) { + /* punch hole is mandatory on hugetlbfs */ + error_report("large page recovery failure addr: " + RAM_ADDR_FMT "@" RAM_ADDR_FMT "", + length, addr); + exit(1); + } + flags =3D MAP_FIXED; + flags |=3D block->flags & RAM_SHARED ? + MAP_SHARED : MAP_PRIVATE; + flags |=3D block->flags & RAM_NORESERVE ? MAP_NORESERV= E : 0; + prot =3D PROT_READ; + prot |=3D block->flags & RAM_READONLY ? 0 : PROT_WRITE; + if (block->fd >=3D 0) { + area =3D mmap(vaddr, length, prot, flags, block->f= d, + offset + block->fd_offset); + } else { + flags |=3D MAP_ANONYMOUS; + area =3D mmap(vaddr, length, prot, flags, -1, 0); + } + if (area !=3D vaddr) { + error_report("Could not remap addr: " + RAM_ADDR_FMT "@" RAM_ADDR_FMT "", + length, addr); + exit(1); + } + memory_try_enable_merging(vaddr, length); + qemu_ram_setup_dump(vaddr, length); } - memory_try_enable_merging(vaddr, length); - qemu_ram_setup_dump(vaddr, length); } } } --=20 2.43.5