iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Shuah Khan <shuah.khan-VXdhtT5mjnY@public.gmane.org>
To: David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	shuah.khan-VXdhtT5mjnY@public.gmane.org, "Mingarelli,
	Thomas" <Thomas.Mingarelli-VXdhtT5mjnY@public.gmane.org>
Subject: Re: [PATCH v2] Intel IOMMU patch to reprocess RMRR info
Date: Fri, 28 Sep 2012 13:35:29 -0600	[thread overview]
Message-ID: <1348860929.2601.30.camel@lorien2> (raw)
In-Reply-To: <1348859719.2036.128.camel-Fexsq3y4057IgHVZqg5X0TlWvGAXklZc@public.gmane.org>

On Fri, 2012-09-28 at 20:15 +0100, David Woodhouse wrote:
> On Fri, 2012-09-28 at 12:36 -0400, Linda Knippers wrote:
> > I can only speak to the HP servers.  We have been shipping devices
> > 'for a while' that provide sensor-type data to the platform.  The
> > device does DMA writes to a range of memory (the RMRR) and
> > iLO does DMA reads of that data.
> > 
> > This works in general but not when the 'iommu=pt' boot option is
> > used.  This patch associates the RMRR with the devices when
> > they are moved out of the "si" domain.
> 
> That much makes sense, I think, because they're moved out of the
> hardware SI domain *early*, when we realise they're actually only
> capable of 32-bit DMA and we have >4GiB of RAM. Right?

Correct. By default all devices are added to SI domain assuming that
these devices are 64-bit devices. When we detect the device is a 32-bit
device based on the requested dma-mask, it gets removed from SI domain,
hence looses its RMRR association. In the meantime dma continues causing
DMA errors. This patch is re-processing RMRRs for the device in question
and doing re-assignment.

> 
> It sounds like this isn't a case of the device being used by a native
> driver or given to KVM, and subsequently released. This is just booting
> up and losing the RMRR regions on a device which the OS *hasn't* really
> touched. So that should be fixed.
> 
> > Based on Alex's comments about moving RMRR devices between domains,
> > it sounds like we also have a problem without the 'iommu=pt' boot
> > option if someone assigns one of those devices to a guest.
> 
> Yeah... but why *would* they? What possible reason would we have to
> assign either the sensor device, or the iLO, to a KVM guest. Or to have
> a native driver that attempts to do DMA from them?
> 
> Obviously, in an ideal world we'd have proper native drivers for the
> sensor device. But I'm guessing that's not the case here; it's used by
> the firmware and we're not supposed to be touching it?
> 
> And yes, obviously a better hardware design (from the OS/IOMMU point of
> view) would be to have a path for the sensor data that *doesn't* go via
> host RAM and thus via the IOMMU twice. But while that's a lesson that's
> hopefully been learned and will be implemented in future, we have to
> deal with the existing hardware and its (ab)use of RMRRs.
> 

Right. We do have hardware that is relying on being able to do dma from
devices to a system RAM via RMRR.

-- Shuah

  parent reply	other threads:[~2012-09-28 19:35 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-28 15:52 [PATCH v2] Intel IOMMU patch to reprocess RMRR info David Woodhouse
     [not found] ` <uh6q9m8bwu6c2jov69m2aivu.1348847561292-2ueSQiBKiTY7tOexoI0I+QC/G2K4zDHf@public.gmane.org>
2012-09-28 16:30   ` Alex Williamson
2012-09-28 16:36   ` Linda Knippers
     [not found]     ` <5065D1F5.1090003-VXdhtT5mjnY@public.gmane.org>
2012-09-28 17:01       ` Joerg Roedel
     [not found]         ` <20120928170106.GE18962-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2012-09-28 17:06           ` Joerg Roedel
2012-09-28 17:28           ` Alex Williamson
2012-09-28 19:15       ` David Woodhouse
     [not found]         ` <1348859719.2036.128.camel-Fexsq3y4057IgHVZqg5X0TlWvGAXklZc@public.gmane.org>
2012-09-28 19:21           ` Mingarelli, Thomas
2012-09-28 19:35           ` Shuah Khan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-09-18 17:27 Tom Mingarelli
2012-09-18 16:49 Tom Mingarelli
     [not found] ` <20120918164955.12296.28799.sendpatchset-jP8EmR9A9vELnkn81s9yt/egYHeGw8Jk@public.gmane.org>
2012-09-18 17:46   ` Don Dutile
2012-09-27 20:36   ` Alex Williamson
     [not found]     ` <1348778200.2320.241.camel-85EaTFmN5p//9pzu0YdTqQ@public.gmane.org>
2012-09-27 21:10       ` Mingarelli, Thomas
     [not found]         ` <9774516974AF5F4C8A2C3C69CD3412332338F452-KNyhpuZufFMSZAcGdq5asR6epYMZPwEe5NbjCUgZEJk@public.gmane.org>
2012-09-27 21:34           ` Alex Williamson
     [not found]             ` <1348781647.2320.264.camel-85EaTFmN5p//9pzu0YdTqQ@public.gmane.org>
2012-09-27 21:50               ` David Woodhouse
     [not found]                 ` <1348782605.2036.117.camel-Fexsq3y4057IgHVZqg5X0TlWvGAXklZc@public.gmane.org>
2012-09-28  9:46                   ` Joerg Roedel
     [not found]                     ` <20120928094625.GI10549-5C7GfCeVMHo@public.gmane.org>
2012-09-28 10:23                       ` David Woodhouse
     [not found]                         ` <1348827803.2036.121.camel-Fexsq3y4057IgHVZqg5X0TlWvGAXklZc@public.gmane.org>
2012-09-28 12:03                           ` Joerg Roedel
2012-09-27 21:50               ` Linda Knippers
     [not found]                 ` <5064CA2D.3030206-VXdhtT5mjnY@public.gmane.org>
2012-09-27 21:48                   ` Mingarelli, Thomas
2012-09-27 21:52                   ` Alex Williamson
2012-09-28  9:43               ` Joerg Roedel
     [not found]                 ` <20120928094301.GH10549-5C7GfCeVMHo@public.gmane.org>
2012-09-28 12:40                   ` Alex Williamson
     [not found]                     ` <1348836008.2320.284.camel-85EaTFmN5p//9pzu0YdTqQ@public.gmane.org>
2012-09-28 12:52                       ` Joerg Roedel
     [not found]                         ` <20120928125246.GK10549-5C7GfCeVMHo@public.gmane.org>
2012-09-28 13:21                           ` Alex Williamson

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=1348860929.2601.30.camel@lorien2 \
    --to=shuah.khan-vxdhtt5mjny@public.gmane.org \
    --cc=Thomas.Mingarelli-VXdhtT5mjnY@public.gmane.org \
    --cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).