<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/vfio/fsl-mc, branch linux-5.12.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.12.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.12.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-05-14T08:52:39Z</updated>
<entry>
<title>vfio/fsl-mc: Re-order vfio_fsl_mc_probe()</title>
<updated>2021-05-14T08:52:39Z</updated>
<author>
<name>Jason Gunthorpe</name>
</author>
<published>2021-03-30T15:53:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d63e156085ac0bc7ece0d709ede19706229dbce6'/>
<id>urn:sha1:d63e156085ac0bc7ece0d709ede19706229dbce6</id>
<content type='text'>
[ Upstream commit 2b1fe162e584a88ec7f12a651a2a50f94dd8cfac ]

vfio_add_group_dev() must be called only after all of the private data in
vdev is fully setup and ready, otherwise there could be races with user
space instantiating a device file descriptor and starting to call ops.

For instance vfio_fsl_mc_reflck_attach() sets vdev-&gt;reflck and
vfio_fsl_mc_open(), called by fops open, unconditionally derefs it, which
will crash if things get out of order.

This driver started life with the right sequence, but two commits added
stuff after vfio_add_group_dev().

Fixes: 2e0d29561f59 ("vfio/fsl-mc: Add irq infrastructure for fsl-mc devices")
Fixes: f2ba7e8c947b ("vfio/fsl-mc: Added lock support in preparation for interrupt handling")
Co-developed-by: Diana Craciun OSS &lt;diana.craciun@oss.nxp.com&gt;
Signed-off-by: Jason Gunthorpe &lt;jgg@nvidia.com&gt;
Message-Id: &lt;5-v3-225de1400dfc+4e074-vfio1_jgg@nvidia.com&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>vfio/fsl-mc: Make vfio_fsl_mc_irqs_allocate static</title>
<updated>2020-11-03T18:07:40Z</updated>
<author>
<name>Diana Craciun</name>
</author>
<published>2020-10-26T16:53:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8e91cb3812121aca8369d6c4e717ddd072280d0f'/>
<id>urn:sha1:8e91cb3812121aca8369d6c4e717ddd072280d0f</id>
<content type='text'>
Fixed compiler warning:
drivers/vfio/fsl-mc/vfio_fsl_mc_intr.c:16:5: warning: no previous
prototype for function 'vfio_fsl_mc_irqs_allocate' [-Wmissing-prototypes]
       ^
drivers/vfio/fsl-mc/vfio_fsl_mc_intr.c:16:1: note: declare 'static'
if the function is not intended to be used outside of this translation unit
int vfio_fsl_mc_irqs_allocate(struct vfio_fsl_mc_device *vdev)

Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Diana Craciun &lt;diana.craciun@oss.nxp.com&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
<entry>
<title>vfio/fsl-mc: prevent underflow in vfio_fsl_mc_mmap()</title>
<updated>2020-11-03T18:07:19Z</updated>
<author>
<name>Dan Carpenter</name>
</author>
<published>2020-10-23T11:29:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=69848cd6f0c1fb4f82ab255b730343a215ded013'/>
<id>urn:sha1:69848cd6f0c1fb4f82ab255b730343a215ded013</id>
<content type='text'>
My static analsysis tool complains that the "index" can be negative.
There are some checks in do_mmap() which try to prevent underflows but
I don't know if they are sufficient for this situation.  Either way,
making "index" unsigned is harmless so let's do it just to be safe.

Fixes: 67247289688d ("vfio/fsl-mc: Allow userspace to MMAP fsl-mc device MMIO regions")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Acked-by: Diana Craciun &lt;diana.craciun@oss.nxp.com&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
<entry>
<title>vfio/fsl-mc: return -EFAULT if copy_to_user() fails</title>
<updated>2020-11-02T22:00:06Z</updated>
<author>
<name>Dan Carpenter</name>
</author>
<published>2020-10-23T11:34:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=09699e56dee946a16767021af97411ed6f4b3e6b'/>
<id>urn:sha1:09699e56dee946a16767021af97411ed6f4b3e6b</id>
<content type='text'>
The copy_to_user() function returns the number of bytes remaining to be
copied, but this code should return -EFAULT.

Fixes: df747bcd5b21 ("vfio/fsl-mc: Implement VFIO_DEVICE_GET_REGION_INFO ioctl call")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Acked-by: Diana Craciun &lt;diana.craciun@oss.nxp.com&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
<entry>
<title>vfio/fsl-mc: fix the return of the uninitialized variable ret</title>
<updated>2020-10-19T13:09:41Z</updated>
<author>
<name>Diana Craciun</name>
</author>
<published>2020-10-16T09:32:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=822e1a90afff61826252a65e574e940c0038055c'/>
<id>urn:sha1:822e1a90afff61826252a65e574e940c0038055c</id>
<content type='text'>
The vfio_fsl_mc_reflck_attach function may return, on success path,
an uninitialized variable. Fix the problem by initializing the return
variable to 0.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: f2ba7e8c947b ("vfio/fsl-mc: Added lock support in preparation for interrupt handling")
Reported-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Signed-off-by: Diana Craciun &lt;diana.craciun@oss.nxp.com&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
<entry>
<title>vfio/fsl-mc: Fix the dead code in vfio_fsl_mc_set_irq_trigger</title>
<updated>2020-10-15T18:46:08Z</updated>
<author>
<name>Diana Craciun</name>
</author>
<published>2020-10-15T18:14:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=159246378d8483ba63844fc03027df70501552c1'/>
<id>urn:sha1:159246378d8483ba63844fc03027df70501552c1</id>
<content type='text'>
Static analysis discovered that some code in vfio_fsl_mc_set_irq_trigger
is dead code. Fixed the code by changing the conditions order.

Fixes: cc0ee20bd969 ("vfio/fsl-mc: trigger an interrupt via eventfd")
Reported-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Signed-off-by: Diana Craciun &lt;diana.craciun@oss.nxp.com&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
<entry>
<title>vfio/fsl-mc: Fixed vfio-fsl-mc driver compilation on 32 bit</title>
<updated>2020-10-13T17:12:29Z</updated>
<author>
<name>Diana Craciun</name>
</author>
<published>2020-10-13T15:06:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=83e491799e631dd41e7c7a870dd3a7603c461123'/>
<id>urn:sha1:83e491799e631dd41e7c7a870dd3a7603c461123</id>
<content type='text'>
The FSL_MC_BUS on which the VFIO-FSL-MC driver is dependent on
can be compiled on other architectures as well (not only ARM64)
including 32 bit architectures.
Include linux/io-64-nonatomic-hi-lo.h to make writeq/readq used
in the driver available on 32bit platforms.

Signed-off-by: Diana Craciun &lt;diana.craciun@oss.nxp.com&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
<entry>
<title>vfio/fsl-mc: Add support for device reset</title>
<updated>2020-10-12T17:33:48Z</updated>
<author>
<name>Diana Craciun</name>
</author>
<published>2020-10-05T17:36:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ac93ab2bf69a5b7724106ec7ce852eff9c307510'/>
<id>urn:sha1:ac93ab2bf69a5b7724106ec7ce852eff9c307510</id>
<content type='text'>
Currently only resetting the DPRC container is supported which
will reset all the objects inside it. Resetting individual
objects is possible from the userspace by issueing commands
towards MC firmware.

Signed-off-by: Diana Craciun &lt;diana.craciun@oss.nxp.com&gt;
Reviewed-by: Eric Auger &lt;eric.auger@redhat.com&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
<entry>
<title>vfio/fsl-mc: Add read/write support for fsl-mc devices</title>
<updated>2020-10-12T17:33:27Z</updated>
<author>
<name>Diana Craciun</name>
</author>
<published>2020-10-05T17:36:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1bb141ed5e14f773f9e08b80fe5db3fd405399db'/>
<id>urn:sha1:1bb141ed5e14f773f9e08b80fe5db3fd405399db</id>
<content type='text'>
The software uses a memory-mapped I/O command interface (MC portals) to
communicate with the MC hardware. This command interface is used to
discover, enumerate, configure and remove DPAA2 objects. The DPAA2
objects use MSIs, so the command interface needs to be emulated
such that the correct MSI is configured in the hardware (the guest
has the virtual MSIs).

This patch is adding read/write support for fsl-mc devices. The mc
commands are emulated by the userspace. The host is just passing
the correct command to the hardware.

Also the current patch limits userspace to write complete
64byte command once and read 64byte response by one ioctl.

Signed-off-by: Bharat Bhushan &lt;Bharat.Bhushan@nxp.com&gt;
Signed-off-by: Diana Craciun &lt;diana.craciun@oss.nxp.com&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
<entry>
<title>vfio/fsl-mc: trigger an interrupt via eventfd</title>
<updated>2020-10-12T17:33:15Z</updated>
<author>
<name>Diana Craciun</name>
</author>
<published>2020-10-05T17:36:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cc0ee20bd96971c10eba9a83ecf1c0733078a083'/>
<id>urn:sha1:cc0ee20bd96971c10eba9a83ecf1c0733078a083</id>
<content type='text'>
This patch allows to set an eventfd for fsl-mc device interrupts
and also to trigger the interrupt eventfd from userspace for testing.

All fsl-mc device interrupts are MSIs. The MSIs are allocated from
the MSI domain only once per DPRC and used by all the DPAA2 objects.
The interrupts are managed by the DPRC in a pool of interrupts. Each
device requests interrupts from this pool. The pool is allocated
when the first virtual device is setting the interrupts.
The pool of interrupts is protected by a lock.

The DPRC has an interrupt of its own which indicates if the DPRC
contents have changed. However, currently, the contents of a DPRC
assigned to the guest cannot be changed at runtime, so this interrupt
is not configured.

Signed-off-by: Bharat Bhushan &lt;Bharat.Bhushan@nxp.com&gt;
Signed-off-by: Diana Craciun &lt;diana.craciun@oss.nxp.com&gt;
Reviewed-by: Eric Auger &lt;eric.auger@redhat.com&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
</feed>
