mbox series

[0/3] virtio-iommu: Support VIRTIO_IOMMU_F_BYPASS_CONFIG

Message ID 20210930185050.262759-1-jean-philippe@linaro.org (mailing list archive)
Headers show
Series virtio-iommu: Support VIRTIO_IOMMU_F_BYPASS_CONFIG | expand

Message

Jean-Philippe Brucker Sept. 30, 2021, 6:50 p.m. UTC
Replace the VIRTIO_IOMMU_F_BYPASS feature with
VIRTIO_IOMMU_F_BYPASS_CONFIG, which enables a config space bit to switch
global bypass on and off.

Add a boot-bypass option, which defaults to 'on' to be in line with
other vIOMMUs and to allow running firmware/bootloader that are unaware
of the IOMMU.

See the spec change for more rationale
https://lists.oasis-open.org/archives/virtio-dev/202109/msg00137.html

Jean-Philippe Brucker (3):
  NOMERGE: virtio-iommu: Add definitions for
    VIRTIO_IOMMU_F_BYPASS_CONFIG
  virtio-iommu: Default to bypass during boot
  virtio-iommu: Support bypass domain

 include/hw/virtio/virtio-iommu.h              |  1 +
 include/standard-headers/linux/virtio_iommu.h | 10 +++-
 hw/virtio/virtio-iommu.c                      | 60 ++++++++++++++++---
 hw/virtio/trace-events                        |  4 +-
 4 files changed, 64 insertions(+), 11 deletions(-)

Comments

Eric Auger Jan. 11, 2022, 9:02 a.m. UTC | #1
Hi Jean, Michael,

On 9/30/21 8:50 PM, Jean-Philippe Brucker wrote:
> Replace the VIRTIO_IOMMU_F_BYPASS feature with
> VIRTIO_IOMMU_F_BYPASS_CONFIG, which enables a config space bit to switch
> global bypass on and off.
>
> Add a boot-bypass option, which defaults to 'on' to be in line with
> other vIOMMUs and to allow running firmware/bootloader that are unaware
> of the IOMMU.
>
> See the spec change for more rationale
> https://lists.oasis-open.org/archives/virtio-dev/202109/msg00137.html

I guess the kernel bits should be merged in 5.17?

Thanks

Eric
>
> Jean-Philippe Brucker (3):
>   NOMERGE: virtio-iommu: Add definitions for
>     VIRTIO_IOMMU_F_BYPASS_CONFIG
>   virtio-iommu: Default to bypass during boot
>   virtio-iommu: Support bypass domain
>
>  include/hw/virtio/virtio-iommu.h              |  1 +
>  include/standard-headers/linux/virtio_iommu.h | 10 +++-
>  hw/virtio/virtio-iommu.c                      | 60 ++++++++++++++++---
>  hw/virtio/trace-events                        |  4 +-
>  4 files changed, 64 insertions(+), 11 deletions(-)
>
Jean-Philippe Brucker Jan. 11, 2022, 10:13 a.m. UTC | #2
Hi Eric,

On Tue, Jan 11, 2022 at 10:02:12AM +0100, Eric Auger wrote:
> Hi Jean, Michael,
> 
> On 9/30/21 8:50 PM, Jean-Philippe Brucker wrote:
> > Replace the VIRTIO_IOMMU_F_BYPASS feature with
> > VIRTIO_IOMMU_F_BYPASS_CONFIG, which enables a config space bit to switch
> > global bypass on and off.
> >
> > Add a boot-bypass option, which defaults to 'on' to be in line with
> > other vIOMMUs and to allow running firmware/bootloader that are unaware
> > of the IOMMU.
> >
> > See the spec change for more rationale
> > https://lists.oasis-open.org/archives/virtio-dev/202109/msg00137.html
> 
> I guess the kernel bits should be merged in 5.17?

Yes, they should. I can resend at 5.17-rc1 along with a commit updating
the linux headers. Or is there a specific process for synchronizing the
headers?  Looking at git log it looks like scripts/update-linux-headers.sh
is run by whomever needs new UAPI features.

Thanks,
Jean
Eric Auger Jan. 11, 2022, 10:33 a.m. UTC | #3
Hi Jean,

On 1/11/22 11:13 AM, Jean-Philippe Brucker wrote:
> Hi Eric,
>
> On Tue, Jan 11, 2022 at 10:02:12AM +0100, Eric Auger wrote:
>> Hi Jean, Michael,
>>
>> On 9/30/21 8:50 PM, Jean-Philippe Brucker wrote:
>>> Replace the VIRTIO_IOMMU_F_BYPASS feature with
>>> VIRTIO_IOMMU_F_BYPASS_CONFIG, which enables a config space bit to switch
>>> global bypass on and off.
>>>
>>> Add a boot-bypass option, which defaults to 'on' to be in line with
>>> other vIOMMUs and to allow running firmware/bootloader that are unaware
>>> of the IOMMU.
>>>
>>> See the spec change for more rationale
>>> https://lists.oasis-open.org/archives/virtio-dev/202109/msg00137.html
>> I guess the kernel bits should be merged in 5.17?
> Yes, they should. I can resend at 5.17-rc1 along with a commit updating
> the linux headers. Or is there a specific process for synchronizing the
> headers?  Looking at git log it looks like scripts/update-linux-headers.sh
> is run by whomever needs new UAPI features.
yes you need to generate the header update patch using

scripts/update-linux-headers.sh once the kernel pieces have landed

Thanks

Eric

>
> Thanks,
> Jean
>
Michael S. Tsirkin Jan. 11, 2022, 3:40 p.m. UTC | #4
On Tue, Jan 11, 2022 at 10:02:12AM +0100, Eric Auger wrote:
> Hi Jean, Michael,
> 
> On 9/30/21 8:50 PM, Jean-Philippe Brucker wrote:
> > Replace the VIRTIO_IOMMU_F_BYPASS feature with
> > VIRTIO_IOMMU_F_BYPASS_CONFIG, which enables a config space bit to switch
> > global bypass on and off.
> >
> > Add a boot-bypass option, which defaults to 'on' to be in line with
> > other vIOMMUs and to allow running firmware/bootloader that are unaware
> > of the IOMMU.
> >
> > See the spec change for more rationale
> > https://lists.oasis-open.org/archives/virtio-dev/202109/msg00137.html
> 
> I guess the kernel bits should be merged in 5.17?
> 
> Thanks
> 
> Eric

They are in fact in my tree and set to go into 5.16.
They've been in linux-next for a whole cycle now.
But if you feel I'm rushing things, pls let me know.
Also, pls let me know whether my tree actually works well for you!

> >
> > Jean-Philippe Brucker (3):
> >   NOMERGE: virtio-iommu: Add definitions for
> >     VIRTIO_IOMMU_F_BYPASS_CONFIG
> >   virtio-iommu: Default to bypass during boot
> >   virtio-iommu: Support bypass domain
> >
> >  include/hw/virtio/virtio-iommu.h              |  1 +
> >  include/standard-headers/linux/virtio_iommu.h | 10 +++-
> >  hw/virtio/virtio-iommu.c                      | 60 ++++++++++++++++---
> >  hw/virtio/trace-events                        |  4 +-
> >  4 files changed, 64 insertions(+), 11 deletions(-)
> >
Jean-Philippe Brucker Jan. 11, 2022, 4:24 p.m. UTC | #5
Hi Michael,

On Tue, Jan 11, 2022 at 10:40:28AM -0500, Michael S. Tsirkin wrote:
> On Tue, Jan 11, 2022 at 10:02:12AM +0100, Eric Auger wrote:
> > Hi Jean, Michael,
> > 
> > On 9/30/21 8:50 PM, Jean-Philippe Brucker wrote:
> > > Replace the VIRTIO_IOMMU_F_BYPASS feature with
> > > VIRTIO_IOMMU_F_BYPASS_CONFIG, which enables a config space bit to switch
> > > global bypass on and off.
> > >
> > > Add a boot-bypass option, which defaults to 'on' to be in line with
> > > other vIOMMUs and to allow running firmware/bootloader that are unaware
> > > of the IOMMU.
> > >
> > > See the spec change for more rationale
> > > https://lists.oasis-open.org/archives/virtio-dev/202109/msg00137.html
> > 
> > I guess the kernel bits should be merged in 5.17?
> > 
> > Thanks
> > 
> > Eric
> 
> They are in fact in my tree and set to go into 5.16.
> They've been in linux-next for a whole cycle now.
> But if you feel I'm rushing things, pls let me know.
> Also, pls let me know whether my tree actually works well for you!

Thanks, unfortunately I just noticed that those patches are from an older
version of the series, the latest being v3
https://lore.kernel.org/linux-iommu/20211201173323.1045819-1-jean-philippe@linaro.org/

Since Joerg picked the latest one in his tree [1], I was wondering if you
could drop those patches?

51a4c54f35ae iommu/virtio: Support identity-mapped domains
523e55a406aa iommu/virtio: Pass end address to viommu_add_mapping()
97301219dfb2 iommu/virtio: Sort reserved regions
720552613526 iommu/virtio: Support bypass domains
01444b9c772f iommu/virtio: Add definitions for VIRTIO_IOMMU_F_BYPASS_CONFIG

Thanks,
Jean

[1] https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git/