From nobody Tue Feb 10 07:41:42 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1678193784; cv=none; d=zohomail.com; s=zohoarc; b=AI73FDchCZ8q65Rn4fPJSHep3wovK8XnFC9KUVLUkegzp6PsiPaW5AEKsJ32TeQ3IlqCyYZEyR6MxM+/FwBzYCHrTsr83K9+lWK1zeaGn6yWxfirh5WCLTuBOef3Pzq+5X4cf6P940IVC4HuwLAMO8oKXYJAroYX8zXu8NEkMSY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678193784; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=X5el7/OT+rGDSa6e3+a+a+a518kxVGEBeqWOmUXCNOE=; b=mWp01yDWyTFKsaEu08ggSP8O2w7Q4nGyVFxaBllVqmJEpWUGovA9xURENEfUmV2P5rZm5+3r/ohVVdx5uva28daVMpcmIFQ6fMUF2+w+ooaitnrjsQAnWfGhGvZ3oIBB/eldvTNcZsRhwhjs2j06PfgJx2CIpzoJoLn2pebYRh0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1678193784131235.0060241525499; Tue, 7 Mar 2023 04:56:24 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZWrB-0005Y5-BA; Tue, 07 Mar 2023 07:55: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 1pZWr9-0005QI-Au for qemu-devel@nongnu.org; Tue, 07 Mar 2023 07:55: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 1pZWr7-000555-Mm for qemu-devel@nongnu.org; Tue, 07 Mar 2023 07:55:51 -0500 Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3278422R001757; Tue, 7 Mar 2023 12:55:48 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 3p415hwe67-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Mar 2023 12:55:48 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 327BuBse026621; Tue, 7 Mar 2023 12:55:47 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3p4u1eyesc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Mar 2023 12:55:47 +0000 Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 327CtV5B004358; Tue, 7 Mar 2023 12:55:47 GMT Received: from joaomart-mac.uk.oracle.com (dhcp-10-175-196-64.vpn.oracle.com [10.175.196.64]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3p4u1eyefv-7; Tue, 07 Mar 2023 12:55:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=corp-2022-7-12; bh=X5el7/OT+rGDSa6e3+a+a+a518kxVGEBeqWOmUXCNOE=; b=HM81d2ZY1oUT4PYe/RtADJBy6ifBJNBihK2aJgFEGWm1cPSiUE8ddtPNu8pByfpWqlzT +epCVi1CLjryCmlRu4cUAWJroHGuxcRjEbwZlK+neoJUzNeE7g3WaAC2nb4qpwwK+CT/ cG3tNShqN4vXbKveBgifRsc41kYGVXN9Pm4OjemeZ77wG8+rrt9myCIglv4/rfZlFN72 L3adq60RzgBJdkBG+cNE3kOQ1paIQxBhK9EEXbOdKobZBg3UFY1++gUgphY+r3b2jjjA Z+lqJTcbD5bVDBpABtPN4E0FP03NhLPZ0+7HAKvaS82+xKk0p7MbIRHIlpCfLo346tR9 lg== From: Joao Martins To: qemu-devel@nongnu.org Cc: Alex Williamson , Cedric Le Goater , Yishai Hadas , Jason Gunthorpe , Maor Gottlieb , Kirti Wankhede , Tarun Gupta , Avihai Horon , Joao Martins Subject: [PATCH v5 06/15] vfio/common: Use a single tracepoint for skipped sections Date: Tue, 7 Mar 2023 12:54:41 +0000 Message-Id: <20230307125450.62409-7-joao.m.martins@oracle.com> In-Reply-To: <20230307125450.62409-1-joao.m.martins@oracle.com> References: <20230307125450.62409-1-joao.m.martins@oracle.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-07_06,2023-03-07_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 phishscore=0 bulkscore=0 adultscore=0 suspectscore=0 spamscore=0 mlxlogscore=834 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2303070117 X-Proofpoint-GUID: BASHEQpoIkmy0Al17-GU1-bLOBNrkWz8 X-Proofpoint-ORIG-GUID: BASHEQpoIkmy0Al17-GU1-bLOBNrkWz8 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=joao.m.martins@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, DKIMWL_WL_MED=-0.001, 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_H2=-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.com) X-ZM-MESSAGEID: 1678193785388100001 Content-Type: text/plain; charset="utf-8" In preparation to turn more of the memory listener checks into common functions, one of the affected places is how we trace when sections are skipped. Right now there is one for each. Change it into one single tracepoint `vfio_listener_region_skip` which receives a name which refers to the callback i.e. region_add and region_del. Suggested-by: Avihai Horon Signed-off-by: Joao Martins Reviewed-by: C=C3=A9dric Le Goater --- hw/vfio/common.c | 4 ++-- hw/vfio/trace-events | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 99acb998eb14..1cb62efa9743 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -945,7 +945,7 @@ static void vfio_listener_region_add(MemoryListener *li= stener, Error *err =3D NULL; =20 if (vfio_listener_skipped_section(section)) { - trace_vfio_listener_region_add_skip( + trace_vfio_listener_region_skip("region_add", section->offset_within_address_space, section->offset_within_address_space + int128_get64(int128_sub(section->size, int128_one()))); @@ -1183,7 +1183,7 @@ static void vfio_listener_region_del(MemoryListener *= listener, bool try_unmap =3D true; =20 if (vfio_listener_skipped_section(section)) { - trace_vfio_listener_region_del_skip( + trace_vfio_listener_region_skip("region_del", section->offset_within_address_space, section->offset_within_address_space + int128_get64(int128_sub(section->size, int128_one()))); diff --git a/hw/vfio/trace-events b/hw/vfio/trace-events index 669d9fe07cd9..7173e6a5c721 100644 --- a/hw/vfio/trace-events +++ b/hw/vfio/trace-events @@ -96,13 +96,12 @@ vfio_pci_igd_lpc_bridge_enabled(const char *name) "%s" vfio_region_write(const char *name, int index, uint64_t addr, uint64_t dat= a, unsigned size) " (%s:region%d+0x%"PRIx64", 0x%"PRIx64 ", %d)" vfio_region_read(char *name, int index, uint64_t addr, unsigned size, uint= 64_t data) " (%s:region%d+0x%"PRIx64", %d) =3D 0x%"PRIx64 vfio_iommu_map_notify(const char *op, uint64_t iova_start, uint64_t iova_e= nd) "iommu %s @ 0x%"PRIx64" - 0x%"PRIx64 -vfio_listener_region_add_skip(uint64_t start, uint64_t end) "SKIPPING regi= on_add 0x%"PRIx64" - 0x%"PRIx64 +vfio_listener_region_skip(const char *name, uint64_t start, uint64_t end) = "SKIPPING %s 0x%"PRIx64" - 0x%"PRIx64 vfio_spapr_group_attach(int groupfd, int tablefd) "Attached groupfd %d to = liobn fd %d" vfio_listener_region_add_iommu(uint64_t start, uint64_t end) "region_add [= iommu] 0x%"PRIx64" - 0x%"PRIx64 vfio_listener_region_add_ram(uint64_t iova_start, uint64_t iova_end, void = *vaddr) "region_add [ram] 0x%"PRIx64" - 0x%"PRIx64" [%p]" vfio_known_safe_misalignment(const char *name, uint64_t iova, uint64_t off= set_within_region, uintptr_t page_size) "Region \"%s\" iova=3D0x%"PRIx64" o= ffset_within_region=3D0x%"PRIx64" qemu_real_host_page_size=3D0x%"PRIxPTR vfio_listener_region_add_no_dma_map(const char *name, uint64_t iova, uint6= 4_t size, uint64_t page_size) "Region \"%s\" 0x%"PRIx64" size=3D0x%"PRIx64"= is not aligned to 0x%"PRIx64" and cannot be mapped for DMA" -vfio_listener_region_del_skip(uint64_t start, uint64_t end) "SKIPPING regi= on_del 0x%"PRIx64" - 0x%"PRIx64 vfio_listener_region_del(uint64_t start, uint64_t end) "region_del 0x%"PRI= x64" - 0x%"PRIx64 vfio_disconnect_container(int fd) "close container->fd=3D%d" vfio_put_group(int fd) "close group->fd=3D%d" --=20 2.17.2