From nobody Wed Nov 27 18:38:12 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=1732544992; cv=pass; d=zohomail.com; s=zohoarc; b=iIui758Gd3tw2jBveEsSjnXYlGHqdyt6Wwkip9/GZhh1BEl+6sYxFRx9mz8tpk1Vx7WgLALK1aRKJqOuwBb9efU+t142/LAl6T4t1frFGnBz1PR86Ew24gxiY8UCAgRermdT3bx5F3/zc55nOpnjjNuK54GYqRoshisgb65VOf8= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732544992; 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=JHS4+XYDsk9j0XAnR57ueZ667oZE1aJSdUi/2nBXjAc=; b=aaZwDN63zdWaN2s4kn+lNI8Z9Cx6hNoZb6qzWlLulyXyG/2RCOiQitZk/DkVW6FHt6ULmk/qcNsvwwGI71xuna+PM58UmYcNRTUq6KOa2Q+TxpdEYs3gP/hD7Bve7ZqxqiKT5cPFSJ5rAmjpy/jIqhs4g+CdfTSp2IPJmuPjhn0= 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 1732544992159664.7753513355703; Mon, 25 Nov 2024 06:29:52 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFa3x-0007av-4h; Mon, 25 Nov 2024 09:27:41 -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 1tFa3u-0007ZG-Pu; Mon, 25 Nov 2024 09:27:38 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tFa3s-0001UV-3s; Mon, 25 Nov 2024 09:27:38 -0500 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4AP6fddJ008463; Mon, 25 Nov 2024 14:27:25 GMT Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43382kb6wc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 25 Nov 2024 14:27:25 +0000 (GMT) Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4APEPXkB002706; Mon, 25 Nov 2024 14:27:24 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2043.outbound.protection.outlook.com [104.47.66.43]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 4335g7tdjd-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 25 Nov 2024 14:27:24 +0000 Received: from CH3PR10MB7329.namprd10.prod.outlook.com (2603:10b6:610:12c::16) by IA1PR10MB5995.namprd10.prod.outlook.com (2603:10b6:208:3ed::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.21; Mon, 25 Nov 2024 14:27: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%4]) with mapi id 15.20.8182.018; Mon, 25 Nov 2024 14:27:21 +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=JHS4+XYDsk9j0XAnR57ueZ667oZE1aJSdUi/2nBXjAc=; b= AmVIolHWziJN0G6zC4KxoNIqlu5lbTrjwgVKMvJKqyX2qrUjDeIBWOzzGpDwFbTX coYyhHEkSCKGDHkdvwd/R19wyZ+yMQR0/wdXIOo2I8I0oQTmEf8mPUjlFGnL1mBO 7wSmnNP9FuPLqlRXb7ByUcYUwYMHsX1fXxlrkdsvieLiCYZW/AJf+yoFS3pXxcUB wUha85ZDUBEQUrevN3O54f9gvV8Tolt/p6SfopqBF2pFDqnbkTdFhCrIOEBD2xIi 3UUzJoSesrk9VWpBWKmyLPTJRTlpKOhfE+U7hSaFhefBEm7Wq6n7Wkf7x8dt5Max dM9fZyDSWzAxMtxQXuvG4w== ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LVKm9c/Rh1k9bPcI9tlo8X4HEIJ9osej5bPnoaUrqWS+/FHrrLmS37oHLJ9anCkrYPcLzVkoYwl2qah/uUbPCXZLIoXbZtJwSGpr34leOZonHho2wyL5yTiO0mRp7GKVp9xdYBC4qvyyf62x2i61PhNp8wWYEES4QN6+RrGDtmhAdUw8C26Xg4uzjaHSrJas1MOQj+kjMNVPENAwKm+9VznV1xJufUmULAHPGrLX2DXoBn8GXdKWQ0+9hXWEOEglQhH3NKcuW948UhU+D+VOefwrxaQEY79kC9nPYY+L++4JIRQighi089lSkIP82Ra4g/9jHlUi2Vgfpn/2g8vz3A== 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=JHS4+XYDsk9j0XAnR57ueZ667oZE1aJSdUi/2nBXjAc=; b=FD8UmQbwcoBv0U9+Whn4NX+hmilCvO7N9RxrGhMh/mFjeDIPc364LvUoeDSOolEaFYQFSnGNG4m+AFud3Ffo/MdVeN6qLLT1/WWwTphWEQTCSLnsF7NNGRkRfFP9DyT/vtbiKQHn3v5QUds/k3LzlBMl4umwGC50Tp6ZcH6QJaYolVNFlBEF7FSWU6a+zwTTOuu0zEFtxv+FmY6BbSR3e4y/mO7GRJXjXqt2pJr2g069vqgBLG3fRY740w/MCU3pkS+DIa0/VdYfgYsOCa+9IGAiQCz2OAep+2yxvurznQqo/Em26cnsPdHQJx//nuJ+Y0Ahi3bBNBCsxTu8nR9cPw== 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=JHS4+XYDsk9j0XAnR57ueZ667oZE1aJSdUi/2nBXjAc=; b=jzXwdYgt/r2oii/4DVzk0LujoAHbtf0iCuXDd3D3W++5qeP0Mt55osJ/+xH/pFejHv3GQUsULVzqCsi2d5c1JH/9cwYPd3dk+bNkclS3qS0BrMrgTM+H0kTlBNbHOieTLnIdeWXwz0SWmfKpGvYoc2uqWjNrVsQC4CAxuaJsQzE= 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 v3 1/7] hwpoison_page_list and qemu_ram_remap are based of pages Date: Mon, 25 Nov 2024 14:27:12 +0000 Message-ID: <20241125142718.3373203-2-william.roche@oracle.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241125142718.3373203-1-william.roche@oracle.com> References: <20241125142718.3373203-1-william.roche@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: CY5PR10CA0020.namprd10.prod.outlook.com (2603:10b6:930:1c::10) To CH3PR10MB7329.namprd10.prod.outlook.com (2603:10b6:610:12c::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR10MB7329:EE_|IA1PR10MB5995:EE_ X-MS-Office365-Filtering-Correlation-Id: 2e825c46-19e7-42f2-cb56-08dd0d5d4613 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|376014|366016|1800799024|7053199007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?FugNdtLa8gfwNc2VNoAUwtWA37tKYnxVf+A3/0mDD2AohSS3dF2NVMHPyeHA?= =?us-ascii?Q?4B3tLGp56Ml9e7QbiBzGQ1vSo8vlskiy0WMu8Y4kuqkjGJ1IVpt4fCLVcsH8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fmc/kvamYiGAu3XOEhyHLP47B?= =?us-ascii?Q?1NX0bkRJott5ppNF2A2oxvjXk+//pf+OoqggmeNJWjmPGUet7BWGvjccEXvC?= =?us-ascii?Q?5XqjIx74RgIZiGm9Ote6G9/RDIWlGKmjHO15T0lKMpTDzNUTvNnI5OGrkhsR?= =?us-ascii?Q?70vuGv23m+CVSkU8UwKVoZiQupkgWrNfq8aN7fDyzkBQoeYX5fjD5egxhZgs?= =?us-ascii?Q?d44w8WUCcIw/AOd4dPycQbh1HKLjaFmfluWxHWl6woKEZzw0A3HjtXGKltb0?= =?us-ascii?Q?OzD43gb6X+Ok0JEsJSHD2oy6XavAh7E+LjRCDTeGcs1oPdbhtfjkaWEhIEif?= =?us-ascii?Q?laO36M/+aMzifOQSpz5tsDkk8g7Lc+gG8dcjvvb3llbHBw=3D=3D?= 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)(7416014)(376014)(366016)(1800799024)(7053199007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?KVbkWsBNuW6SU13b1upwi8yQYmR2umhFmJ67V7qOnpcyxBy+KDlGD2QJySxJ?= =?us-ascii?Q?jqsOaIRIv2j3WsFjSn7Om4uohZYR4QTPp9oYHqEmIwA/YF1z8JjKGdQ4tlKE?= =?us-ascii?Q?MQrivcAv7dvXYUsnyKLS7HkxGQp6xJvQX38KBK4xkUn9p8nss19FMigcJnDv?= =?us-ascii?Q?HzL6e+ehjGq/4v2lKbc8aMfrNj31U2T/vTcqagUPMHhgIHICZA1tS/L7n8WW?= =?us-ascii?Q?2w0hBHH4O0K7nVvv17etlwLYSeIEaldFhlN4GUgRSi+qKijhNGAgmlfxW7YF?= =?us-ascii?Q?g/we4aSJrndLiOECnjJVD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M/7aR0J4KCNFde66DzS8GOp8/rrTswcUNVVVR+gY6FhGap4ZIp/jl2FDpBn396wySRgBMlVxskWfYzmfUlg8Yb6tXatM3bPK9BB0hYFqb9nRURn1lrrNKFNBkAlye1uDXdoIPF+UbyjOVAEODLheypmtdwDyxev6/wOg= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2e825c46-19e7-42f2-cb56-08dd0d5d4613 X-MS-Exchange-CrossTenant-AuthSource: CH3PR10MB7329.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2024 14:27:21.6949 (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: bSQQCMlxvzihG1hQYqRPTwP+5AsfUxbHVaTR3mAuVCeKS3+5DqgYPgKhyfEMnSWqWP207nmVE6iIgYBTvajjSvyrC3uvPCn1NwtDagB3YhA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB5995 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-25_09,2024-11-25_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxlogscore=999 phishscore=0 adultscore=0 suspectscore=0 malwarescore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2411250122 X-Proofpoint-ORIG-GUID: WAeDn65P7dQHYD5tO-NzawQDra0gcF2k X-Proofpoint-GUID: WAeDn65P7dQHYD5tO-NzawQDra0gcF2k 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.177.32; envelope-from=william.roche@oracle.com; helo=mx0b-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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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: 1732544997203019100 Content-Type: text/plain; charset="utf-8" From: William Roche The list of hwpoison pages used to remap the memory on reset is based on the backend real page size. When dealing with hugepages, we create a single entry for the entire page. Co-developed-by: David Hildenbrand Signed-off-by: William Roche --- accel/kvm/kvm-all.c | 6 +++++- include/exec/cpu-common.h | 3 ++- system/physmem.c | 32 ++++++++++++++++++++++++++------ 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 801cff16a5..24c0c4ce3f 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -1278,7 +1278,7 @@ static void kvm_unpoison_all(void *param) =20 QLIST_FOREACH_SAFE(page, &hwpoison_page_list, list, next_page) { QLIST_REMOVE(page, list); - qemu_ram_remap(page->ram_addr, TARGET_PAGE_SIZE); + qemu_ram_remap(page->ram_addr); g_free(page); } } @@ -1286,6 +1286,10 @@ static void kvm_unpoison_all(void *param) void kvm_hwpoison_page_add(ram_addr_t ram_addr) { HWPoisonPage *page; + size_t page_size =3D qemu_ram_pagesize_from_addr(ram_addr); + + if (page_size > TARGET_PAGE_SIZE) + ram_addr =3D QEMU_ALIGN_DOWN(ram_addr, page_size); =20 QLIST_FOREACH(page, &hwpoison_page_list, list) { if (page->ram_addr =3D=3D ram_addr) { diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index 638dc806a5..59fbb324fa 100644 --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -67,7 +67,7 @@ typedef uintptr_t ram_addr_t; =20 /* memory API */ =20 -void qemu_ram_remap(ram_addr_t addr, ram_addr_t length); +void qemu_ram_remap(ram_addr_t addr); /* This should not be used by devices. */ ram_addr_t qemu_ram_addr_from_host(void *ptr); ram_addr_t qemu_ram_addr_from_host_nofail(void *ptr); @@ -108,6 +108,7 @@ bool qemu_ram_is_named_file(RAMBlock *rb); int qemu_ram_get_fd(RAMBlock *rb); =20 size_t qemu_ram_pagesize(RAMBlock *block); +size_t qemu_ram_pagesize_from_addr(ram_addr_t addr); size_t qemu_ram_pagesize_largest(void); =20 /** diff --git a/system/physmem.c b/system/physmem.c index dc1db3a384..410eabd29d 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -1665,6 +1665,19 @@ size_t qemu_ram_pagesize(RAMBlock *rb) return rb->page_size; } =20 +/* Return backend real page size used for the given ram_addr. */ +size_t qemu_ram_pagesize_from_addr(ram_addr_t addr) +{ + RAMBlock *rb; + + RCU_READ_LOCK_GUARD(); + rb =3D qemu_get_ram_block(addr); + if (!rb) { + return TARGET_PAGE_SIZE; + } + return qemu_ram_pagesize(rb); +} + /* Returns the largest size of page in use */ size_t qemu_ram_pagesize_largest(void) { @@ -2167,17 +2180,22 @@ void qemu_ram_free(RAMBlock *block) } =20 #ifndef _WIN32 -void qemu_ram_remap(ram_addr_t addr, ram_addr_t length) +void qemu_ram_remap(ram_addr_t addr) { RAMBlock *block; ram_addr_t offset; int flags; void *area, *vaddr; int prot; + size_t page_size; =20 RAMBLOCK_FOREACH(block) { offset =3D addr - block->offset; if (offset < block->max_length) { + /* Respect the pagesize of our RAMBlock */ + page_size =3D qemu_ram_pagesize(block); + offset =3D QEMU_ALIGN_DOWN(offset, page_size); + vaddr =3D ramblock_ptr(block, offset); if (block->flags & RAM_PREALLOC) { ; @@ -2191,21 +2209,23 @@ void qemu_ram_remap(ram_addr_t addr, ram_addr_t len= gth) 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, + area =3D mmap(vaddr, page_size, prot, flags, block->fd, offset + block->fd_offset); } else { flags |=3D MAP_ANONYMOUS; - area =3D mmap(vaddr, length, prot, flags, -1, 0); + area =3D mmap(vaddr, page_size, prot, flags, -1, 0); } if (area !=3D vaddr) { error_report("Could not remap addr: " RAM_ADDR_FMT "@" RAM_ADDR_FMT "", - length, addr); + page_size, addr); exit(1); } - memory_try_enable_merging(vaddr, length); - qemu_ram_setup_dump(vaddr, length); + memory_try_enable_merging(vaddr, page_size); + qemu_ram_setup_dump(vaddr, page_size); } + + break; } } } --=20 2.43.5 From nobody Wed Nov 27 18:38:12 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=1732544969; cv=pass; d=zohomail.com; s=zohoarc; b=BOpmB35FRQqZdakLkh95isDWqtgKCgm6C1xVEwCl5zdBuWJ5CiQnxEbxQHwdd8sPX+LmrPcpTlVACInAAbe5fZddTs995S0ph7/+gJMJ2uLX31ju5ImvMsWqZOkCWDnPdFhxYNA8/AZPmmX540RyWJbPyb/74BaGG9/M2irtmwA= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732544969; 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=5A679e/2eKPMHKee/atd42aBQUwZQOa2Q2ipO/drAnU=; b=TVSlNj6RCqWePdMCiPfi/BVKVPE0Af9ZbQkxGPvXUoFb3uBSUWPeobJ0Q+psUyykgod0eZgyRgzjU0XMQZHJ7v/1Os1t3J7YIqzeH34tAWHDwgq+vkjD9PrndVvq96LgRrMZpjUVxS3a4WU6J6KdAXJpXsQtjkSMKs0v3QFZfO4= 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 1732544969482141.67295967886787; Mon, 25 Nov 2024 06:29:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFa3v-0007ZO-5V; Mon, 25 Nov 2024 09:27:39 -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 1tFa3t-0007Ys-BU; Mon, 25 Nov 2024 09:27:37 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tFa3r-0001Ud-G5; Mon, 25 Nov 2024 09:27:37 -0500 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 4AP6fcpQ006728; Mon, 25 Nov 2024 14:27:28 GMT Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43384au7a5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 25 Nov 2024 14:27:28 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4APE8bJ8023429; Mon, 25 Nov 2024 14:27:27 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2048.outbound.protection.outlook.com [104.47.66.48]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 4335g7k1m7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 25 Nov 2024 14:27:27 +0000 Received: from CH3PR10MB7329.namprd10.prod.outlook.com (2603:10b6:610:12c::16) by IA1PR10MB5995.namprd10.prod.outlook.com (2603:10b6:208:3ed::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.21; Mon, 25 Nov 2024 14:27:23 +0000 Received: from CH3PR10MB7329.namprd10.prod.outlook.com ([fe80::f238:6143:104c:da23]) by CH3PR10MB7329.namprd10.prod.outlook.com ([fe80::f238:6143:104c:da23%4]) with mapi id 15.20.8182.018; Mon, 25 Nov 2024 14:27:23 +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=5A679e/2eKPMHKee/atd42aBQUwZQOa2Q2ipO/drAnU=; b= fS8mnoCWDxPD4D7IbS6ZmTD6KMxswooS3NMRrr1PQHMrctCAQEZH6xQ30y6+s9pq 4w11xL8Po3/cDKdZAhaJpYY02BPDgBw+dPebsWbU7jPzwd9F86eWkr1dmgMIEwEx BQAso5q+TgKx0JFR6/aukiGYO1pVEzOjQZPGbHoWPB3EtKYmaHjo8hAMDRvHTvYv aG6x5Le0U6Dtt/O3lbnDIQHhibZ8iKpR7DZ6/ih2CnoU3JwQOgOTwSGAEfQPEGLY Y9DEnN0GZ4clcebfer7tSffEivJ1dVYIcT2VliJ2jtYMxiQt4FG8pGvDC33JmNls SakicwgcPTUM5VDBVWbk/A== ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rg2v6gWs7BotvhmioxEi1gIjPugmiBiKb+OZamyKeNZ3IfTTcyvhI7fxMjjmUz9nbyQpI/fbc4QmOI7RpTQdp8Pb14IJes3CjjFjnrV6UL/YfLfIvOeB6+Kqs7EXWoq7QrfZC0TSFQ9Z8zwO6ezrEO1nnAcDyGrvOnxJqLyDv+yIaN4CRBsYnZdXXst1gusxVyJD6fk0o0s3aBSUQL1y2DxU/LI5p9VZCyu23HURMWq8skFUU/eFYpOOfzvvdsW/gnefZ7gzvS3Xw9kWCfT2o5fl6ADQaW1jze3nZYm1nPKJzfy0oofaiam8pYi5QnzowqoGvF7Tlypj9pKKXlPR0w== 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=5A679e/2eKPMHKee/atd42aBQUwZQOa2Q2ipO/drAnU=; b=neP/EE9CxwxiObHr43g5fCMzJ0WpVAThWUMMMgqR6MKSxEnK1lvGBLmyGJ+8Tqkf629ngDk0lGZfFv6V2nT2ceZ5X2xKHtD/+bvbvsLfeyizsHL6ZMqwFm21Pz6tI32FSaogPBHpzyF0V4sf0GV+bVNIUGOaCueYOwkwhH6oWMUOkeI9UWcQbHcaBrtNOKnEn3/CZBw6cILN+Hwj9V+XcF7qcMxfjHlXrYoAiFuVyhDvDsgn1gEhpVD9q+haxfrUvPPNp+Mcx50QlWugmjYkrE0f/oqV2eM6jtQBRUtGsenCUcPxp4bfNcy4jQSz8+V2AtQFGkmG2hUc//zNnBud3g== 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=5A679e/2eKPMHKee/atd42aBQUwZQOa2Q2ipO/drAnU=; b=IKz8XjLna9T3HnN10McmnY2yJp4TpVz+FctYooKeA/ReBnYQpMi/g3sDQI9MCvfmDwCsNFGMO//ugATfmP6qOC9c3Irn2OJgOYLB/cXzUTUGEPaGVjqCVOr2xsONCj39jXiTDAom0sMeEGFcVyaibrJBR0EVxD1NRX5P/fEDL/I= 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 v3 2/7] system/physmem: poisoned memory discard on reboot Date: Mon, 25 Nov 2024 14:27:13 +0000 Message-ID: <20241125142718.3373203-3-william.roche@oracle.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241125142718.3373203-1-william.roche@oracle.com> References: <20241125142718.3373203-1-william.roche@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: CY5PR19CA0084.namprd19.prod.outlook.com (2603:10b6:930:69::20) To CH3PR10MB7329.namprd10.prod.outlook.com (2603:10b6:610:12c::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR10MB7329:EE_|IA1PR10MB5995:EE_ X-MS-Office365-Filtering-Correlation-Id: 09049a0e-94ea-4702-976f-08dd0d5d471e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?pilFt6GvHd3DCimyKy1A277mcVavihIo6hFA48TO/qct5or2QzGwW5ixmCpR?= =?us-ascii?Q?E+h72N7k/c9/sGZLzbOv7abiIpLu8KlK21eLVxcgYCKQ6zy3JEUP+JVbraxw?= =?us-ascii?Q?TnUXFBDe1Dn/sstMeGRzYsit9WFFA5An05WtvqFXrMl+rJO1lf4W8I3RNMXK?= =?us-ascii?Q?hLrz/6X0IS+lSkzK5h2z7nMPzGMloOYqqr+nFgzIEZA5jixPUNCpUiTbHM3x?= =?us-ascii?Q?zLZnnWO6a8KfAoYBMk7mYiYkfg/3nSgEhfgsp6fr5Ca+H6A9uNk+/3P0JSxH?= =?us-ascii?Q?gii92tMdGPaEdPCZaQ0mrSNnJadLglzFS72Qp45BaaPHPl0HAewZ8D/gTYNz?= =?us-ascii?Q?jPIljvpLzlHN+PYgCkpXpEQoWhIYlWpGoG9o+itIKuIJUqRoKldf60T8XTPa?= =?us-asc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337mjJbrdvIj36rBDy22lzXYiND?= =?us-ascii?Q?CZsVT89WgGqWhqqfLzmlCB40FbnhnULNdAI0h3m5A+SNwA=3D=3D?= 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)(7416014)(376014)(366016)(1800799024); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?RPzxHquCn6+4M3wqKZWcYYoJzmx4M+iWN3Nf3ifR4QPHnlLKdiViWZpA0tRb?= =?us-ascii?Q?Dns/7VC9VEkHgvBYNZsmm3qWdRHByk7DsZ19MbgWOq7RaYPiHB7II6L0km7N?= =?us-ascii?Q?z/vWoj1BP09RM09YaRm2DsqwHdnXBUDVxjphioZAc1Ae3VY+VYQQ/8w7LuZW?= =?us-ascii?Q?2t0csaGgvZlShrrqEpc4Lk8dZS9IgsJX7cnrpxBXjexOO9IV1rL5xfaaWWe2?= =?us-ascii?Q?lVIZhIyrqTxpssSXi4Fxo97kY1sIW5JTkItibAVkhgnXtiOUC98aaqI2eYu2?= =?us-ascii?Q?X+DjyJshjYRopWviG+TaPH6wTKFRduaBBu9VcT3GKjFV2xV6OiwoShZ5vjNf?= =?us-ascii?Q?T2iEW0hiYLLrEP03HbyIa4qXRGq7EMY9WkM2lBQQoApzV6vn0rucBYLazTac?= =?us-ascii?Q?Y2vz/amefg8ME7tWIjUB9WpP7kNTYK3FzCLftHtO8nfIEzYS5w59yjWwCewx?= =?us-ascii?Q?G3WvaSTvLL47E9D89WJeHD7rm+pFk94wsFxp+yL0/WgYji3owabT2t0nw47a?= =?us-ascii?Q?Dh6Tyb/cq/j3JGo3hkxnK1CZUvYU2MnpAkpb5o5C4av+NkL3xERX4aCSY3ir?= =?us-ascii?Q?c1X6v90+UGjcDJEOg5h1625i3IwSUKgYVekYwPJL3oJu8a170ee54MYThcS/?= =?us-ascii?Q?10/DmC+re/vumDB9lj55orXa566Iqyr2F/0CdX7BXATDm4M6Apmxr0b75JB1?= =?us-ascii?Q?vnqw6AFlUdsDNr1nsMJqoRihbSVJOz+EqYLnveUM526RKyxBuHmpEKeZ4FPN?= =?us-ascii?Q?Yf7IJHfO1BK++/MnfGHJPJfdH4jJiNKhGdXXQseqy7MQKE7xFeOeqEgEaJID?= =?us-ascii?Q?+wvhBJg1ynnxDCjcwguo0x8Rw3Hq8w1LxgquFnvHiTMjGcLjz7XjuJADeXs9?= =?us-ascii?Q?iubTNkUBga2TvuJpCrST7ZJqune8Tqxz50aYmERiWmlPZd/2rtOUhtpCs2oz?= =?us-ascii?Q?nlvudB6It9r734opVHnBomf36v17u3th1ImVmTpkluC48Q/q5ZqOj64xZE7n?= =?us-ascii?Q?9kC7biCNcB2tVugCOmIisXg8ABIhS07rdYsm8lVUL4gBteYMoMYyKB3M7/kc?= =?us-ascii?Q?ZHOTkVuj58HdjpJUX0PIXBvuOAQ2aaYj37asoEqq/BW2QoL+5VC8eaUQordb?= =?us-ascii?Q?3ZbPL+QfLJprZWWk1i/p3S3zVAw+6JJ1s8+PbMWTNDk/VSz+wumb6KM3MLwY?= =?us-ascii?Q?5TfIyiF1BPAHUZkFTZN1LAf8knngW6qC2R3+sEQZVyqtSStzB7lMHXiEECIG?= =?us-ascii?Q?A0HO03eWTcSUIzP6bB3HK/MVHAqqiqIwa6QNci+qU+/0oLJjl2iD7UUw0cVU?= =?us-ascii?Q?+EHv0vb21cYFwPlYJBpKsp1vAD8ZknnFWR4tlWcK7B0665oMrjd4z0jfmZyv?= =?us-ascii?Q?HUwq/Udh+eupVKAyTD8d1NkbsGlYeFS8FsYYUaH3jqguDAw5q3BW55haxlLg?= =?us-ascii?Q?4/FBdVK/XywceGB1KWCTvZiOFY40xCmqfxvSgIzUXFLJBsIy6vxr8JXlfWQa?= =?us-ascii?Q?Wus825nbai+igr/Rc6IQZEQIopkU7bKdTnODQle0vYN5Rolu5qEKP3XPc8zX?= =?us-ascii?Q?MvSwcM5ZinL6WhNx4Ll1aNUA8w+N+XYQDQNM8XRb1ksVm355JTM00mpRQE4E?= =?us-ascii?Q?Rw=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: eVXE1CAPJ7oIf4EtVqrt2wXfFVTkRftmd8Jd1+MUQbUJvhjH9nnuRWXMFzLkWUccz6QVFCwFrgjmpvjrZis1t0xq74rTmSKy3x9byvX96XCUC+20VlpbRDdrcFX7hkCPLf0XN3JXBWhbmixp117e63nZy/W/0pSE4s0lOohCUB/y7Lp4h6CFvtF0Vzvr3Si2TxWWa7KfL/7PQuCuoX4TEhAg1bFU1PIMGOKcXIwRvJTnYAVGOhVFFz/D2M27uJ3y3gI9txjIxlg4Pu8xLxlEJAypgmetpS4nwfvurONOns7xybCdsU/BJlTREUyKXhv4VmAHsfyfsUQPrdDdM/AT9ffJ7WCd4yB4Izc+2+paIsG7FiXhg67b++QQZcYvonD0omImDmKgwlpMK/Mnwi5B7A7F6vmfief1eKoPcxGdE1GHVwGFU2HOdMJoT80fBRRA2A5XL4N8pK6Wir4vgkypzXNqf9feoruyIjnEaMTv1R1qRRHWx5F21mHkhCbv+kDnroK+ixqDtCoNz0RXidlDTuj/grujxEFydlP/m9nWuGVdgtj4m7SCm2Gxetx3PKJenCBvDxVWUBesHip+J6wcGL79Yjx5n8CcDbYCh6qlsxQ= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 09049a0e-94ea-4702-976f-08dd0d5d471e X-MS-Exchange-CrossTenant-AuthSource: CH3PR10MB7329.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2024 14:27:23.4404 (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: /AkAggE2991FepsoP8oGJdA8kOjL+cEl9UA6TzEm7W3qpP3mdljkVvPyycg5CGVr3GgkNBQ/kCG8vf+VlBq9+uVGeysPhELmZlu5+1iOkQ0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB5995 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-25_09,2024-11-25_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 phishscore=0 adultscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2411250122 X-Proofpoint-ORIG-GUID: lyZC0jhQefSxZsPpAel929IbpQeXg13r X-Proofpoint-GUID: lyZC0jhQefSxZsPpAel929IbpQeXg13r 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.177.32; envelope-from=william.roche@oracle.com; helo=mx0b-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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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: 1732544970837019100 Content-Type: text/plain; charset="utf-8" From: William Roche Repair memory locations, calling ram_block_discard_range(), punching 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(). Signed-off-by: William Roche --- system/physmem.c | 69 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 46 insertions(+), 23 deletions(-) diff --git a/system/physmem.c b/system/physmem.c index 410eabd29d..26711df2d2 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -2180,13 +2180,37 @@ void qemu_ram_free(RAMBlock *block) } =20 #ifndef _WIN32 +/* Try to recover the given location using mmap */ +static void qemu_ram_remap_mmap(RAMBlock *block, void* vaddr, size_t size, + ram_addr_t offset) +{ + int flags, prot; + void *area; + + 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, size, prot, flags, block->fd, + offset + block->fd_offset); + } else { + flags |=3D MAP_ANONYMOUS; + area =3D mmap(vaddr, size, prot, flags, -1, 0); + } + if (area !=3D vaddr) { + error_report("Could not remap addr: " RAM_ADDR_FMT "@" RAM_ADDR_FM= T "", + size, addr); + exit(1); + } +} + void qemu_ram_remap(ram_addr_t addr) { RAMBlock *block; ram_addr_t offset; - int flags; - void *area, *vaddr; - int prot; + void *vaddr; size_t page_size; =20 RAMBLOCK_FOREACH(block) { @@ -2202,27 +2226,26 @@ void qemu_ram_remap(ram_addr_t addr) } 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, page_size, prot, flags, block->fd, - offset + block->fd_offset); - } else { - flags |=3D MAP_ANONYMOUS; - area =3D mmap(vaddr, page_size, prot, flags, -1, 0); - } - if (area !=3D vaddr) { - error_report("Could not remap addr: " - RAM_ADDR_FMT "@" RAM_ADDR_FMT "", - page_size, addr); - exit(1); + if (ram_block_discard_range(block, offset + block->fd_offs= et, + length) !=3D 0) { + /* + * Fold back to using mmap(), but it cannot zap pageca= che + * pages, only anonymous pages. As soon as we might ha= ve + * pagecache pages involved (either private or shared + * mapping), we must be careful. + * We don't take the risk of using mmap and fail now. + */ + if (block->fd >=3D 0 && (qemu_ram_is_shared(block) || + (length > TARGET_PAGE_SIZE))) { + error_report("Memory poison recovery failure addr:= " + RAM_ADDR_FMT "@" RAM_ADDR_FMT "", + length, addr); + exit(1); + } + qemu_ram_remap_mmap(block, vaddr, page_size, offset); + memory_try_enable_merging(vaddr, size); + qemu_ram_setup_dump(vaddr, size); } - memory_try_enable_merging(vaddr, page_size); - qemu_ram_setup_dump(vaddr, page_size); } =20 break; --=20 2.43.5 From nobody Wed Nov 27 18:38:12 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=1732545046; cv=pass; d=zohomail.com; s=zohoarc; b=DDY14rifVmPBJvxt4n1I/NhRu2I6PtqQh0oXHs/69muu8URpVtWb5+XYRNIDUrvc68Klv8pJZlfAPXv+HU6BEc+zNILKAdX0QB6UQMpe8IEkM4Gd5wRYOW4x06VL5asAmAjEvyuhSHU/6dIOXo8Q3KsrCEIKajTo/Edzs8cFF2A= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732545046; 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=ipoV9WK3RuMHwbmP3L6WzHMD/UP1pjywH8C3EFRAAZg=; b=iYL/fz1M8xb2ZWHWnpMu6bK6iD9vQpYZIksWZ7NZpXIAndnC8Mv/gVBvx9C3Zq0/l4A47Kn+gZ6+p/KZQ8Z99YlIKuc+OWlvoekQ0fOyDboy5HJaORORaar0YI+uhsl0ZbUcjNLBaM85uaPj3LJJKx6Lqkv8UEUsU4z/8rX9fHM= 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 1732545046598154.48684938583676; Mon, 25 Nov 2024 06:30:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFa3x-0007ax-6T; Mon, 25 Nov 2024 09:27:41 -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 1tFa3u-0007ZI-Te; Mon, 25 Nov 2024 09:27:38 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tFa3r-0001Uh-Sx; Mon, 25 Nov 2024 09:27:38 -0500 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4AP6fenW003680; Mon, 25 Nov 2024 14:27:29 GMT Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43384e368v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 25 Nov 2024 14:27:29 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4APE8bJ9023429; Mon, 25 Nov 2024 14:27:28 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2048.outbound.protection.outlook.com [104.47.66.48]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 4335g7k1m7-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 25 Nov 2024 14:27:28 +0000 Received: from CH3PR10MB7329.namprd10.prod.outlook.com (2603:10b6:610:12c::16) by IA1PR10MB5995.namprd10.prod.outlook.com (2603:10b6:208:3ed::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.21; Mon, 25 Nov 2024 14:27:25 +0000 Received: from CH3PR10MB7329.namprd10.prod.outlook.com ([fe80::f238:6143:104c:da23]) by CH3PR10MB7329.namprd10.prod.outlook.com ([fe80::f238:6143:104c:da23%4]) with mapi id 15.20.8182.018; Mon, 25 Nov 2024 14:27:25 +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=ipoV9WK3RuMHwbmP3L6WzHMD/UP1pjywH8C3EFRAAZg=; b= fauyKGJblT0cAEtn2DXHf6qvDOt47p/dDPv69WTwz0wP+34ZkLllTnPsbj7i2M8L DNkkoWgOGuGPUzCcxzPUzsYfEcurwObpGb+kTbnhSvVU+rTUaRqVUX51n3EwuzVb PDxAUyYeQPVcguBVzx2d7Kc4Xzhh0ahGHK0GdkTIOY0e4EAs1OM6cGpp+6bUe+wM aQrJDGu9fuESv9cFFm4imGKsMA9KWqooBHt1SrCagn2VxO/n6sQzBrezrpPboo8b ePwZoA/dlynxUacF4g+jbmpqJ31mg9lVp+DGopHDQwqjFsGhAPhTWADTcrErRihg fSJW5Cy4TngbKTaMvfEC6w== ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Fy2Jg6xU1OF5kxsYug7jr18llSiAwYUTLSBM9GFpghQ0yh6TxM1+DhYNGVN607/ZZjlfgS55DOD6wMVzsCCqeybXQAvn7cuduWMxRxUMYJEDBfLJoo7oFDbPHLo53T1FAbvpEWUkUa6i/CXtKc1LT4xw2yHDr9IY1bKhDxyZy20+7PB5t7YscuF6ZJeJqu/3N3wwOHQJh6zPJhp45xxoFSR0Wase3Ck9KHJmWdCZsS+synvXmtnfYAebYN8uHIjsC3+1Sx63vdDlJPV2CyCayYhtpEGUv3LR9XNf6/EXnolUtSgxH4udVeWW6VfempDhFy9OQ5lv+zr67kwMZyt43A== 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=ipoV9WK3RuMHwbmP3L6WzHMD/UP1pjywH8C3EFRAAZg=; b=L3lsCMwoPPMzF7ilxH5SCiKQdi0pieTYDtyc79vanCCaY+ZSGX/2IxwqKegglNpgN1VAPE/KojAJGsIgYOM6bXTbyfwLN4zplfWiOo0YoX4x1n5qkpt8c0Mym4FjPpKCc4kmmRWELZxn/1RFZ4VaF4clz8vjtqCeWIwvm+Xl3XXIfPAInQdZ8dZJzg5k5xD93kn+qB1IdGSpvYiGeWoD/aB/mMoHqRLu18Mm35xKTRo1dJNR44ALXbAiuZRrHJ4lFPY1Ctwk80HtFcRuB1NsEHj6rBZ+hwtJVyO61U0l8CirrDTKUVRUROz6b4HWqValsw5MWMH5t3FLXHrkzAgfIA== 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=ipoV9WK3RuMHwbmP3L6WzHMD/UP1pjywH8C3EFRAAZg=; b=rkMRMo7oJToxECtIdsFZ/vjMKBQnih5bW9/6hUBLleU/yw85sWs1ZQU9DxoDTBDFxoXzgn/sCuwiEiIyPbuSRp81Oq7gHDXFI09FS80F7hdFImAqQ3xRs3ij7QkvAgN/ixG7ebqbE6JUmtvXHbAmhL76zlQ4r/dkUdN/zfpy3us= 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 v3 3/7] accel/kvm: Report the loss of a large memory page Date: Mon, 25 Nov 2024 14:27:14 +0000 Message-ID: <20241125142718.3373203-4-william.roche@oracle.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241125142718.3373203-1-william.roche@oracle.com> References: <20241125142718.3373203-1-william.roche@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: CY5PR13CA0035.namprd13.prod.outlook.com (2603:10b6:930:11::24) To CH3PR10MB7329.namprd10.prod.outlook.com (2603:10b6:610:12c::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR10MB7329:EE_|IA1PR10MB5995:EE_ X-MS-Office365-Filtering-Correlation-Id: 09158a3e-eeb3-42f2-d430-08dd0d5d4825 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?N3ccyYRSuCwRF25PeLTw2kpettcc5PvjwQFrN8O+8ksg7Kt+RZktP/gHuDod?= =?us-ascii?Q?Q0mOm0hZClVMwLRMPNcLnduppexK2G84ejPpVgE097JxCXs3/dw0qPnbhRdh?= =?us-ascii?Q?2E2KG7mX+c88eB0kbIKpjwX8YXzZVIYiMy7gZloWuroT9+ypu9rOdK32sbjO?= =?us-ascii?Q?RvYP7hsn/M1FpCu5/+gi40Ox+arpY+7bd3DajfnVcnIYSKNgmyBbYHe7pSyE?= =?us-ascii?Q?sl8NxzrM8v+5rEGbcEgA3Dsir6lrJBwrMpQsxpG//5OFgR3yHUYFlP6heHah?= =?us-ascii?Q?+4r1KrH3vLWdwOFuq4ICLDcq5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PT+Gri?= =?us-ascii?Q?TN+xTTH1vMY4V3VzVrvCtWE0DVXgKEQd6US6kqMrjUzKmLJLLLCC9C1sg3MJ?= =?us-ascii?Q?UkwZIQxxreXzNJHvLhdReSiduq3OeJ3Ov4ydA+ClS0SrkbCdpFcZwcmKnvsf?= =?us-ascii?Q?qQwRhodxLgEK60jKzd9jY0daU0/oma1nqa2u8LgsWIGVeQ=3D=3D?= 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)(7416014)(376014)(366016)(1800799024); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?IEEf+eIyqWCIPjTsLIY+vwdA5a3+KKQK4FUTKygOs4hvmJpxFYiqmRlIRFDX?= =?us-ascii?Q?Yy9ZMLeSP8PEtbCYDsFUnpeECsZihdm2IKgp2GV8I/OsNEn4GmoVTe4mdc5U?= =?us-ascii?Q?h3D/63aQDikSDZ/dnlKQedEuMgpgp67Wk9kKG3l5RWrUugYgl4Gbg1CyOxAZ?= =?us-ascii?Q?2ASebS6YzqKhIRkjn9T1Qp27THV36ZNtkiEjldx8BBJb1xTfZDlCHJ/pvchw?= =?us-ascii?Q?gdpG2wLYKcAPbxKEgMW5owEjvVSHAAvSUdJtRaLro0E9Ue9vDJ6yVnwH5Cjg?= =?us-ascii?Q?fmLhAkWNBCsAijiQNQNvBUzbY+vsY3HtTaTCcNrvhNk0uUM3kr22HsYclc+I?= =?us-ascii?Q?grz5ytecs9uEVyOC2v8vGin2KXlqXrAzB/OpKZ+MFYIkMhuAVnkKynt58pjO?= =?us-ascii?Q?xSeTGDNQrMdokkhoHI3pST7vVApHlM3Prh145hl/IO3cKzv9f+ZALbokZnM4?= =?us-ascii?Q?x5bcGQzKJnb3y4LINmoeWLE4wb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zVy6/0myiTZ1Da+5JKud/i3GWXzHrJuiFz99P1DpHr5ENOxbhq61IK?= =?us-ascii?Q?qslpzUMb35dDaVVN0sE8yMUdvTVv9tIjZma/gYaOku8RjZ8u3Nsk01kpQPAR?= =?us-ascii?Q?+qEAqchkXpCtL21mDAce/4Ih4yaiv7JZO0eH5Asi5zWSVombdNKljUukop3x?= =?us-ascii?Q?TuT/p1SFdBGqecbfVSq5VgoHFylGu9exhjhyuxFRTSXfKeDGQhvgy5LLsbvn?= =?us-ascii?Q?vQ=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: fuwZkTX5lOvtwRsGCi25enIodIDOHqKs57hy3Yi53BwYILOaOn98SEbPSWFOwsd/OMzcDY4WEgCFWtRz75eDnMET8brUtNW0uLEOD9I5FkQ8bSt9M18WBN26n7msD6XSHMW26SfnZyuKL2b9yXalFCn7sTzGfoLSFAmYhjC/rts6kKpmPoJTfc2mz/vPwoEGgZlAkb1ssCM1Jr0NW7dSGi/xUc03Ti3X/lscY7K5CReggh/dt/509wVMm8jLfhozZ4mLGZ3VF4RGFZ8v7WtJ5oXNDnGVGrScS7/bcjcwSxyKrA7na9sec9OemhI/EhQqKui6S+y5RWovOzNT04DMCs0PgOwzsEf/jE01n0xdiYYF1mR2am4YM0Qbcxa6/yTDucLRUfUA63PM039rItEhX5nKmTuq7IXDATefRqXTiWbVOFMMSsD1DKhUEL9Qel+W7kQkiUvDULPBzwTAeJhhRsk2H6q8k3WBMPuiW3w+RqoMAlflWRxdlwFiNr7871aLFOsn9gvUDOro/mJkQG+YnuOkrBwMi0KCaQJRPtVeh5IimsWnzQR7mEvW0mxlWWxLqAK5unlOQ1K3pY0q4xQX47MJE1N9srI7fZVgBHSlhQ0= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 09158a3e-eeb3-42f2-d430-08dd0d5d4825 X-MS-Exchange-CrossTenant-AuthSource: CH3PR10MB7329.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2024 14:27:25.1748 (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: kcaD+8bJDOtJaxPSxxibVm41FAG1o6jP3RvgYz/FQ4npudnjs64MzdU2UfuW+yOrZBhZAR/tvY96SdTL3jyaUDNoFXM/ZxMqNEW9HZ/TSrA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB5995 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-25_09,2024-11-25_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 phishscore=0 adultscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2411250122 X-Proofpoint-GUID: D3RVCD7RyKYiFgbIy4BPasAQVK2MNHm8 X-Proofpoint-ORIG-GUID: D3RVCD7RyKYiFgbIy4BPasAQVK2MNHm8 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.177.32; envelope-from=william.roche@oracle.com; helo=mx0b-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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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: 1732545047148019100 Content-Type: text/plain; charset="utf-8" From: William Roche In case of a large page impacted by a memory error, complete the existing Qemu error message to indicate that the error is injected in the VM. Also include a simlar message to the ARM platform. Only in the case of a large page impacted, we now report: ...Memory Error at QEMU addr X and GUEST addr Y on lost large page SIZE@ADD= R of type... Signed-off-by: William Roche --- accel/kvm/kvm-all.c | 4 ---- system/physmem.c | 12 ++++++------ target/arm/kvm.c | 13 +++++++++++++ target/i386/kvm/kvm.c | 18 ++++++++++++++---- 4 files changed, 33 insertions(+), 14 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 24c0c4ce3f..8a47aa7258 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -1286,10 +1286,6 @@ static void kvm_unpoison_all(void *param) void kvm_hwpoison_page_add(ram_addr_t ram_addr) { HWPoisonPage *page; - size_t page_size =3D qemu_ram_pagesize_from_addr(ram_addr); - - if (page_size > TARGET_PAGE_SIZE) - ram_addr =3D QEMU_ALIGN_DOWN(ram_addr, page_size); =20 QLIST_FOREACH(page, &hwpoison_page_list, list) { if (page->ram_addr =3D=3D ram_addr) { diff --git a/system/physmem.c b/system/physmem.c index 26711df2d2..b8daf42d20 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -2201,7 +2201,7 @@ static void qemu_ram_remap_mmap(RAMBlock *block, void= * vaddr, size_t size, } if (area !=3D vaddr) { error_report("Could not remap addr: " RAM_ADDR_FMT "@" RAM_ADDR_FM= T "", - size, addr); + size, block->offset + offset); exit(1); } } @@ -2227,7 +2227,7 @@ void qemu_ram_remap(ram_addr_t addr) abort(); } else { if (ram_block_discard_range(block, offset + block->fd_offs= et, - length) !=3D 0) { + page_size) !=3D 0) { /* * Fold back to using mmap(), but it cannot zap pageca= che * pages, only anonymous pages. As soon as we might ha= ve @@ -2236,15 +2236,15 @@ void qemu_ram_remap(ram_addr_t addr) * We don't take the risk of using mmap and fail now. */ if (block->fd >=3D 0 && (qemu_ram_is_shared(block) || - (length > TARGET_PAGE_SIZE))) { + (page_size > TARGET_PAGE_SIZE))) { error_report("Memory poison recovery failure addr:= " RAM_ADDR_FMT "@" RAM_ADDR_FMT "", - length, addr); + page_size, addr); exit(1); } qemu_ram_remap_mmap(block, vaddr, page_size, offset); - memory_try_enable_merging(vaddr, size); - qemu_ram_setup_dump(vaddr, size); + memory_try_enable_merging(vaddr, page_size); + qemu_ram_setup_dump(vaddr, page_size); } } =20 diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 7b6812c0de..d92b195851 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -2366,6 +2366,8 @@ void kvm_arch_on_sigbus_vcpu(CPUState *c, int code, v= oid *addr) { ram_addr_t ram_addr; hwaddr paddr; + size_t page_size; + char lp_msg[57]; =20 assert(code =3D=3D BUS_MCEERR_AR || code =3D=3D BUS_MCEERR_AO); =20 @@ -2373,6 +2375,14 @@ void kvm_arch_on_sigbus_vcpu(CPUState *c, int code, = void *addr) ram_addr =3D qemu_ram_addr_from_host(addr); if (ram_addr !=3D RAM_ADDR_INVALID && kvm_physical_memory_addr_from_host(c->kvm_state, addr, &paddr)= ) { + page_size =3D qemu_ram_pagesize_from_addr(ram_addr); + if (page_size > TARGET_PAGE_SIZE) { + ram_addr =3D ROUND_DOWN(ram_addr, page_size); + sprintf(lp_msg, " on lost large page " + RAM_ADDR_FMT "@" RAM_ADDR_FMT "", page_size, ram_addr); + } else { + lp_msg[0] =3D '\0'; + } kvm_hwpoison_page_add(ram_addr); /* * If this is a BUS_MCEERR_AR, we know we have been called @@ -2389,6 +2399,9 @@ void kvm_arch_on_sigbus_vcpu(CPUState *c, int code, v= oid *addr) kvm_cpu_synchronize_state(c); if (!acpi_ghes_record_errors(ACPI_HEST_SRC_ID_SEA, paddr))= { kvm_inject_arm_sea(c); + error_report("Guest Memory Error at QEMU addr %p and " + "GUEST addr 0x%" HWADDR_PRIx "%s of type %s inject= ed", + addr, paddr, lp_msg, "BUS_MCEERR_AR"); } else { error_report("failed to record the error"); abort(); diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 8e17942c3b..182985b159 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -741,6 +741,8 @@ void kvm_arch_on_sigbus_vcpu(CPUState *c, int code, voi= d *addr) CPUX86State *env =3D &cpu->env; ram_addr_t ram_addr; hwaddr paddr; + size_t page_size; + char lp_msg[57]; =20 /* If we get an action required MCE, it has been injected by KVM * while the VM was running. An action optional MCE instead should @@ -753,6 +755,14 @@ void kvm_arch_on_sigbus_vcpu(CPUState *c, int code, vo= id *addr) ram_addr =3D qemu_ram_addr_from_host(addr); if (ram_addr !=3D RAM_ADDR_INVALID && kvm_physical_memory_addr_from_host(c->kvm_state, addr, &paddr)= ) { + page_size =3D qemu_ram_pagesize_from_addr(ram_addr); + if (page_size > TARGET_PAGE_SIZE) { + ram_addr =3D ROUND_DOWN(ram_addr, page_size); + sprintf(lp_msg, " on lost large page " + RAM_ADDR_FMT "@" RAM_ADDR_FMT "", page_size, ram_a= ddr); + } else { + lp_msg[0] =3D '\0'; + } kvm_hwpoison_page_add(ram_addr); kvm_mce_inject(cpu, paddr, code); =20 @@ -763,12 +773,12 @@ void kvm_arch_on_sigbus_vcpu(CPUState *c, int code, v= oid *addr) */ if (code =3D=3D BUS_MCEERR_AR) { error_report("Guest MCE Memory Error at QEMU addr %p and " - "GUEST addr 0x%" HWADDR_PRIx " of type %s injected", - addr, paddr, "BUS_MCEERR_AR"); + "GUEST addr 0x%" HWADDR_PRIx "%s of type %s injected", + addr, paddr, lp_msg, "BUS_MCEERR_AR"); } else { warn_report("Guest MCE Memory Error at QEMU addr %p and " - "GUEST addr 0x%" HWADDR_PRIx " of type %s injected", - addr, paddr, "BUS_MCEERR_AO"); + "GUEST addr 0x%" HWADDR_PRIx "%s of type %s injected", + addr, paddr, lp_msg, "BUS_MCEERR_AO"); } =20 return; --=20 2.43.5 From nobody Wed Nov 27 18:38:12 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=1732544937; cv=pass; d=zohomail.com; s=zohoarc; b=ItFuoVD7/KHSEHrXVt3C8tv+awXiV455JLvEdRxCjHvpvKpcLqk7rPmkRaJ54o8OwRhFiBuvxnW27eYs91A/3qxgOKaTlo/XA0d6nJZcWOHtdKZq0mgP4QS1g51+/0oxiSUb0i6kKJsuOapx321/ThDbaWFzYe9e1hIXpEDi8Fs= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732544937; 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=vteplBxtLrG+J86puz+nqt8Ab/wYSNv62AD6jJgg5CM=; b=VTmpfcoA6jRM9B9KHVOlwbQ0cXTU8kkFPyDoMBUpETLru/uzgfjZmNlVVWt/NoVFTeVm+eP6C7yKglhmh7lZZ2T5n6m2iDO+dZxN8BX8Ejsa3VMefJgOkL1ZowZeJamDzCc0NRXvX5QALVa00QqZQqQ4+0tYdM8I++fcVroazks= 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 1732544937682222.3070880585792; Mon, 25 Nov 2024 06:28:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFa3z-0007c6-0V; Mon, 25 Nov 2024 09:27:43 -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 1tFa3w-0007Zx-1w; Mon, 25 Nov 2024 09:27:40 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tFa3u-0001V8-CT; Mon, 25 Nov 2024 09:27:39 -0500 Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4AP6feOO013084; Mon, 25 Nov 2024 14:27:30 GMT Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 433874b7dc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 25 Nov 2024 14:27:30 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4APE8bJA023429; Mon, 25 Nov 2024 14:27:29 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2048.outbound.protection.outlook.com [104.47.66.48]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 4335g7k1m7-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 25 Nov 2024 14:27:29 +0000 Received: from CH3PR10MB7329.namprd10.prod.outlook.com (2603:10b6:610:12c::16) by IA1PR10MB5995.namprd10.prod.outlook.com (2603:10b6:208:3ed::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.21; Mon, 25 Nov 2024 14:27:27 +0000 Received: from CH3PR10MB7329.namprd10.prod.outlook.com ([fe80::f238:6143:104c:da23]) by CH3PR10MB7329.namprd10.prod.outlook.com ([fe80::f238:6143:104c:da23%4]) with mapi id 15.20.8182.018; Mon, 25 Nov 2024 14:27:26 +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=vteplBxtLrG+J86puz+nqt8Ab/wYSNv62AD6jJgg5CM=; b= M36e36TE4XhJQA3uTf3PDDGXIM/kGSu5sf3kVDLJaT39TUmT8w7Yh0U50okpq+/2 dYTpAEiamBHfjeZDk98ah+Ht6Jkr/STwMR7oOLUKEe63jvYwJACtyatb20gPpgHm tIzpFuOWNtXvxjWRk3M8duloX/xv+5lzDdLk6OBRt2+SJAytrquvknKlDIXBGFxt qRp7GV/f1HIlxo1cmrPDc4rKk4o3PlKCncyND+DPgwKfA1r4c0MvBdTKuwIB43GL RiAornLkHodmEZQldUf7/IIZ0EAvqULvNZXUxh/2HfXv2dTMgudOnGFVLo9givHh Jz+ZX89kmVozmG+prxv7fQ== ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Xcywp1XbSVGnabRlerO+tt/HpshmpSfk8rUnA9LEA40IpIn9uuOYQt4JyFmsrNXnGRBtUqli4QbsKRPv/X15lBXKVywT3eQ1xRc+jSlGzwt7CfoHG+6dhTHSEXF0csOvOFtpvGQmnLOYuo0gP9UXOQZxPmS11Y/AB+v/AkAgfV/Ed/iOIXmRbb5t6qzQ+EL+4hNX8MI+n/fHieQTHq6cIj9vXGmPBuvucqBhcN8bl7k4e5TeMxr48M3t8UYV/XtRBVI/WGxG0OQCMrKmmrwjG6AxzLg6bOHfGm45ZjahR4N7u7YdInRGYBq6uQTzX3DN3/iDz9z8OVw0mEm89GP13w== 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=vteplBxtLrG+J86puz+nqt8Ab/wYSNv62AD6jJgg5CM=; b=MLgEAuPnVmlH+NvdhdsMCncgfg/O9434rQquiQaviTvMJtCZ/ZSNntrVJi1KcuL6+q53Y3p3hqBpVMmN+/aNgAJOKCmwe2nyW0JflcJIeL+04RZ7Pq6gRjoY30MQwdg3i6GaYEYt8Uxd6JBD7S5RkNbxeWXXTE0PFBDbMiXE0BK1+VuK6RIVKJnUVuq4z9h0v/sFWCWO8c85g+3XdeX3403b/kRMKzba7BLVT+ys2bWuDx6ucwbFVsdOOaP9nOs89l8ICkfNGpkD3V0SkKoMMDMbHmxVSvBNooeUQWhkeOI93ET1jhJuC6vBdeXj4q+bwhyoPY3XgsBk4CKQJslTqw== 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=vteplBxtLrG+J86puz+nqt8Ab/wYSNv62AD6jJgg5CM=; b=j5GK+Mm7D1jvU4KOk3ZNvBvKfWfXiE5rF2TAu9ps5IUXKJBeS9qDjrT2j0SGcMYsxIpL6H2VKMDI7PqtygP42iT31rjaZqzypzXYDim9x+O9WRSj3kKSJWMAH4oQ5frz2pzzfpmNWtnAQAwwhV9rw24/dO/dk1qtF20MPifaJ0E= 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 v3 4/7] numa: Introduce and use ram_block_notify_remap() Date: Mon, 25 Nov 2024 14:27:15 +0000 Message-ID: <20241125142718.3373203-5-william.roche@oracle.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241125142718.3373203-1-william.roche@oracle.com> References: <20241125142718.3373203-1-william.roche@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: CY5PR13CA0039.namprd13.prod.outlook.com (2603:10b6:930:11::25) To CH3PR10MB7329.namprd10.prod.outlook.com (2603:10b6:610:12c::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR10MB7329:EE_|IA1PR10MB5995:EE_ X-MS-Office365-Filtering-Correlation-Id: 83b7c7b6-6800-4950-4b87-08dd0d5d4925 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|376014|366016|1800799024|7053199007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?QL3NIns36iE5yjJnyYmNaXzh6cCYA4VaDFnEkk9llGgld/68saau1cam7tyc?= =?us-ascii?Q?dY+1W/JAdDfFIoZi59++mlehIjPleo/Eya5zn70X9bIdodOV6bTsOTeGFRju?= =?us-ascii?Q?CVuwp49wF4rRtgIfHlXlyEkwNSbvOxhFOeUtU/1vIkG1yqr7YdnttmruGSLM?= =?us-ascii?Q?j2qvcrRf+NxXF9TRw2pII2pjirFSuPUHL+pPyazGCS0B5V8MnCCbBBjNdclV?= =?us-ascii?Q?mK+KjElk5uv6QmUapsI86LlPMUAkRdqV95CHvQjoZ9YV5rQTRn4qY9CGUJKf?= =?us-ascii?Q?xAgTBIJ88z7nf2zO6NO0CpTqC/StOg8X0966vRmscnsCUKqJVvmPA45KN0jp?= =?us-ascii?Q?g5JnneZtWdun5YuQbyZ7vWgRskHsMRNcmwVKObLctMGzQGvXfY5fg7YMDnb9?= =?us-ascii?Q?NjwvbzzRU+8z4QbtvTBRkP6o7JlSkerCUynPNI0Lo67Br2LMLOtZU2ZTyCgw?= =?us-ascii?Q?SjYOpJboxQWoxdUPuIEeYMlHpSwNuCVvxdES6AJk0B/PSEfl/nXKK0o3tpEe?= =?us-ascii?Q?qcOPGy4FjTGMjT/GH4XzC5AOhFtYn4gMtx82tYVlNTQ/1BOQNWetx0AaymIj?= =?us-ascii?Q?csYQPa8UACcPTAWUHtLSIfGE0lrMxCknG4SoZlh6uRlylS9TauZyb/D12l+B?= =?us-ascii?Q?7LxZP18iNno5vLuVwAPIqERrW8/r06DGS5D2aRN3bZdBFFGh7XDRl3yOZiJN?= =?us-ascii?Q?HR12ZXFHoYD3F2YuBvnrUw3UI6e0mQBjoMUG8IeoxZKjMmTyYdUnRQU4x0gs?= =?us-ascii?Q?7uN+jSb9B3KWIkHxPk1OJZC+GIENSmpbXzZzIR8AKdAiNb1ZQC2uGlRBxq+G?= =?us-ascii?Q?hLAFZ3qbB5IxDGsEoAlaOq2q3DQiShXcJ+YsBuc58RRdFwjdI0NNeIRrTL5D?= =?us-ascii?Q?CKY1YTvyGp5HmDvYcCmLTjUHJJtXs4E5avjRQfu2bSeLmkIdV4eQRmbwTY05?= =?us-ascii?Q?2d6jfe3jnVtbDVyW6TbjmIDahb1SAXGbUeJz7kdasN77EJ2A0m2lnkaH4AEY?= =?us-ascii?Q?NpeZGyIqw3aqQBmDpcw6z3nd5q2GLBHTcc4UNt6ZroB+gsjLb0eYh31Nls3/?= =?us-ascii?Q?Yo7VFStFxjAvgNsc4j51MQelyMK7yN1DQvqBJ8zo2psbi7ygFz4xURL6Dqgh?= =?us-ascii?Q?vQ0qxg5ngHvbBTpX4jnSbg5oJuW3SqwipgOSJg5PMGyiPuJTJpgyFpmYuOie?= =?us-ascii?Q?OGn1edZuBMkT7kRBZl/pY0KyyYXnvX3XkxozZsZQMeFW1Ej5hLJAs/hCP3wL?= =?us-ascii?Q?W5lYC+B1UvwcdELV6lJ9uBGIWTmit0r2w9RhDJ1Gs3yI+CEfNMvbL6MU7Cv/?= =?us-ascii?Q?iMjTtlNt+wWukF426qYkWvQfxtksTU2WOkHO0NlpWvZw5g=3D=3D?= 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)(7416014)(376014)(366016)(1800799024)(7053199007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?9PKDDjR4ZNdJ+g1k1vEIs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ii?Q?NcLlE0TpxG1ukFhVwsC4oYhYsC6qbYyrxqi2WlVWg8FWd7HJHObZbrn/cdCR?= =?us-ascii?Q?Tcwbk0usUeZ9vPnqOAbQs+mLALmO5NHqKC/ZPaQ5L+sZq9wRQFSfvW1s+3gD?= =?us-ascii?Q?kv781JWrLiPM09wHnUPSoD0TtR8DVx8T1tvSrmFGEZc43ECM7eMH/HzKhR17?= =?us-ascii?Q?fBcnytK7zmDId2b4LIU28Tj8W8x+XLugKnGST+m10/t08g3ZFAXcVn+q4/Np?= =?us-ascii?Q?vzea9b+W4KJad85GLqND7X0G82S1r98OU4Gtp7qHybDkyFRNUnBY2J53U/UW?= =?us-ascii?Q?cUXDp2ycgA3v8RCD3SzyuPG+44I9OJiEaKXlcdEwZ4WsXDLJI26zLtdjwKuL?= =?us-ascii?Q?M+TiPrqC6xlDy61EMmcniHChwh6+CfDhSuxXIfRlexeQdhferqUhUwGWWiQM?= =?us-ascii?Q?mVklFbDtAIZ0KpnWmDe2PHcMCCV2OuNNjxGk+TucTDjjAerNbZ8UAosMpuHo?= =?us-ascii?Q?5ZEGa+I1Swax4AHMDLzjC7mPXOVSh/3AxvgEOP7lG6lVvnUa3xa4S/DFoIK8?= =?us-ascii?Q?jseGljMxRUlhmb3f5P7SX6o1AKYqz4rmG4CE5ROKGXaQCIAbMfpbkDrz4rVg?= =?us-ascii?Q?TiZ46LC0NKyRvZxg8pwBNNrfi+AglOKx+65NUaFqUQU916/MYCJUfUEqNOkT?= =?us-ascii?Q?Tc7Ud7u77yu4ugjJ+I5YanvfS10ti7ZG2bfqWye9R7nBoqeEXDg41ZWaoPed?= =?us-ascii?Q?hA=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: WIYh6ERbBH1D5o5jP+xupxCirFdUtmHBRTlE/RyQMlCncMEh5J295ya+E9wpeOE7PEOE39RzSdHppmC5UulJEUXFEPjWxElAG92RXBFCNQq6KYJkhP7ftSy0a+KlJsJbbrJiVNxU00t3krhaU11IaNtSde0Bsp+vtQ6cGfmye112W3txoDYyGHh8bcZ5onq+VtFPf3IDcxoVg3TQVRX7LwM/m8i1sGSfPdnaHDXGqjQkx9OhNo6W3VfqkDjvB2NBOkQb+LBQq0d9QbyQXLqCUul3/1qJzxqKt/TsP1/Pafa5EbQ9SjkLTjSJtKdHmWaNB/F206YL+0HQjS084S9tj85N4CcWytlC7DwiQ1n2RzbvnsNlWgDD0jNAP7sZF5lIcx4mQtqeUBsdHI7pGcd42P6P633tg4eLVBskLFc0DkpStYoEv+R6an5BLKWVZAkTiWYUt0kn3FAS+vE66qn/XlPA5ei5Mz0jM4gyzSca2ya2IfIZPUSpgSUVszahyqM76iZWxHyHLC7C2CNUC0Ui2K42AUvKBp2DUozURKDtJbfABUfewDWkVY7VQay7MbrdRmt4uPjPmZeoHjQ7LLvJvgfr/ZCxyyyBksFCZH8WhVw= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 83b7c7b6-6800-4950-4b87-08dd0d5d4925 X-MS-Exchange-CrossTenant-AuthSource: CH3PR10MB7329.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2024 14:27:26.8512 (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: 4F8dUvMe/cjnrY9JVrxe+e4JDAo7L4f2+euXFzqQIcS2tbxylMrsdjR8ILWUMcq3uN6bFznX/MV+RXRlEyCQZW3fUFk+gu7S7rWFwsffDhw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB5995 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-25_09,2024-11-25_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 phishscore=0 adultscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2411250122 X-Proofpoint-GUID: o4QnDdn5jyZJMLYAcntfkbGVCsqek2W- X-Proofpoint-ORIG-GUID: o4QnDdn5jyZJMLYAcntfkbGVCsqek2W- 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.177.32; envelope-from=william.roche@oracle.com; helo=mx0b-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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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: 1732544938769019100 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand Notify registered listeners about the remap at the end of qemu_ram_remap() so e.g., a memory backend can re-apply its settings correctly. Signed-off-by: David Hildenbrand Signed-off-by: William Roche --- hw/core/numa.c | 11 +++++++++++ include/exec/ramlist.h | 3 +++ system/physmem.c | 1 + 3 files changed, 15 insertions(+) diff --git a/hw/core/numa.c b/hw/core/numa.c index 1b5f44baea..4ca67db483 100644 --- a/hw/core/numa.c +++ b/hw/core/numa.c @@ -895,3 +895,14 @@ void ram_block_notify_resize(void *host, size_t old_si= ze, size_t new_size) } } } + +void ram_block_notify_remap(void *host, size_t offset, size_t size) +{ + RAMBlockNotifier *notifier; + + QLIST_FOREACH(notifier, &ram_list.ramblock_notifiers, next) { + if (notifier->ram_block_remapped) { + notifier->ram_block_remapped(notifier, host, offset, size); + } + } +} diff --git a/include/exec/ramlist.h b/include/exec/ramlist.h index d9cfe530be..c1dc785a57 100644 --- a/include/exec/ramlist.h +++ b/include/exec/ramlist.h @@ -72,6 +72,8 @@ struct RAMBlockNotifier { size_t max_size); void (*ram_block_resized)(RAMBlockNotifier *n, void *host, size_t old_= size, size_t new_size); + void (*ram_block_remapped)(RAMBlockNotifier *n, void *host, size_t off= set, + size_t size); QLIST_ENTRY(RAMBlockNotifier) next; }; =20 @@ -80,6 +82,7 @@ void ram_block_notifier_remove(RAMBlockNotifier *n); void ram_block_notify_add(void *host, size_t size, size_t max_size); void ram_block_notify_remove(void *host, size_t size, size_t max_size); void ram_block_notify_resize(void *host, size_t old_size, size_t new_size); +void ram_block_notify_remap(void *host, size_t offset, size_t size); =20 GString *ram_block_format(void); =20 diff --git a/system/physmem.c b/system/physmem.c index b8daf42d20..6b948c0a88 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -2246,6 +2246,7 @@ void qemu_ram_remap(ram_addr_t addr) memory_try_enable_merging(vaddr, page_size); qemu_ram_setup_dump(vaddr, page_size); } + ram_block_notify_remap(block->host, offset, page_size); } =20 break; --=20 2.43.5 From nobody Wed Nov 27 18:38:13 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=1732545033; cv=pass; d=zohomail.com; s=zohoarc; b=jBnwHwoPYs9UrAEgP7s9Wzq2rhvv0ADKqsB0GWlaixc/WPSGWSyZgYGuQqyYlN60jRPq6wub7PBO2Swc60L2cmr355LU7TWYnNIz44Bzx1v7mt1P1UpZI/Eg+zYdoMdXvGRVpIwLsicG118ZvfRubowYHMDT4/o7apsQLjAds9E= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732545033; 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=tMm7sfsa5tMZm+9vPsMqJy+JU6H3ZOklscSFRUBodPg=; b=YOShLxUXYKdaoQYFbYHn9TY7ybH7GteaIoxdv3L0j1HnMWeiqC9BjA4I/uJ+Acy1kAvoglid17S8lVenm7ErVGTfHR2D0zhhuQ5LesrT3Zahvj5xXqX5roncvVKq9TVHEjXwj3er0c5lDfoJr9fYyk5YERuoNYx2/Xf7sppFzC4= 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 1732545033048642.8955847949361; Mon, 25 Nov 2024 06:30:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFa3y-0007bK-5L; Mon, 25 Nov 2024 09:27:42 -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 1tFa3w-0007Zy-6G; Mon, 25 Nov 2024 09:27:40 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tFa3u-0001VO-C1; Mon, 25 Nov 2024 09:27:39 -0500 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 4AP6fcpS006728; Mon, 25 Nov 2024 14:27:31 GMT Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43384au7aj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 25 Nov 2024 14:27:31 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4APENbjt023448; Mon, 25 Nov 2024 14:27:30 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2169.outbound.protection.outlook.com [104.47.59.169]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 4335g7k1py-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 25 Nov 2024 14:27:30 +0000 Received: from CH3PR10MB7329.namprd10.prod.outlook.com (2603:10b6:610:12c::16) by IA1PR10MB5995.namprd10.prod.outlook.com (2603:10b6:208:3ed::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.21; Mon, 25 Nov 2024 14:27:28 +0000 Received: from CH3PR10MB7329.namprd10.prod.outlook.com ([fe80::f238:6143:104c:da23]) by CH3PR10MB7329.namprd10.prod.outlook.com ([fe80::f238:6143:104c:da23%4]) with mapi id 15.20.8182.018; Mon, 25 Nov 2024 14:27:28 +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=tMm7sfsa5tMZm+9vPsMqJy+JU6H3ZOklscSFRUBodPg=; b= dyAlblfLsgGCFiIaJjIu+9ai/k1VUQ5bKoBDDxDQch/7JsUebco3RS6ZnimrFy2c +d1a4ua8T1eLiPOMflLM4VDnRVdH+pJ0oPQP9JSQTY5sqAMbIZi/VJgrHCRAorYy dey426FvkgFHrhjUzkhZ8J5RwOTRDXqKXYwxvTS9pr9/7vX3dxrVQ+fbcSuk1pxv +B7lquUJn9ci5E47ysxMplXeYS12lF8fvfs72wlPcAcXulAIRpFO1JOtekNIs/6U K3ZcxznLdHgC/JnhN05lzJl8LEClBhWxtUB38sfV0dhm0z9M/A993/txy/SJfZIr jQJgCKKb43lAPERCmBmO8A== ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bf9mBq76uxsPPpDOthxcOOfAvBPLvYnldyFqrs3LhogjbAIj1KAYeBpbc40F6jpnMlr8dU1XHOddhyEUvH0lcErWCXQCnvxavzLOVYcUZCJ0bMPJNMYpi7NJQzWt1BrYGeV+KJns80Z/xjAnoA4kWOrsMr5kTCoUf+mxNsIno4Ef2Q1WQTXY4B/lYp9j1/ANzSV7wXQXt24oXwpNa23bVwBeaEmqQqtF4jRFUL9ruvkjstNiWDJrNvK1Tl4ptjgNW4sVBjaQhZjWhNqUnEIj/FfriIgMfy0ZHcjiM8d7j8gJ7DMJKkUMsDokjzZHcXpraWBA0meubnF/ibiSPxYcSA== 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=tMm7sfsa5tMZm+9vPsMqJy+JU6H3ZOklscSFRUBodPg=; b=VUy+NV4SeSE1roQiW1ABgO3Jj5QERjZiJnbOALI79bEb2z7S//BezqxjnE8suppIXy80JjBlF121QDGfNvhVeq//bxRITQbKGd+rEhSO6Is55ikd9a9Z0METNdpmwcWncLaPncfURjx2DNstIOPLS9cG6tKFbySJj6Z1F4QsPrLGfNe2O9HXqBsvMYWtzmVS3yHREzRVqd8LhbVVEqsWLO9+URiI36/Wp1gp0Fqt/dIJzPItwSSPQUnG/5tz76bPRUTNevSqoPy9u9z7hwVzAafAqWESGKsxy/VDJ1OKCVVlblKkOLmJc2j+j9bypw9IOdSvgeuMlWeXsU7rR/nwwQ== 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=tMm7sfsa5tMZm+9vPsMqJy+JU6H3ZOklscSFRUBodPg=; b=ItrXmzZIijZXt0eccTSA0AzsnDbpfxhQG9pCu2VFfBFFyGrEMKgYD2PKUihmSVX6oQWEQxKywm5snN/31tVIQEHJ9G95x21wR44U4h5FY7mS2TSom2z9pX0aW4SdUr+UolGGgbIK0C20Pon6QMv18k5uXmaa32Ro98uiQjPxn+o= 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 v3 5/7] hostmem: Factor out applying settings Date: Mon, 25 Nov 2024 14:27:16 +0000 Message-ID: <20241125142718.3373203-6-william.roche@oracle.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241125142718.3373203-1-william.roche@oracle.com> References: <20241125142718.3373203-1-william.roche@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: CY5PR17CA0018.namprd17.prod.outlook.com (2603:10b6:930:17::28) To CH3PR10MB7329.namprd10.prod.outlook.com (2603:10b6:610:12c::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR10MB7329:EE_|IA1PR10MB5995:EE_ X-MS-Office365-Filtering-Correlation-Id: 0b920879-52f0-45d4-91f0-08dd0d5d4a20 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|376014|366016|1800799024|7053199007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?nol3CV5FOuL0MM/dXQudAlCt2afV+WN2CUPVEM1mHivm5PX0+8H6UmatY+gF?= =?us-ascii?Q?KTakGZPWqmIM/w5zbhPXz1lyhWlgl5G666QPM+xafgYRM0IWjjm6dJo8H9Ru?= =?us-ascii?Q?AMdIQYMcw9cQ+N4fZtEFb/wJEY74I+C4KImBmsdf/N5BX7BsPHCiFgh3ClVc?= =?us-ascii?Q?4B0dPPlf+pZlW4OYJ8puh8Cwt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3xa?= =?us-ascii?Q?PIyAdBj8ZcMQM2j4QJK1LjU3UuAOEmWetHyjJ0oIp64oliMZI1HcLjC4PhEN?= =?us-ascii?Q?gmfi3tVhFXC6QqeErFYR88n8ihcwdR2ZR+iD8TvXM3dZcSd6O/sS6rmNOa+Y?= =?us-ascii?Q?aVAD5TYT0WNdZQJl+VpaCvFVgoaQzqg6RM3nVKfCSuQrnBUCH8DqhT4rIQ8l?= =?us-ascii?Q?SM03q2oaBWDWDpKP1lkWPg1PNzhMDAqIEIlDljW0Apt1UrKUWd2TYjxJkPC1?= =?us-ascii?Q?5MF5Pdnog+t+0hurYjmXLCLBaZs62On0ptmfEqSYVlQ5hQ=3D=3D?= 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)(7416014)(376014)(366016)(1800799024)(7053199007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?IO4IS9ecFK9vWFef2QQBg6pODatgIxNHlpmln9JJr6xaGoPwXxlJOj3zSArl?= =?us-ascii?Q?EUU3yD8G9naXHpCeSPpj80KvDrmZM+5tCrW2v4aYR5pfwN8uapCNne03ysyL?= =?us-ascii?Q?qlPGMybfExEHLFehY7i77sqKO4PuMFUqCq4QzIs+2PShcCv4q5yjPysdNiMe?= =?us-ascii?Q?4IkX+iqp49Ri04145r3LufXOLEiYhFIF2aaqtfn1wC686SaY9k255rd6dmyt?= =?us-ascii?Q?Y/Nu/Skoc8+sRHIi/iOMpkA7gLkuXumu85TJZpdnkRjayyYekWmWcoqacfWI?= =?us-ascii?Q?1ykRjdf80WFcQ3ecf4tF8sapgF1j+j+ob1j1D964XGuNGmlLPT53cqzeIdff?= =?us-ascii?Q?jpUIkYHK0/3UX18AAF/J46znUNnpPNPdsznPNlffj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PdfIvraYCVsxEn91eDr/qCpUtqe7bMzm/rhXKv8sGRspanUrf0e77c= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0b920879-52f0-45d4-91f0-08dd0d5d4a20 X-MS-Exchange-CrossTenant-AuthSource: CH3PR10MB7329.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2024 14:27:28.4881 (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: e4Blo6kK4eN/AFqATgTjeyHqiAne1hEDFLCTIHZqc3Z0GIuhu4Oh2A+U5KDVG2ivYRz5lnepiYQs1J4x8Y0IGIhPUPjh6zcA9R5ki/B5TAA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB5995 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-25_09,2024-11-25_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 phishscore=0 adultscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2411250122 X-Proofpoint-ORIG-GUID: uVWDEO6C_G4ekZmF_Y69t0MhLgViO8aq X-Proofpoint-GUID: uVWDEO6C_G4ekZmF_Y69t0MhLgViO8aq 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.177.32; envelope-from=william.roche@oracle.com; helo=mx0b-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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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: 1732545035399019100 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand We want to reuse the functionality when remapping or resizing RAM. Signed-off-by: David Hildenbrand Signed-off-by: William Roche --- backends/hostmem.c | 155 ++++++++++++++++++++++++--------------------- 1 file changed, 82 insertions(+), 73 deletions(-) diff --git a/backends/hostmem.c b/backends/hostmem.c index 181446626a..bf85d716e5 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -36,6 +36,87 @@ QEMU_BUILD_BUG_ON(HOST_MEM_POLICY_BIND !=3D MPOL_BIND); QEMU_BUILD_BUG_ON(HOST_MEM_POLICY_INTERLEAVE !=3D MPOL_INTERLEAVE); #endif =20 +static void host_memory_backend_apply_settings(HostMemoryBackend *backend, + void *ptr, uint64_t size, + Error **errp) +{ + bool async =3D !phase_check(PHASE_LATE_BACKENDS_CREATED); + + if (backend->merge) { + qemu_madvise(ptr, size, QEMU_MADV_MERGEABLE); + } + if (!backend->dump) { + qemu_madvise(ptr, size, QEMU_MADV_DONTDUMP); + } +#ifdef CONFIG_NUMA + unsigned long lastbit =3D find_last_bit(backend->host_nodes, MAX_NODES= ); + /* lastbit =3D=3D MAX_NODES means maxnode =3D 0 */ + unsigned long maxnode =3D (lastbit + 1) % (MAX_NODES + 1); + /* + * Ensure policy won't be ignored in case memory is preallocated + * before mbind(). note: MPOL_MF_STRICT is ignored on hugepages so + * this doesn't catch hugepage case. + */ + unsigned flags =3D MPOL_MF_STRICT | MPOL_MF_MOVE; + int mode =3D backend->policy; + + /* + * Check for invalid host-nodes and policies and give more verbose + * error messages than mbind(). + */ + if (maxnode && backend->policy =3D=3D MPOL_DEFAULT) { + error_setg(errp, "host-nodes must be empty for policy default," + " or you should explicitly specify a policy other" + " than default"); + return; + } else if (maxnode =3D=3D 0 && backend->policy !=3D MPOL_DEFAULT) { + error_setg(errp, "host-nodes must be set for policy %s", + HostMemPolicy_str(backend->policy)); + return; + } + + /* + * We can have up to MAX_NODES nodes, but we need to pass maxnode+1 + * as argument to mbind() due to an old Linux bug (feature?) which + * cuts off the last specified node. This means backend->host_nodes + * must have MAX_NODES+1 bits available. + */ + assert(sizeof(backend->host_nodes) >=3D + BITS_TO_LONGS(MAX_NODES + 1) * sizeof(unsigned long)); + assert(maxnode <=3D MAX_NODES); + +#ifdef HAVE_NUMA_HAS_PREFERRED_MANY + if (mode =3D=3D MPOL_PREFERRED && numa_has_preferred_many() > 0) { + /* + * Replace with MPOL_PREFERRED_MANY otherwise the mbind() below + * silently picks the first node. + */ + mode =3D MPOL_PREFERRED_MANY; + } +#endif + + if (maxnode && + mbind(ptr, size, mode, backend->host_nodes, maxnode + 1, flags)) { + if (backend->policy !=3D MPOL_DEFAULT || errno !=3D ENOSYS) { + error_setg_errno(errp, errno, + "cannot bind memory to host NUMA nodes"); + return; + } + } +#endif + /* + * Preallocate memory after the NUMA policy has been instantiated. + * This is necessary to guarantee memory is allocated with + * specified NUMA policy in place. + */ + if (backend->prealloc && + !qemu_prealloc_mem(memory_region_get_fd(&backend->mr), + ptr, size, backend->prealloc_threads, + backend->prealloc_context, async, errp)) { + return; + } +} + char * host_memory_backend_get_name(HostMemoryBackend *backend) { @@ -337,7 +418,6 @@ host_memory_backend_memory_complete(UserCreatable *uc, = Error **errp) void *ptr; uint64_t sz; size_t pagesize; - bool async =3D !phase_check(PHASE_LATE_BACKENDS_CREATED); =20 if (!bc->alloc) { return; @@ -357,78 +437,7 @@ host_memory_backend_memory_complete(UserCreatable *uc,= Error **errp) return; } =20 - if (backend->merge) { - qemu_madvise(ptr, sz, QEMU_MADV_MERGEABLE); - } - if (!backend->dump) { - qemu_madvise(ptr, sz, QEMU_MADV_DONTDUMP); - } -#ifdef CONFIG_NUMA - unsigned long lastbit =3D find_last_bit(backend->host_nodes, MAX_NODES= ); - /* lastbit =3D=3D MAX_NODES means maxnode =3D 0 */ - unsigned long maxnode =3D (lastbit + 1) % (MAX_NODES + 1); - /* - * Ensure policy won't be ignored in case memory is preallocated - * before mbind(). note: MPOL_MF_STRICT is ignored on hugepages so - * this doesn't catch hugepage case. - */ - unsigned flags =3D MPOL_MF_STRICT | MPOL_MF_MOVE; - int mode =3D backend->policy; - - /* check for invalid host-nodes and policies and give more verbose - * error messages than mbind(). */ - if (maxnode && backend->policy =3D=3D MPOL_DEFAULT) { - error_setg(errp, "host-nodes must be empty for policy default," - " or you should explicitly specify a policy other" - " than default"); - return; - } else if (maxnode =3D=3D 0 && backend->policy !=3D MPOL_DEFAULT) { - error_setg(errp, "host-nodes must be set for policy %s", - HostMemPolicy_str(backend->policy)); - return; - } - - /* - * We can have up to MAX_NODES nodes, but we need to pass maxnode+1 - * as argument to mbind() due to an old Linux bug (feature?) which - * cuts off the last specified node. This means backend->host_nodes - * must have MAX_NODES+1 bits available. - */ - assert(sizeof(backend->host_nodes) >=3D - BITS_TO_LONGS(MAX_NODES + 1) * sizeof(unsigned long)); - assert(maxnode <=3D MAX_NODES); - -#ifdef HAVE_NUMA_HAS_PREFERRED_MANY - if (mode =3D=3D MPOL_PREFERRED && numa_has_preferred_many() > 0) { - /* - * Replace with MPOL_PREFERRED_MANY otherwise the mbind() below - * silently picks the first node. - */ - mode =3D MPOL_PREFERRED_MANY; - } -#endif - - if (maxnode && - mbind(ptr, sz, mode, backend->host_nodes, maxnode + 1, flags)) { - if (backend->policy !=3D MPOL_DEFAULT || errno !=3D ENOSYS) { - error_setg_errno(errp, errno, - "cannot bind memory to host NUMA nodes"); - return; - } - } -#endif - /* - * Preallocate memory after the NUMA policy has been instantiated. - * This is necessary to guarantee memory is allocated with - * specified NUMA policy in place. - */ - if (backend->prealloc && !qemu_prealloc_mem(memory_region_get_fd(&back= end->mr), - ptr, sz, - backend->prealloc_threads, - backend->prealloc_context, - async, errp)) { - return; - } + host_memory_backend_apply_settings(backend, ptr, sz, errp); } =20 static bool --=20 2.43.5 From nobody Wed Nov 27 18:38:13 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=1732545011; cv=pass; d=zohomail.com; s=zohoarc; b=SzdAayhjrQRGZm0LIrOAXMv2ln3f6ImzLJDdktlAA661EBS18Y2VomytGbGWJ3kZil6vrH0hTEGTitzVYNGnyyEczepTxsY2vUmZiSrmANPECuNtj0408DNCod1iWJk7ni3G8CVBVKYIoVYP98GjjPdmiMbnD1mX3Enlq7lF5mw= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732545011; 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=uLhbKhI5RH66g6X1oJem2vCjv5om1/AgyTDM5B2oaik=; b=nzvFK7uQlTRwysQoIBY5qUlDRqrrrXj8Ukxu3h7D9fs3LBC5n6BYUAyElYZMOQSq+g4ea9RXDpOPH3xu1gBaDPoajyQl8WWDKuUqhhua50h1lqt0hvz4+FziL79MRj7PnHfnAsaNCXvIof8HnoR3dxTv0LSI9FIOpPI9jN7lld0= 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 1732545011777482.1688002625982; Mon, 25 Nov 2024 06:30:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFa42-0007dd-8N; Mon, 25 Nov 2024 09:27:46 -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 1tFa41-0007d4-0Q; Mon, 25 Nov 2024 09:27:45 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tFa3z-0001Wk-Bs; Mon, 25 Nov 2024 09:27:44 -0500 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4AP6fk15003729; Mon, 25 Nov 2024 14:27:36 GMT Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43384e369k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 25 Nov 2024 14:27:36 +0000 (GMT) Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4APDnGGX004564; Mon, 25 Nov 2024 14:27:35 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2168.outbound.protection.outlook.com [104.47.55.168]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 4335g7j5eu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 25 Nov 2024 14:27:35 +0000 Received: from CH3PR10MB7329.namprd10.prod.outlook.com (2603:10b6:610:12c::16) by IA1PR10MB5995.namprd10.prod.outlook.com (2603:10b6:208:3ed::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.21; Mon, 25 Nov 2024 14:27:32 +0000 Received: from CH3PR10MB7329.namprd10.prod.outlook.com ([fe80::f238:6143:104c:da23]) by CH3PR10MB7329.namprd10.prod.outlook.com ([fe80::f238:6143:104c:da23%4]) with mapi id 15.20.8182.018; Mon, 25 Nov 2024 14:27:32 +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=uLhbKhI5RH66g6X1oJem2vCjv5om1/AgyTDM5B2oaik=; b= C6q5AEFd/S2NqIUqIhdbNY6b6BlJfQrq9mo7k+pXg6/ZxF/xtwPYv7qomFpYsAba fmdvDZIX2oFw6/68FDmbbCwqLwmXvUZ38g6i+2IXSMRVvCto1Qk+euHT53NTONXu D2cwOO00nzAeOeHxwdY2h221Tj0t6HpP2kM4B5IfomQ6rtWIm/mlKUUjb6vJL9gv zy00t3UuCDnzXUlLvXUfKVQ3VJkL0aUjSO11atME/863KHkP2V7fTRTxZ6PdUVIq oFNNmvlQCHGSpWhL7H3uWdYznJ04CmqHZ/w1hcaiZFrVd80yjdsBc+VASDW32/oJ nxOB/CBog8c6PnfB04Z1DQ== ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=AA4lWfVwaQZx81vkcEU7N6CQrBXjXWnRoJM7PLcA6c2SD/DB+xVNSWf048e1IadwGETLD70Pg7Gh2vHAbA6ZXofUujMhajzPsOKMGlcSDizJDEK91eGnjcPrxq/IsQvKC9DjV2FU7r5u9XmW95RauFpKCdSDCUXEerQR04BhuzslMo1SKe+SyzJooF+Vi+zyXV1objfA20W8Lr0rlvupC9DBIw+MXS9CLyLkxhY+VKer/GTcedFtL2rTknWvvQZ/dIrbFu/DsQznvKQCGvb8nSg2hFdiGvw5WHXDW6kpwJTjZX1LrRpmzOUsUuUTDgMNSny6QVXR3qAPlfWQbXa7AA== 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=uLhbKhI5RH66g6X1oJem2vCjv5om1/AgyTDM5B2oaik=; b=Fp8KLvxT7C0MEgHf9DHUmgKhugsNDPK2Cnnbc21R84KTStbc2H4kpnvfZRfxNNKHGDUoBXXMobyBmwoYEqskau3rpOC58nB+dM2XLXw7Os6FLif/jspHGFQ3O9mTZh87wT0pt0hV3h5l/+lnd3wdTxaXUUFyRIwXXf9FGryhCliS2bHW44KHU06QUPdEp8dx9WilxoHOcJAH36PAWr0avFd2VoOOIh5kTdPGHLywX1+RcqAfwhDfcH23x9el5PgziP38KN19bL7qhDPeDxsolgAVVmNdweYM7m5M/WMbNJHMo0WxD8vB5CLx6SIpHP9PKwXqLdrWlD/OF9NRTQxsDQ== 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=uLhbKhI5RH66g6X1oJem2vCjv5om1/AgyTDM5B2oaik=; b=CjVPdvc/U/aif45smqR+W/kMJVxZGvvw6pSn+sflrE7OOfOmNZgN6170OUmscK2PVV9/an4oDKk5ueT9FidaOKBatuGNSEPlj0aPDgwrMLWCSbucMQa4YMguJGoxOcVac7fO/OaMtV28MgD78Dyi6kjuHFSSVFTLe1Lniw0O6yI= 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 v3 6/7] hostmem: Handle remapping of RAM Date: Mon, 25 Nov 2024 14:27:17 +0000 Message-ID: <20241125142718.3373203-7-william.roche@oracle.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241125142718.3373203-1-william.roche@oracle.com> References: <20241125142718.3373203-1-william.roche@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: LO4P265CA0034.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2ae::8) To CH3PR10MB7329.namprd10.prod.outlook.com (2603:10b6:610:12c::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR10MB7329:EE_|IA1PR10MB5995:EE_ X-MS-Office365-Filtering-Correlation-Id: 9e5a0238-f9da-422b-83d5-08dd0d5d4c5d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|376014|366016|1800799024|7053199007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?75dhWzv3TbugQTe/DJWPvKzCXeZBMozvZ0SGUAbk5kzPWlPMvfTSLeqURA8P?= =?us-ascii?Q?CUC1LCNhoyfBfMLOY5FsoXwhEeFZmHqJAUvH2BBOU31D8TXFXKMsG+bOPBMh?= =?us-ascii?Q?8XhEBTV/DYe2ulemdFMYFPjuUUqmgqa0Z7cmU2BU0FKrUmoJuuba6mSXpLuW?= =?us-ascii?Q?IWG7Y4jFc06DEGlDhaBXZ1xRz8Lo6jkdQufq9Zbnqmc6wnWU14q/sqVKq4zY?= =?us-ascii?Q?x/d27QCtCgtVrJdGPMeAVc3Kr5ButiW4ESRbgQ0fTPXIJzvvmWxMOVwx9ij9?= =?us-ascii?Q?eP6jgvtpRqod/GgzKpcxMfKjIYs7V2FRJyBC365ehSUR/KJ/u6xsFW8NU3PS?= =?us-ascii?Q?SXO8uoN892ujy8L0gPXjTZYb8Hov4SY37BHArHelk2CJ/oSt3xej5t7oeRvm?= =?us-ascii?Q?uzFBSxmQpAcnTAnXfd8XJH35yd1yO8I2fesIWuQMudyc78quZLx0QQFApYM6?= =?us-ascii?Q?4A9oinb4twdYTBgv0NpXBRl8EDPVCHbl2fpl/965DdXDyVizQhDE1PMI6fzE?= =?us-ascii?Q?0IndNSdm3JUVrOyNrHgQ+EcIoMt8wVnBYRit2i8kVgSWayB69YWcf5ca34xt?= =?us-ascii?Q?BjrA4jIHGuHOGLiE9ijDV+3lIRqxPpUQ2UnJY0dxeP5u6gFUmCmfbf3RbJZI?= =?us-ascii?Q?VrIq3+BAaPNrjaX/uc6YyWzZ5Y2JazZ1a2fcKVNIZkkriHB2BfEYKmsB6mts?= =?us-ascii?Q?VEGQXojvIUCLpGFc3EWiWDWRTxJKDwi3n+FHyItRjrllxq+mQG3zFkzaj1b8?= =?us-ascii?Q?pzOSce5j4VhF4Gg0GA8bGgNR3gRyHstkLty+8JiCGKKcv6ZZesLl5378XFgK?= =?us-ascii?Q?ZkbiXtATsigjdSmDfNMmYQZDsTSRoHL93B5hMPOaPKeMMQJaRYQRpSPVlmcf?= =?us-ascii?Q?c049kyaP0OvgzGkI5mFSUZ/UcbvChiKFzjHHgqAJychz082N/XJ4Mo2Wy7rv?= =?us-ascii?Q?3zRUNiqwUwrsOqggVgJ7vbU34U6fRoZs8R90mtJvJou0Q1wiVKqAmJRgm8pX?= =?us-ascii?Q?tfUhSv5m7rDjYEFLPAWkp3u0nPGVvUAVhcDyjFYLO6S6ijcRy0xukLkxq42s?= =?us-ascii?Q?6WQuaLE31NQhiVDNYT5jldicnLwV71JnwUCHQtAC+do2uefgsy2ecdPxgoVT?= =?us-ascii?Q?g0cUqSMRLp+JbaFWr6CxTc2kOhpJ1DWDdAW2NPWCm4JSZCHTF+lNFxg203G0?= =?us-ascii?Q?fgOUnE+CQeTPofJyw/0LeRBHyPG/wjYpmWJCF+NWnIMMY6nE34VGOUtxBmgX?= =?us-ascii?Q?7LLEmYpYwik9BKwJ71tQArRY9UCils5Xrc2MikH+OgTcyQdKCgAkWlEURDI5?= =?us-ascii?Q?dYXj7jWvRPxiVJCZCpXs9N2jADKBdILrQ6pms/MTorTcaA=3D=3D?= 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)(7416014)(376014)(366016)(1800799024)(7053199007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-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jljfoE9QVRGDtePylijaDaRiwkeBe+tYjYJea+YnVicS5?= =?us-ascii?Q?sDgbX3DniX8d3TXJ3MN+gqcenY8ViXVp1+FeL2sScb0WTS64uHw3+bTz8AwZ?= =?us-ascii?Q?83ozXG73reazjXexw6DSDhz74LjrhWUlQo0Kd4OeC7gzYi+JbabVN+F7xEUX?= =?us-ascii?Q?aVyZr+nFD2p9SN+TsDDypxLH7ts6iVT5AGm/EfpZ5lEOAcfExf9Yerq+oKkc?= =?us-ascii?Q?bKI+mYHoSE32m0v3vaBvChHHochozbRnZ50yADyvwrHNIfcKVmiVxIQreoYE?= =?us-ascii?Q?iQqy0evYVzAO5EivY0SJQFlg9X+l/snQMI7vR5CU09qUMNqv00qU4bDAKAzd?= =?us-ascii?Q?lS5BZ7YuPkcLc2+tQnzyCYaRmQaH/n6eQE4lNcvHfQzBgjBLcUst8BprTSMk?= =?us-ascii?Q?mdt3mDlaCJ04XJRXrHDuhasEAZ8f5zT/ndwOKexayj/szLcehJhbWEyfV0F2?= =?us-ascii?Q?DXUnxTHIhlRT5fTofsLWyg7gtUG6cAcv0UJNDHem6virICb4gTbMq8UA/UXS?= =?us-ascii?Q?j91rGOxLmZeJMSaIc+y47iAEP55PljZurG9w8teYgljNqZW09mVhF3fJ1qEO?= =?us-ascii?Q?5yOTT05DWMx5Ry3+A3Umn7TbZT9lXqL/30PSNmACGPjXb6CaTrfpbuSoyoII?= =?us-ascii?Q?fk6gWa+folN7xrC1S4YTDVASvAFinoMkjJ9eU9X6j68zcqLKgNPRhdcBZkIR?= =?us-ascii?Q?AZ9nN4brIS5hJT8dmd+C5cykMxZqmEq7wCxiRPSlXAu0aa8HQqBLUveEqxcn?= =?us-ascii?Q?5A=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: B5gN8+tSHm+LkP7qank2XU0+dnF/459T2pTcvDyS+g2r3bl5KRjl8go58OFkX9IwmN9tOWTEGoebR39AzcKG4Hv8zZriAGDay6YHI8bjRdGNaxgYLwQqTQ8ajYE3nzi9+P9c61k/PxlF4RsXXfIZ/zoRhYHxypgpN1OKB/kXFyuTN/4l4W8OemJVkhkGiY34niAGuqSVTBtcpTNj+kCwLWAET8KDqnvcMw8yL88GWd9rvHuuSmRKuZQAdxYXqoUE5sjVkFbifyh/R0EO1ca0e9Ntp/pwRYOBZeDgpQ9WdLs79LOjDCWhn6KP51Ba9jHim0g0Zdb3yn+J3jZaev1BzImtjZP7rgKlVqtZK5CQMWD9cvGTbVAvu5FF2vq4B39b9twc9EG9mH7RHJb0wcOLqx5eJjqiylP3qhn2bybyAADbiJMZ4EffFyxv44RSpdez2aWWX6CjncKNJaBJCDzqXuLmiqjpJA8xTXIZDegAoP8RrRLEI/fAjhG8WARMoFP90o2BwzbddPkOLjbd5Vc0K8K0lyuFZ00CfYaFV8L1oalQEp2facT8OA28yeK5TI3eShAFI0zEPKKnpg7w5mXkk7MA+2UYx2+XRTnbIEIC7tw= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9e5a0238-f9da-422b-83d5-08dd0d5d4c5d X-MS-Exchange-CrossTenant-AuthSource: CH3PR10MB7329.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2024 14:27:32.3144 (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: +aLBZ8ibvyZlTu4l2eADfTrPqSyGnymAdqJtP2NGAR0MF79mTE5TMfLMWNhD8FsM+pl15vfiCFcYqwMbVmy+Z8ztDOJVa5G7+7qaAbKio9o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB5995 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-25_09,2024-11-25_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxscore=0 adultscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2411250122 X-Proofpoint-GUID: qEZxZVNDXFh7sP87PW7FXQc6OUgzpczh X-Proofpoint-ORIG-GUID: qEZxZVNDXFh7sP87PW7FXQc6OUgzpczh 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.177.32; envelope-from=william.roche@oracle.com; helo=mx0b-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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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: 1732545013024019100 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand Let's register a RAM block notifier and react on remap notifications. Simply re-apply the settings. Exit if something goes wrong. Note: qemu_ram_remap() will not remap when RAM_PREALLOC is set. Could be that hostmem is still missing to update that flag ... Signed-off-by: David Hildenbrand Signed-off-by: William Roche --- backends/hostmem.c | 34 ++++++++++++++++++++++++++++++++++ include/sysemu/hostmem.h | 1 + 2 files changed, 35 insertions(+) diff --git a/backends/hostmem.c b/backends/hostmem.c index bf85d716e5..863f6da11d 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -361,11 +361,37 @@ static void host_memory_backend_set_prealloc_threads(= Object *obj, Visitor *v, backend->prealloc_threads =3D value; } =20 +static void host_memory_backend_ram_remapped(RAMBlockNotifier *n, void *ho= st, + size_t offset, size_t size) +{ + HostMemoryBackend *backend =3D container_of(n, HostMemoryBackend, + ram_notifier); + Error *err =3D NULL; + + if (!host_memory_backend_mr_inited(backend) || + memory_region_get_ram_ptr(&backend->mr) !=3D host) { + return; + } + + host_memory_backend_apply_settings(backend, host + offset, size, &err); + if (err) { + /* + * If memory settings can't be successfully applied on remap, + * don't take the risk to continue without them. + */ + error_report_err(err); + exit(1); + } +} + static void host_memory_backend_init(Object *obj) { HostMemoryBackend *backend =3D MEMORY_BACKEND(obj); MachineState *machine =3D MACHINE(qdev_get_machine()); =20 + backend->ram_notifier.ram_block_remapped =3D host_memory_backend_ram_r= emapped; + ram_block_notifier_add(&backend->ram_notifier); + /* TODO: convert access to globals to compat properties */ backend->merge =3D machine_mem_merge(machine); backend->dump =3D machine_dump_guest_core(machine); @@ -379,6 +405,13 @@ static void host_memory_backend_post_init(Object *obj) object_apply_compat_props(obj); } =20 +static void host_memory_backend_finalize(Object *obj) +{ + HostMemoryBackend *backend =3D MEMORY_BACKEND(obj); + + ram_block_notifier_remove(&backend->ram_notifier); +} + bool host_memory_backend_mr_inited(HostMemoryBackend *backend) { /* @@ -595,6 +628,7 @@ static const TypeInfo host_memory_backend_info =3D { .instance_size =3D sizeof(HostMemoryBackend), .instance_init =3D host_memory_backend_init, .instance_post_init =3D host_memory_backend_post_init, + .instance_finalize =3D host_memory_backend_finalize, .interfaces =3D (InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { } diff --git a/include/sysemu/hostmem.h b/include/sysemu/hostmem.h index 67f45abe39..98309a9457 100644 --- a/include/sysemu/hostmem.h +++ b/include/sysemu/hostmem.h @@ -83,6 +83,7 @@ struct HostMemoryBackend { HostMemPolicy policy; =20 MemoryRegion mr; + RAMBlockNotifier ram_notifier; }; =20 bool host_memory_backend_mr_inited(HostMemoryBackend *backend); --=20 2.43.5 From nobody Wed Nov 27 18:38:13 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=1732544937; cv=pass; d=zohomail.com; s=zohoarc; b=T94aAlleBJiauFlJPFKmvqQt+epjfnxZ3Cr5GORglHxwROykmvpcnwVsnqXAS3IiPJuM2IA98Ka7uoR3lymZ4LtmCRkYuPcFPMv8NJ783H17rpHxvIKus2T7IN2w9lkEJ0prSd5ZGirqkS2C3HSxIwtZP0pa97vwNmWFhR4l+VY= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732544937; 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=0dYtQssQodKteOemuW+BXocH/li0Yw0mJiC2BY/oj6c=; b=VMaNrxFaYtgMenRdV5etEarOAR+oj9wUUYX0/xTXiLFkkkkgiqtJoWkVAM1A0WR0FAT4VBrQ+2h6PHiJ+g1XP8Uuv48TjAF64tEe/1Hi7OngRmld4Vs+RJ2mEhUvzPl7M9X+p58t8JXkfQML2fQ9XP8PXb+8Dmu5J9UXNC5FEjw= 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 173254493725384.67403053831606; Mon, 25 Nov 2024 06:28:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFa49-0007f2-Rx; Mon, 25 Nov 2024 09:27:53 -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 1tFa47-0007ek-8y; Mon, 25 Nov 2024 09:27:51 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tFa45-0001XS-NX; Mon, 25 Nov 2024 09:27:50 -0500 Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4AP6fdj5013071; Mon, 25 Nov 2024 14:27:40 GMT Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 433874b7eq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 25 Nov 2024 14:27:40 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4APCZj77027232; Mon, 25 Nov 2024 14:27:39 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2168.outbound.protection.outlook.com [104.47.55.168]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 4335gdy6ak-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 25 Nov 2024 14:27:39 +0000 Received: from CH3PR10MB7329.namprd10.prod.outlook.com (2603:10b6:610:12c::16) by IA1PR10MB5995.namprd10.prod.outlook.com (2603:10b6:208:3ed::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.21; Mon, 25 Nov 2024 14:27:36 +0000 Received: from CH3PR10MB7329.namprd10.prod.outlook.com ([fe80::f238:6143:104c:da23]) by CH3PR10MB7329.namprd10.prod.outlook.com ([fe80::f238:6143:104c:da23%4]) with mapi id 15.20.8182.018; Mon, 25 Nov 2024 14:27:36 +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=0dYtQssQodKteOemuW+BXocH/li0Yw0mJiC2BY/oj6c=; b= B/KPsn+zzLgJ5iNdEPykSXXnq4HEzEQskYe5JzfKycuRutEIDJUW/ZB91L8QyWh5 9CDIAgRDwjg/+K7S9jhh5wJNsSNC+gpyrz8LJzcHzPmC74clCXucs3QHZ/yeuNOe GZNtx3cpO0rVsJxQqbFeu4XPLptUpL0MU1qX+8ltfYdYyj2gaeLjswbiNg/YyLzK y8SKsvNcSJpGeNSxjP0kkXBekmLGWS078Y1t0oWx8LVpDlouW6l73vrqiCve2mWl mkhg6C7zhUml3pSeHXlugu1dUSmK7+uVb7xHEDybPYifp8vOi9/wnq4ElWFTNuKD jrTwvFqIgdyPi6mi7TIxBw== ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=t13KrUF5FGIdckmUWWWSW48oMC6Ho/ftcSS9MYBp78+HbUwtKafms+gLhsyy0UCfYb6D6SCDgC5sst8wWYcBcj1S/AyZMC+3fNBPpIY9PzM3dg0GuV6qAUBY9aGa8F5lDZ2IAv0qZBcv2WdC56qNissP+fGR/8hJhU8YS9GqndgH7QzbnbY/ML/N5Zj98bxBLlBJM0JBTG6Zm3nzhFWz56Mekp2SjUTVWOwR4N9lLnoEH7xc0xhB2YqJhIzSZMOBGtZuEUUKq7e4FFfnE2q4AoRJhh4rOpU6hdkubM/6J9SUXWrjUcEjbb0hOyO3ZDlffCjdfg6hJs1ZaBSWASf9Bw== 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=0dYtQssQodKteOemuW+BXocH/li0Yw0mJiC2BY/oj6c=; b=paTSnpw47VUeaDmseLoXKinApaF49ipt7CfKZS28wqmNsRKR9dFnQYqgx7sFM38xmQpNjFPCc3HAbFt6Djwt6gO0wNEP2IYc7pkKsk2TWFGLWZPULRaB2a7WQIBwvVMZLoSc12y89wByr+HQEvBTj+xj6dYRumZ4R3OLHhCKu2aLleOskpHwwucSlkEkCoYQyp74JhIpC/pgQS0DajQcjQlfaJrhcIy76lNIFPHq7ZaFXaJRcYbGJVvt/NeGPDTCZo68zCpaei8qK4zWJGurEAjuGrwfxteqNpfwWhIQjxhBoKN7CRD1XcEYqSl6fsTN3EpYXYOmoRXOJR8Z6VdqKw== 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=0dYtQssQodKteOemuW+BXocH/li0Yw0mJiC2BY/oj6c=; b=pdU0ExrMANH3G93xF5lqufnmhDusYw4I42I/Z6gHeYawt+V+kY1Pev8vBvD8JbfQTf4CPbrBml9IzCJuAxF7HpJIVuK5xpcd+hywfDM3zfN4Sxacx2rTPW698FHQG1HdsWc4wmfQ1o7uCVL2nimWQ2UVsb4ViL/xBAoJS9FIDkw= 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 v3 7/7] system/physmem: Memory settings applied on remap notification Date: Mon, 25 Nov 2024 14:27:18 +0000 Message-ID: <20241125142718.3373203-8-william.roche@oracle.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241125142718.3373203-1-william.roche@oracle.com> References: <20241125142718.3373203-1-william.roche@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: LO2P265CA0262.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:8a::34) To CH3PR10MB7329.namprd10.prod.outlook.com (2603:10b6:610:12c::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR10MB7329:EE_|IA1PR10MB5995:EE_ X-MS-Office365-Filtering-Correlation-Id: f5bb2cfd-446a-4bba-ac6c-08dd0d5d4ec7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?eiJ6+xmvzQ0RakZ1FXhdFSQOhlHwNWtJsFlqMBSj/PUYPvl++M2TNvPxEgi4?= =?us-ascii?Q?fKwfUQlnRfT6s6KeLRb3jMjjG4fgoDARvezEW07SGPYNwM099kHnzbYXbQ5d?= =?us-ascii?Q?u8FbUD/Zb1UPJw4VYRiF3ImjLX9NL6pUhfDb9Yws76Lv/GfptyLZ/y4ucCye?= =?us-ascii?Q?MAab5+oS+UWmagQEBFhwHOYYAf7MTqlYN7TcFLqtScmsSTLxniRZkQczWCQ4?= =?us-ascii?Q?gUox/5SNwVc/L1Wn8ctV9GcH4d9rOPQJzChshhVl147Y02fAAH9Sz1DkWq0j?= =?us-ascii?Q?dmbDdIGzMBn2a0SrGT0Llh+7CPoYw1M6JKWGgvb7R7TXUKCFusbDlfmyK/jg?= =?us-ascii?Q?onIXq6qacuUB6nH2/7AVDmW6pa1uW9vf8dfHcW1u/XjsiN7CZVRpntCX+kI7?= =?us-ascii?Q?qfJisO7jKLrE3HDPV7QFFKtqFpn8KWr2es7xv41MFiUV60DtQvEBzOkzpqLB?= =?us-ascii?Q?UYOqD3xuKtcc3GqsHyboZe8oLJw8v0DrCHoexUTwPI8FWq6b+EatJ1/pBlmt?= =?us-ascii?Q?mSc/vwSLdz+Td/ym9Fg2/jFuMrC4XaqtSn9kwbEJ2xtrvq0znIl8MZYlAZtb?= =?us-ascii?Q?NcvSIZ3d1hIgWqbnD6ZWugZEPk1qGy2LQKpfTdmEHyvh2D3C9SpEtrH0Lk4J?= =?us-ascii?Q?HohERDq9pi3NCUw2RWJHnrMxI93X3FjTFJEmkIFSwXC0zsFn5nQYvn3gDBO3?= =?us-ascii?Q?tkF2sjNL7WYV2VepT8Uw9uczaXC1kModHDKJ0B4nDEion2FitjKYixdMSxO0?= =?us-ascii?Q?VM1ErtsoWwG8eUrhYLpL+cI6isXszXw8Wrxl3qwHRLf4bCm8gpjyUiAV+9xd?= =?us-ascii?Q?g9XLpFwFIXyItTAm1Xtd7dKo79usABJty08//ZfNMTy8tUX//MAAgKnO3V2z?= =?us-ascii?Q?RV0bn1dfO1EU52dASe3tvVUk3sbOanyALSJnU5PiczzAkPa5TA5cG+Q2X4xt?= =?us-ascii?Q?IbimPirS2Pbev4nJyaxz9g3A7HcId6JRgDeCWUxftCg0T3IGp4jMs+vjUqZX?= =?us-ascii?Q?aJ6ro9A6UhZC4+ggpZgv+bcWVT7344V9nBVeDS9Y5q0/Ex66N4KxdN5h8Z/i?= =?us-ascii?Q?B1VsQacPqz+0vKJOXBpgNwD2+cuG2EBFu/zW88qTCa687I2U4C4LLUGd9ScN?= =?us-ascii?Q?9Vs9bquQ1bsq4sm8/6BQesUon8k3KRn76VVB6ZTBhG3MKG1xeazfhIJuxE5y?= =?us-ascii?Q?ClWMzOmKPtOPdLPYXFE8GK0V/TNahmVfzRA2d+r1icc15rCdI5UP+TnEz/Zp?= =?us-ascii?Q?WTAd4A40e28hbuq52/oqHiRvwFremouwW2TCcBCXE9aSxym+kQjcLTzVN/6Y?= =?us-ascii?Q?w0ietZKxIlaHPGGqxa9dxbbhBnPUIjP2pegwUorPSe3GpA=3D=3D?= 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)(7416014)(376014)(366016)(1800799024); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?oEXuv8I386NmFON1xwAJkDH9DhhaODqAjyifnr5cU80wbxVmy4NoHwkkH+9R?= =?us-ascii?Q?7mAahNzNiRE8ypi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UpK2p78XdQoHiZ71Ay8Qok1t9?= =?us-ascii?Q?PVnx3/LS2T09iNdda81BDwA+uCYwktmBYqTxTSe5CEGJspWG18/xwiXZ5ufv?= =?us-ascii?Q?502Nsaj8eK0gu9/14dNnsyDByrAXUqe3dxxpjbDHEAHN2li8shla/LHLn4Jl?= =?us-ascii?Q?IhxfO2ra6n84yqJYJPpmYLIA2gTV3mdlOXlPF2EzUGLw1cPGIwFdH6hjGng4?= =?us-ascii?Q?OHeSjdaHN9vxwmBA4tBXRrooy/6RwD9kfuuDsWz4GIjyEhBCF46wbWehS4CR?= =?us-ascii?Q?SSPGM4bSKcIxhEwctQRmxyA5C3PQGJkOF0eQC53ljQFp91cE7wnE9ZPJ9Cfy?= =?us-ascii?Q?huvI802fLtooJdBHcD/FuKx9xk0EBftiPMXiq6oUitV19vtRMxVpgrBC8rYx?= =?us-ascii?Q?Bmsy2DUpCIYE/2mWf4fcXJmWg7x8rIa8IXNdrYuKWK0moAgUaLD0YS7tTMDU?= =?us-ascii?Q?bt2ZlUcVpQUpF2KYiq3do8WJ7v7r6uV4PXXmf0oq3poOLGeBGzbPXh6nycVl?= =?us-ascii?Q?SNdHSMmnw5fSZVShLWBM2YW6NncDKADZjCVTKoOfx6Q/oCgpgFAYtu8tDXnd?= =?us-ascii?Q?inMr/yV+kfH/4JfXmEFoR4VYB+R00IxTf2WZYFUN6sFY8M0CpSD9onQgVKvf?= =?us-ascii?Q?UrlnQ57PGQgkZQfSCOVwS3KOCeDmo7q3ZdgaqhkkH0iDjUsjR/S6ZKla2ks7?= =?us-ascii?Q?KQ=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: RjuPKWyIkZ4QQE3VYy+Gb7Xfz/13ZvtVU8y7YTJkOH97YzxeHYWBNxAGnblA64RUJOBDxjsUb26yhRFZGLdn0OD0olbXqnaCFcEQkijlaGq/bjZ/lEyjgl3UhLL/rIzlsrPYoJRO6tQ+md5MkOgUEbklBq4Hu0/hhg5VZhqJl+DO/rVIrCqLN/AiQn2FR9o8lEgG+6QH/NgNVApGzHoovyHlN68fjA4DpOFtiUQ3IYJZM3j5/mjci+ULCnu/pGQYAHNv77EpeInr4vaR110cmqKzfYZ83FTgC+mZ5xlBop9rMpkasV+8CUq0B/dv6YEHwAVezvsYKjYHiwRS7tkZ0RqOLgj8VKjjJCBJgadQ3a1DZodfnvpJp0JUDEJW8/+v40IAEcccll4755320WBB1bYISLVC6TiQ4Rq75TdAMJj+IRxmGEvlq1YZdGKdPJPnxTlbFcSIHaj0ox3EfR9VIbabv1iUHZnEU49ct91sJU1bDKYnaBs7qCVp48wZXqG4U0ZT1WIqXtu3JCQNMraZbSRKRGYIERzG9TB/x+bJCTqHk96pSrQAQajnk9fUSgjXX8OyzH/A+MHiyh69PPfYl1tY8KFc91xwEafzCz1ICG8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f5bb2cfd-446a-4bba-ac6c-08dd0d5d4ec7 X-MS-Exchange-CrossTenant-AuthSource: CH3PR10MB7329.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2024 14:27:36.3800 (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: Qa+GV1QzbvFW4Jnf+t/bTDQRHCneEJ9kkb7VotURVeIBEElS/ZbcH3ZoOmVomtBnte/mm7CHcXDm2Z9oAbuEbosgM6TxM4kOuWrVPRJ8oc4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB5995 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-25_09,2024-11-25_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 mlxlogscore=999 spamscore=0 suspectscore=0 mlxscore=0 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2411250122 X-Proofpoint-GUID: vJgPJ5LSp6LrEIuXe5_aWjpCtwwKb9sL X-Proofpoint-ORIG-GUID: vJgPJ5LSp6LrEIuXe5_aWjpCtwwKb9sL 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.177.32; envelope-from=william.roche@oracle.com; helo=mx0b-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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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: 1732544938739019100 Content-Type: text/plain; charset="utf-8" From: William Roche Merging and dump settings are handled by the remap notification in addition to memory policy and preallocation. If preallocation is set on a memory block, qemu_prealloc_mem() call is needed also after a ram_block_discard_range() use for this block. Signed-off-by: William Roche --- system/physmem.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/system/physmem.c b/system/physmem.c index 6b948c0a88..f37c280db2 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -2243,8 +2243,6 @@ void qemu_ram_remap(ram_addr_t addr) exit(1); } qemu_ram_remap_mmap(block, vaddr, page_size, offset); - memory_try_enable_merging(vaddr, page_size); - qemu_ram_setup_dump(vaddr, page_size); } ram_block_notify_remap(block->host, offset, page_size); } --=20 2.43.5