lkml.org 
[lkml]   [2010]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: pci_get_dev_by_id() from interrupt handlers
On Tue, Apr 20, 2010 at 09:32:15AM -0700, Greg KH wrote:
> On Tue, Apr 20, 2010 at 06:04:24PM +0200, Joerg Roedel wrote:
> > Hi Jesse,
> >
> > I have a question regarding the warning in the pci_get_dev_by_id()
> > [search.c] function which triggers when called from interrupt context.
> > As far as I have seen this function should be save to be called in
> > atomic mode.
>
> Are you sure?

Not anymore. You proved me wrong ;-)

> > Is there any other reason it should not be called in interrupt
> > handlers?
>
> klist traversal is not safe to be done in interrupt context as the
> spinlock is not told to be interrupt safe. Now you could go and change
> the klist core to be interrupt safe, but you should probably rethink
> your need here first.

The idea was to capture IO page faults in the IOMMU and propagate them
to KVM instead of just printk into dmesg. KVM could do something better
then like killing the guest. Currently a malicious guest could flood
host dmesg by causing IO page faults.
For the AMD IOMMU the page faults are reported in an event log and the
cpu is informed by an interrupt about it. The event log entry contains
the bus/dev/function of the device. To get the necessary information to
propagate this to KVM I need to get the 'struct device' for it.
I could certainly do this in a tasklet instead but doing that only for
the task of converting bus/device/function into 'struct device' sounds
a bit complicated to me.

Regards,

Joerg



\
 
 \ /
  Last update: 2010-04-20 19:39    [W:0.102 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site