Received: by 10.192.165.148 with SMTP id m20csp3639803imm; Mon, 30 Apr 2018 03:58:51 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrMQrl0bNb4Cgx/bMMYB8G7cguMjQH6tvO3sBrq2N4hUnDUWZXwidoZqCa4sGurnutv8atY X-Received: by 2002:a63:7981:: with SMTP id u123-v6mr9671956pgc.328.1525085931515; Mon, 30 Apr 2018 03:58:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525085931; cv=none; d=google.com; s=arc-20160816; b=m1sZvlz2/sdL/62jq0ZsSRmvRoD/iJuTufjwqCWJ6W50yno29K2C7+zL7+UPp5DR8+ y6ghngQwXvEIUKfD2DVjF9ztDRvPM4IbKdOlBfh2yGy/SYNPhGqZePPasbw32fht277B r7sm3TiB9mSNgQo6xR0kOiyzp8WH2o5uzwtHZIZovvaDR9jiWZBQlDZ12kGRhl5t4GhP oAIqadrIvDCq6X8HhuwtGu3VfccYeOJMAkKqJ2u8XObZR1ex46xM3s0GMN1lD20iQOwu tGJbx9OniK/HMPc8j6SunF69zCsklYbuJO5sOZV5CwHmoHbjfJbFW7DQgh9AfIp6i6Tp WBXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=5vf6VLCs7OZVAco8yTmHhPHYWCWgXV3woOqYvTdFH+s=; b=QPH1l1TNgfD6qk62niSSna56+SfzykOw/GdYtMhf9g9Xj2XBJC0pDbPZLZNHLJSNvX UNCMzrlf+YwN4pwKPUmFYW89t86t061rWtF5oNpgf237GenC8bHUDeSX0b0C8er9kszA YsmcMTNLgSs7yEMntnN5UETEj7ZOjgmG5b3Hf2+9SIFJAENQPp8P/nSITMM83dTiQewR zAJnWCYTm4R8jPtWQqOy0jTVAZdT/3BEqEm8QxaOCAZfO0rVz8oAxt/5AYpf/qmucWtE o49icBp11cq0h8P/ao0D20knSLUzbojEQYflOwzTunSqcepzD95qICDg6txlpkz1mHwL OYKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r13-v6si3414019pgt.8.2018.04.30.03.58.37; Mon, 30 Apr 2018 03:58:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752985AbeD3K6W (ORCPT + 99 others); Mon, 30 Apr 2018 06:58:22 -0400 Received: from foss.arm.com ([217.140.101.70]:58964 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751361AbeD3K6S (ORCPT ); Mon, 30 Apr 2018 06:58:18 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3809B15BF; Mon, 30 Apr 2018 03:58:18 -0700 (PDT) Received: from [10.1.210.33] (ostrya.cambridge.arm.com [10.1.210.33]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 198943F587; Mon, 30 Apr 2018 03:58:15 -0700 (PDT) Subject: Re: [PATCH v4 14/22] iommu: handle page response timeout To: Jacob Pan Cc: "iommu@lists.linux-foundation.org" , LKML , Joerg Roedel , David Woodhouse , Greg Kroah-Hartman , Alex Williamson , Rafael Wysocki , "Liu, Yi L" , "Tian, Kevin" , Raj Ashok , Christoph Hellwig , Lu Baolu References: <1523915351-54415-1-git-send-email-jacob.jun.pan@linux.intel.com> <1523915351-54415-15-git-send-email-jacob.jun.pan@linux.intel.com> <20180423153622.GC38106@ostrya.localdomain> <20180425083711.222202e7@jacob-builder> From: Jean-Philippe Brucker Message-ID: Date: Mon, 30 Apr 2018 11:58:10 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180425083711.222202e7@jacob-builder> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25/04/18 16:37, Jacob Pan wrote: >> In the other cases (unsupported PRI or rogue guest) then disabling PRI >> using a FAILURE status might be the right thing to do. However, >> assuming the device follows the PCI spec it will stop sending page >> requests once there are as many PPRs in flight as the allocated >> credit. >> > Agreed, here I am not taking any actions. There may be need to drain > in-fly requests. Right, as long as we first ensure that no new fault is generated (by using a Response Failure). Though in my opinion not taking action might be the safest option :) Another thought: currently the comment in iommu.h says "@IOMMU_FAULT_STATUS_FAILURE: General error. Drop all subsequent faults from this device if possible. This is "Response Failure" in PCI PRI." I wonder if we should simply say "Drop all subsequent faults from the device". Even if the PCI device doesn't properly implement PRI, the IOMMU driver should set a "PRI disabled" bit in the device data that prevents it from from reporting new faults and flooding the queue. Anyway, it's a small detail that could go in a future patch series. >> If there isn't any possibility of memory leak or abusing resources, I >> don't think it's our problem that the guest is excessively slow at >> handling page requests. Setting an upper bound to page request latency >> might do more harm than good. Ensuring that devices respect the number >> of allocated in-flight PPRs is more important in my opinion. >> > How about we have a really long timeout, e.g. 1 min similar to device > invalidate response timeout in ATS spec., just for basic safety and > diagnosis. Optionally, we could have quota in parallel. I agree that for development a timeout is useful. It might be worth adding it as an option to the IOMMU module instead of a define. Perhaps a number of seconds, 10 being the default and 0 disabling the timeout? Otherwise we would probably end up with a succession of patches incrementing the timeout by arbitrary values, if people find it inconvenient. Thanks, Jean