[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171208132248.60bd65e7@jacob-builder>
Date: Fri, 8 Dec 2017 13:22:48 -0800
From: Jacob Pan <jacob.jun.pan@...ux.intel.com>
To: Alex Williamson <alex.williamson@...hat.com>
Cc: iommu@...ts.linux-foundation.org,
LKML <linux-kernel@...r.kernel.org>,
Joerg Roedel <joro@...tes.org>,
David Woodhouse <dwmw2@...radead.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Rafael Wysocki <rafael.j.wysocki@...el.com>,
"Liu, Yi L" <yi.l.liu@...el.com>,
Lan Tianyu <tianyu.lan@...el.com>,
"Tian, Kevin" <kevin.tian@...el.com>,
Raj Ashok <ashok.raj@...el.com>,
Jean Delvare <khali@...ux-fr.org>,
"Christoph Hellwig" <hch@...radead.org>,
jacob.jun.pan@...ux.intel.com
Subject: Re: [PATCH v3 10/16] iommu: introduce device fault report API
On Fri, 8 Dec 2017 13:59:09 -0700
Alex Williamson <alex.williamson@...hat.com> wrote:
> > >
> > > Isn't this all rather racy? I see that we can have multiple
> > > callers to register racing.
> > I agree, should use a lock here to prevent unregister. For multiple
> > caller race, it won't happen since there is only one caller can
> > register handler.
>
> If you have multiple simultaneous callers to
> iommu_register_device_fault_handler, they can all get past the test
> for fault_param (testing and setting is not atomic), then it's
> indeterminate which handler gets installed. Thanks,
>
I see, having the mutex would prevent it. Later callers would get
-EBUSY.
Thanks a lot!
> Alex
Powered by blists - more mailing lists