Re: [PATCH v2 02/11] xen/gnttab: Rework resource acquisition

2021-01-12 Thread Jan Beulich
On 11.01.2021 22:22, Andrew Cooper wrote: > On 25/09/2020 14:17, Jan Beulich wrote: >> On 22.09.2020 20:24, Andrew Cooper wrote: >>> --- a/xen/common/grant_table.c >>> +++ b/xen/common/grant_table.c >>> @@ -4013,6 +4013,81 @@ static int gnttab_get_shared_frame_mfn(struct domain >>> *d, >>> re

Re: [PATCH v2 02/11] xen/gnttab: Rework resource acquisition

2021-01-12 Thread Jan Beulich
On 11.01.2021 22:22, Andrew Cooper wrote: > On 24/09/2020 10:51, Paul Durrant wrote: >>> diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c >>> index a5d3ed8bda..912f07be47 100644 >>> --- a/xen/common/grant_table.c >>> +++ b/xen/common/grant_table.c >>> @@ -4013,6 +4013,81 @@ static i

RE: [PATCH v2 02/11] xen/gnttab: Rework resource acquisition

2021-01-12 Thread Paul Durrant
> -Original Message- > From: Andrew Cooper > Sent: 11 January 2021 21:23 > To: p...@xen.org; 'Xen-devel' > Cc: 'George Dunlap' ; 'Ian Jackson' > ; 'Jan Beulich' > ; 'Stefano Stabellini' ; 'Wei Liu' > ; 'Julien > Grall' ; 'Michał Leszczyński' ; > 'Hubert Jasudowicz' > ; 'Tamas K Lengyel

Re: [PATCH v2 09/11] xen/memory: Fix mapping grant tables with XENMEM_acquire_resource

2021-01-12 Thread Jan Beulich
On 11.01.2021 21:05, Andrew Cooper wrote: > On 28/09/2020 10:37, Jan Beulich wrote: >> On 22.09.2020 20:24, Andrew Cooper wrote: >>> --- a/xen/common/compat/memory.c >>> +++ b/xen/common/compat/memory.c >>> @@ -636,15 +662,45 @@ int compat_memory_op(unsigned int cmd, >>> XEN_GUEST_HANDLE_PARAM(voi

Re: [PATCH v20210111 34/39] tools: adjust libxl_domain_suspend to receive a struct props

2021-01-12 Thread Christian Lindig
> Upcoming changes will pass more knobs down to xc_domain_save. > Adjust the libxl_domain_suspend API to allow easy adding of additional knobs. Acked-by: Christian Lindig From: Olaf Hering Sent: 11 January 2021 17:42 To: xen-devel@lists.xenproject.org Cc

Re: [PATCH v4 11/11] xen/arm: smmuv3: Add support for SMMUv3 driver

2021-01-12 Thread Rahul Singh
Hello Oleksandr , Thanks for reviewing the code. > On 11 Jan 2021, at 4:09 pm, Oleksandr wrote: > > > On 08.01.21 16:46, Rahul Singh wrote: > > Hi Rahul > >> Add support for ARM architected SMMUv3 implementation. It is based on >> the Linux SMMUv3 driver. >> >> Driver is currently supported

Re: [PATCH] iommu/arm: ipmmu-vmsa: Use 1U << 31 rather than 1 << 31

2021-01-12 Thread Bertrand Marquis
> On 11 Jan 2021, at 10:33, Oleksandr Tyshchenko wrote: > > From: Oleksandr Tyshchenko > > Replace all the use of 1 << 31 with 1U << 31 to prevent undefined > behavior in the IPMMU-VMSA driver. > > Signed-off-by: Oleksandr Tyshchenko Reviewed-by: Bertrand Marquis Cheers Bertrand > --- >

Re: [PATCH] xen/privcmd: allow fetching resource sizes

2021-01-12 Thread Roger Pau Monné
On Tue, Jan 12, 2021 at 06:57:30AM +0100, Jürgen Groß wrote: > On 11.01.21 16:29, Roger Pau Monne wrote: > > Allow issuing an IOCTL_PRIVCMD_MMAP_RESOURCE ioctl with num = 0 and > > addr = 0 in order to fetch the size of a specific resource. > > > > Add a shortcut to the default map resource path,

Re: [PATCH 0/2] sysemu: Let VMChangeStateHandler take boolean 'running' argument

2021-01-12 Thread Stefan Hajnoczi
On Mon, Jan 11, 2021 at 04:20:18PM +0100, Philippe Mathieu-Daudé wrote: > Trivial prototype change to clarify the use of the 'running' > argument of VMChangeStateHandler. > > Green CI: > https://gitlab.com/philmd/qemu/-/pipelines/239497352 > > Philippe Mathieu-Daudé (2): > sysemu/runstate: Let

Re: [PATCH] xen/privcmd: allow fetching resource sizes

2021-01-12 Thread Jürgen Groß
On 12.01.21 11:03, Roger Pau Monné wrote: On Tue, Jan 12, 2021 at 06:57:30AM +0100, Jürgen Groß wrote: On 11.01.21 16:29, Roger Pau Monne wrote: Allow issuing an IOCTL_PRIVCMD_MMAP_RESOURCE ioctl with num = 0 and addr = 0 in order to fetch the size of a specific resource. Add a shortcut to the

Re: [PATCH] xen/arm: don't read aarch32 regs when aarch32 isn't available

2021-01-12 Thread Bertrand Marquis
Hi Stefano, > On 12 Jan 2021, at 00:16, Stefano Stabellini wrote: > > Don't read aarch32 system registers at boot time when the aarch32 state > is not available. They are UNKNOWN, so it is not useful to read them. > Moreover, on Cavium ThunderX reading ID_PFR2_EL1 causes a Xen crash. > Instead,

[ovmf test] 158375: all pass - PUSHED

2021-01-12 Thread osstest service owner
flight 158375 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/158375/ Perfect :-) All tests in this flight passed as required version targeted for testing: ovmf ebfe2d3eb5ac7fd92d74011edb31303a181920c7 baseline version: ovmf e992cc3f4859f653d6a42

Re: [PATCH] xen/arm: don't read aarch32 regs when aarch32 isn't available

2021-01-12 Thread Julien Grall
Hi Stefano, On 12/01/2021 00:16, Stefano Stabellini wrote: Don't read aarch32 system registers at boot time when the aarch32 state is not available. They are UNKNOWN, so it is not useful to read them. Moreover, on Cavium ThunderX reading ID_PFR2_EL1 causes a Xen crash. Instead, only read them wh

Re: [PATCH v4 09/11] xen/arm: smmuv3: Use fallthrough pseudo-keyword

2021-01-12 Thread Bertrand Marquis
> On 8 Jan 2021, at 14:46, Rahul Singh wrote: > > Merge the patch from linux to use fallthrough pseudo-keyword. > > Replace the existing /* fall through */ comments and its variants with > the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary > fall-through markings when it is

Re: [PATCH v4 10/11] xen/arm: smmuv3: Replace linux functions with xen functions.

2021-01-12 Thread Bertrand Marquis
Hi Rahul, > On 8 Jan 2021, at 14:46, Rahul Singh wrote: > > Replace all Linux device tree handling function with the XEN > functions. > > Replace all Linux ktime function with the XEN time functions. > > Signed-off-by: Rahul Singh Reviewed-by: Bertrand Marquis Cheers Bertrand > --- > Chang

Re: [PATCH v4 07/11] xen/arm: bitops: Implement a ffsll function

2021-01-12 Thread Bertrand Marquis
Hi, > On 8 Jan 2021, at 14:46, Rahul Singh wrote: > > Implement the ffsll based on built-in function "__builtin_ffsll()" > > ffsll will return one plus the index of the least significant 1-bit in > doublewords or if doublewords is zero, returns zero. > > Signed-off-by: Rahul Singh Reviewed-by

Re: [PATCH v4 08/11] xen/compiler: import 'fallthrough' keyword from linux

2021-01-12 Thread Bertrand Marquis
Hi, > On 8 Jan 2021, at 14:46, Rahul Singh wrote: > > -Wimplicit-fallthrough warns when a switch case falls through. Warning > can be suppress by either adding a /* fallthrough */ comment, or by > using a null statement: __attribute__ ((fallthrough)) > > Define the pseudo keyword 'fallthrough'

Re: [PATCH v4 05/11] xen/arm: smmuv3: Remove Linux specific code that is not usable in XEN

2021-01-12 Thread Bertrand Marquis
Hi, > On 8 Jan 2021, at 14:46, Rahul Singh wrote: > > Remove code that is related to below functionality : > 1. struct io_pgtable_ops > 2. struct io_pgtable_cfg > 3. struct iommu_flush_ops, > 4. struct iommu_ops > 5. module_param_named, MODULE_PARM_DESC, module_platform_driver, >MODULE_* > 6

Re: [PATCH v4 06/11] xen/device-tree: Add dt_property_match_string helper

2021-01-12 Thread Bertrand Marquis
Hi, > On 8 Jan 2021, at 14:46, Rahul Singh wrote: > > Import the Linux helper of_property_match_string. This function searches > a string list property and returns the index of a specific string value. > > Signed-off-by: Rahul Singh Reviewed-by: Bertrand Marquis Cheers Bertrand > --- > Chan

Re: [PATCH v4 08/11] xen/compiler: import 'fallthrough' keyword from linux

2021-01-12 Thread Jan Beulich
On 08.01.2021 15:46, Rahul Singh wrote: > -Wimplicit-fallthrough warns when a switch case falls through. Warning > can be suppress by either adding a /* fallthrough */ comment, or by > using a null statement: __attribute__ ((fallthrough)) Why is the comment variant (which we use in many places alr

Re: [PATCH 2/6] x86/mm: p2m_add_foreign() is HVM-only

2021-01-12 Thread Jan Beulich
On 11.01.2021 09:23, Oleksandr wrote: > On 11.01.21 09:41, Jan Beulich wrote: >> If you could also provide your exact .config, I could see whether I >> can repro here with some of the gcc5 versions I have laying around. > > Please see attached Builds perfectly fine with 5.4.0 here. Jan

[PATCH v2] xen/privcmd: allow fetching resource sizes

2021-01-12 Thread Roger Pau Monne
Allow issuing an IOCTL_PRIVCMD_MMAP_RESOURCE ioctl with num = 0 and addr = 0 in order to fetch the size of a specific resource. Add a shortcut to the default map resource path, since fetching the size requires no address to be passed in, and thus no VMA to setup. This is missing from the initial

Re: [PATCH v2] xen/privcmd: allow fetching resource sizes

2021-01-12 Thread Jürgen Groß
On 12.01.21 12:53, Roger Pau Monne wrote: Allow issuing an IOCTL_PRIVCMD_MMAP_RESOURCE ioctl with num = 0 and addr = 0 in order to fetch the size of a specific resource. Add a shortcut to the default map resource path, since fetching the size requires no address to be passed in, and thus no VMA

Re: [PATCH] xen/arm: don't read aarch32 regs when aarch32 isn't available

2021-01-12 Thread Julien Grall
On 12/01/2021 10:50, Bertrand Marquis wrote: Hi Stefano, On 12 Jan 2021, at 00:16, Stefano Stabellini wrote: Don't read aarch32 system registers at boot time when the aarch32 state is not available. They are UNKNOWN, so it is not useful to read them. Moreover, on Cavium ThunderX reading ID

Re: [PATCH] xen/arm: don't read aarch32 regs when aarch32 isn't available

2021-01-12 Thread Bertrand Marquis
Hi Julien, > On 12 Jan 2021, at 12:46, Julien Grall wrote: > > > > On 12/01/2021 10:50, Bertrand Marquis wrote: >> Hi Stefano, >>> On 12 Jan 2021, at 00:16, Stefano Stabellini wrote: >>> >>> Don't read aarch32 system registers at boot time when the aarch32 state >>> is not available. They ar

Re: [PATCH] xen/arm: don't read aarch32 regs when aarch32 isn't available

2021-01-12 Thread Rahul Singh
Hello Julien, > On 12 Jan 2021, at 11:00 am, Julien Grall wrote: > > Hi Stefano, > > On 12/01/2021 00:16, Stefano Stabellini wrote: >> Don't read aarch32 system registers at boot time when the aarch32 state >> is not available. They are UNKNOWN, so it is not useful to read them. >> Moreover, on

Purpose of translate MSI interrupt into INTx for guest passthrough

2021-01-12 Thread Roger Pau Monné
Hello, While trying to do some cleanup of the Xen interrupt support for pci pass though I came across the MSI to INTx translation that Xen is in theory capable of performing (ie: use a physical MSI interrupt source and inject that as an INTx to a guest). AFAICT such functionality is not wired up

[xen-unstable test] 158369: regressions - FAIL

2021-01-12 Thread osstest service owner
flight 158369 xen-unstable real [real] flight 158377 xen-unstable real-retest [real] http://logs.test-lab.xenproject.org/osstest/logs/158369/ http://logs.test-lab.xenproject.org/osstest/logs/158377/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be r

Re: Purpose of translate MSI interrupt into INTx for guest passthrough

2021-01-12 Thread Roger Pau Monné
Dropping Qing He as this address bounces. On Tue, Jan 12, 2021 at 03:10:57PM +0100, Roger Pau Monné wrote: > Hello, > > While trying to do some cleanup of the Xen interrupt support for pci > pass though I came across the MSI to INTx translation that Xen is in > theory capable of performing (ie: u

Re: [PATCH] xen/arm: don't read aarch32 regs when aarch32 isn't available

2021-01-12 Thread Julien Grall
On 12/01/2021 13:28, Rahul Singh wrote: Hello Julien, Hi Rahul, On 12 Jan 2021, at 11:00 am, Julien Grall wrote: Hi Stefano, On 12/01/2021 00:16, Stefano Stabellini wrote: Don't read aarch32 system registers at boot time when the aarch32 state is not available. They are UNKNOWN, so i

Re: [PATCH] xen/arm: don't read aarch32 regs when aarch32 isn't available

2021-01-12 Thread Bertrand Marquis
Hi, > On 12 Jan 2021, at 14:27, Julien Grall wrote: > > > > On 12/01/2021 13:28, Rahul Singh wrote: >> Hello Julien, > > Hi Rahul, > >>> On 12 Jan 2021, at 11:00 am, Julien Grall wrote: >>> >>> Hi Stefano, >>> >>> On 12/01/2021 00:16, Stefano Stabellini wrote: Don't read aarch32 syst

[qemu-mainline test] 158372: regressions - FAIL

2021-01-12 Thread osstest service owner
flight 158372 qemu-mainline real [real] flight 158378 qemu-mainline real-retest [real] http://logs.test-lab.xenproject.org/osstest/logs/158372/ http://logs.test-lab.xenproject.org/osstest/logs/158378/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be

Re: Purpose of translate MSI interrupt into INTx for guest passthrough

2021-01-12 Thread Jason Andryuk
On Tue, Jan 12, 2021 at 9:25 AM Roger Pau Monné wrote: > > Dropping Qing He as this address bounces. > > On Tue, Jan 12, 2021 at 03:10:57PM +0100, Roger Pau Monné wrote: > > Hello, > > > > While trying to do some cleanup of the Xen interrupt support for pci > > pass though I came across the MSI to

Re: Purpose of translate MSI interrupt into INTx for guest passthrough

2021-01-12 Thread Roger Pau Monné
On Tue, Jan 12, 2021 at 09:48:17AM -0500, Jason Andryuk wrote: > On Tue, Jan 12, 2021 at 9:25 AM Roger Pau Monné wrote: > > > > Dropping Qing He as this address bounces. > > > > On Tue, Jan 12, 2021 at 03:10:57PM +0100, Roger Pau Monné wrote: > > > Hello, > > > > > > While trying to do some cleanu

[linux-linus test] 158373: regressions - FAIL

2021-01-12 Thread osstest service owner
flight 158373 linux-linus real [real] http://logs.test-lab.xenproject.org/osstest/logs/158373/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-i386-xl-xsm7 xen-install fail REGR. vs. 152332 test-amd64-i386-qem

[PATCH] x86/dpci: remove the dpci EOI timer

2021-01-12 Thread Roger Pau Monne
Current interrupt pass though code will setup a timer for each interrupt injected to the guest that requires an EOI from the guest. Such timer would perform two actions if the guest doesn't EOI the interrupt before a given period of time. The first one is deasserting the virtual line, the second is

Proposal - lightweight auto test binaries

2021-01-12 Thread Ian Jackson
Andy and I were discussing some new tests he's written which (will) live in xen.git and which we would like to wire into osstest. We came up with the following proposal (I have refined some of the details beyond what we discussed on IRC): * Tests will live in tools/tests/ ideally, but they might

Re: [RFC PATCH v3 0/6] Restricted DMA

2021-01-12 Thread Florian Fainelli
On 1/11/21 11:48 PM, Claire Chang wrote: > On Fri, Jan 8, 2021 at 1:59 AM Florian Fainelli wrote: >> >> On 1/7/21 9:42 AM, Claire Chang wrote: >> Can you explain how ATF gets involved and to what extent it does help, besides enforcing a secure region from the ARM CPU's perpsective? Does

new (mostly) NetBSD patches

2021-01-12 Thread Manuel Bouyer
Hello, I'm about to send a new batch of patches which are mostly NetBSD-related fixes. They replace the patches I sent in december. As my git repo became a mess, I just started again from scratch, hopefully getting things in a better state now. Also I followed advices using the Xen scripts, so the

Re: [PATCH v2 02/11] xen/gnttab: Rework resource acquisition

2021-01-12 Thread Andrew Cooper
On 12/01/2021 08:15, Jan Beulich wrote: > On 11.01.2021 22:22, Andrew Cooper wrote: >> On 25/09/2020 14:17, Jan Beulich wrote: >>> On 22.09.2020 20:24, Andrew Cooper wrote: --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -4013,6 +4013,81 @@ static int gnttab_get_shar

[PATCH] NetBSD: Fix lock directory path

2021-01-12 Thread Manuel Bouyer
From: Manuel Bouyer On NetBSD the lock directory is in /var/run/ Signed-off-by: Manuel Bouyer --- m4/paths.m4 | 2 +- tools/configure | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/m4/paths.m4 b/m4/paths.m4 index 89d3bb8312..1c107b1a61 100644 --- a/m4/paths.m4 +++ b

[PATCH] NetBSD hotplug: Introduce locking functions

2021-01-12 Thread Manuel Bouyer
From: Manuel Bouyer On NetBSD, some block device configuration requires serialisation. Introcuce locking functions, and use them in the block script where appropriate. Signed-off-by: Manuel Bouyer --- tools/hotplug/NetBSD/Makefile | 1 + tools/hotplug/NetBSD/block | 5 ++- tools/hotpl

[PATCH] NetBSD hotplug: fix block unconfigure on destroy

2021-01-12 Thread Manuel Bouyer
From: Manuel Bouyer When a domain is destroyed, xparams may not be available any more when the block script is called to unconfigure the vnd. Check xparam only at configure time, and just unconfigure any vnd present in the xenstore. Signed-off-by: Manuel Bouyer --- tools/hotplug/NetBSD/block |

[PATCH] Fix error: array subscript has type 'char'

2021-01-12 Thread Manuel Bouyer
From: Manuel Bouyer Use unsigned char variable, or cast to (unsigned char), for tolower()/islower() and friends. Fix compiler error array subscript has type 'char' [-Werror=char-subscripts] Signed-off-by: Manuel Bouyer --- tools/libs/light/libxl_qmp.c | 2 +- tools/xentrace/xentrace.c| 2 +

[PATCH] NetBSD hotplug: handle case where vifname is not present

2021-01-12 Thread Manuel Bouyer
From: Manuel Bouyer Some Xen version didn't set the vifname in xenstore; just build one if not present. Signed-off-by: Manuel Bouyer --- tools/hotplug/NetBSD/vif-bridge | 5 - tools/hotplug/NetBSD/vif-ip | 4 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/hotp

[PATCH] NetBSD: remove xenbackendd

2021-01-12 Thread Manuel Bouyer
From: Manuel Bouyer NetBSD doens't need xenbackendd with xl toolstack so don't build it. Remove now unused xenbackendd directory/files. Signed-off-by: Manuel Bouyer --- tools/Makefile | 1 - tools/xenbackendd/Makefile | 45 - tools/xenbackendd/xenbackendd.c | 326 -

[PATCH] NetBSD: use system-provided headers

2021-01-12 Thread Manuel Bouyer
From: Manuel Bouyer On NetBSD use the system-provided headers for ioctl and related definitions, they are up to date and have more chances to match the kernel's idea of the ioctls and structures. Remove now-unused NetBSD/evtchn.h and NetBSD/privcmd.h. Don't fail install if xen/sys/*.h are not pre

[PATCH] libs/light: pass some infos to qemu

2021-01-12 Thread Manuel Bouyer
From: Manuel Bouyer Pass bridge name to qemu as command line option When starting qemu, set an environnement variable XEN_DOMAIN_ID, to be used by qemu helper scripts Signed-off-by: Manuel Bouyer --- tools/libs/light/libxl_dm.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/tools/li

[PATCH] xenpaging.c: include errno.h

2021-01-12 Thread Manuel Bouyer
From: Manuel Bouyer writable definition of errno on NetBSD. Signed-off-by: Manuel Bouyer --- tools/xenpaging/xenpaging.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/xenpaging/xenpaging.c b/tools/xenpaging/xenpaging.c index 33098046c2..6e5490315d 100644 --- a/tools/xenpaging/xenpa

[PATCH] libs/light: fix uuid on NetBSD

2021-01-12 Thread Manuel Bouyer
From: Manuel Bouyer NetBSD uses the same uuid library as FreeBSD. As this is in a __FreeBSD__ || __NetBSD__ block, just drop the #ifdef __FreeBSD__ and dead code. Signed-off-by: Manuel Bouyer --- tools/libs/light/libxl_uuid.c | 21 - 1 file changed, 21 deletions(-) diff --

[PATCH] libs/light: Switch NetBSD to QEMU_XEN

2021-01-12 Thread Manuel Bouyer
From: Manuel Bouyer Switch NetBSD to QEMU_XEN. All 3 versions of libxl__default_device_model() now return LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN, so remove it and just set b_info->device_model_version to LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN in libxl__domain_build_info_setdefault(). Signed-off-by: Ma

[PATCH] libs/gnttab: implement on NetBSD

2021-01-12 Thread Manuel Bouyer
From: Manuel Bouyer Implement gnttab interface on NetBSD. The kernel interface is different from FreeBSD so we can't use the FreeBSD version Signed-off-by: Manuel Bouyer --- tools/libs/gnttab/Makefile | 2 +- tools/libs/gnttab/netbsd.c | 267 + 2 files cha

[PATCH] libs/foreignmemory: Implement on NetBSD

2021-01-12 Thread Manuel Bouyer
From: Manuel Bouyer Implement foreignmemory interface on NetBSD. The compat interface is now used only on __sun__ Signed-off-by: Manuel Bouyer --- tools/libs/foreignmemory/Makefile | 2 +- tools/libs/foreignmemory/netbsd.c | 75 ++ tools/libs/foreignmemory/privat

[PATCH] ocaml/libs/eventchn: drop unneeded evtchn.h

2021-01-12 Thread Manuel Bouyer
From: Manuel Bouyer On NetBSD xen/sys/evtchn.h is not available any more. Just remove it as it's not needed. Signed-off-by: Manuel Bouyer --- tools/ocaml/libs/eventchn/xeneventchn_stubs.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/ocaml/libs/eventchn/xeneventchn_stubs.c b/tools

[PATCH] libs/call: fix build on NetBSD

2021-01-12 Thread Manuel Bouyer
From: Manuel Bouyer Define PAGE_* if not already defined Catch up with osdep interface change. Signed-off-by: Manuel Bouyer --- tools/libs/call/netbsd.c | 19 +++ tools/libs/call/private.h | 6 -- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/tools/libs

[PATCH] libs/evtchn: fix build on NetBSD.

2021-01-12 Thread Manuel Bouyer
From: Manuel Bouyer use xenio3.h for ioctl definitions read_exact/write_exact seems to not be available here, which cause a gcc error. Use plain read/write, the xenevtchn interface won't do partial read/write on NetBSD anyway so it should be safe. Signed-off-by: Manuel Bouyer Fixes: b7f76a699dc

[PATCH] gdbsx: use right path for privcmd

2021-01-12 Thread Manuel Bouyer
From: Manuel Bouyer On NetBSD the privcmd interface node is /kern/xen/privcmd Signed-off-by: Manuel Bouyer --- tools/debugger/gdbsx/xg/xg_main.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/debugger/gdbsx/xg/xg_main.c b/tools/debugger/gdbsx/xg/xg_main.c

[PATCH] xenstat_netbsd: remove usused code

2021-01-12 Thread Manuel Bouyer
From: Manuel Bouyer remove PROCNETDEV_HEADER[] and read_attributes_vbd(), gcc complains that they are unused Signed-off-by: Manuel Bouyer --- tools/libs/stat/xenstat_netbsd.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/tools/libs/stat/xenstat_netbsd.c b/tools/libs/stat/xens

[PATCH] libs/light: make it build without setresuid()

2021-01-12 Thread Manuel Bouyer
From: Manuel Bouyer NetBSD doesn't have setresuid(). Add a configure check for it, and use plain setuid() if !HAVE_SETRESUID Signed-off-by: Manuel Bouyer --- tools/configure | 13 + tools/configure.ac | 3 +++ tools/libs/light/libxl_dm.c | 10 ++ 3 fil

[PATCH] xenpmd.c: use dynamic allocation

2021-01-12 Thread Manuel Bouyer
From: Manuel Bouyer On NetBSD, d_name is larger than 256, so file_name[284] may not be large enough (and gcc emits a format-truncation error). Use asprintf() instead of snprintf() on a static on-stack buffer. Signed-off-by: Manuel Bouyer --- tools/xenpmd/xenpmd.c | 8 1 file changed,

[PATCH] libs/light: fix tv_sec printf format

2021-01-12 Thread Manuel Bouyer
From: Manuel Bouyer Don't assume tv_sec is a unsigned long, it is 64 bits on NetBSD 32 bits. Use %jd and cast to (intmax_t) instead Signed-off-by: Manuel Bouyer --- tools/libs/light/libxl_create.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/libs/light/lib

[PATCH] libs/store: make build without PTHREAD_STACK_MIN

2021-01-12 Thread Manuel Bouyer
From: Manuel Bouyer On NetBSD, PTHREAD_STACK_MIN is not available. Just use DEFAULT_THREAD_STACKSIZE if PTHREAD_STACK_MIN is not available. Signed-off-by: Manuel Bouyer --- tools/libs/store/xs.c | 4 1 file changed, 4 insertions(+) diff --git a/tools/libs/store/xs.c b/tools/libs/store/xs

Re: [PATCH] xen/arm: don't read aarch32 regs when aarch32 isn't available

2021-01-12 Thread Stefano Stabellini
On Tue, 12 Jan 2021, Julien Grall wrote: > > +aarch32 = c->pfr64.el1 == 2; > > This is checking that AArch32 is available in EL1. However, it may not be the > case yet it would be available in EL0. > > As a consequence, 32-bit userspace wouldn't work properly after this patch. > > The Arm Ar

Re: [PATCH] xen/arm: don't read aarch32 regs when aarch32 isn't available

2021-01-12 Thread Julien Grall
On Tue, 12 Jan 2021 at 19:09, Stefano Stabellini wrote: > > On Tue, 12 Jan 2021, Julien Grall wrote: > > > +aarch32 = c->pfr64.el1 == 2; > > > > This is checking that AArch32 is available in EL1. However, it may not be > > the > > case yet it would be available in EL0. > > > > As a consequenc

[PATCH v3 6/7] xen/memory: Indent part of acquire_resource()

2021-01-12 Thread Andrew Cooper
Indent the middle of acquire_resource() inside a do {} while ( 0 ) loop. This is broken out specifically to make the following change readable. No functional change. Signed-off-by: Andrew Cooper Reviewed-by: Paul Durrant --- CC: George Dunlap CC: Ian Jackson CC: Jan Beulich CC: Stefano Stab

[PATCH v3 0/7] Multiple fixes to XENMEM_acquire_resource

2021-01-12 Thread Andrew Cooper
I thought this was going to be a very simple small bugfix for Michał's Processor Trace series. Serves me right for expecting it not to be full of bear traps... The sole implementation of acquire_resource never asks for size, so its little surprise that Xen is broken for compat callers, and return

[PATCH v3 4/7] xen/memory: Clarify the XENMEM_acquire_resource ABI description

2021-01-12 Thread Andrew Cooper
This is how similar operations already operate, compatible with the sole implementation (in Linux), and explicitly gives us some flexibility. Signed-off-by: Andrew Cooper Reviewed-by: Paul Durrant --- CC: George Dunlap CC: Ian Jackson CC: Jan Beulich CC: Stefano Stabellini CC: Wei Liu CC: J

[PATCH v3 7/7] xen/memory: Fix mapping grant tables with XENMEM_acquire_resource

2021-01-12 Thread Andrew Cooper
A guest's default number of grant frames is 64, and XENMEM_acquire_resource will reject an attempt to map more than 32 frames. This limit is caused by the size of mfn_list[] on the stack. Fix mapping of arbitrary size requests by looping over batches of 32 in acquire_resource(), and using hyperca

[PATCH v3 3/7] tools/foreignmem: Support querying the size of a resource

2021-01-12 Thread Andrew Cooper
With the Xen side of this interface fixed to return real sizes, userspace needs to be able to make the query. Introduce xenforeignmemory_resource_size() for the purpose, bumping the library minor version. Update both Linux and FreeBSD's osdep_xenforeignmemory_map_resource() to understand size req

[PATCH v3 5/7] xen/memory: Improve compat XENMEM_acquire_resource handling

2021-01-12 Thread Andrew Cooper
The frame_list is an input, or an output, depending on whether the calling domain is translated or not. The array does not need marshalling in both directions. Furthermore, the copy-in loop was very inefficient, copying 4 bytes at at time. Rewrite it to copy in all nr_frames at once, and then ex

[PATCH v3 2/7] xen/memory: Fix acquire_resource size semantics

2021-01-12 Thread Andrew Cooper
Calling XENMEM_acquire_resource with a NULL frame_list is a request for the size of the resource, but the returned 32 is bogus. If someone tries to follow it for XENMEM_resource_ioreq_server, the acquire call will fail as IOREQ servers currently top out at 2 frames, and it is only half the size of

[PATCH v3 1/7] xen/gnttab: Rework resource acquisition

2021-01-12 Thread Andrew Cooper
The existing logic doesn't function in the general case for mapping a guests grant table, due to arbitrary 32 frame limit, and the default grant table limit being 64. In order to start addressing this, rework the existing grant table logic by implementing a single gnttab_acquire_resource(). This

Re: [PATCH v2 02/11] xen/gnttab: Rework resource acquisition

2021-01-12 Thread Andrew Cooper
On 12/01/2021 08:23, Jan Beulich wrote: > On 11.01.2021 22:22, Andrew Cooper wrote: >> On 24/09/2020 10:51, Paul Durrant wrote: diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c index a5d3ed8bda..912f07be47 100644 --- a/xen/common/grant_table.c +++ b/xen/common/gr

Re: [PATCH v2] xen/privcmd: allow fetching resource sizes

2021-01-12 Thread Andrew Cooper
On 12/01/2021 12:17, Jürgen Groß wrote: > On 12.01.21 12:53, Roger Pau Monne wrote: >> Allow issuing an IOCTL_PRIVCMD_MMAP_RESOURCE ioctl with num = 0 and >> addr = 0 in order to fetch the size of a specific resource. >> >> Add a shortcut to the default map resource path, since fetching the >> size

Re: [PATCH v3 2/7] xen/memory: Fix acquire_resource size semantics

2021-01-12 Thread Julien Grall
Hi Andrew, On Tue, 12 Jan 2021 at 19:49, Andrew Cooper wrote: > > Calling XENMEM_acquire_resource with a NULL frame_list is a request for the > size of the resource, but the returned 32 is bogus. > > If someone tries to follow it for XENMEM_resource_ioreq_server, the acquire > call will fail as I

Re: [PATCH v3 2/7] xen/memory: Fix acquire_resource size semantics

2021-01-12 Thread Andrew Cooper
On 12/01/2021 20:15, Julien Grall wrote: > Hi Andrew, > > On Tue, 12 Jan 2021 at 19:49, Andrew Cooper wrote: >> Calling XENMEM_acquire_resource with a NULL frame_list is a request for the >> size of the resource, but the returned 32 is bogus. >> >> If someone tries to follow it for XENMEM_resource

Re: [PATCH v4 11/11] xen/arm: smmuv3: Add support for SMMUv3 driver

2021-01-12 Thread Oleksandr
On 12.01.21 11:41, Rahul Singh wrote: Hi Rahul -static int arm_smmu_of_xlate(struct device *dev, struct of_phandle_args *args) +static int arm_smmu_dt_xlate(struct device *dev, + const struct dt_phandle_args *args) { - return iommu_fwspec_add_ids(de

Re: [PATCH] xen/arm: don't read aarch32 regs when aarch32 isn't available

2021-01-12 Thread Stefano Stabellini
On Tue, 12 Jan 2021, Julien Grall wrote: > On Tue, 12 Jan 2021 at 19:09, Stefano Stabellini > wrote: > > > > On Tue, 12 Jan 2021, Julien Grall wrote: > > > > +aarch32 = c->pfr64.el1 == 2; > > > > > > This is checking that AArch32 is available in EL1. However, it may not be > > > the > > > ca

Re: [PATCH v3 2/7] xen/memory: Fix acquire_resource size semantics

2021-01-12 Thread Tamas K Lengyel
On Tue, Jan 12, 2021 at 3:57 PM Andrew Cooper wrote: > > On 12/01/2021 20:15, Julien Grall wrote: > > Hi Andrew, > > > > On Tue, 12 Jan 2021 at 19:49, Andrew Cooper > > wrote: > >> Calling XENMEM_acquire_resource with a NULL frame_list is a request for the > >> size of the resource, but the retu

[PATCH V4 00/24] IOREQ feature (+ virtio-mmio) on Arm

2021-01-12 Thread Oleksandr Tyshchenko
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] and RFC-V3 series at [2]-[5]. Xen on Arm requires some implementation to forward guest MMIO access to a device model in order to implement vi

[PATCH V4 01/24] x86/ioreq: Prepare IOREQ feature for making it common

2021-01-12 Thread Oleksandr Tyshchenko
From: Oleksandr Tyshchenko As a lot of x86 code can be re-used on Arm later on, this patch makes some preparation to x86/hvm/ioreq.c before moving to the common code. This way we will get a verbatim copy for a code movement in subsequent patch. This patch mostly introduces specific hooks to abst

[PATCH V4 02/24] x86/ioreq: Add IOREQ_STATUS_* #define-s and update code for moving

2021-01-12 Thread Oleksandr Tyshchenko
From: Oleksandr Tyshchenko This patch continues to make some preparation to x86/hvm/ioreq.c before moving to the common code. Add IOREQ_STATUS_* #define-s and update candidates for moving since X86EMUL_* shouldn't be exposed to the common code in that form. This support is going to be used on A

[PATCH V4 03/24] x86/ioreq: Provide out-of-line wrapper for the handle_mmio()

2021-01-12 Thread Oleksandr Tyshchenko
From: Oleksandr Tyshchenko The IOREQ is about to be common feature and Arm will have its own implementation. But the name of the function is pretty generic and can be confusing on Arm (we already have a try_handle_mmio()). In order not to rename the function (which is used for a varying set of

[PATCH V4 05/24] xen/ioreq: Make x86's hvm_ioreq_needs_completion() common

2021-01-12 Thread Oleksandr Tyshchenko
From: Oleksandr Tyshchenko The IOREQ is a common feature now and this helper will be used on Arm as is. Move it to xen/ioreq.h and remove "hvm" prefix. Although PIO handling on Arm is not introduced with the current series (it will be implemented when we add support for vPCI), technically the PI

[PATCH V4 06/24] xen/ioreq: Make x86's hvm_mmio_first(last)_byte() common

2021-01-12 Thread Oleksandr Tyshchenko
From: Oleksandr Tyshchenko The IOREQ is a common feature now and these helpers will be used on Arm as is. Move them to xen/ioreq.h and replace "hvm" prefixes with "ioreq". Signed-off-by: Oleksandr Tyshchenko Reviewed-by: Paul Durrant CC: Julien Grall [On Arm only] Tested-by: Wei Chen --- Pl

[PATCH V4 04/24] xen/ioreq: Make x86's IOREQ feature common

2021-01-12 Thread Oleksandr Tyshchenko
From: Oleksandr Tyshchenko As a lot of x86 code can be re-used on Arm later on, this patch moves previously prepared IOREQ support to the common code (the code movement is verbatim copy). The "legacy" mechanism of mapping magic pages for the IOREQ servers remains x86 specific and not exposed to

[PATCH V4 07/24] xen/ioreq: Make x86's hvm_ioreq_(page/vcpu/server) structs common

2021-01-12 Thread Oleksandr Tyshchenko
From: Oleksandr Tyshchenko The IOREQ is a common feature now and these structs will be used on Arm as is. Move them to xen/ioreq.h and remove "hvm" prefixes. Signed-off-by: Oleksandr Tyshchenko Acked-by: Jan Beulich CC: Julien Grall [On Arm only] Tested-by: Wei Chen --- Please note, this is

[PATCH V4 08/24] xen/ioreq: Move x86's ioreq_server to struct domain

2021-01-12 Thread Oleksandr Tyshchenko
From: Oleksandr Tyshchenko The IOREQ is a common feature now and this struct will be used on Arm as is. Move it to common struct domain. This also significantly reduces the layering violation in the common code (*arch.hvm* usage). We don't move ioreq_gfn since it is not used in the common code (

[PATCH V4 20/24] xen/arm: io: Harden sign extension check

2021-01-12 Thread Oleksandr Tyshchenko
From: Oleksandr Tyshchenko In the ideal world we would never get an undefined behavior when propagating the sign bit since that bit can only be set for access size smaller than the register size (i.e byte/half-word for aarch32, byte/half-word/word for aarch64). In the real world we need to care

[PATCH V4 18/24] xen/dm: Introduce xendevicemodel_set_irq_level DM op

2021-01-12 Thread Oleksandr Tyshchenko
From: Julien Grall This patch adds ability to the device emulator to notify otherend (some entity running in the guest) using a SPI and implements Arm specific bits for it. Proposed interface allows emulator to set the logical level of a one of a domain's IRQ lines. We can't reuse the existing D

[PATCH V4 23/24] libxl: Introduce basic virtio-mmio support on Arm

2021-01-12 Thread Oleksandr Tyshchenko
From: Julien Grall This patch creates specific device node in the Guest device-tree with allocated MMIO range and SPI interrupt if specific 'virtio' property is present in domain config. Signed-off-by: Julien Grall Signed-off-by: Oleksandr Tyshchenko [On Arm only] Tested-by: Wei Chen --- Ple

[PATCH V4 17/24] xen/ioreq: Introduce domain_has_ioreq_server()

2021-01-12 Thread Oleksandr Tyshchenko
From: Oleksandr Tyshchenko This patch introduces a helper the main purpose of which is to check if a domain is using IOREQ server(s). On Arm the current benefit is to avoid calling vcpu_ioreq_handle_completion() (which implies iterating over all possible IOREQ servers anyway) on every return in

[PATCH V4 15/24] xen/arm: Stick around in leave_hypervisor_to_guest until I/O has completed

2021-01-12 Thread Oleksandr Tyshchenko
From: Oleksandr Tyshchenko This patch adds proper handling of return value of vcpu_ioreq_handle_completion() which involves using a loop in leave_hypervisor_to_guest(). The reason to use an unbounded loop here is the fact that vCPU shouldn't continue until the I/O has completed. The IOREQ code

[PATCH V4 11/24] xen/mm: Make x86's XENMEM_resource_ioreq_server handling common

2021-01-12 Thread Oleksandr Tyshchenko
From: Julien Grall As x86 implementation of XENMEM_resource_ioreq_server can be re-used on Arm later on, this patch makes it common and removes arch_acquire_resource as unneeded. Also re-order #include-s alphabetically. This support is going to be used on Arm to be able run device emulator outs

[PATCH V4 13/24] xen/ioreq: Use guest_cmpxchg64() instead of cmpxchg()

2021-01-12 Thread Oleksandr Tyshchenko
From: Oleksandr Tyshchenko The cmpxchg() in ioreq_send_buffered() operates on memory shared with the emulator domain (and the target domain if the legacy interface is used). In order to be on the safe side we need to switch to guest_cmpxchg64() to prevent a domain to DoS Xen on Arm. As there is

[PATCH V4 14/24] arm/ioreq: Introduce arch specific bits for IOREQ/DM features

2021-01-12 Thread Oleksandr Tyshchenko
From: Julien Grall This patch adds basic IOREQ/DM support on Arm. The subsequent patches will improve functionality and add remaining bits. The IOREQ/DM features are supposed to be built with IOREQ_SERVER option enabled, which is disabled by default on Arm for now. Please note, the "PIO handlin

[PATCH V4 22/24] xen/arm: Add mapcache invalidation handling

2021-01-12 Thread Oleksandr Tyshchenko
From: Oleksandr Tyshchenko We need to send mapcache invalidation request to qemu/demu everytime the page gets removed from a guest. At the moment, the Arm code doesn't explicitely remove the existing mapping before inserting the new mapping. Instead, this is done implicitely by __p2m_set_entry()

[PATCH V4 12/24] xen/ioreq: Remove "hvm" prefixes from involved function names

2021-01-12 Thread Oleksandr Tyshchenko
From: Oleksandr Tyshchenko This patch removes "hvm" prefixes and infixes from IOREQ related function names in the common code and performs a renaming where appropriate according to the more consistent new naming scheme: - IOREQ server functions should start with "ioreq_server_" - IOREQ functions

[PATCH V4 24/24] [RFC] libxl: Add support for virtio-disk configuration

2021-01-12 Thread Oleksandr Tyshchenko
From: Oleksandr Tyshchenko This patch adds basic support for configuring and assisting virtio-disk backend (emualator) which is intended to run out of Qemu and could be run in any domain. Xenstore was chosen as a communication interface for the emulator running in non-toolstack domain to be able

[PATCH V4 10/24] xen/ioreq: Move x86's io_completion/io_req fields to struct vcpu

2021-01-12 Thread Oleksandr Tyshchenko
From: Oleksandr Tyshchenko The IOREQ is a common feature now and these fields will be used on Arm as is. Move them to common struct vcpu as a part of new struct vcpu_io and drop duplicating "io" prefixes. Also move enum hvm_io_completion to xen/sched.h and remove "hvm" prefixes. This patch compl

  1   2   >