All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Dong <xmdong@google.com>
To: Lu Baolu <baolu.lu@linux.intel.com>
Cc: David Woodhouse <dwmw2@infradead.org>,
	Joerg Roedel <joro@8bytes.org>,
	iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org,
	Jis Ben <jisben@google.com>, James Dong <xmdong@google.com>
Subject: RE: [PATCH] iommu/vt-d: Handle hotplug devices' default identity mapping setting
Date: Fri, 22 Feb 2019 08:28:29 +0000	[thread overview]
Message-ID: <20190222082829.75567-1-xmdong@google.com> (raw)
In-Reply-To: <21c17b44-af9b-2f18-f109-ba4bb0635e61@linux.intel.com>

Baolu:

The reproduction depends on devices. HW passthrough PCIe devices with default
identity map could have the issue. Make sure that messages like following came
out in dmesg and their mapping does not change after booting:
  [   10.167809] DMAR: Hardware identity mapping for device 0000:30:00.0
  [   10.167823] DMAR: Hardware identity mapping for device 0000:30:00.1

Devices which make following true could also be used for the experiment:
  > static int iommu_should_identity_map(struct device *dev, int startup)
  > {
  >		if ((iommu_identity_mapping & IDENTMAP_AZALIA) && IS_AZALIA(pdev))
  >			return 1;
  >		if ((iommu_identity_mapping & IDENTMAP_GFX) && IS_GFX_DEVICE(pdev))
  >			return 1;

Once they are up, remove them first by following command:
  echo 1 > /sys/bus/pci/devices/0000\:03\:00.1/remove

Then trigger the hotplug device rescanning:
  echo 1 > /sys/bus/pci/rescan

To provide an example of specific devices on the market, I need to try out.
Or, if it is fine with you, forcing a PCIe NIC card to be default hardware
passthrough by changing the intel-iommu.c is another easy way to reproduce
this issue.

Best Regards,
James

  reply	other threads:[~2019-02-22  8:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-22  2:44 [PATCH] iommu/vt-d: Handle hotplug devices' default identity mapping setting James Dong
2019-02-22  5:06 ` Lu Baolu
2019-02-22  5:30   ` Lu Baolu
     [not found]     ` <fe6dcb4e-03c4-0bbf-c51f-5964b20593dd-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2019-02-22  6:38       ` James Dong via iommu
2019-02-22  7:42         ` Lu Baolu
2019-02-22  8:28           ` James Dong [this message]
     [not found]             ` <20190222082829.75567-1-xmdong-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2019-02-22 18:07               ` Jis Ben via iommu
2019-02-22 18:10             ` Jis Ben
2019-02-22  7:36     ` James Dong
2019-02-24  8:51       ` Lu Baolu
2019-02-24  8:51         ` Lu Baolu
2019-02-24 16:10         ` James Dong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190222082829.75567-1-xmdong@google.com \
    --to=xmdong@google.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=dwmw2@infradead.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jisben@google.com \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.