From: Oleksandr Tyshchenko Date: Fri, 29 Jan 2021 01:48:51 +0000 (+0200) Subject: xen/ioreq: Do not let bufioreq to be used on other than x86 arches X-Git-Tag: archive/raspbian/4.16.0+51-g0941d6cb-1+rpi1~2^2~42^2~979 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=2fbd7e609e1803ac5e5c26e22aa8e4b5a6cddbb1;p=xen.git xen/ioreq: Do not let bufioreq to be used on other than x86 arches 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 Acked-by: Jan Beulich Acked-by: Julien Grall Acked-by: Paul Durrant --- diff --git a/xen/common/ioreq.c b/xen/common/ioreq.c index 67ef1f706e..a36137d41d 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;