> -----Original Message-----
> From: Xen-devel <xen-devel-boun...@lists.xenproject.org> On Behalf Of 
> Oleksandr Tyshchenko
> Sent: 03 August 2020 19:21
> To: xen-devel@lists.xenproject.org
> Cc: Stefano Stabellini <sstabell...@kernel.org>; Julien Grall 
> <jul...@xen.org>; Wei Liu <w...@xen.org>;
> Andrew Cooper <andrew.coop...@citrix.com>; Ian Jackson 
> <ian.jack...@eu.citrix.com>; George Dunlap
> <george.dun...@citrix.com>; Oleksandr Tyshchenko 
> <oleksandr_tyshche...@epam.com>; Julien Grall
> <julien.gr...@arm.com>; Jan Beulich <jbeul...@suse.com>; Daniel De Graaf 
> <dgde...@tycho.nsa.gov>;
> Volodymyr Babchuk <volodymyr_babc...@epam.com>
> Subject: [RFC PATCH V1 04/12] xen/arm: Introduce arch specific bits for 
> IOREQ/DM features
> 
> From: Oleksandr Tyshchenko <oleksandr_tyshche...@epam.com>
> 
> This patch makes possible to forward Guest MMIO accesses
> to a device emulator on Arm and enables that support for
> Arm64.
> 
> Also update XSM code a bit to let DM op be used on Arm.
> New arch DM op will be introduced in the follow-up patch.
> 
> Please note, at the moment build on Arm32 is broken
> (see cmpxchg usage in hvm_send_buffered_ioreq()) if someone
> wants to enable CONFIG_IOREQ_SERVER due to the lack of
> cmpxchg_64 support on Arm32.
> 
> Please note, this is a split/cleanup of Julien's PoC:
> "Add support for Guest IO forwarding to a device emulator"
> 
> Signed-off-by: Julien Grall <julien.gr...@arm.com>
> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshche...@epam.com>
> ---
>  tools/libxc/xc_dom_arm.c        |  25 +++++++---
>  xen/arch/arm/Kconfig            |   1 +
>  xen/arch/arm/Makefile           |   2 +
>  xen/arch/arm/dm.c               |  34 +++++++++++++
>  xen/arch/arm/domain.c           |   9 ++++
>  xen/arch/arm/hvm.c              |  46 +++++++++++++++++-
>  xen/arch/arm/io.c               |  67 +++++++++++++++++++++++++-
>  xen/arch/arm/ioreq.c            |  86 +++++++++++++++++++++++++++++++++
>  xen/arch/arm/traps.c            |  17 +++++++
>  xen/common/memory.c             |   5 +-
>  xen/include/asm-arm/domain.h    |  80 +++++++++++++++++++++++++++++++
>  xen/include/asm-arm/hvm/ioreq.h | 103 
> ++++++++++++++++++++++++++++++++++++++++
>  xen/include/asm-arm/mmio.h      |   1 +
>  xen/include/asm-arm/p2m.h       |   7 +--
>  xen/include/xsm/dummy.h         |   4 +-
>  xen/include/xsm/xsm.h           |   6 +--
>  xen/xsm/dummy.c                 |   2 +-
>  xen/xsm/flask/hooks.c           |   5 +-
>  18 files changed, 476 insertions(+), 24 deletions(-)
>  create mode 100644 xen/arch/arm/dm.c
>  create mode 100644 xen/arch/arm/ioreq.c
>  create mode 100644 xen/include/asm-arm/hvm/ioreq.h
> 
> diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
> index 931404c..b5fc066 100644
> --- a/tools/libxc/xc_dom_arm.c
> +++ b/tools/libxc/xc_dom_arm.c
> @@ -26,11 +26,19 @@
>  #include "xg_private.h"
>  #include "xc_dom.h"
> 
> -#define NR_MAGIC_PAGES 4
> +
>  #define CONSOLE_PFN_OFFSET 0
>  #define XENSTORE_PFN_OFFSET 1
>  #define MEMACCESS_PFN_OFFSET 2
>  #define VUART_PFN_OFFSET 3
> +#define IOREQ_SERVER_PFN_OFFSET 4
> +
> +#define NR_IOREQ_SERVER_PAGES 8
> +#define NR_MAGIC_PAGES (4 + NR_IOREQ_SERVER_PAGES)
> +
> +#define GUEST_MAGIC_BASE_PFN (GUEST_MAGIC_BASE >> XC_PAGE_SHIFT)
> +
> +#define special_pfn(x)  (GUEST_MAGIC_BASE_PFN + (x))

Why introduce 'magic pages' for Arm? It's quite a horrible hack that we have 
begun to do away with by adding resource mapping.

  Paul


Reply via email to