mbox series

[QEMU,v3,0/7] Xen: support grant mappings.

Message ID 20240227223501.28475-1-vikram.garhwal@amd.com (mailing list archive)
Headers show
Series Xen: support grant mappings. | expand

Message

Vikram Garhwal Feb. 27, 2024, 10:34 p.m. UTC
Hi,
This patch series add support for grant mappings as a pseudo RAM region for Xen.

Enabling grant mappings patches(first 6) are written by Juergen in 2021.

QEMU Virtio device provides an emulated backends for Virtio frontned devices
in Xen.
Please set "iommu_platform=on" option when invoking QEMU. As this will set
VIRTIO_F_ACCESS_PLATFORM feature which will be used by virtio frontend in Xen
to know whether backend supports grants or not.

Changelog:
v2->v3:
    Drop patch 1/7. This was done because device unplug is an x86-only case.
    Add missing qemu_mutex_unlock() before return.
v1->v2:
    Split patch 2/7 to keep phymem.c changes in a separate.
    In patch "xen: add map and unmap callbacks for grant" add check for total
        allowed grant < XEN_MAX_VIRTIO_GRANTS.
    Fix formatting issues and re-based with master latest.

Regards,
Vikram

Juergen Gross (5):
  xen: add pseudo RAM region for grant mappings
  softmmu: let qemu_map_ram_ptr() use qemu_ram_ptr_length()
  xen: let xen_ram_addr_from_mapcache() return -1 in case of not found
    entry
  memory: add MemoryRegion map and unmap callbacks
  xen: add map and unmap callbacks for grant region

Vikram Garhwal (2):
  softmmu: physmem: Split ram_block_add()
  hw: arm: Add grant mapping.

 hw/arm/xen_arm.c                |   3 +
 hw/i386/xen/xen-hvm.c           |   3 +
 hw/xen/xen-hvm-common.c         |   4 +-
 hw/xen/xen-mapcache.c           | 214 ++++++++++++++++++++++++++++++--
 include/exec/memory.h           |  21 ++++
 include/exec/ram_addr.h         |   1 +
 include/hw/xen/xen-hvm-common.h |   2 +
 include/hw/xen/xen_pvdev.h      |   3 +
 include/sysemu/xen-mapcache.h   |   3 +
 system/physmem.c                | 179 +++++++++++++++-----------
 10 files changed, 351 insertions(+), 82 deletions(-)

Comments

Manos Pitsidianakis Feb. 28, 2024, 1:27 p.m. UTC | #1
Hello Vikram,

Series doesn't apply on master. Can you rebase and also provide a 
base-commit with --base=<COMMIT_SHA> when you use git-format-patch? This 
will help git rebase if there are any conflicts found locally.

Thanks,

On Wed, 28 Feb 2024 00:34, Vikram Garhwal <vikram.garhwal@amd.com> wrote:
>Hi,
>This patch series add support for grant mappings as a pseudo RAM region for Xen.
>
>Enabling grant mappings patches(first 6) are written by Juergen in 2021.
>
>QEMU Virtio device provides an emulated backends for Virtio frontned devices
>in Xen.
>Please set "iommu_platform=on" option when invoking QEMU. As this will set
>VIRTIO_F_ACCESS_PLATFORM feature which will be used by virtio frontend in Xen
>to know whether backend supports grants or not.
>
>Changelog:
>v2->v3:
>    Drop patch 1/7. This was done because device unplug is an x86-only case.
>    Add missing qemu_mutex_unlock() before return.
>v1->v2:
>    Split patch 2/7 to keep phymem.c changes in a separate.
>    In patch "xen: add map and unmap callbacks for grant" add check for total
>        allowed grant < XEN_MAX_VIRTIO_GRANTS.
>    Fix formatting issues and re-based with master latest.
>
>Regards,
>Vikram
>
>Juergen Gross (5):
>  xen: add pseudo RAM region for grant mappings
>  softmmu: let qemu_map_ram_ptr() use qemu_ram_ptr_length()
>  xen: let xen_ram_addr_from_mapcache() return -1 in case of not found
>    entry
>  memory: add MemoryRegion map and unmap callbacks
>  xen: add map and unmap callbacks for grant region
>
>Vikram Garhwal (2):
>  softmmu: physmem: Split ram_block_add()
>  hw: arm: Add grant mapping.
>
> hw/arm/xen_arm.c                |   3 +
> hw/i386/xen/xen-hvm.c           |   3 +
> hw/xen/xen-hvm-common.c         |   4 +-
> hw/xen/xen-mapcache.c           | 214 ++++++++++++++++++++++++++++++--
> include/exec/memory.h           |  21 ++++
> include/exec/ram_addr.h         |   1 +
> include/hw/xen/xen-hvm-common.h |   2 +
> include/hw/xen/xen_pvdev.h      |   3 +
> include/sysemu/xen-mapcache.h   |   3 +
> system/physmem.c                | 179 +++++++++++++++-----------
> 10 files changed, 351 insertions(+), 82 deletions(-)
>
>-- 
>2.17.1
>
>
Vikram Garhwal Feb. 28, 2024, 6:59 p.m. UTC | #2
Hi Manos,
On Wed, Feb 28, 2024 at 03:27:12PM +0200, Manos Pitsidianakis wrote:
> Hello Vikram,
> 
> Series doesn't apply on master. Can you rebase and also provide a
> base-commit with --base=<COMMIT_SHA> when you use git-format-patch? This
> will help git rebase if there are any conflicts found locally.
I rebased it with latest master and it works fine. Series is based on following
commit: bfe8020c814a30479a4241aaa78b63960655962b.

For v4, I will send a version with base-commit id.

Can you please share what is base-commit id on your side?

Thanks!
> 
> Thanks,
> 
> On Wed, 28 Feb 2024 00:34, Vikram Garhwal <vikram.garhwal@amd.com> wrote:
> > Hi,
> > This patch series add support for grant mappings as a pseudo RAM region for Xen.
> > 
> > Enabling grant mappings patches(first 6) are written by Juergen in 2021.
> > 
> > QEMU Virtio device provides an emulated backends for Virtio frontned devices
> > in Xen.
> > Please set "iommu_platform=on" option when invoking QEMU. As this will set
> > VIRTIO_F_ACCESS_PLATFORM feature which will be used by virtio frontend in Xen
> > to know whether backend supports grants or not.
> > 
> > Changelog:
> > v2->v3:
> >    Drop patch 1/7. This was done because device unplug is an x86-only case.
> >    Add missing qemu_mutex_unlock() before return.
> > v1->v2:
> >    Split patch 2/7 to keep phymem.c changes in a separate.
> >    In patch "xen: add map and unmap callbacks for grant" add check for total
> >        allowed grant < XEN_MAX_VIRTIO_GRANTS.
> >    Fix formatting issues and re-based with master latest.
> > 
> > Regards,
> > Vikram
> > 
> > Juergen Gross (5):
> >  xen: add pseudo RAM region for grant mappings
> >  softmmu: let qemu_map_ram_ptr() use qemu_ram_ptr_length()
> >  xen: let xen_ram_addr_from_mapcache() return -1 in case of not found
> >    entry
> >  memory: add MemoryRegion map and unmap callbacks
> >  xen: add map and unmap callbacks for grant region
> > 
> > Vikram Garhwal (2):
> >  softmmu: physmem: Split ram_block_add()
> >  hw: arm: Add grant mapping.
> > 
> > hw/arm/xen_arm.c                |   3 +
> > hw/i386/xen/xen-hvm.c           |   3 +
> > hw/xen/xen-hvm-common.c         |   4 +-
> > hw/xen/xen-mapcache.c           | 214 ++++++++++++++++++++++++++++++--
> > include/exec/memory.h           |  21 ++++
> > include/exec/ram_addr.h         |   1 +
> > include/hw/xen/xen-hvm-common.h |   2 +
> > include/hw/xen/xen_pvdev.h      |   3 +
> > include/sysemu/xen-mapcache.h   |   3 +
> > system/physmem.c                | 179 +++++++++++++++-----------
> > 10 files changed, 351 insertions(+), 82 deletions(-)
> > 
> > -- 
> > 2.17.1
> > 
> >
Edgar E. Iglesias April 10, 2024, 12:43 p.m. UTC | #3
On Wed, Feb 28, 2024 at 8:00 PM Vikram Garhwal <vikram.garhwal@amd.com>
wrote:

> Hi Manos,
> On Wed, Feb 28, 2024 at 03:27:12PM +0200, Manos Pitsidianakis wrote:
> > Hello Vikram,
> >
> > Series doesn't apply on master. Can you rebase and also provide a
> > base-commit with --base=<COMMIT_SHA> when you use git-format-patch? This
> > will help git rebase if there are any conflicts found locally.
> I rebased it with latest master and it works fine. Series is based on
> following
> commit: bfe8020c814a30479a4241aaa78b63960655962b.
>
> For v4, I will send a version with base-commit id.
>
> Can you please share what is base-commit id on your side?
>
> Thanks!
> >
> > Thanks,
>

Hi all,

I'll send a v4 on behalf of Vikram.

Stefano, I saw your comments here:
https://marc.info/?l=qemu-devel&m=169999555103080
I've manage to loose the email so I can't reply but you indicated that
you're OK with the current patch but perhaps would have preferred another
approach.
I like what Juergen did (so I RB tagged it) but if you feel strongly about
finding another approach we can have a look.

Best regards,
Edgar