From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 04BBEA04DD; Tue, 10 Nov 2020 18:43:46 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D26ECF90; Tue, 10 Nov 2020 18:43:44 +0100 (CET) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by dpdk.org (Postfix) with ESMTP id EF37AF64 for ; Tue, 10 Nov 2020 18:43:42 +0100 (CET) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0AAHX2dH122556; Tue, 10 Nov 2020 12:43:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=8ouRxJV2uB99CLUlxB2ZT9lyIB+d6md1H4mxymX6Kuo=; b=KLr6rTvGRrXdRFW4OFeCaFbOfrDfWehuFcQwmcDcZxUcCAbuzm4Dp2AAyqD6VnRiY+cx equPPiz509tQvh1fdMM1Q3CpjT5tpdpT4oDhTuL5PaqRAWLZ+rjb5JcKUyO0idhL0xYU f1guk32AwAM5bbpouw/ZhiMy5sP86GrwwibyVrVk8Il+2pcinloujyxm+lbLev9DqrtU oJqF7rzpD+m7Ux33lVj4hSSRQa5t3PyEGYvZIu4k0XMdSaV/0o3wchTZAHrpg1wjQoRh 55llAo5opkw7+sPqPvjDKmPM94y+8e1/737n5hDxflqBWBZExG6edjG+H2K30DIWOWGd aw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 34qyaw8d8k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Nov 2020 12:43:41 -0500 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 0AAHY3LY130241; Tue, 10 Nov 2020 12:43:40 -0500 Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0a-001b2d01.pphosted.com with ESMTP id 34qyaw8d7u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Nov 2020 12:43:40 -0500 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0AAHc7pl023645; Tue, 10 Nov 2020 17:43:39 GMT Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by ppma04wdc.us.ibm.com with ESMTP id 34q5nekpq1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Nov 2020 17:43:39 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0AAHhWMP15860368 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Nov 2020 17:43:32 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 243DBC605D; Tue, 10 Nov 2020 17:43:38 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CD27EC605A; Tue, 10 Nov 2020 17:43:37 +0000 (GMT) Received: from localhost.localdomain (unknown [9.114.224.51]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Tue, 10 Nov 2020 17:43:37 +0000 (GMT) From: David Christensen To: dev@dpdk.org, anatoly.burakov@intel.com, david.marchand@redhat.com Cc: David Christensen Date: Tue, 10 Nov 2020 09:43:31 -0800 Message-Id: <20201110174332.12409-1-drc@linux.vnet.ibm.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201109203528.132797-1-drc@linux.vnet.ibm.com> References: <20201109203528.132797-1-drc@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312, 18.0.737 definitions=2020-11-10_07:2020-11-10, 2020-11-10 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 priorityscore=1501 mlxscore=0 adultscore=0 spamscore=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 bulkscore=0 mlxlogscore=999 malwarescore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011100124 Subject: [dpdk-dev] [PATCH v7 0/1] vfio: modify spapr iommu support to use static window sizing X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The SPAPR v2 IOMMU used on bare-metal PowerNV systems requires that a DMA window be defined before mapping/unmapping memory. The current VFIO code dynamically resizes this DMA window every time a new memory request is made, which requires that all existing memory be unmapped/remapped. While this strategy worked in DPDK 17.11 and earlier where memory was statically allocated during startup, it is potentially dangerous in DPDK 18.11 and later where memory can be allocated during runtime, temporarily invalidating IOVA memory used by hardware. This new code statically sizes the DMA window at startup, based on the amount of memory installed in the system, avoiding the need to unmap memory during runtime. --- v7: - No patch changes, fixed email patch description v6: - Fix build error on Linux kernels prior to 4.2.0 - Rebased on 20.11-rc3 v5: - Modify get_highest_mem_addr to return error, not address - Add comment regarding sPAPR v1/v2 default window and why it needs to be removed - Added indent to second line of vfio_spapr_dma_mem_map() definition v4: - Move file reading code out of vfio_spapr_window_size_walk() v3: - Rebase for 20.08 v2: - Drop patch to wrap ppc64 code with ifdef's - Add warning when external memory detected - Change VA memory size detection to scan memseg list when setting DMA window for IOVA=VA - Add explicit error message when attempting to map outside the DMA window David Christensen (1): vfio: modify spapr iommu support to use static window sizing lib/librte_eal/linux/eal_vfio.c | 430 +++++++++++++++----------------- 1 file changed, 207 insertions(+), 223 deletions(-) -- 2.18.4