From nobody Thu Jan 23 03:23:59 2025 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=1737500149; cv=pass; d=zohomail.com; s=zohoarc; b=cWheXVlp7qw/9BbwEdQ6NF4VRSm/T79A4f8LOiBAtdI9A8s3yH3wC9FYx6RIumPSvC5aA4R0AYjg1xydnByTNXn4DVP1WxEMmzc/0zxyQlthlqxrmHahYtqPiN9fPsQK4Pva4cfV5JsFAXeQeoFikRX/Ula4wSFbKZOrTU79BhE= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1737500149; 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=2JebKhSaeSsCDp5vm3YQQekzOPweuydSZzr5zMP6Vj0=; b=F/Dzhj7A4AVzy72zzqd70vqKQHU3jy/nBTDkXoMP/2v7iul828bxpy7ca6GHwdDrGBunfxmUz+vAoVkRy+RFDQTpt9GhiGLMGuE8hBfO4Ck2aPOOdgUD0Tkea4KR7WX/X+GPTJ8HilFRmrarKNxd3nc2leyf08mTRQ4LXLK4d24= 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 173750014936771.35553196916862; Tue, 21 Jan 2025 14:55:49 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taN8m-000053-6A; Tue, 21 Jan 2025 17:54:36 -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 1taN8k-0008WE-Kk for qemu-devel@nongnu.org; Tue, 21 Jan 2025 17:54:34 -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 1taN8j-0001Wv-2r for qemu-devel@nongnu.org; Tue, 21 Jan 2025 17:54:34 -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 50LJJpJt025758; Tue, 21 Jan 2025 22:54:31 GMT Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 4485qkxje2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 21 Jan 2025 22:54:30 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 50LMUKTb030388; Tue, 21 Jan 2025 22:54:30 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2177.outbound.protection.outlook.com [104.47.59.177]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 4491fjem4e-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 21 Jan 2025 22:54:30 +0000 Received: from CH3PR10MB7329.namprd10.prod.outlook.com (2603:10b6:610:12c::16) by SA3PR10MB7072.namprd10.prod.outlook.com (2603:10b6:806:31d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8377.16; Tue, 21 Jan 2025 22:54:29 +0000 Received: from CH3PR10MB7329.namprd10.prod.outlook.com ([fe80::f238:6143:104c:da23]) by CH3PR10MB7329.namprd10.prod.outlook.com ([fe80::f238:6143:104c:da23%5]) with mapi id 15.20.8356.020; Tue, 21 Jan 2025 22:54:29 +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=2JebKhSaeSsCDp5vm3YQQekzOPweuydSZzr5zMP6Vj0=; b= YZplHiQN+dJs0sQ1wzZ4w223jOHaLpcEP0K1Vy9WKVlH5+H/L/lsvdluVkqnrid2 wAlpqD4vdMHje7P6pEz7MxMTf8bze8i7G29vq7tuggmzB0TNXaYU7SRYJERj4a9D 5wgb6MS57Jk9Gs+brSXjZkTI8AdDymGAsL0hH3z6lmYqj5jLV3oVD+XBaa55X9Vh /xz1P1W9Achd+wqjUvdWW4MEjla7NPiYnJF8Par429fJ4BxFDardgSdzsOjCgdlI 0gMnuGcPS9AkDr0mnylx2SV7DGAE448LfOuz2osfJ5bSudWdVWSWFFkTBNoKEUgG SzVCY16LT205ZPNAQ5IqaA== ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Ch3hkRQNk9BNhLyp8olMDuQzEFegnBjZanSrfFYqfFPB201R8KXCYtGA1z6p/n9c+iPbYgstMSzS4aLsbd0JzDtqrob/qlVqganTeRy5aZW1mBsvGVzHMoDWr/KZPHPNiE0hsxmJCDoashJLfugJwIxEZKM87XnYNQ0CFw/c7DBJ9FUz4BJRqI35U96NUor6eOsjs06TqhLx4GsHGALUvwX3Jkp6ifE3cwtBtttk8q9nh49yAY2/28e4dWVSRjYpQcLxpb2vzrB//Q3FCsUUSstPn1OPSGOepMoL9YIptrURSRZ2FK6TBWLwLD8Adu15yHCBvxu/V9Y8SAgERVTxTQ== 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=2JebKhSaeSsCDp5vm3YQQekzOPweuydSZzr5zMP6Vj0=; b=XheoNon1HitBUhI4+KbsR/QsXd7Gtl6bYO2XZaejUnkCJCEo8I6cGUopq3RR+si202XNj02PCh75i/n4s0VIev6VmYus/Tnb6+UN2K1fsFn7QRv0tCRMPSHuOvrh2xvdRs3dv2IU02QoDMih/cgvhiFnwKNO0HmxmMpt0hyHtUiEJuiQmLFP/M+ki+5Me7btHn5OhTnzuSUAQv83J6Ge70y6CRJgUGwgbm9WwsX987aUk8Fm3sC+1wt0Hb4i9YqV+f/4eTzndmOWxxmBQVSEFNcTRX3Jugk/Y00ELxh9p6sMw7PIJctG6uwugYO34iJWiJijUDzZoC2YKq6HgtlNuQ== 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=2JebKhSaeSsCDp5vm3YQQekzOPweuydSZzr5zMP6Vj0=; b=s5D/Us/yoCWqWBKEaJSRIc4n1znADhPisj2nknpPnEYRxV7zk5roo6bLEDWlz6T12qqyx5P6jPPL3Fm+nAUi5ftEzFf1IARuAL5Muqpv5uM0ChnFqdecfSBepzPsTK20mZQarrhFN+AkRm5bk3Q62Wh1wkJFTkJEOViwgDGDShM= From: =?UTF-8?q?=E2=80=9CWilliam=20Roche?= To: david@redhat.com, peterx@redhat.com, qemu-devel@nongnu.org, pbonzini@redhat.com, philmd@linaro.org Cc: william.roche@oracle.com Subject: [PATCH v2 1/1] system/physmem: take into account fd_offset for file fallocate Date: Tue, 21 Jan 2025 22:54:26 +0000 Message-ID: <20250121225426.3043160-2-william.roche@oracle.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20250121225426.3043160-1-william.roche@oracle.com> References: <20250121225426.3043160-1-william.roche@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: BL0PR02CA0009.namprd02.prod.outlook.com (2603:10b6:207:3c::22) To CH3PR10MB7329.namprd10.prod.outlook.com (2603:10b6:610:12c::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR10MB7329:EE_|SA3PR10MB7072:EE_ X-MS-Office365-Filtering-Correlation-Id: 72f57127-73da-4f3d-0e26-08dd3a6e8fbc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?gUZgc2GpG+hC/1EzlGup0OZGca9IjCvUI2kCoE8Z+1v/iI7GwSKVEw+bPB5l?= =?us-ascii?Q?kYmBny/BBqC+2pOs6yEEB+xqUVDHgUdLhwhpPGqg0VE2LaKd5TTqs4kwe+33?= =?us-ascii?Q?k/gpWx+yXUMk3wHvmO2OeuCDHAdZ6+NllpysJN/GV8+BKNzhmi6Kc+Z/R/FT?= =?us-ascii?Q?b5Gr82v/AkrdNYEAx399G2nTh1HuQAizMl1eneKu4MIa0hVOBR44paCS6TtM?= =?us-ascii?Q?BZEV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Xhk?= =?us-ascii?Q?0CDM3dP09YpDzC5BYFUveMHCZF36YT93yV7X1OzNVIgk6PCKsAmQLxidewhM?= =?us-ascii?Q?T5DPWQqVR3cssHeI3xCgB0qZfRzlRv8vBIoRY66oSw8poHKr4IzKamqvFyVh?= =?us-ascii?Q?D/ZnOsYMU/ZfSRPk8i8HNUUmbAAPzNcIVRfopOvxubYY4VVMISen+4AS8KNX?= =?us-ascii?Q?SrGLsxV8rVvXLpNGVVJ1ktyKloZOBYRQwo7XlEml9bgCuVCaORJFIJ8Pm5pb?= =?us-ascii?Q?mMx0LdNz7wPdLvMFZgkt/ag3Mi+7?= 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)(366016)(1800799024)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?B6jPHzv/XLuHaliPO2yJ19pEjLn3Djt9yGHLyBMVr0MWQmUeQDelZf9XCQyl?= =?us-ascii?Q?Zk2EztnjNl+tbaL8pMHtJ9BPlxCkIvjrQOqmp1BAukMYiwTxhBaFOAC7tXLM?= =?us-ascii?Q?xeC/oa2SkmbjLmdBwz2JqESt9o38aHWMBHugZZPqmNd1OL9r56DIQb67W+uJ?= =?us-ascii?Q?r7sPnW1JT7MuTItrOoK5Q5NX9GCOuNmYjgeII9foDnaqoXyD0QwFNvkHCcPi?= =?us-ascii?Q?M6yJob1bVYWePdXnNbighXfJEoKWNHeg0dZy6Zw0SiDTvSxcjg2LFPWwcf/s?= =?us-ascii?Q?HMVPXHwQK5ofQWMyyZUB0xQJKUBja6wh3hVSheJ1HnOmusl5tfTxGgIYl59y?= =?us-ascii?Q?md7LK9MJ+WRR1EPDolIWnfN6zw5FEfiGeQtT4w3GqWSAAaK0yqNr3Hh/pNsu?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rmxK3Di+5KKxaHRPDuaOdqy9+5U9XpU4e3F9ttjF3zDBd6eTd4pZAKMJ4lGQka19pg= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 72f57127-73da-4f3d-0e26-08dd3a6e8fbc X-MS-Exchange-CrossTenant-AuthSource: CH3PR10MB7329.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2025 22:54:29.0094 (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: TrTbpd+8Eo8UUho4LBWOSKZc6H3+JslM3oA17pL1tyk5gR/scWAhq3DuthtOapdWU7TRwMhXXdwq15VoxSCVZ3LYZKDh6Xz49dxZf6pyq7Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR10MB7072 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-01-21_09,2025-01-21_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 bulkscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 adultscore=0 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2501210182 X-Proofpoint-GUID: cwmjZwPj7SkyGmF-bs72C-rHF6x5fh7l X-Proofpoint-ORIG-GUID: cwmjZwPj7SkyGmF-bs72C-rHF6x5fh7l 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: 1737500151816019000 Content-Type: text/plain; charset="utf-8" From: William Roche Punching a hole in a file with fallocate needs to take into account the fd_offset value for a correct file location. But guest_memfd internal use doesn't currently consider fd_offset. Fixes: 4b870dc4d0c0 ("hostmem-file: add offset option") Signed-off-by: William Roche --- system/physmem.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/system/physmem.c b/system/physmem.c index c76503aea8..7e4da79311 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -3655,6 +3655,7 @@ int ram_block_discard_range(RAMBlock *rb, uint64_t st= art, size_t length) need_madvise =3D (rb->page_size =3D=3D qemu_real_host_page_size()); need_fallocate =3D rb->fd !=3D -1; if (need_fallocate) { + uint64_t file_offset =3D start + rb->fd_offset; /* For a file, this causes the area of the file to be zero'd * if read, and for hugetlbfs also causes it to be unmapped * so a userfault will trigger. @@ -3689,18 +3690,18 @@ int ram_block_discard_range(RAMBlock *rb, uint64_t = start, size_t length) } =20 ret =3D fallocate(rb->fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEE= P_SIZE, - start, length); + file_offset, length); if (ret) { ret =3D -errno; error_report("%s: Failed to fallocate %s:%" PRIx64 " +%zx = (%d)", - __func__, rb->idstr, start, length, ret); + __func__, rb->idstr, file_offset, length, ret= ); goto err; } #else ret =3D -ENOSYS; error_report("%s: fallocate not available/file" "%s:%" PRIx64 " +%zx (%d)", - __func__, rb->idstr, start, length, ret); + __func__, rb->idstr, file_offset, length, ret); goto err; #endif } @@ -3747,6 +3748,7 @@ int ram_block_discard_guest_memfd_range(RAMBlock *rb,= uint64_t start, int ret =3D -1; =20 #ifdef CONFIG_FALLOCATE_PUNCH_HOLE + /* ignore fd_offset with guest_memfd */ ret =3D fallocate(rb->guest_memfd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KE= EP_SIZE, start, length); =20 --=20 2.43.5