Re: [PATCH v10 10/10] vfio: Don't issue full 2^64 unmap

2020-11-02 Thread Alex Williamson
On Mon, 2 Nov 2020 18:44:11 +0100 Paolo Bonzini wrote: > On 02/11/20 18:37, Alex Williamson wrote: > > I think we still have the issue at the vfio ioctl which takes __u64 iova > > and size parameters, in bytes. Therefore we cannot unmap an entire > > 64-bit address space with a single ioctl

Re: [PATCH v10 10/10] vfio: Don't issue full 2^64 unmap

2020-11-02 Thread Paolo Bonzini
On 02/11/20 18:37, Alex Williamson wrote: > I think we still have the issue at the vfio ioctl which takes __u64 iova > and size parameters, in bytes. Therefore we cannot unmap an entire > 64-bit address space with a single ioctl call. We'd need to make use > of a flag to modify the ioctl

Re: [PATCH v10 10/10] vfio: Don't issue full 2^64 unmap

2020-11-02 Thread Alex Williamson
On Fri, 30 Oct 2020 19:19:14 +0100 Paolo Bonzini wrote: > On 30/10/20 18:26, Alex Williamson wrote: > >> > >> if (try_unmap) { > >> +if (llsize == int128_2_64()) { > >> +/* The unmap ioctl doesn't accept a full 64-bit span. */ > >> +llsize =

Re: [PATCH v10 10/10] vfio: Don't issue full 2^64 unmap

2020-10-30 Thread Paolo Bonzini
On 30/10/20 18:26, Alex Williamson wrote: >> >> if (try_unmap) { >> +if (llsize == int128_2_64()) { >> +/* The unmap ioctl doesn't accept a full 64-bit span. */ >> +llsize = int128_rshift(llsize, 1); >> +ret = vfio_dma_unmap(container, iova,

Re: [PATCH v10 10/10] vfio: Don't issue full 2^64 unmap

2020-10-30 Thread Alex Williamson
On Fri, 30 Oct 2020 06:25:34 -0400 "Michael S. Tsirkin" wrote: > On Thu, Oct 08, 2020 at 03:22:14PM -0600, Alex Williamson wrote: > > On Thu, 8 Oct 2020 19:15:58 +0200 > > Jean-Philippe Brucker wrote: > > > > > IOMMUs may declare memory regions spanning from 0 to UINT64_MAX. When > > >

Re: [PATCH v10 10/10] vfio: Don't issue full 2^64 unmap

2020-10-30 Thread Michael S. Tsirkin
On Thu, Oct 08, 2020 at 03:22:14PM -0600, Alex Williamson wrote: > On Thu, 8 Oct 2020 19:15:58 +0200 > Jean-Philippe Brucker wrote: > > > IOMMUs may declare memory regions spanning from 0 to UINT64_MAX. When > > attempting to deal with such region, vfio_listener_region_del() passes a > > size

Re: [PATCH v10 10/10] vfio: Don't issue full 2^64 unmap

2020-10-16 Thread Auger Eric
Hi Jean, On 10/8/20 7:15 PM, Jean-Philippe Brucker wrote: > IOMMUs may declare memory regions spanning from 0 to UINT64_MAX. When > attempting to deal with such region, vfio_listener_region_del() passes a > size of 2^64 to int128_get64() which throws an assertion failure. Even > ignoring this,

Re: [PATCH v10 10/10] vfio: Don't issue full 2^64 unmap

2020-10-08 Thread Alex Williamson
On Thu, 8 Oct 2020 19:15:58 +0200 Jean-Philippe Brucker wrote: > IOMMUs may declare memory regions spanning from 0 to UINT64_MAX. When > attempting to deal with such region, vfio_listener_region_del() passes a > size of 2^64 to int128_get64() which throws an assertion failure. Even > ignoring

[PATCH v10 10/10] vfio: Don't issue full 2^64 unmap

2020-10-08 Thread Jean-Philippe Brucker
IOMMUs may declare memory regions spanning from 0 to UINT64_MAX. When attempting to deal with such region, vfio_listener_region_del() passes a size of 2^64 to int128_get64() which throws an assertion failure. Even ignoring this, the VFIO_IOMMU_DMA_MAP ioctl cannot handle this size since the size