From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84039C0650E for ; Mon, 1 Jul 2019 17:42:05 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 62BCD21721 for ; Mon, 1 Jul 2019 17:42:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="b0zaBkLx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 62BCD21721 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=LMDJZQ1iC23PiIdA9gkLYgQC9DXRye/Z9HmOWCnB5hg=; b=b0zaBkLxhdabuz3HH9t2HTKH3 kpLh7jVSgHH4GbfC9x9/c8EpTSlxw6EpOqEAoANefRdBN4s34ctrXXxqudggBzDkVwdGNKmClcA19 ti7hrY3nm841XQzy1mZUcu5EvDuE1vZmO5tUblMniHu1QEP9vzn5IypJGba6J7jawdD6TAi/9eSI+ +WIIHVeEVQRvdBHQWBz2wxkNSmPlQKkzxjyMW5C8XKsjhdeekrk756lymHgymSxZchO55yf6m/cxi 2NxgBGMJkMA3bnesY9piW6Ye/eRLCcv9qIZM50neL73p21PQlSwIVLV1c9qdqY3a57INhaVtK3RvV xbwkFYb/A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hi0JY-0002FU-MO; Mon, 01 Jul 2019 17:42:04 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hi0JW-0002En-2a for linux-arm-kernel@lists.infradead.org; Mon, 01 Jul 2019 17:42:03 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A200228; Mon, 1 Jul 2019 10:41:59 -0700 (PDT) Received: from [10.1.197.57] (e110467-lin.cambridge.arm.com [10.1.197.57]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 155A33F703; Mon, 1 Jul 2019 10:41:57 -0700 (PDT) Subject: Re: [PATCH v3 8/9] iommu/arm-smmu-v3: Add support for PCI ATS To: Jean-Philippe Brucker , will.deacon@arm.com, lorenzo.pieralisi@arm.com, bhelgaas@google.com References: <20190417182448.12382-1-jean-philippe.brucker@arm.com> <20190417182448.12382-9-jean-philippe.brucker@arm.com> From: Robin Murphy Message-ID: <7fcd5263-8a20-11cb-0c20-9fee35fe65c1@arm.com> Date: Mon, 1 Jul 2019 18:41:56 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190417182448.12382-9-jean-philippe.brucker@arm.com> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190701_104202_167313_1B5AF2A5 X-CRM114-Status: GOOD ( 16.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: zhongmiao@hisilicon.com, okaya@kernel.org, sudeep.holla@arm.com, rjw@rjwysocki.net, linux-acpi@vger.kernel.org, iommu@lists.linux-foundation.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, lenb@kernel.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Jean-Philippe, I realise it's a bit late for a "review", but digging up the original patch seemed as good a place as any to raise this... On 17/04/2019 19:24, Jean-Philippe Brucker wrote: [...] > @@ -1740,6 +1906,9 @@ static void arm_smmu_detach_dev(struct arm_smmu_master *master) > > master->domain = NULL; > arm_smmu_install_ste_for_dev(master); > + > + /* Disabling ATS invalidates all ATC entries */ > + arm_smmu_disable_ats(master); > } Is that actually true? I had initially overlooked this entirely while diagnosing something else and thought that we were missing any ATC invalidation on detach at all, but even having looked again I'm not entirely convinced it's bulletproof. Firstly, the ATS spec only seems to say that *enabling* the ATS capability invalidates all ATC entries, although I think any corner cases that that alone opens up should be at best theoretical. More importantly though, pci_disable_ats() might not actually touch the capability - given that, it seems possible to move a VF to a new domain, and if it's not reset, end up preserving now-bogus ATC entries despite the old domain being torn down and freed. Do we need an explicit ATC invalidation here to be 100% safe, or is there something else I'm missing? Robin. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel