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

2020-08-17 Thread Ard Biesheuvel
Hi Marek, On Sun, 16 Aug 2020 at 02:20, Marek Marczykowski-Górecki wrote: > > 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

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

2020-08-17 Thread Julien Grall
Hi, On 17/08/2020 10:24, Roger Pau Monné wrote: On Sat, Aug 15, 2020 at 06:21:43PM +0100, Julien Grall wrote: 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

[PATCH II v2 09/17] tools/misc: replace PAGE_SIZE with XC_PAGE_SIZE in xen-mfndump.c

2020-08-17 Thread Juergen Gross
The definition of PAGE_SIZE comes from xc_private.h, which shouldn't be used by xen-mfndump.c. Replace PAGE_SIZE by XC_PAGE_SIZE, as xc_private.h contains: #define PAGE_SIZE XC_PAGE_SIZE For the same reason PAGE_SHIFT_X86 needs to replaced with XC_PAGE_SHIFT. Signed-off-by: Juergen Gross --- t

[PATCH II v2 04/17] tools/python: drop libxenguest from setup.py

2020-08-17 Thread Juergen Gross
There is not a single wrapper for a libxenguest function defined. So drop libxenguest from tools/python/setup.py. Signed-off-by: Juergen Gross --- tools/python/setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/python/setup.py b/tools/python/setup.py index 8fa

[PATCH II v2 12/17] tools/libxc: move xc_[un]map_domain_meminfo() into new source xg_domain.c

2020-08-17 Thread Juergen Gross
Move xc_[un]map_domain_meminfo() functions to new source xg_domain.c as they are defined in include/xenguest.h and should be in libxenguest. Signed-off-by: Juergen Gross --- tools/libxc/Makefile| 4 +- tools/libxc/xc_domain.c | 126 - tools/libxc/xg_domain.c

[PATCH II v2 03/17] tools: tweak tools/libs/libs.mk for being able to support libxenctrl

2020-08-17 Thread Juergen Gross
tools/libs/libs.mk needs to be modified for being able to support building libxenctrl, as the pkg-config file of that library is not following the same conventions as those of the other libraries. So add support for specifying PKG_CONFIG before including libs.mk. In order to make life easier for

[PATCH II v2 06/17] tools: don't assume libxenguest and libxenctrl to be in same directory

2020-08-17 Thread Juergen Gross
There are quite some places in Makefiles assuming libxenguest and libxenctrl being built in the same directory via a single Makefile. Drop this assumption by specifying the dependencies and path variables for both libraries correctly. Signed-off-by: Juergen Gross --- tools/Rules.mk | 7 ++

[PATCH II v2 10/17] tools/misc: drop all libxc internals from xen-mfndump.c

2020-08-17 Thread Juergen Gross
The last libxc internal used by xen-mfndump.c is the ERROR() macro. Add a simple definition for that macro to xen-mfndump.c and replace the libxc private header includes by official ones. Signed-off-by: Juergen Gross --- tools/misc/Makefile | 2 -- tools/misc/xen-mfndump.c | 13 +--

[PATCH II v2 01/17] stubdom: add correct dependencies for Xen libraries

2020-08-17 Thread Juergen Gross
The stubdom Makefile is missing several dependencies between Xen libraries. Add them. Signed-off-by: Juergen Gross --- stubdom/Makefile | 5 + 1 file changed, 5 insertions(+) diff --git a/stubdom/Makefile b/stubdom/Makefile index af8cde41b9..6fcecadeb9 100644 --- a/stubdom/Makefile +++ b/st

[PATCH II v2 02/17] tools: drop explicit path specifications for qemu build

2020-08-17 Thread Juergen Gross
Since more than three years now qemu is capable to set the needed include and library paths for the Xen libraries via pkg-config. So drop the specification of those paths in tools/Makefile. This will enable to move libxenctrl away from tools/libxc, as qemu's configure script has special treatment

[PATCH II v2 14/17] tools/libxc: rename libxenguest internal headers

2020-08-17 Thread Juergen Gross
Rename the header files private to libxenguest from xc_*.h to xg_*.h. Signed-off-by: Juergen Gross --- tools/libxc/xg_dom_bzimageloader.c | 2 +- tools/libxc/{xc_dom_decompress.h => xg_dom_decompress.h}| 2 +- tools/libxc/xg_dom_decompress_lz4.c

[PATCH II v2 05/17] tools: fix pkg-config file for libxenguest

2020-08-17 Thread Juergen Gross
The pkg-config file for libxenguest is missing the private dependency on libxenctrl. Signed-off-by: Juergen Gross --- tools/libxc/xenguest.pc.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libxc/xenguest.pc.in b/tools/libxc/xenguest.pc.in index 225ac0b9c8..6b43b67e6

[PATCH II v2 11/17] tools/libxc: remove unused headers xc_efi.h and xc_elf.h

2020-08-17 Thread Juergen Gross
Remove xc_efi.h and xc_elf.h as they aren't used anywhere. Signed-off-by: Juergen Gross --- tools/libxc/xc_efi.h | 158 --- tools/libxc/xc_elf.h | 16 - 2 files changed, 174 deletions(-) delete mode 100644 tools/libxc/xc_efi.h delete mode 100644 too

[PATCH II v2 16/17] tools/libxc: untangle libxenctrl from libxenguest

2020-08-17 Thread Juergen Gross
Sources of libxenctrl and libxenguest are completely entangled. In practice libxenguest is a user of libxenctrl, so don't let any source libxenctrl include xg_private.h. This can be achieved by moving all definitions used by libxenctrl from xg_private.h to xc_private.h. Export xenctrl_dom.h as it

[PATCH II v2 13/17] tools/libxc: rename all libxenguest sources to xg_*

2020-08-17 Thread Juergen Gross
Some sources of libxenguest are named xg_*.c and some xc_*.c. Rename the xc_*.c files to xg_*.c. Signed-off-by: Juergen Gross --- tools/libxc/Makefile | 59 ++- .../libxc/{xc_cpuid_x86.c => xg_cpuid_x86.c} | 0 tools/libxc/{xc_dom_arm.c => xg_dom_arm.c}

[PATCH II v2 07/17] tools/misc: don't use libxenctrl internals from xen-hptool

2020-08-17 Thread Juergen Gross
xen-hptool is including private headers from tools/libxc without any need. Switch it to use official headers only. Signed-off-by: Juergen Gross --- tools/misc/Makefile | 2 -- tools/misc/xen-hptool.c | 8 +--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/misc/Make

[PATCH II v2 08/17] tools/misc: don't include xg_save_restore.h from xen-mfndump.c

2020-08-17 Thread Juergen Gross
xen-mfndump.c is including the libxc private header xg_save_restore.h. Avoid that by moving the definition of is_mapped() to xen-mfndump.c (it is used there only) and by duplicating the definition of M2P_SIZE() in xen-mfndump.c. Signed-off-by: Juergen Gross --- tools/libxc/xg_save_restore.h | 4

[PATCH II v2 00/17] move libxenctrl to tools/libs directory

2020-08-17 Thread Juergen Gross
This is part 2 of the series moving more libraries under tools/libs. It is based on part 1 and does the needed cleanup work and moving for libxenctrl into tools/libs/ctrl. Please note that patch 17 ("tools: move libxenctrl below tools/libs") needs the related qemu-trad patch applied in order not t

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

2020-08-17 Thread Wei Liu
On Sat, Aug 15, 2020 at 11:43:21PM +0200, Samuel Thibault wrote: > 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. > > > > Sig

[PATCH II v2 15/17] tools/misc: rename xc_dom.h do xenctrl_dom.h

2020-08-17 Thread Juergen Gross
For being able to disentangle lixenctrl and libxenguest headers xc_dom.h will need to be public. Prepare that by renaming xc_dom.h to xenctrl_dom.h. Signed-off-by: Juergen Gross --- stubdom/grub/kexec.c| 2 +- tools/helpers/init-xenstore-domain.c| 2 +- to

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

2020-08-17 Thread Wei Liu
On Sat, Aug 15, 2020 at 11:40:02PM +0200, Samuel Thibault wrote: > 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 importa

[PATCH II v2 17/17] tools: move libxenctrl below tools/libs

2020-08-17 Thread Juergen Gross
Today tools/libxc needs to be built after tools/libs as libxenctrl is depending on some libraries in tools/libs. This in turn blocks moving other libraries depending on libxenctrl below tools/libs. So carve out libxenctrl from tools/libxc and move it into tools/libs/ctrl. Signed-off-by: Juergen G

Re: [PATCH v1 4/6] tools/ocaml/xenstored: drop select based

2020-08-17 Thread Wei Liu
The subject line seems to be cut off half way. "Drop select based $SOMETHING"? Wei.

Re: [PATCH II v2 01/17] stubdom: add correct dependencies for Xen libraries

2020-08-17 Thread Samuel Thibault
Hello, Juergen Gross, le lun. 17 août 2020 11:49:06 +0200, a ecrit: > The stubdom Makefile is missing several dependencies between Xen > libraries. Add them. > @@ -405,6 +405,7 @@ libs-$(XEN_TARGET_ARCH)/toollog/libxentoollog.a: > mk-headers-$(XEN_TARGET_ARCH) $ > > .PHONY: libxenevtchn > li

Re: [PATCH II v2 17/17] tools: move libxenctrl below tools/libs

2020-08-17 Thread Samuel Thibault
Juergen Gross, le lun. 17 août 2020 11:49:22 +0200, a ecrit: > diff --git a/stubdom/Makefile b/stubdom/Makefile > index 6fcecadeb9..440adc2eb4 100644 > --- a/stubdom/Makefile > +++ b/stubdom/Makefile > diff --git a/stubdom/mini-os.mk b/stubdom/mini-os.mk > index 32528bb91f..b1387df3f8 100644 > ---

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

2020-08-17 Thread Julien Grall
Hi, On 17/08/2020 11:33, Roger Pau Monné wrote: On Mon, Aug 17, 2020 at 10:42:54AM +0100, Julien Grall wrote: Hi, On 17/08/2020 10:24, Roger Pau Monné wrote: On Sat, Aug 15, 2020 at 06:21:43PM +0100, Julien Grall wrote: From: Julien Grall The IOREQ code is using cmpxchg() with 64-bit value

Re: [PATCH II v2 01/17] stubdom: add correct dependencies for Xen libraries

2020-08-17 Thread Jürgen Groß
On 17.08.20 12:12, Samuel Thibault wrote: Hello, Juergen Gross, le lun. 17 août 2020 11:49:06 +0200, a ecrit: The stubdom Makefile is missing several dependencies between Xen libraries. Add them. @@ -405,6 +405,7 @@ libs-$(XEN_TARGET_ARCH)/toollog/libxentoollog.a: mk-headers-$(XEN_TARGET_AR

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

2020-08-17 Thread Jürgen Groß
On 16.08.20 14:34, Juergen Gross wrote: 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

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

2020-08-17 Thread Roger Pau Monné
On Sun, Aug 16, 2020 at 02:19:49AM +0200, Marek Marczykowski-Górecki wrote: > 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. I think that's because the memory map returned by XENMEM_machine_memory_map is in e820 form,

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

2020-08-17 Thread Julien Grall
On 17/08/2020 12:50, Roger Pau Monné wrote: On Mon, Aug 17, 2020 at 12:05:54PM +0100, Julien Grall wrote: Hi, On 17/08/2020 11:33, Roger Pau Monné wrote: On Mon, Aug 17, 2020 at 10:42:54AM +0100, Julien Grall wrote: Hi, On 17/08/2020 10:24, Roger Pau Monné wrote: On Sat, Aug 15, 2020 at

Re: [PATCH] xen/x86: irq: Avoid a TOCTOU race in pirq_spin_lock_irq_desc()

2020-08-17 Thread Julien Grall
Hi, On 17/08/2020 13:46, Roger Pau Monné wrote: On Fri, Aug 14, 2020 at 08:25:28PM +0100, Julien Grall wrote: Hi Andrew, Sorry for the late answer. On 23/07/2020 14:59, Andrew Cooper wrote: On 23/07/2020 14:22, Julien Grall wrote: Hi Jan, On 23/07/2020 12:23, Jan Beulich wrote: On 22.07.2

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

2020-08-17 Thread Roger Pau Monné
On Sat, Aug 15, 2020 at 06:21:43PM +0100, Julien Grall wrote: > 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. >

Re: [PATCH v1 4/6] tools/ocaml/xenstored: drop select based

2020-08-17 Thread Edwin Torok
On Mon, 2020-08-17 at 09:59 +, Wei Liu wrote: > [CAUTION - EXTERNAL EMAIL] DO NOT reply, click links, or open > attachments unless you have verified the sender and know the content > is safe. > > The subject line seems to be cut off half way. > > "Drop select based $SOMETHING"? $SOMETHING =

Re: [PATCH v1 0/6] tools/ocaml/xenstored: simplify code

2020-08-17 Thread Christian Lindig
I am going to look at this in more detail. In general, all of this are welcome changes. The main problem with select/poll is emulation of select behaviour which creates a lot of lists and consequently memory garbage at high frequency. This change is not yet addressing that but by dropping select

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

2020-08-17 Thread Roger Pau Monné
On Mon, Aug 17, 2020 at 10:42:54AM +0100, Julien Grall wrote: > Hi, > > On 17/08/2020 10:24, Roger Pau Monné wrote: > > On Sat, Aug 15, 2020 at 06:21:43PM +0100, Julien Grall wrote: > > > From: Julien Grall > > > > > > The IOREQ code is using cmpxchg() with 64-bit value. At the moment, this > >

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

2020-08-17 Thread Oleksandr
On 15.08.20 20:56, Julien Grall wrote: Hi Julien. 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

Re: [PATCH] xen/x86: irq: Avoid a TOCTOU race in pirq_spin_lock_irq_desc()

2020-08-17 Thread Julien Grall
On 17/08/2020 15:01, Roger Pau Monné wrote: On Mon, Aug 17, 2020 at 02:14:01PM +0100, Julien Grall wrote: Hi, On 17/08/2020 13:46, Roger Pau Monné wrote: On Fri, Aug 14, 2020 at 08:25:28PM +0100, Julien Grall wrote: Hi Andrew, Sorry for the late answer. On 23/07/2020 14:59, Andrew Cooper

Re: [RFC PATCH V1 07/12] A collection of tweaks to be able to run emulator in driver domain

2020-08-17 Thread Oleksandr
On 16.08.20 18:36, Julien Grall wrote: Hi Julien. On 14/08/2020 17:30, Oleksandr wrote: Hello all. -Original Message- From: Jan Beulich Sent: 05 August 2020 17:20 To: Oleksandr Tyshchenko ; Paul Durrant Cc: xen-devel@lists.xenproject.org; Oleksandr Tyshchenko ; Andrew Coope

Re: [PATCH v2 1/7] x86/EFI: sanitize build logic

2020-08-17 Thread Jan Beulich
On 10.08.2020 16:38, Andrew Cooper wrote: > On 07/08/2020 17:33, Andrew Cooper wrote: >> On 07/08/2020 12:32, Jan Beulich wrote: >>> With changes done over time and as far as linking goes, the only special >>> thing about building with EFI support enabled is the need for the dummy >>> relocations o

Re: [RFC PATCH V1 05/12] hvm/dm: Introduce xendevicemodel_set_irq_level DM op

2020-08-17 Thread Jan Beulich
On 07.08.2020 23:50, Stefano Stabellini wrote: > On Fri, 7 Aug 2020, Jan Beulich wrote: >> On 07.08.2020 01:49, Stefano Stabellini wrote: >>> On Thu, 6 Aug 2020, Julien Grall wrote: On 06/08/2020 01:37, Stefano Stabellini wrote: > On Wed, 5 Aug 2020, Julien Grall wrote: >> On 05/08/202

Re: [RFC PATCH 1/2] libxl: add Function class to IDL

2020-08-17 Thread Nick Rosbrook
On Fri, Aug 14, 2020 at 11:52:33AM +0100, Anthony PERARD wrote: > On Mon, Jul 27, 2020 at 09:26:32AM -0400, Nick Rosbrook wrote: > > Add a Function and CtxFunction classes to idl.py to allow generator > > scripts to generate wrappers which are repetitive and straight forward > > when doing so by ha

Re: [PATCH 05/14] kernel-doc: public/features.h

2020-08-17 Thread Jan Beulich
On 07.08.2020 23:52, Stefano Stabellini wrote: > On Fri, 7 Aug 2020, Jan Beulich wrote: >> On 07.08.2020 01:49, Stefano Stabellini wrote: >>> @@ -41,19 +41,25 @@ >>> * XENFEAT_dom0 MUST be set if the guest is to be booted as dom0, >>> */ >>> >>> -/* >>> - * If set, the guest does not need to

Re: [PATCH 08/14] kernel-doc: public/memory.h

2020-08-17 Thread Jan Beulich
On 07.08.2020 23:51, Stefano Stabellini wrote: > On Fri, 7 Aug 2020, Jan Beulich wrote: >> On 07.08.2020 01:49, Stefano Stabellini wrote: >>> From: Stefano Stabellini >>> >>> Convert in-code comments to kernel-doc format wherever possible. >>> >>> Signed-off-by: Stefano Stabellini >>> --- >>> xe

Re: [PATCH 4/4] EFI: free unused boot mem in at least some cases

2020-08-17 Thread Jan Beulich
On 10.08.2020 19:09, Andrew Cooper wrote: > On 06/08/2020 10:06, Jan Beulich wrote: >> Address at least the primary reason why 52bba67f8b87 ("efi/boot: Don't >> free ebmalloc area at all") was put in place: Make xen_in_range() aware >> of the freed range. This is in particular relevant for EFI-enab

Re: [RFC PATCH 2/2] libxl: prototype libxl_device_nic_add/remove with IDL

2020-08-17 Thread Nick Rosbrook
On Fri, Aug 14, 2020 at 11:57:47AM +0100, Anthony PERARD wrote: > On Mon, Jul 27, 2020 at 09:26:33AM -0400, Nick Rosbrook wrote: > > Add a DeviceFunction class and describe prototypes for > > libxl_device_nic_add/remove in libxl_types.idl. > > > > Signed-off-by: Nick Rosbrook > > -- > > This is m

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

2020-08-17 Thread Roger Pau Monné
On Mon, Aug 17, 2020 at 12:05:54PM +0100, Julien Grall wrote: > Hi, > > On 17/08/2020 11:33, Roger Pau Monné wrote: > > On Mon, Aug 17, 2020 at 10:42:54AM +0100, Julien Grall wrote: > > > Hi, > > > > > > On 17/08/2020 10:24, Roger Pau Monné wrote: > > > > On Sat, Aug 15, 2020 at 06:21:43PM +0100,

Re: [PATCH] xen/x86: irq: Avoid a TOCTOU race in pirq_spin_lock_irq_desc()

2020-08-17 Thread Julien Grall
On 17/08/2020 16:03, Roger Pau Monné wrote: On Mon, Aug 17, 2020 at 03:39:52PM +0100, Julien Grall wrote: On 17/08/2020 15:01, Roger Pau Monné wrote: On Mon, Aug 17, 2020 at 02:14:01PM +0100, Julien Grall wrote: Hi, On 17/08/2020 13:46, Roger Pau Monné wrote: On Fri, Aug 14, 2020 at 08:

Re: [PATCH 3/4] build: also check for empty .bss.* in .o -> .init.o conversion

2020-08-17 Thread Jan Beulich
On 10.08.2020 19:51, Andrew Cooper wrote: > On 07/08/2020 16:40, Jan Beulich wrote: >> On 07.08.2020 17:12, Andrew Cooper wrote: >>> On 07/08/2020 11:56, Jan Beulich wrote: On 06.08.2020 18:16, Andrew Cooper wrote: > On 06/08/2020 10:05, Jan Beulich wrote: > Can't we remove all of this

Re: [PATCH 3/3] x86: don't override INVALID_M2P_ENTRY with SHARED_M2P_ENTRY

2020-08-17 Thread Jan Beulich
On 10.08.2020 18:42, Andrew Cooper wrote: > On 06/08/2020 10:29, Jan Beulich wrote: >> While in most cases code ahead of the invocation of set_gpfn_from_mfn() >> deals with shared pages, at least in set_typed_p2m_entry() I can't spot >> such handling (it's entirely possible there's code missing the

Re: [RFC] efi/boot: Unified Xen executable for UEFI Secure Boot support

2020-08-17 Thread Jan Beulich
On 11.08.2020 16:47, Trammell Hudson wrote: > On Friday, August 7, 2020 2:23 PM, Jan Beulich wrote: >> On 06.08.2020 16:15, Trammell Hudson wrote: >>> --- /dev/null >>> +++ b/xen/scripts/unify-xen >>> @@ -0,0 +1,89 @@ >>> +#!/bin/bash >>> +# Build a "unified Xen" image. >>> +# Usage >>> +# unify x

Re: [PATCH] xen/x86: irq: Avoid a TOCTOU race in pirq_spin_lock_irq_desc()

2020-08-17 Thread Roger Pau Monné
On Fri, Aug 14, 2020 at 08:25:28PM +0100, Julien Grall wrote: > Hi Andrew, > > Sorry for the late answer. > > On 23/07/2020 14:59, Andrew Cooper wrote: > > On 23/07/2020 14:22, Julien Grall wrote: > > > Hi Jan, > > > > > > On 23/07/2020 12:23, Jan Beulich wrote: > > > > On 22.07.2020 18:53, Juli

Re: [PATCH v1 5/6] tools/ocaml/xenstored: use more efficient node trees

2020-08-17 Thread Christian Lindig
+let compare a b = + if equal a b then 0 + else -(String.compare a b) I think this bit could use an inline comment why the sort order is reversed. This could be also simplified to -(String.compare a b) because this goes to the internal (polymorphic) compare implemented in C which does a physic

Re: [PATCH v1 0/6] tools/ocaml/xenstored: simplify code

2020-08-17 Thread Christian Lindig
From: Edwin Torok Sent: 14 August 2020 23:11 To: xen-devel@lists.xenproject.org Cc: Edwin Torok; Christian Lindig; David Scott; Ian Jackson; Wei Liu Subject: [PATCH v1 0/6] tools/ocaml/xenstored: simplify code Fix warnings, and delete some obsolete code. o

CI loop working group

2020-08-17 Thread George Dunlap
As a brief summary, here is what we discussed at the XenSummit design session on CI; # What is needed to run CI on patches posted to the list: 1. Get a patch series. Determine if it's for Xen or not. 2. determine the base branch (staging, staging-4.13, staging-4.12, etc) ("for-4.14" after a bra

Re: [PATCH] xen/x86: irq: Avoid a TOCTOU race in pirq_spin_lock_irq_desc()

2020-08-17 Thread Julien Grall
On 17/08/2020 18:33, Roger Pau Monné wrote: On Mon, Aug 17, 2020 at 04:53:51PM +0100, Julien Grall wrote: On 17/08/2020 16:03, Roger Pau Monné wrote: On Mon, Aug 17, 2020 at 03:39:52PM +0100, Julien Grall wrote: On 17/08/2020 15:01, Roger Pau Monné wrote: On Mon, Aug 17, 2020 at 02:14:

Re: [PATCH] xen/x86: irq: Avoid a TOCTOU race in pirq_spin_lock_irq_desc()

2020-08-17 Thread Roger Pau Monné
On Mon, Aug 17, 2020 at 02:14:01PM +0100, Julien Grall wrote: > Hi, > > On 17/08/2020 13:46, Roger Pau Monné wrote: > > On Fri, Aug 14, 2020 at 08:25:28PM +0100, Julien Grall wrote: > > > Hi Andrew, > > > > > > Sorry for the late answer. > > > > > > On 23/07/2020 14:59, Andrew Cooper wrote: > >

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

2020-08-17 Thread Roger Pau Monné
On Mon, Aug 17, 2020 at 02:03:23PM +0100, Julien Grall wrote: > > > On 17/08/2020 12:50, Roger Pau Monné wrote: > > On Mon, Aug 17, 2020 at 12:05:54PM +0100, Julien Grall wrote: > > > Hi, > > > > > > On 17/08/2020 11:33, Roger Pau Monné wrote: > > > > On Mon, Aug 17, 2020 at 10:42:54AM +0100, Ju

Re: [PATCH] xen/x86: irq: Avoid a TOCTOU race in pirq_spin_lock_irq_desc()

2020-08-17 Thread Roger Pau Monné
On Mon, Aug 17, 2020 at 03:39:52PM +0100, Julien Grall wrote: > > > On 17/08/2020 15:01, Roger Pau Monné wrote: > > On Mon, Aug 17, 2020 at 02:14:01PM +0100, Julien Grall wrote: > > > Hi, > > > > > > On 17/08/2020 13:46, Roger Pau Monné wrote: > > > > On Fri, Aug 14, 2020 at 08:25:28PM +0100, Ju

[PATCH 1/8] x86/vmx: handle writes to MISC_ENABLE MSR

2020-08-17 Thread Roger Pau Monne
Such handling consist in checking that no bits have been changed from the read value, if that's the case silently drop the write, otherwise inject a fault. At least Windows guests will expect to write to the MISC_ENABLE MSR with the same value that's been read from it. Signed-off-by: Roger Pau Mo

[PATCH 8/8] x86/hvm: Disallow access to unknown MSRs

2020-08-17 Thread Roger Pau Monne
From: Andrew Cooper Change the catch-all behavior for MSR not explicitly handled. Instead of allow full read-access to the MSR space and silently dropping writes return an exception when the MSR is not explicitly handled. Signed-off-by: Andrew Cooper --- xen/arch/x86/hvm/svm/svm.c | 8 ---

[PATCH 7/8] x86/pv: disallow access to unknown MSRs

2020-08-17 Thread Roger Pau Monne
Change the catch-all behavior for MSR not explicitly handled. Instead of allow full read-access to the MSR space and silently dropping writes return an exception when the MSR is not explicitly handled. Signed-off-by: Roger Pau Monné --- xen/arch/x86/pv/emul-priv-op.c | 18 ++ 1 f

[PATCH 4/8] x86/pv: handle reads to the PAT MSR

2020-08-17 Thread Roger Pau Monne
The value in the PAT MSR is part of the ABI between Xen and PV guests, and there's no reason to not allow a PV guest to read it. Signed-off-by: Roger Pau Monné --- xen/arch/x86/pv/emul-priv-op.c | 4 1 file changed, 4 insertions(+) diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86

[PATCH 6/8] x86/pv: allow reading FEATURE_CONTROL MSR

2020-08-17 Thread Roger Pau Monne
Linux PV guests will attempt to read the FEATURE_CONTROL MSR, report no features enabled or available, and that the MSR is already locked. Signed-off-by: Roger Pau Monné --- xen/arch/x86/pv/emul-priv-op.c | 4 1 file changed, 4 insertions(+) diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xe

[PATCH 2/8] x86/svm: silently drop writes to SYSCFG and related MSRs

2020-08-17 Thread Roger Pau Monne
The SYSCFG, TOP_MEM1 and TOP_MEM2 MSRs are currently exposed to guests and writes are silently discarded. Make this explicit in the SVM code now, and just return 0 when attempting to read any of the MSRs, while continuing to silently drop writes. Signed-off-by: Roger Pau Monné --- xen/arch/x86/h

[PATCH 0/8] x86: switch default MSR behavior

2020-08-17 Thread Roger Pau Monne
Hello, The current series attempts to change the current MSR default handling behavior, which is to silently drop writes to writable MSRs, and allow reading any MSR not explicitly handled. After this series access to MSRs not explicitly handled will trigger a #GP fault. I've tested this series wi

[PATCH 5/8] x86/pv: allow reading APIC_BASE MSR

2020-08-17 Thread Roger Pau Monne
Linux PV guests will attempt to read the APIC_BASE MSR, so just report a default value to make Linux happy. Signed-off-by: Roger Pau Monné --- xen/arch/x86/pv/emul-priv-op.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c

[PATCH 3/8] x86/pv: handle writes to the EFER MSR

2020-08-17 Thread Roger Pau Monne
Silently drop writes to the EFER MSR for PV guests if the value is not changed from what it's being reported. Current PV Linux will attempt to write to the MSR with the same value that's been read, and raising a fault will result in a guest crash. As part of this work introduce a helper to easily

Re: Planned osstest outage, around 17th August

2020-08-17 Thread Ian Jackson
Ian Jackson writes ("Planned osstest outage, around 17th August"): > osstest's infrastructure hosts need upgrading to Debian "buster" (aka > Debian "stable"). We are planning to do this on Monday the 17th of > August. > > This will involve telling osstest to start draining its queues some > time

Re: [PATCH] xen/x86: irq: Avoid a TOCTOU race in pirq_spin_lock_irq_desc()

2020-08-17 Thread Roger Pau Monné
On Mon, Aug 17, 2020 at 04:53:51PM +0100, Julien Grall wrote: > > > On 17/08/2020 16:03, Roger Pau Monné wrote: > > On Mon, Aug 17, 2020 at 03:39:52PM +0100, Julien Grall wrote: > > > > > > > > > On 17/08/2020 15:01, Roger Pau Monné wrote: > > > > On Mon, Aug 17, 2020 at 02:14:01PM +0100, Julie

[OSSTEST PATCH 1/2] Tcl: Use tclsh8.6

2020-08-17 Thread Ian Jackson
This is needed to run on buster. I have checked that tclsh8.6 and TclX works on osstest.test-lab. TclX seems to be provided by tcl8.4 but work with tcl8.6 (at least on buster). Deployment note: hosts running earlier Debian (including osstest.xs.citrite.net, the Citrix Cambridge instance), may ne

[OSSTEST PATCH 2/2] tcl: JobDB: Do not require particular Pgtcl version

2020-08-17 Thread Ian Jackson
This just serves to complicate upgrades. Signed-off-by: Ian Jackson --- tcl/JobDB-Executive.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcl/JobDB-Executive.tcl b/tcl/JobDB-Executive.tcl index 56b61825..29c82821 100644 --- a/tcl/JobDB-Executive.tcl +++ b/tcl/JobDB-Exec

[PATCH v2 1/6] tools/ocaml/libs/xc: Fix ambiguous documentation comment

2020-08-17 Thread Edwin Török
Signed-off-by: Edwin Török --- tools/ocaml/libs/xc/xenctrl.mli | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/ocaml/libs/xc/xenctrl.mli b/tools/ocaml/libs/xc/xenctrl.mli index 26ec7e59b1..f7f6ec570d 100644 --- a/tools/ocaml/libs/xc/xenctrl.mli +++ b/tools/ocaml/libs/xc/xenctrl.mli @@

[PATCH v2 4/6] tools/ocaml/xenstored: drop select based socket watching

2020-08-17 Thread Edwin Török
Poll has been the default since 2014, I think we can safely say by now that poll() works and we don't need to fall back to select(). This will allow fixing up the way we call poll to be more efficient (and pave the way for introducing epoll support): currently poll wraps the select API, which is i

[PATCH v2 3/6] tools/ocaml/xenstored: replace hand rolled GC with weak GC references

2020-08-17 Thread Edwin Török
The code here is attempting to reduce memory usage by sharing common substrings in the tree: it replaces strings with ints, and keeps a string->int map that gets manually garbage collected using a hand-rolled mark and sweep algorithm. This is unnecessary: OCaml already has a mark-and-sweep Garbage

[PATCH v2 6/6] tools/ocaml/xenstored: use more efficient tries

2020-08-17 Thread Edwin Török
No functional change, just an optimization. Signed-off-by: Edwin Török --- Changed since v1: * fix missing 'set_node' in 'set' that got lost in conversion to map * simplify 'compare' function --- tools/ocaml/xenstored/connections.ml | 2 +- tools/ocaml/xenstored/symbol.ml | 6 +-- tools

[PATCH v2 5/6] tools/ocaml/xenstored: use more efficient node trees

2020-08-17 Thread Edwin Török
This changes the output of xenstore-ls to be sorted. Previously the keys were listed in the order in which they were inserted in. docs/misc/xenstore.txt doesn't specify in what order keys are listed. Map.update is used to retain semantics with replace_child: only an existing child is replaced, if

[PATCH v2 0/6] tools/ocaml/xenstored: simplify code

2020-08-17 Thread Edwin Török
Fix warnings, and delete some obsolete code. oxenstored contained a hand-rolled GC to perform hash-consing: this can be done with a lot fewer lines of code by using the built-in Weak module. The choice of data structures for trees/tries is not very efficient: they are just lists. Using a map imp

[PATCH v2 2/6] tools/ocaml/xenstored: fix deprecation warning

2020-08-17 Thread Edwin Török
``` File "xenstored/disk.ml", line 33, characters 9-23: 33 |let c = Char.lowercase c in ^^ (alert deprecated): Stdlib.Char.lowercase Use Char.lowercase_ascii instead. ``` Signed-off-by: Edwin Török --- tools/ocaml/xenstored/disk.ml | 2 +- 1 file changed, 1 insertio

[PATCH v3 4/6] tools/ocaml/xenstored: drop select based socket watching

2020-08-17 Thread Edwin Török
Poll has been the default since 2014, I think we can safely say by now that poll() works and we don't need to fall back to select(). This will allow fixing up the way we call poll to be more efficient (and pave the way for introducing epoll support): currently poll wraps the select API, which is i

[PATCH v3 6/6] tools/ocaml/xenstored: use more efficient tries

2020-08-17 Thread Edwin Török
No functional change, just an optimization. Signed-off-by: Edwin Török --- Changed since v1: * fix missing 'set_node' in 'set' that got lost in conversion to map * simplify 'compare' function --- tools/ocaml/xenstored/connections.ml | 2 +- tools/ocaml/xenstored/symbol.ml | 6 +-- tools

[PATCH v3 0/6] tools/ocaml/xenstored: simplify code

2020-08-17 Thread Edwin Török
Fix warnings, and delete some obsolete code. oxenstored contained a hand-rolled GC to perform hash-consing: this can be done with a lot fewer lines of code by using the built-in Weak module. The choice of data structures for trees/tries is not very efficient: they are just lists. Using a map imp

[PATCH v3 2/6] tools/ocaml/xenstored: fix deprecation warning

2020-08-17 Thread Edwin Török
``` File "xenstored/disk.ml", line 33, characters 9-23: 33 |let c = Char.lowercase c in ^^ (alert deprecated): Stdlib.Char.lowercase Use Char.lowercase_ascii instead. ``` Signed-off-by: Edwin Török --- tools/ocaml/xenstored/disk.ml | 2 +- 1 file changed, 1 insertio

[PATCH v3 1/6] tools/ocaml/libs/xc: Fix ambiguous documentation comment

2020-08-17 Thread Edwin Török
Signed-off-by: Edwin Török --- tools/ocaml/libs/xc/xenctrl.mli | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/ocaml/libs/xc/xenctrl.mli b/tools/ocaml/libs/xc/xenctrl.mli index 26ec7e59b1..f7f6ec570d 100644 --- a/tools/ocaml/libs/xc/xenctrl.mli +++ b/tools/ocaml/libs/xc/xenctrl.mli @@

Re: [PATCH v1 5/6] tools/ocaml/xenstored: use more efficient node trees

2020-08-17 Thread Edwin Torok
On Mon, 2020-08-17 at 14:52 +0200, Christian Lindig wrote: > +let compare a b = > + if equal a b then 0 > + else -(String.compare a b) > > I think this bit could use an inline comment why the sort order is > reversed. This could be also simplified to -(String.compare a b) > because this goes to

[PATCH v3 5/6] tools/ocaml/xenstored: use more efficient node trees

2020-08-17 Thread Edwin Török
This changes the output of xenstore-ls to be sorted. Previously the keys were listed in the order in which they were inserted in. docs/misc/xenstore.txt doesn't specify in what order keys are listed. Map.update is used to retain semantics with replace_child: only an existing child is replaced, if

[PATCH v3 3/6] tools/ocaml/xenstored: replace hand rolled GC with weak GC references

2020-08-17 Thread Edwin Török
The code here is attempting to reduce memory usage by sharing common substrings in the tree: it replaces strings with ints, and keeps a string->int map that gets manually garbage collected using a hand-rolled mark and sweep algorithm. This is unnecessary: OCaml already has a mark-and-sweep Garbage

Re: [RFC PATCH V1 05/12] hvm/dm: Introduce xendevicemodel_set_irq_level DM op

2020-08-17 Thread Stefano Stabellini
On Mon, 17 Aug 2020, Jan Beulich wrote: > On 07.08.2020 23:50, Stefano Stabellini wrote: > > On Fri, 7 Aug 2020, Jan Beulich wrote: > >> On 07.08.2020 01:49, Stefano Stabellini wrote: > >>> On Thu, 6 Aug 2020, Julien Grall wrote: > On 06/08/2020 01:37, Stefano Stabellini wrote: > > On Wed,

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

2020-08-17 Thread Stefano Stabellini
On Sat, 15 Aug 2020, Julien Grall wrote: > 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 im

Re: [PATCH 05/14] kernel-doc: public/features.h

2020-08-17 Thread Stefano Stabellini
On Mon, 17 Aug 2020, Jan Beulich wrote: > On 07.08.2020 23:52, Stefano Stabellini wrote: > > On Fri, 7 Aug 2020, Jan Beulich wrote: > >> On 07.08.2020 01:49, Stefano Stabellini wrote: > >>> @@ -41,19 +41,25 @@ > >>> * XENFEAT_dom0 MUST be set if the guest is to be booted as dom0, > >>> */ > >>>

Re: [PATCH 08/14] kernel-doc: public/memory.h

2020-08-17 Thread Stefano Stabellini
On Mon, 17 Aug 2020, Jan Beulich wrote: > On 07.08.2020 23:51, Stefano Stabellini wrote: > > On Fri, 7 Aug 2020, Jan Beulich wrote: > >> On 07.08.2020 01:49, Stefano Stabellini wrote: > >>> From: Stefano Stabellini > >>> > >>> Convert in-code comments to kernel-doc format wherever possible. > >>>

[PATCH] xen/arm: Missing N1/A76/A75 FP registers in vCPU context switch

2020-08-17 Thread Wei Chen
Xen has cpu_has_fp/cpu_has_simd to detect whether the CPU supports FP/SIMD or not. But currently, this two MACROs only consider value 0 of ID_AA64PFR0_EL1.FP/SIMD as FP/SIMD features enabled. But for CPUs that support FP/SIMD and half-precision floating-point features, the ID_AA64PFR0_EL1.FP/SIMD a

[RFC PATCH] xen/gntdev.c: Convert get_user_pages*() to pin_user_pages*()

2020-08-17 Thread Souptick Joarder
In 2019, we introduced pin_user_pages*() and now we are converting get_user_pages*() to the new API as appropriate. [1] & [2] could be referred for more information. This is case 5 as per document [1]. [1] Documentation/core-api/pin_user_pages.rst [2] "Explicit pinning of user-space pages":