[linux-5.4 test] 158387: tolerable FAIL - PUSHED

2021-01-12 Thread osstest service owner
flight 158387 linux-5.4 real [real] http://logs.test-lab.xenproject.org/osstest/logs/158387/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stopfail like 158297 test-amd64-i386-xl-qemut-win7-amd64 19

[xen-unstable bisection] complete test-arm64-arm64-xl

2021-01-12 Thread osstest service owner
branch xen-unstable xenbranch xen-unstable job test-arm64-arm64-xl testid xen-boot Tree: linux git://xenbits.xen.org/linux-pvops.git Tree: linuxfirmware git://xenbits.xen.org/osstest/linux-firmware.git Tree: qemuu git://xenbits.xen.org/qemu-xen.git Tree: xen git://xenbits.xen.org/xen.git *** Foun

[linux-linus test] 158384: regressions - FAIL

2021-01-12 Thread osstest service owner
flight 158384 linux-linus real [real] http://logs.test-lab.xenproject.org/osstest/logs/158384/ 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

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

2021-01-12 Thread Tian, Kevin
> From: Roger Pau Monne > Sent: Wednesday, January 13, 2021 1:33 AM > > 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 gi

[xen-unstable test] 158379: regressions - FAIL

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

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

2021-01-12 Thread Tomasz Figa
On Wed, Jan 13, 2021 at 12:56 PM Florian Fainelli wrote: > > > > On 1/12/2021 6:29 PM, Tomasz Figa wrote: > > Hi Florian, > > > > On Wed, Jan 13, 2021 at 3:01 AM Florian Fainelli > > wrote: > >> > >> On 1/11/21 11:48 PM, Claire Chang wrote: > >>> On Fri, Jan 8, 2021 at 1:59 AM Florian Fainelli

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

2021-01-12 Thread Tomasz Figa
Hi Florian, On Wed, Jan 13, 2021 at 3:01 AM Florian Fainelli wrote: > > 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 i

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

2021-01-12 Thread Florian Fainelli
On 1/12/2021 8:25 PM, Tomasz Figa wrote: > On Wed, Jan 13, 2021 at 12:56 PM Florian Fainelli > wrote: >> >> >> >> On 1/12/2021 6:29 PM, Tomasz Figa wrote: >>> Hi Florian, >>> >>> On Wed, Jan 13, 2021 at 3:01 AM Florian Fainelli >>> wrote: On 1/11/21 11:48 PM, Claire Chang wrote: >>

[qemu-mainline test] 158382: regressions - FAIL

2021-01-12 Thread osstest service owner
flight 158382 qemu-mainline real [real] http://logs.test-lab.xenproject.org/osstest/logs/158382/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-libvirt-vhd 19 guest-start/debian.repeat fail REGR. vs. 152631 test-amd64-amd64

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

2021-01-12 Thread Florian Fainelli
On 1/12/2021 6:29 PM, Tomasz Figa wrote: > Hi Florian, > > On Wed, Jan 13, 2021 at 3:01 AM Florian Fainelli wrote: >> >> 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 yo

Re: [PATCH] OvmfPkg/XenPlatformPei: Use CPUID to get physical address width on Xen

2021-01-12 Thread Laszlo Ersek
On 01/13/21 04:42, Igor Druzhinin wrote: > We faced a problem with passing through a PCI device with 64GB BAR to > UEFI guest. The BAR is expectedly programmed into 64-bit PCI aperture at > 64G address which pushes physical address space to 37 bits. That is above > 36-bit width that OVMF exposes cu

[PATCH] OvmfPkg/XenPlatformPei: Use CPUID to get physical address width on Xen

2021-01-12 Thread Igor Druzhinin
We faced a problem with passing through a PCI device with 64GB BAR to UEFI guest. The BAR is expectedly programmed into 64-bit PCI aperture at 64G address which pushes physical address space to 37 bits. That is above 36-bit width that OVMF exposes currently to a guest without tweaking PcdPciMmio64S

Inconsistent console behavior during HVM direct boot

2021-01-12 Thread Tamas K Lengyel
While direct booting a Linux kernel into an HVM VM no console output is received if serial="pty" is set in the VM config but the kernel command line specifies "console=hvc0". If "console=ttyS0" is specified then the console output is received as expected. Conversely, if the serial line is commented

[PATCH] x86/mem_sharing: fix wrong field name used in 2c5119d

2021-01-12 Thread Tamas K Lengyel
The arch_domain struct has "msr", not "msrs". Reported-by: Andrew Cooper Signed-off-by: Tamas K Lengyel --- I've build tested originally with "msr" but typod "msrs" when creating the patch that was sent in. Sorry for the noise. --- xen/arch/x86/mm/mem_sharing.c | 2 +- 1 file changed, 1 inserti

Re: [RFC PATCH v3 2/6] swiotlb: Add restricted DMA pool

2021-01-12 Thread Robin Murphy
On 2021-01-07 17:57, Konrad Rzeszutek Wilk wrote: On Fri, Jan 08, 2021 at 01:39:18AM +0800, Claire Chang wrote: Hi Greg and Konrad, This change is intended to be non-arch specific. Any arch that lacks DMA access control and has devices not behind an IOMMU can make use of it. Could you share why

Re: [RESEND] [RFC PATCH] xen/arm: domain_build: Ignore empty memory bank

2021-01-12 Thread Elliott Mitchell
On Mon, Jan 11, 2021 at 04:49:57PM -0800, Stefano Stabellini wrote: > On Mon, 4 Jan 2021, Elliott Mitchell wrote: > > On Mon, Dec 21, 2020 at 06:28:35PM +, Julien Grall wrote: > > > So I think we first need to figure out what is the offending node and > > > why it is dt_device_get_address() is

Re: [RFC PATCH v3 2/6] swiotlb: Add restricted DMA pool

2021-01-12 Thread Florian Fainelli
On 1/5/21 7:41 PM, Claire Chang wrote: > Add the initialization function to create restricted DMA pools from > matching reserved-memory nodes in the device tree. > > Signed-off-by: Claire Chang > --- > include/linux/device.h | 4 ++ > include/linux/swiotlb.h | 7 +- > kernel/dma/Kconfig

Re: [RFC PATCH v3 2/6] swiotlb: Add restricted DMA pool

2021-01-12 Thread Florian Fainelli
On 1/7/21 1:19 PM, Konrad Rzeszutek Wilk wrote: > On Thu, Jan 07, 2021 at 10:09:14AM -0800, Florian Fainelli wrote: >> On 1/7/21 9:57 AM, Konrad Rzeszutek Wilk wrote: >>> On Fri, Jan 08, 2021 at 01:39:18AM +0800, Claire Chang wrote: Hi Greg and Konrad, This change is intended to be n

Re: [RFC PATCH v3 6/6] of: Add plumbing for restricted DMA pool

2021-01-12 Thread Florian Fainelli
On 1/5/21 7:41 PM, Claire Chang wrote: > If a device is not behind an IOMMU, we look up the device node and set > up the restricted DMA when the restricted-dma-pool is presented. > > Signed-off-by: Claire Chang > --- [snip] > +int of_dma_set_restricted_buffer(struct device *dev) > +{ > + st

IRQ latency measurements in hypervisor

2021-01-12 Thread Volodymyr Babchuk
Hello community, Recently I was experimenting with context switching latencies in Xen. I want to share my findings and discuss some issues I have found. My target was to ensure that no more 30us passes between interrupt generation and handling in a guest VM. Main goal was to determine if Xen is

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

2021-01-12 Thread Stefano Stabellini
Don't read aarch32 system registers at boot time when the aarch32 state is not available at EL0. 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 when aarch32 is available. Leave the corresponding fie

Re: [RFC PATCH v3 4/6] swiotlb: Add restricted DMA alloc/free support.

2021-01-12 Thread Florian Fainelli
On 1/5/21 7:41 PM, Claire Chang wrote: > Add the functions, swiotlb_alloc and swiotlb_free to support the > memory allocation from restricted DMA pool. > > Signed-off-by: Claire Chang > --- [snip] > diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c > index 30ccbc08e229..126e9b3354d6 100644

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

2021-01-12 Thread Stefano Stabellini
On Tue, 12 Jan 2021, Stefano Stabellini wrote: > On Tue, 12 Jan 2021, Jan Beulich wrote: > > 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 n

Re: [RFC PATCH v3 3/6] swiotlb: Use restricted DMA pool if available

2021-01-12 Thread Florian Fainelli
On 1/5/21 7:41 PM, Claire Chang wrote: > Regardless of swiotlb setting, the restricted DMA pool is preferred if > available. > > The restricted DMA pools provide a basic level of protection against > the DMA overwriting buffer contents at unexpected times. However, to > protect against general dat

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

2021-01-12 Thread Stefano Stabellini
On Tue, 12 Jan 2021, Jan Beulich wrote: > 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

[xen-unstable-smoke test] 158388: tolerable all pass - PUSHED

2021-01-12 Thread osstest service owner
flight 158388 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/158388/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-amd64-libvirt 15 migrate-support-checkfail never pass test-arm64-arm64-xl-xsm 1

Re: [PATCH V3 09/23] xen/dm: Make x86's DM feature common

2021-01-12 Thread Oleksandr
Hi Jan. On 07.01.21 18:49, Oleksandr wrote: On 07.01.21 17:01, Jan Beulich wrote: Hi Jan, all On 07.01.2021 15:38, Oleksandr wrote: Well, on v2 you replied you didn't consider the alternative. I would have expected that you would at least go through this consideration process, and see wh

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 21:05, Stefano Stabellini wrote: > > 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 t

[PATCH V4 19/24] xen/arm: io: Abstract sign-extension

2021-01-12 Thread Oleksandr Tyshchenko
From: Oleksandr Tyshchenko In order to avoid code duplication (both handle_read() and handle_ioserv() contain the same code for the sign-extension) put this code to a common helper to be used for both. Signed-off-by: Oleksandr Tyshchenko CC: Julien Grall [On Arm only] Tested-by: Wei Chen ---

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

2021-01-12 Thread Oleksandr Tyshchenko
From: Oleksandr Tyshchenko As the IOREQ is a common feature now and we also need to invalidate qemu/demu mapcache on Arm when the required condition occurs this patch moves this function to the common code (and remames it to ioreq_signal_mapcache_invalidate). This patch also moves per-domain qemu

[PATCH V4 09/24] xen/ioreq: Make x86's IOREQ related dm-op handling common

2021-01-12 Thread Oleksandr Tyshchenko
From: Julien Grall As a lot of x86 code can be re-used on Arm later on, this patch moves the IOREQ related dm-op handling to the common code. The idea is to have the top level dm-op handling arch-specific and call into ioreq_server_dm_op() for otherwise unhandled ops. Pros: - More natural than d

[PATCH V4 16/24] xen/mm: Handle properly reference in set_foreign_p2m_entry() on Arm

2021-01-12 Thread Oleksandr Tyshchenko
From: Oleksandr Tyshchenko This patch implements reference counting of foreign entries in in set_foreign_p2m_entry() on Arm. This is a mandatory action if we want to run emulator (IOREQ server) in other than dom0 domain, as we can't trust it to do the right thing if it is not running in dom0. So

[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

[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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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

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

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 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 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 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 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 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

[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

[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 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 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 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 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 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

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

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

[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

[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] 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: 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] 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/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] 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] 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/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] 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/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/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: 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] 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] 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 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] 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: 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] 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: 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

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

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: [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

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

[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

[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

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

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

  1   2   >