[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [RFC PATCH V1 04/12] xen/arm: Introduce arch specific bits for IOREQ/DM features



> -----Original Message-----
> From: Xen-devel <xen-devel-bounces@xxxxxxxxxxxxxxxxxxxx> On Behalf Of 
> Oleksandr Tyshchenko
> Sent: 03 August 2020 19:21
> To: xen-devel@xxxxxxxxxxxxxxxxxxxx
> Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>; Julien Grall 
> <julien@xxxxxxx>; Wei Liu <wl@xxxxxxx>;
> Andrew Cooper <andrew.cooper3@xxxxxxxxxx>; Ian Jackson 
> <ian.jackson@xxxxxxxxxxxxx>; George Dunlap
> <george.dunlap@xxxxxxxxxx>; Oleksandr Tyshchenko 
> <oleksandr_tyshchenko@xxxxxxxx>; Julien Grall
> <julien.grall@xxxxxxx>; Jan Beulich <jbeulich@xxxxxxxx>; Daniel De Graaf 
> <dgdegra@xxxxxxxxxxxxx>;
> Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
> Subject: [RFC PATCH V1 04/12] xen/arm: Introduce arch specific bits for 
> IOREQ/DM features
> 
> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
> 
> 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.grall@xxxxxxx>
> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
> ---
>  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




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.