[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <51CC1881.5060500@ozlabs.ru>
Date: Thu, 27 Jun 2013 20:48:33 +1000
From: Alexey Kardashevskiy <aik@...abs.ru>
To: Benjamin Herrenschmidt <benh@...nel.crashing.org>
CC: Stephen Rothwell <sfr@...b.auug.org.au>,
linuxppc-dev@...ts.ozlabs.org, kvm@...r.kernel.org,
linux-doc@...r.kernel.org, Alexander Graf <agraf@...e.de>,
kvm-ppc@...r.kernel.org, linux-kernel@...r.kernel.org,
Alex Williamson <alex.williamson@...hat.com>,
Paul Mackerras <paulus@...ba.org>,
"Paul E . McKenney" <paulmck@...ux.vnet.ibm.com>,
David Gibson <david@...son.dropbear.id.au>
Subject: Re: [PATCH 3/8] vfio: add external user support
On 06/27/2013 07:42 PM, Benjamin Herrenschmidt wrote:
> On Thu, 2013-06-27 at 16:59 +1000, Stephen Rothwell wrote:
>>> +/* Allows an external user (for example, KVM) to unlock an IOMMU
>> group */
>>> +static void vfio_group_del_external_user(struct file *filep)
>>> +{
>>> + struct vfio_group *group = filep->private_data;
>>> +
>>> + BUG_ON(filep->f_op != &vfio_group_fops);
>>
>> We usually reserve BUG_ON for situations where there is no way to
>> continue running or continuing will corrupt the running kernel. Maybe
>> WARN_ON() and return?
>
> Not even that. This is a user space provided "fd", we shouldn't oops the
> kernel because we passed a wrong argument, just return -EINVAL or
> something like that (add a return code).
I'll change to WARN_ON but...
This is going to be called on KVM exit on a file pointer previously
verified for correctness. If it is a wrong file*, then something went
terribly wrong.
--
Alexey
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists