[v19,for-4.14,02/13] tools/libxc: xc_memshr_fork with interrupts blocked
diff mbox series

Message ID 03b382a38c62b5431c63d00f9acffacf43b55c1d.1591017086.git.tamas.lengyel@intel.com
State New
Headers show
Series
  • VM forking
Related show

Commit Message

Tamas K Lengyel June 1, 2020, 1:21 p.m. UTC
Toolstack side for creating forks with interrupt injection blocked.

Signed-off-by: Tamas K Lengyel <tamas.lengyel@intel.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/include/xenctrl.h | 3 ++-
 tools/libxc/xc_memshr.c       | 4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

Comments

Paul Durrant June 2, 2020, 7:44 a.m. UTC | #1
> -----Original Message-----
> From: Xen-devel <xen-devel-bounces@lists.xenproject.org> On Behalf Of Tamas K Lengyel
> Sent: 01 June 2020 14:22
> To: xen-devel@lists.xenproject.org
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>; Tamas K Lengyel <tamas.lengyel@intel.com>; Wei Liu
> <wl@xen.org>; Roger Pau Monné <roger.pau@citrix.com>
> Subject: [PATCH v19 for-4.14 02/13] tools/libxc: xc_memshr_fork with interrupts blocked
> 
> Toolstack side for creating forks with interrupt injection blocked.
> 
> Signed-off-by: Tamas K Lengyel <tamas.lengyel@intel.com>
> Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

Release-acked-by: Paul Durrant <paul@xen.org>

> ---
>  tools/libxc/include/xenctrl.h | 3 ++-
>  tools/libxc/xc_memshr.c       | 4 +++-
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
> index f9e17ae424..5eeee1de46 100644
> --- a/tools/libxc/include/xenctrl.h
> +++ b/tools/libxc/include/xenctrl.h
> @@ -2241,7 +2241,8 @@ int xc_memshr_range_share(xc_interface *xch,
>  int xc_memshr_fork(xc_interface *xch,
>                     uint32_t source_domain,
>                     uint32_t client_domain,
> -                   bool allow_with_iommu);
> +                   bool allow_with_iommu,
> +                   bool block_interrupts);
> 
>  /*
>   * Note: this function is only intended to be used on short-lived forks that
> diff --git a/tools/libxc/xc_memshr.c b/tools/libxc/xc_memshr.c
> index 2300cc7075..a6cfd7dccf 100644
> --- a/tools/libxc/xc_memshr.c
> +++ b/tools/libxc/xc_memshr.c
> @@ -240,7 +240,7 @@ int xc_memshr_debug_gref(xc_interface *xch,
>  }
> 
>  int xc_memshr_fork(xc_interface *xch, uint32_t pdomid, uint32_t domid,
> -                   bool allow_with_iommu)
> +                   bool allow_with_iommu, bool block_interrupts)
>  {
>      xen_mem_sharing_op_t mso;
> 
> @@ -251,6 +251,8 @@ int xc_memshr_fork(xc_interface *xch, uint32_t pdomid, uint32_t domid,
> 
>      if ( allow_with_iommu )
>          mso.u.fork.flags |= XENMEM_FORK_WITH_IOMMU_ALLOWED;
> +    if ( block_interrupts )
> +        mso.u.fork.flags |= XENMEM_FORK_BLOCK_INTERRUPTS;
> 
>      return xc_memshr_memop(xch, domid, &mso);
>  }
> --
> 2.25.1
>
Wei Liu June 2, 2020, 10:26 a.m. UTC | #2
On Mon, Jun 01, 2020 at 06:21:36AM -0700, Tamas K Lengyel wrote:
> Toolstack side for creating forks with interrupt injection blocked.
> 
> Signed-off-by: Tamas K Lengyel <tamas.lengyel@intel.com>
> Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

Acked-by: Wei Liu <wl@xen.org>

Patch
diff mbox series

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index f9e17ae424..5eeee1de46 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -2241,7 +2241,8 @@  int xc_memshr_range_share(xc_interface *xch,
 int xc_memshr_fork(xc_interface *xch,
                    uint32_t source_domain,
                    uint32_t client_domain,
-                   bool allow_with_iommu);
+                   bool allow_with_iommu,
+                   bool block_interrupts);
 
 /*
  * Note: this function is only intended to be used on short-lived forks that
diff --git a/tools/libxc/xc_memshr.c b/tools/libxc/xc_memshr.c
index 2300cc7075..a6cfd7dccf 100644
--- a/tools/libxc/xc_memshr.c
+++ b/tools/libxc/xc_memshr.c
@@ -240,7 +240,7 @@  int xc_memshr_debug_gref(xc_interface *xch,
 }
 
 int xc_memshr_fork(xc_interface *xch, uint32_t pdomid, uint32_t domid,
-                   bool allow_with_iommu)
+                   bool allow_with_iommu, bool block_interrupts)
 {
     xen_mem_sharing_op_t mso;
 
@@ -251,6 +251,8 @@  int xc_memshr_fork(xc_interface *xch, uint32_t pdomid, uint32_t domid,
 
     if ( allow_with_iommu )
         mso.u.fork.flags |= XENMEM_FORK_WITH_IOMMU_ALLOWED;
+    if ( block_interrupts )
+        mso.u.fork.flags |= XENMEM_FORK_BLOCK_INTERRUPTS;
 
     return xc_memshr_memop(xch, domid, &mso);
 }