[PATCH 5/5 v11] iommu/fsl: Freescale PAMU driver and iommu implementation.
Timur Tabi
timur at tabi.org
Wed Apr 3 12:35:54 EST 2013
On Tue, Apr 2, 2013 at 11:18 AM, Joerg Roedel <joro at 8bytes.org> wrote:
> > + panic("\n");
>
> A kernel panic seems like an over-reaction to an access violation.
We have no way to determining what code caused the violation, so we
can't just kill the process. I agree it seems like overkill, but what
else should we do? Does the IOMMU layer have a way for the IOMMU
driver to stop the device that caused the problem?
> Besides the device that caused the violation the system should still
> work, no?
Not really. The PAMU was designed to add IOMMU support to legacy
devices, which have no concept of an MMU. If the PAMU detects an
access violation, there's no way for the device to recover, because it
has no idea that a violation has occurred. It's going to keep on
writing to bad data.
Maybe we need a mechanism where a driver can register a callback
function to handle IOMMU exceptions?
> > + /*
> > + * In case of devices with multiple LIODNs just store
> > + * the info for the first LIODN as all
> > + * LIODNs share the same domain
> > + */
> > + if (!old_domain_info)
> > + dev->archdata.iommu_domain = info;
> > + spin_unlock(&device_domain_lock);
>
> Don't you have to tell the hardware that a device was added to a domain?
> I don't see that, what I am missing?
I'm not sure I understand. What "hardware" do you think needs to be notified?
The PAMU reads everything it needs from the PAACT, which we update.
The PAMU does not know anything about the devices that it monitors,
and the devices don't know anything about the PAMU.
More information about the Linuxppc-dev
mailing list