[PATCH] efi: discover ESRT table on Xen PV too

2020-08-15 Thread Marek Marczykowski-Górecki
In case of Xen PV dom0, Xen passes along info about system tables (see arch/x86/xen/efi.c), but not the memory map from EFI. This makes sense as it is Xen responsible for managing physical memory address space. In this case, it doesn't make sense to condition using ESRT table on availability of

Re: [PATCH] mini-os: fix do_map_frames() for pvh

2020-08-15 Thread Samuel Thibault
Juergen Gross, le sam. 15 août 2020 13:12:57 +0200, a ecrit: > In case ov PVH dom_map_frames() is missing to increment the virtual > address. This leads to writing only the first page table entry multiple > times. > > Signed-off-by: Juergen Gross Reviewed-by: Samuel Thibault > --- >

Re: [PATCH] mini-os: correct memory access rights for pvh mode

2020-08-15 Thread Samuel Thibault
Juergen Gross, le sam. 15 août 2020 13:15:57 +0200, a ecrit: > When running as a PVH guest the memory access rights are not set > correctly: _PAGE_USER should not be set and CR0.WP should be set. > Especially CR0.WP is important in order to let the allocate on > demand feature work, as it requires

u-boot vs. uefi as boot loaders on ARM

2020-08-15 Thread Roman Shaposhnik
Hi! with the recent excellent work by Anastasiia committed to the u-boot's main line, we now have two different ways of bringing ARM DomUs. Is there any chance someone can educate the general public on pros and cons of both approaches? In Project EVE we're still using uefi on ARM (to stay

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

2020-08-15 Thread Julien Grall
Hi, On 04/08/2020 15:01, Julien Grall wrote: On 04/08/2020 08:49, Paul Durrant wrote: 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"  

Re: [RFC PATCH V1 01/12] hvm/ioreq: Make x86's IOREQ feature common

2020-08-15 Thread Julien Grall
Hi Oleksandr, On 03/08/2020 19:21, Oleksandr Tyshchenko wrote: +static int hvm_send_buffered_ioreq(struct hvm_ioreq_server *s, ioreq_t *p) +{ [...] +/* Canonicalize read/write pointers to prevent their overflow. */ +while ( (s->bufioreq_handling == HVM_IOREQSRV_BUFIOREQ_ATOMIC) && +

Re: [RFC PATCH V1 00/12] IOREQ feature (+ virtio-mmio) on Arm

2020-08-15 Thread Julien Grall
Hi Oleksandr, On 03/08/2020 19:21, Oleksandr Tyshchenko wrote: From: Oleksandr Tyshchenko Hello all. The purpose of this patch series is to add IOREQ/DM support to Xen on Arm. You can find an initial discussion at [1]. Xen on Arm requires some implementation to forward guest MMIO access to

[PATCH] xen: Introduce cmpxchg64() and guest_cmpxchg64()

2020-08-15 Thread Julien Grall
From: Julien Grall The IOREQ code is using cmpxchg() with 64-bit value. At the moment, this is x86 code, but there is plan to make it common. To cater 32-bit arch, introduce two new helpers to deal with 64-bit cmpxchg. The Arm 32-bit implementation of cmpxchg64() is based on the __cmpxchg64 in

[PATCH I v2 1/6] stubdom: add stubdom/mini-os.mk for Xen paths used by Mini-OS

2020-08-15 Thread Juergen Gross
stubdom/mini-os.mk should contain paths used by Mini-OS when built as stubdom. Signed-off-by: Juergen Gross Reviewed-by: Samuel Thibault --- stubdom/mini-os.mk | 17 + 1 file changed, 17 insertions(+) create mode 100644 stubdom/mini-os.mk diff --git a/stubdom/mini-os.mk

[PATCH I v2 3/6] tools: add a copy of library headers in tools/include

2020-08-15 Thread Juergen Gross
The headers.chk target in tools/Rules.mk tries to compile all headers stand alone for testing them not to include any internal header. Unfortunately the headers tested against are not complete, as any header for a Xen library is not included in the include path of the test compile run, resulting

[PATCH I v2 4/6] tools: don't call make recursively from libs.mk

2020-08-15 Thread Juergen Gross
During build of a xen library make is called again via libs.mk. This is not necessary as the same can be achieved by a simple dependency. Signed-off-by: Juergen Gross Reviewed-by: Ian Jackson --- tools/libs/libs.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

[PATCH I v2 6/6] tools: generate most contents of library make variables

2020-08-15 Thread Juergen Gross
Library related make variables (CFLAGS_lib*, SHDEPS_lib*, LDLIBS_lib* and SHLIB_lib*) mostly have a common pattern for their values. Generate most of this content automatically by adding a new per-library variable defining on which other libraries a lib is depending. This in turn makes it

[PATCH I v2 0/6] tools: streamline tools/libs/ building

2020-08-15 Thread Juergen Gross
Generate many make variables automatically instead of having to reiterate common patterns multiple times. This is part I of a larger series. The previous version included the move of multiple other libraries below tools/libs. In V2 I have decided to split the series up, as this makes it easier to

[PATCH I v2 2/6] tools: switch XEN_LIBXEN* make variables to lower case (XEN_libxen*)

2020-08-15 Thread Juergen Gross
In order to harmonize names of library related make variables switch XEN_LIBXEN* names to XEN_libxen*, as all other related variables (e.g. CFLAGS_libxen*, SHDEPS_libxen*, ...) already use this pattern. Rename XEN_LIBXC to XEN_libxenctrl, XEN_XENSTORE to XEN_libxenstore, XEN_XENLIGHT to

[PATCH I v2 5/6] tools: define ROUNDUP() in tools/include/xen-tools/libs.h

2020-08-15 Thread Juergen Gross
Today there are multiple copies of the ROUNDUP() macro in various sources and headers. Define it once in tools/include/xen-tools/libs.h. Using xen-tools/libs.h enables removing copies of MIN() and MAX(), too. Signed-off-by: Juergen Gross --- tools/console/daemon/io.c| 6 +-

Re: [PATCH] qemu-trad: remove Xen path dependencies

2020-08-15 Thread Jürgen Groß
On 15.07.20 11:01, Juergen Gross wrote: xen-hhoks.mak contains hard wired paths for the used libraries of qemu-trad. Replace those by the make variables from Xen's Rules.mk, which is already included. This in turn removes the need to add the runtime link paths of the libraries the directly used

[PATCH] mini-os: correct memory access rights for pvh mode

2020-08-15 Thread Juergen Gross
When running as a PVH guest the memory access rights are not set correctly: _PAGE_USER should not be set and CR0.WP should be set. Especially CR0.WP is important in order to let the allocate on demand feature work, as it requires a page fault when writing to a read-only page. Signed-off-by:

[PATCH] mini-os: fix do_map_frames() for pvh

2020-08-15 Thread Juergen Gross
In case ov PVH dom_map_frames() is missing to increment the virtual address. This leads to writing only the first page table entry multiple times. Signed-off-by: Juergen Gross --- arch/x86/mm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/mm.c b/arch/x86/mm.c index

[PATCH v4 4/6] x86/entry/32: revert "Fix XEN_PV build dependency"

2020-08-15 Thread Juergen Gross
With 32-bit Xen PV support gone commit a4c0e91d1d65bc58 ("x86/entry/32: Fix XEN_PV build dependency") can be reverted again. Signed-off-by: Juergen Gross --- arch/x86/include/asm/idtentry.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/idtentry.h

[PATCH v4 5/6] x86/paravirt: remove set_pte_at pv-op

2020-08-15 Thread Juergen Gross
On x86 set_pte_at() is now always falling back to set_pte(). So instead of having this fallback after the paravirt maze just drop the set_pte_at paravirt operation and let set_pte_at() use the set_pte() function directly. Signed-off-by: Juergen Gross --- arch/x86/include/asm/paravirt.h |

[PATCH v4 1/6] x86/paravirt: remove 32-bit support from PARAVIRT_XXL

2020-08-15 Thread Juergen Gross
The last 32-bit user of stuff under CONFIG_PARAVIRT_XXL is gone. Remove 32-bit specific parts. Signed-off-by: Juergen Gross --- arch/x86/entry/vdso/vdso32/vclock_gettime.c | 1 + arch/x86/include/asm/paravirt.h | 120 ++-- arch/x86/include/asm/paravirt_types.h

[PATCH v4 0/6] x86/paravirt: cleanup after 32-bit PV removal

2020-08-15 Thread Juergen Gross
A lot of cleanup after removal of 32-bit Xen PV guest support in paravirt code. Changes in V4: - dropped patches 1-3, as already committed - addressed comments to V3 - added new patches 5+6 Changes in V3: - addressed comments to V2 - split patch 1 into 2 patches - new patches 3 and 7 Changes in

[PATCH v4 2/6] x86/paravirt: cleanup paravirt macros

2020-08-15 Thread Juergen Gross
Some paravirt macros are no longer used, delete them. Signed-off-by: Juergen Gross --- arch/x86/include/asm/paravirt.h | 15 --- 1 file changed, 15 deletions(-) diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h index 25c7a73461f6..e02c409fa054 100644

[PATCH v4 3/6] x86/paravirt: use CONFIG_PARAVIRT_XXL instead of CONFIG_PARAVIRT

2020-08-15 Thread Juergen Gross
There are some code parts using CONFIG_PARAVIRT for Xen pvops related issues instead of the more stringent CONFIG_PARAVIRT_XXL. Signed-off-by: Juergen Gross --- arch/x86/entry/entry_64.S| 4 ++-- arch/x86/include/asm/fixmap.h| 2 +-

[PATCH v4 6/6] x86/paravirt: avoid needless paravirt step clearing page table entries

2020-08-15 Thread Juergen Gross
pte_clear() et al are based on tw0 paravirt steps today: one step to create a page table entry with all zeroes, and one step to write this entry value. Drop the first step as it is completely useless. Signed-off-by: Juergen Gross --- arch/x86/include/asm/paravirt.h | 12 ++-- 1 file