Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp4110124rdh; Fri, 29 Sep 2023 11:20:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHOTtPcTjW9/RGW2vA9gs5oQwuYodfgl6uMXA7Ye+yoXWdV5JwjFQOSq7xlGskcXhXoDqPw X-Received: by 2002:a17:90b:f8b:b0:26f:b733:6887 with SMTP id ft11-20020a17090b0f8b00b0026fb7336887mr4174562pjb.27.1696011640440; Fri, 29 Sep 2023 11:20:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696011640; cv=none; d=google.com; s=arc-20160816; b=g3Mf07g2OX9YjQBEDtZP49bEPufFd8SbGuscMwTIYNGtaMQZKRkA3gKpFjUywipoyu FioJGWiOx1ef2lJjvGMrYQIPpb5FJiz+xhpsYp96bQXUC7AMVRQp3JJGgACVkKJp7uo0 kAuj0ZTWxNUwHjWahQoBu6C5yOOV7l5X6ymcbCWtrGhMUP6kWkgUXi0BvF1i39UrhbzX 8ljUFNOvuHdcx182LmhIOsSAkg4ceCixADcWsYosihN7ih9TlwqRnSqYqt95ht8Mv2hp K+Xzxo5rDs98C8D65kJeAtNeIfmla+IqeDxtkWVSE6KjDeXzcZEVFrXO+Yl3CMDZBZYa PeAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=QqTTLT9aZkvqLOeMtXOrEvkTt7kMlZSB0+m85iN5u54=; fh=TuWDVhDmg3yhSsQmb54NodeFh02Xfq726sW39nXfjao=; b=VYId8mLCxu85adcR1jMsEsf8+Ps0wf4FedFR74f9IOhnQXGTkO0DRL6B974RFiluVS W4j/kfz/mQfVlIk5QpOol/lVC8JbR1N5BVV6By0rdBPRTNvGZEvM/3Gnxp37ZXOmMbAL OHofBWXL52To7cQFAUyEB6d+6Qq3EGB8aunuZKtdsE43T7es6sanlmRORoGNH7bMT024 X78FpnlUEdYY3lt8Xr75kAGIUeZvW/i2fFVRix58F9m3V2sr8nC9m8vrQh3UG2oK2R1B k0a11QNUSeVIP3X7aosrvP3Wk+vhng3x1otDsbzjXbtJp6wHxQDQM6PmLEB3gJeZCSgG hOig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b="Och/FWQT"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id t13-20020a17090aba8d00b002791e648ceasi2047670pjr.112.2023.09.29.11.20.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 11:20:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b="Och/FWQT"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 496D1806886B; Fri, 29 Sep 2023 05:57:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233066AbjI2M5q (ORCPT + 99 others); Fri, 29 Sep 2023 08:57:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232803AbjI2M5p (ORCPT ); Fri, 29 Sep 2023 08:57:45 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DA30C0; Fri, 29 Sep 2023 05:57:42 -0700 (PDT) Received: from pps.filterd (m0353726.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38TCoxb4013374; Fri, 29 Sep 2023 12:56:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=QqTTLT9aZkvqLOeMtXOrEvkTt7kMlZSB0+m85iN5u54=; b=Och/FWQTgIJwiibkwBGlGRsTVsD/QPfi3WiMg33KXn9WnrnZXGt5r+QaO1ZlNYrQVdaT SZTg6yVNXrNvYQDLdurQLzmMP2ZUuqXfqunhs3fQc1zO+9g4+1R27YxA2v0kwNuWERkD WTd2iHpODkJjr93yC2xadbFRuQzK/52kK31ggGBQBMR4pGsSaR8NRPQAcvKXrLRVR73N r6hVD9QLzsnJyCku33qAZGQMTzQ2kSOVN3XZ+IOLK4P5kZQ+4weW/cW+CJRkWAg4CiiG UuuoRmBc+zdjtC7mjHIFQT2LI/KnUWrFjsVqlAwjF+6hltohqQ7NC/+8hYNGgOawKtgY 7w== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tdxxnr3pm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Sep 2023 12:56:38 +0000 Received: from m0353726.ppops.net (m0353726.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 38TCpPrI014220; Fri, 29 Sep 2023 12:56:37 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tdxxnr3p0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Sep 2023 12:56:37 +0000 Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 38TCZGqp008250; Fri, 29 Sep 2023 12:56:36 GMT Received: from smtprelay05.wdc07v.mail.ibm.com ([172.16.1.72]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3tabbnvpnx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Sep 2023 12:56:36 +0000 Received: from smtpav01.wdc07v.mail.ibm.com (smtpav01.wdc07v.mail.ibm.com [10.39.53.228]) by smtprelay05.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 38TCuZgC5243498 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Sep 2023 12:56:35 GMT Received: from smtpav01.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4648A5804B; Fri, 29 Sep 2023 12:56:35 +0000 (GMT) Received: from smtpav01.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E78BB58063; Fri, 29 Sep 2023 12:56:30 +0000 (GMT) Received: from [9.61.175.8] (unknown [9.61.175.8]) by smtpav01.wdc07v.mail.ibm.com (Postfix) with ESMTP; Fri, 29 Sep 2023 12:56:30 +0000 (GMT) Message-ID: <2513a9d4-ac92-2e50-4861-bb65465cf1ae@linux.ibm.com> Date: Fri, 29 Sep 2023 08:56:30 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v13 4/6] iommu/s390: Disable deferred flush for ISM devices Content-Language: en-US To: Niklas Schnelle , Joerg Roedel , Will Deacon , Wenjia Zhang , Robin Murphy , Jason Gunthorpe Cc: Gerd Bayer , Julian Ruess , Pierre Morel , Alexandra Winter , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Suravee Suthikulpanit , Hector Martin , Sven Peter , Alyssa Rosenzweig , David Woodhouse , Lu Baolu , Andy Gross , Bjorn Andersson , Konrad Dybcio , Yong Wu , Matthias Brugger , AngeloGioacchino Del Regno , Gerald Schaefer , Orson Zhai , Baolin Wang , Chunyan Zhang , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Thierry Reding , Krishna Reddy , Jonathan Hunter , Jonathan Corbet , linux-s390@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-doc@vger.kernel.org References: <20230928-dma_iommu-v13-0-9e5fc4dacc36@linux.ibm.com> <20230928-dma_iommu-v13-4-9e5fc4dacc36@linux.ibm.com> From: Matthew Rosato In-Reply-To: <20230928-dma_iommu-v13-4-9e5fc4dacc36@linux.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: uTzj7zKg3b0sQ930cOsKCPRxfgqwTFsD X-Proofpoint-GUID: XNXEAeo9ExEttPSRC78HhL_bg28OSuTv X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-29_10,2023-09-28_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 adultscore=0 mlxlogscore=999 clxscore=1015 suspectscore=0 mlxscore=0 bulkscore=0 priorityscore=1501 spamscore=0 malwarescore=0 phishscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309290107 X-Spam-Status: No, score=-4.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 29 Sep 2023 05:57:55 -0700 (PDT) On 9/28/23 10:31 AM, Niklas Schnelle wrote: > ISM devices are virtual PCI devices used for cross-LPAR communication. > Unlike real PCI devices ISM devices do not use the hardware IOMMU but > inspects IOMMU translation tables directly on IOTLB flush (s390 RPCIT > instruction). > > ISM devices keep their DMA allocations static and only very rarely DMA > unmap at all. For each IOTLB flush that occurs after unmap the ISM > devices will however inspect the area of the IOVA space indicated by the > flush. This means that for the global IOTLB flushes used by the flush > queue mechanism the entire IOVA space would be inspected. In principle > this would be fine, albeit potentially unnecessarily slow, it turns out > however that ISM devices are sensitive to seeing IOVA addresses that are > currently in use in the IOVA range being flushed. Seeing such in-use > IOVA addresses will cause the ISM device to enter an error state and > become unusable. > > Fix this by claiming IOMMU_CAP_DEFERRED_FLUSH only for non-ISM devices. > This makes sure IOTLB flushes only cover IOVAs that have been unmapped > and also restricts the range of the IOTLB flush potentially reducing > latency spikes. > > Signed-off-by: Niklas Schnelle Looks like my review tag from v12 got dropped on accident -- no changes since prior version and still looks good to me so Reviewed-by: Matthew Rosato