diff mbox series

[V6,23/24] xen/ioreq: Do not let bufioreq to be used on other than x86 arches

Message ID 1611884932-1851-24-git-send-email-olekstysh@gmail.com (mailing list archive)
State New, archived
Headers show
Series IOREQ feature (+ virtio-mmio) on Arm | expand

Commit Message

Oleksandr Tyshchenko Jan. 29, 2021, 1:48 a.m. UTC
From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

This patch prevents the device model running on other than x86
systems to use buffered I/O feature for now.

Please note, there is no caller which requires to send buffered
I/O request on Arm currently and the purpose of this check is
to catch any future user of bufioreq.

Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

---
Please note, this is a split/cleanup/hardening of Julien's PoC:
"Add support for Guest IO forwarding to a device emulator"

Changes V5 -> V6:
   - new patch
---
---
 xen/common/ioreq.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Jan Beulich Jan. 29, 2021, 8:59 a.m. UTC | #1
On 29.01.2021 02:48, Oleksandr Tyshchenko wrote:
> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
> 
> This patch prevents the device model running on other than x86
> systems to use buffered I/O feature for now.
> 
> Please note, there is no caller which requires to send buffered
> I/O request on Arm currently and the purpose of this check is
> to catch any future user of bufioreq.
> 
> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

It wasn't entirely clear to me what your respective reply on
the v5 sub-thread was saying, so assuming this doesn't break
functionality that the earlier parts of the series put in
place:
Acked-by: Jan Beulich <jbeulich@suse.com>

Jan
Julien Grall Jan. 29, 2021, 10:21 a.m. UTC | #2
Hi Oleksandr,

On 29/01/2021 01:48, Oleksandr Tyshchenko wrote:
> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
> 
> This patch prevents the device model running on other than x86
> systems to use buffered I/O feature for now.
> 
> Please note, there is no caller which requires to send buffered
> I/O request on Arm currently and the purpose of this check is
> to catch any future user of bufioreq.
> 
> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

Acked-by: Julien Grall <jgrall@amazon.com>

Cheers,

> 
> ---
> Please note, this is a split/cleanup/hardening of Julien's PoC:
> "Add support for Guest IO forwarding to a device emulator"
> 
> Changes V5 -> V6:
>     - new patch
> ---
> ---
>   xen/common/ioreq.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/xen/common/ioreq.c b/xen/common/ioreq.c
> index 67ef1f7..a36137d 100644
> --- a/xen/common/ioreq.c
> +++ b/xen/common/ioreq.c
> @@ -629,6 +629,9 @@ static int ioreq_server_create(struct domain *d, int bufioreq_handling,
>       unsigned int i;
>       int rc;
>   
> +    if ( !IS_ENABLED(CONFIG_X86) && bufioreq_handling )
> +        return -EINVAL;
> +
>       if ( bufioreq_handling > HVM_IOREQSRV_BUFIOREQ_ATOMIC )
>           return -EINVAL;
>   
>
Paul Durrant Jan. 29, 2021, 10:24 a.m. UTC | #3
> -----Original Message-----
> From: Oleksandr Tyshchenko <olekstysh@gmail.com>
> Sent: 29 January 2021 01:49
> To: xen-devel@lists.xenproject.org
> Cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>; Paul Durrant <paul@xen.org>; Julien Grall
> <julien@xen.org>; Stefano Stabellini <sstabellini@kernel.org>; Andrew Cooper
> <andrew.cooper3@citrix.com>
> Subject: [PATCH V6 23/24] xen/ioreq: Do not let bufioreq to be used on other than x86 arches
> 
> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
> 
> This patch prevents the device model running on other than x86
> systems to use buffered I/O feature for now.
> 
> Please note, there is no caller which requires to send buffered
> I/O request on Arm currently and the purpose of this check is
> to catch any future user of bufioreq.
> 
> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
> 

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

> ---
> Please note, this is a split/cleanup/hardening of Julien's PoC:
> "Add support for Guest IO forwarding to a device emulator"
> 
> Changes V5 -> V6:
>    - new patch
> ---
> ---
>  xen/common/ioreq.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/xen/common/ioreq.c b/xen/common/ioreq.c
> index 67ef1f7..a36137d 100644
> --- a/xen/common/ioreq.c
> +++ b/xen/common/ioreq.c
> @@ -629,6 +629,9 @@ static int ioreq_server_create(struct domain *d, int bufioreq_handling,
>      unsigned int i;
>      int rc;
> 
> +    if ( !IS_ENABLED(CONFIG_X86) && bufioreq_handling )
> +        return -EINVAL;
> +
>      if ( bufioreq_handling > HVM_IOREQSRV_BUFIOREQ_ATOMIC )
>          return -EINVAL;
> 
> --
> 2.7.4
diff mbox series

Patch

diff --git a/xen/common/ioreq.c b/xen/common/ioreq.c
index 67ef1f7..a36137d 100644
--- a/xen/common/ioreq.c
+++ b/xen/common/ioreq.c
@@ -629,6 +629,9 @@  static int ioreq_server_create(struct domain *d, int bufioreq_handling,
     unsigned int i;
     int rc;
 
+    if ( !IS_ENABLED(CONFIG_X86) && bufioreq_handling )
+        return -EINVAL;
+
     if ( bufioreq_handling > HVM_IOREQSRV_BUFIOREQ_ATOMIC )
         return -EINVAL;