Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp8429769ybn; Tue, 1 Oct 2019 08:02:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0LtjN5L03Tj2JJu9ZJpSvQBYR1nEZUef1dzZJR/KdV8e4vUOgqzBm6XahN30T73RzWfC6 X-Received: by 2002:a50:935d:: with SMTP id n29mr26031741eda.294.1569942122922; Tue, 01 Oct 2019 08:02:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569942122; cv=none; d=google.com; s=arc-20160816; b=nwsk+IuaBwVxgKl9z8tOOXESTMHsEBwqCY5+z4OdxnnVOWSyM++BZslQJzbsrrnPUa b1XKG9IdmcUNb9mVCDi68ZzX16GI4wDnnQS3suNWFatl/EIO5PzhenAj0tWMaHGZi2ZS tB9D4zOIZ6JFStcY3U2KYfn3FLbZOL8J/nkeZPg4Z9Gd5dM4kmqJJ3MTye0RUlkHK/KW 65TgIqXGMglBMeAtStqzo39k/NDBM7sisCLZ8tFqfMwzuv8tYNH1HcPQ70PbQAxaun2b cZUs2OiSxlN33VD2LA2cAXMMhCAvzbcA1+zNpJo9XsLDD5GNkFTynCcPp+FCGp03ZeD/ nhkQ== 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:mime-version :references:in-reply-to:organization:message-id:date:subject:cc:to :from; bh=wDSOtUlTDFvqvxmGJvqPpIK3gBBqfPZWlLEQKkWOF3g=; b=kUSO9yJpt0szZ2WbiMk25OJNqxuw1Bluur1zUAkRSxNLsbP2T/uOhuyYPHgEvlxKR3 18vLvHgEECT3EICNSIR9sJp6GZkM6tuOGe5OLvYb+WdAIR9zMLEl+4M9s7eeK0JK6vvT aMByfvv4EF6OzId6NZMOp0ppjN/UMUtC5Qe+9ocqpe7OYYNYeE4M6jft87Yy41f+z1nU 2g3lAz5KiZNYNfONV5fEphyMy6Mwg3ooUL4e//JQKgYi5TXaLMP6QMHNo4ELR3i2BEZi ivFpDy4UHfTJR+FtBhCHdr1nVl7qYYfTWS9OAf+8hOXFFFeXD/rSjSeSsLXFIwbSxKv2 4f7g== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h13si9624010edh.242.2019.10.01.08.01.35; Tue, 01 Oct 2019 08:02:02 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389351AbfJAPBK (ORCPT + 99 others); Tue, 1 Oct 2019 11:01:10 -0400 Received: from mga01.intel.com ([192.55.52.88]:4861 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727051AbfJAPBK (ORCPT ); Tue, 1 Oct 2019 11:01:10 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Oct 2019 08:01:09 -0700 X-IronPort-AV: E=Sophos;i="5.64,571,1559545200"; d="scan'208";a="190615982" Received: from jkrzyszt-desk.igk.intel.com (HELO jkrzyszt-desk.ger.corp.intel.com) ([172.22.244.17]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Oct 2019 08:01:07 -0700 From: Janusz Krzysztofik To: Lu Baolu Cc: David Woodhouse , Joerg Roedel , iommu@lists.linux-foundation.org, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, =?utf-8?B?TWljaGHFgg==?= Wajdeczko Subject: Re: [RFC PATCH] iommu/vt-d: Fix IOMMU field not populated on device hot re-plug Date: Tue, 01 Oct 2019 17:01:02 +0200 Message-ID: <7739498.9tyZrNxj5X@jkrzyszt-desk.ger.corp.intel.com> Organization: Intel Technology Poland sp. z o.o. - ul. Slowackiego 173, 80-298 Gdansk - KRS 101882 - NIP 957-07-52-316 In-Reply-To: <2674326.ZPvzKFr69O@jkrzyszt-desk.ger.corp.intel.com> References: <20190822142922.31526-1-janusz.krzysztofik@linux.intel.com> <52fbfac9-c879-4b45-dd74-fafe62c2432b@linux.intel.com> <2674326.ZPvzKFr69O@jkrzyszt-desk.ger.corp.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Baolu, On Tuesday, September 3, 2019 9:41:23 AM CEST Janusz Krzysztofik wrote: > Hi Baolu, > > On Tuesday, September 3, 2019 3:29:40 AM CEST Lu Baolu wrote: > > Hi Janusz, > > > > On 9/2/19 4:37 PM, Janusz Krzysztofik wrote: > > >> I am not saying that keeping data is not acceptable. I just want to > > >> check whether there are any other solutions. > > > Then reverting 458b7c8e0dde and applying this patch still resolves the > issue > > > for me. No errors appear when mappings are unmapped on device close after > the > > > device has been removed, and domain info preserved on device removal is > > > successfully reused on device re-plug. > > > > This patch doesn't look good to me although I agree that keeping data is > > acceptable. Any progress with that? Which mailing list should I watch for updates? Thanks, Janusz > > It updates dev->archdata.iommu, but leaves the hardware > > context/pasid table unchanged. This might cause problems somewhere. > > > > > > > > Is there anything else I can do to help? > > > > Can you please tell me how to reproduce the problem? > > The most simple way to reproduce the issue, assuming there are no non-Intel > graphics adapters installed, is to run the following shell commands: > > #!/bin/sh > # load i915 module > modprobe i915 > # open an i915 device and keep it open in background > cat /dev/dri/card0 >/dev/null & > sleep 2 > # simulate device unplug > echo 1 >/sys/class/drm/card0/device/remove > # make the background process close the device on exit > kill $! > > Thanks, > Janusz > > > > Keeping the per > > device domain info while device is unplugged is a bit dangerous because > > info->dev might be a wild pointer. We need to work out a clean fix. > > > > > > > > Thanks, > > > Janusz > > > > > > > Best regards, > > Baolu > > > > > > >