[ovmf test] 161899: all pass - PUSHED

2021-05-10 Thread osstest service owner
flight 161899 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/161899/ Perfect :-) All tests in this flight passed as required version targeted for testing: ovmf ef3840c1ff320698523dd6b94ba7c86354392784 baseline version: ovmf

[qemu-mainline test] 161896: regressions - FAIL

2021-05-10 Thread osstest service owner
flight 161896 qemu-mainline real [real] http://logs.test-lab.xenproject.org/osstest/logs/161896/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-qemuu-freebsd11-amd64 16 guest-saverestore fail REGR. vs. 152631

Re: Regression when booting 5.15 as dom0 on arm64 (WAS: Re: [linux-linus test] 161829: regressions - FAIL)

2021-05-10 Thread Stefano Stabellini
On Mon, 10 May 2021, Christoph Hellwig wrote: > On Sat, May 08, 2021 at 12:32:37AM +0100, Julien Grall wrote: > > The pointer dereferenced seems to suggest that the swiotlb hasn't been > > allocated. From what I can tell, this may be because swiotlb_force is set > > to SWIOTLB_NO_FORCE, we will

[linux-linus test] 161894: regressions - FAIL

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

RE: Discussion of Xenheap problems on AArch64

2021-05-10 Thread Henry Wang
Hi Julien, > From: Julien Grall > Hi Henry, > > On 07/05/2021 05:06, Henry Wang wrote: > >> From: Julien Grall > >> On 28/04/2021 10:28, Henry Wang wrote: > [...] > > > when I continue booting Xen, I got following error log: > > > > (XEN) CPU:0 > > (XEN) PC: 002b5a5c

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

2021-05-10 Thread osstest service owner
flight 161897 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/161897/ 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

[ovmf test] 161895: all pass - PUSHED

2021-05-10 Thread osstest service owner
flight 161895 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/161895/ Perfect :-) All tests in this flight passed as required version targeted for testing: ovmf 375f2d8e684dce2ab6f375382f35e546c7ab62ee baseline version: ovmf

Re: [PATCH] xen-netback: Check for hotplug-status existence before watching

2021-05-10 Thread Marek Marczykowski-Górecki
On Mon, May 10, 2021 at 08:06:55PM +0100, Michael Brown wrote: > If you have a suggested patch, I'm happy to test that it doesn't reintroduce > the regression bug that was fixed by this commit. Actually, I've just tested with a simple reloading xen-netfront module. It seems in this case, the

Re: [PATCH] xen-netback: Check for hotplug-status existence before watching

2021-05-10 Thread Michael Brown
On 10/05/2021 19:53, Marek Marczykowski-Górecki wrote: On Mon, May 10, 2021 at 07:47:01PM +0100, Michael Brown wrote: That doesn't sound plausible to me. In the setup as you describe, how is the kernel expected to differentiate between "hotplug script has not yet created the node" and "hotplug

Re: Regression when booting 5.15 as dom0 on arm64 (WAS: Re: [linux-linus test] 161829: regressions - FAIL)

2021-05-10 Thread Florian Fainelli
On 5/10/2021 11:15 AM, Julien Grall wrote: > Hi Christoph, > > On 10/05/2021 09:40, Christoph Hellwig wrote: >> On Sat, May 08, 2021 at 12:32:37AM +0100, Julien Grall wrote: >>> The pointer dereferenced seems to suggest that the swiotlb hasn't been >>> allocated. From what I can tell, this may

Re: [PATCH] xen-netback: Check for hotplug-status existence before watching

2021-05-10 Thread Marek Marczykowski-Górecki
On Mon, May 10, 2021 at 07:47:01PM +0100, Michael Brown wrote: > On 10/05/2021 19:32, Marek Marczykowski-Górecki wrote: > > On Tue, Apr 13, 2021 at 04:25:12PM +0100, Michael Brown wrote: > > > The logic in connect() is currently written with the assumption that > > > xenbus_watch_pathfmt() will

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

2021-05-10 Thread osstest service owner
flight 161893 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/161893/ 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

Re: [PATCH] xen-netback: Check for hotplug-status existence before watching

2021-05-10 Thread Michael Brown
On 10/05/2021 19:32, Marek Marczykowski-Górecki wrote: On Tue, Apr 13, 2021 at 04:25:12PM +0100, Michael Brown wrote: The logic in connect() is currently written with the assumption that xenbus_watch_pathfmt() will return an error for a node that does not exist. This assumption is incorrect:

Re: [PATCH] xen-netback: Check for hotplug-status existence before watching

2021-05-10 Thread Marek Marczykowski-Górecki
On Tue, Apr 13, 2021 at 04:25:12PM +0100, Michael Brown wrote: > The logic in connect() is currently written with the assumption that > xenbus_watch_pathfmt() will return an error for a node that does not > exist. This assumption is incorrect: xenstore does allow a watch to > be registered for a

Re: Regression when booting 5.15 as dom0 on arm64 (WAS: Re: [linux-linus test] 161829: regressions - FAIL)

2021-05-10 Thread Julien Grall
Hi Christoph, On 10/05/2021 09:40, Christoph Hellwig wrote: On Sat, May 08, 2021 at 12:32:37AM +0100, Julien Grall wrote: The pointer dereferenced seems to suggest that the swiotlb hasn't been allocated. From what I can tell, this may be because swiotlb_force is set to SWIOTLB_NO_FORCE, we

PING Re: [PATCH 00/14] Use const whether we point to literal strings (take 1)

2021-05-10 Thread Julien Grall
Hi, Ian, Wei, Anthony, can I get some feedbacks on the tools side? Cheers, On 05/04/2021 16:56, Julien Grall wrote: From: Julien Grall Hi all, By default, both Clang and GCC will happily compile C code where non-const char * point to literal strings. This means the following code will be

PING Re: [PATCH v2] xen/arm: kernel: Propagate the error if we fail to decompress the kernel

2021-05-10 Thread Julien Grall
On 18/04/2021 19:26, Julien Grall wrote: On 12/04/2021 07:45, Michal Orzel wrote: On 06.04.2021 21:15, Julien Grall wrote: From: Julien Grall Currently, we are ignoring any error from perform_gunzip() and replacing the compressed kernel with the "uncompressed" kernel. If there is a gzip

Re: Ping: [PATCH] build: centralize / unify asm-offsets generation

2021-05-10 Thread Julien Grall
Hi Jan, Sorry for the late answer. On 29/04/2021 10:18, Jan Beulich wrote: On 27.04.2021 16:13, Roger Pau Monné wrote: Acked-by: Roger Pau Monné Thanks Roger. Julien, Stefano, may I ask for an Arm side ack (or otherwise) here as well? Acked-by: Julien Grall I will let you commit the

Re: [PATCH] optee: enable OPTEE_SMC_SEC_CAP_MEMREF_NULL capability

2021-05-10 Thread Julien Grall
Hi Volodymyr, On 07/05/2021 02:39, Volodymyr Babchuk wrote: OP-TEE mediator already have support for NULL memory references. It was added in patch 0dbed3ad336 ("optee: allow plain TMEM buffers with NULL address"). But it does not propagate OPTEE_SMC_SEC_CAP_MEMREF_NULL capability flag to a

Re: [PATCH] tools/xenstore: Fix indentation in the header of xenstored_control.c

2021-05-10 Thread Julien Grall
Hi Juergen, On 10/05/2021 16:12, Juergen Gross wrote: On 10.05.21 17:07, Julien Grall wrote: From: Julien Grall Commit e867af081d94 "tools/xenstore: save new binary for live update" seemed to have spuriously changed the indentation of the first line of the copyright header. The previous

Re: [PATCH] tools/xenstored: Prevent a buffer overflow in dump_state_node_perms()

2021-05-10 Thread Julien Grall
Hi Juergen, On 10/05/2021 08:49, Juergen Gross wrote: On 06.05.21 18:12, Julien Grall wrote: From: Julien Grall ASAN reported one issue when Live Updating Xenstored: = ==873==ERROR: AddressSanitizer: stack-buffer-overflow on

Re: [PATCH v3 00/10] arm64: Get rid of READ/WRITE_SYSREG32

2021-05-10 Thread Julien Grall
Hi Michal, On 05/05/2021 08:42, Michal Orzel wrote: The purpose of this patch series is to remove usage of 32bit helper macros READ/WRITE_SYSREG32 on arm64 as the idea of them is not following the latest ARMv8 specification and mrs/msr instructions are expecting 64bit values. According to ARM

Re: [PATCH v3 02/10] arm/domain: Get rid of READ/WRITE_SYSREG32

2021-05-10 Thread Julien Grall
On 06/05/2021 07:13, Michal Orzel wrote: Hi Julien, Hi Michal, On 05.05.2021 20:03, Julien Grall wrote: Hi Michal, On 05/05/2021 08:43, Michal Orzel wrote: AArch64 registers are 64bit whereas AArch32 registers are 32bit or 64bit. MSR/MRS are expecting 64bit values thus we should get

Re: Discussion of Xenheap problems on AArch64

2021-05-10 Thread Julien Grall
Hi Henry, On 07/05/2021 05:06, Henry Wang wrote: From: Julien Grall On 28/04/2021 10:28, Henry Wang wrote: Hi Julien, Hi Henry, I've done some test about the patch series in https://xenbits.xen.org/gitweb/?p=people/julieng/xen- unstable.git;a=shortlog;h=refs/heads/pt/rfc-v2 Thanks

[qemu-mainline test] 161890: regressions - trouble: fail/pass/starved

2021-05-10 Thread osstest service owner
flight 161890 qemu-mainline real [real] http://logs.test-lab.xenproject.org/osstest/logs/161890/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-qemuu-freebsd11-amd64 16 guest-saverestore fail REGR. vs. 152631

[linux-linus test] 161891: regressions - trouble: blocked/fail/pass/starved

2021-05-10 Thread osstest service owner
flight 161891 linux-linus real [real] http://logs.test-lab.xenproject.org/osstest/logs/161891/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-amd64 6 xen-buildfail REGR. vs. 152332 build-arm64

[PATCH v5 2/2] xen/pci: Refactor MSI code that implements MSI functionality within XEN

2021-05-10 Thread Rahul Singh
MSI code that implements MSI functionality to support MSI within XEN is not usable on ARM. Move the code under CONFIG_HAS_PCI_MSI_INTERCEPT flag to gate the code for ARM. Currently, we have no idea how MSI functionality will be supported for other architecture therefore we have decided to move

[PATCH v5 1/2] xen/pci: Refactor PCI MSI intercept related code

2021-05-10 Thread Rahul Singh
MSI intercept related code is not useful for ARM when MSI interrupts are injected via GICv3 ITS. Therefore introducing the new flag CONFIG_HAS_PCI_MSI_INTERCEPT to gate the MSI code for ARM in common code and also implemented the stub version for the unused code for ARM to avoid compilation error

[PATCH v5 0/2] xen/pci: Make PCI passthrough code non-x86 specific

2021-05-10 Thread Rahul Singh
This patch series is preparatory work to implement the PCI passthrough support for the ARM architecture. Rahul Singh (2): xen/pci: Refactor PCI MSI intercept related code xen/pci: Refactor MSI code that implements MSI functionality within XEN xen/arch/x86/Kconfig| 1

Re: [PATCH] tools/xenstore: Fix indentation in the header of xenstored_control.c

2021-05-10 Thread Juergen Gross
On 10.05.21 17:07, Julien Grall wrote: From: Julien Grall Commit e867af081d94 "tools/xenstore: save new binary for live update" seemed to have spuriously changed the indentation of the first line of the copyright header. The previous indentation is re-instated so all the lines are indented

[PATCH] tools/xenstore: Fix indentation in the header of xenstored_control.c

2021-05-10 Thread Julien Grall
From: Julien Grall Commit e867af081d94 "tools/xenstore: save new binary for live update" seemed to have spuriously changed the indentation of the first line of the copyright header. The previous indentation is re-instated so all the lines are indented the same. Reported-by: Bjoern Doebel

Re: [PATCH v6 08/15] swiotlb: Bounce data from/to restricted DMA pool if available

2021-05-10 Thread Christoph Hellwig
> +static inline bool is_dev_swiotlb_force(struct device *dev) > +{ > +#ifdef CONFIG_DMA_RESTRICTED_POOL > + if (dev->dma_io_tlb_mem) > + return true; > +#endif /* CONFIG_DMA_RESTRICTED_POOL */ > + return false; > +} > + > /* If SWIOTLB is active, use its maximum mapping

Re: [PATCH v6 05/15] swiotlb: Add a new get_io_tlb_mem getter

2021-05-10 Thread Christoph Hellwig
> +static inline struct io_tlb_mem *get_io_tlb_mem(struct device *dev) > +{ > +#ifdef CONFIG_DMA_RESTRICTED_POOL > + if (dev && dev->dma_io_tlb_mem) > + return dev->dma_io_tlb_mem; > +#endif /* CONFIG_DMA_RESTRICTED_POOL */ > + > + return io_tlb_default_mem; Given that we're

Re: [PATCH v6 04/15] swiotlb: Add restricted DMA pool initialization

2021-05-10 Thread Christoph Hellwig
> +#ifdef CONFIG_DMA_RESTRICTED_POOL > +#include > +#include > +#include > +#include > +#include > +#endif I don't think any of this belongs into swiotlb.c. Marking swiotlb_init_io_tlb_mem non-static and having all this code in a separate file is probably a better idea. > +#ifdef

Re: [PATCH v6 02/15] swiotlb: Refactor swiotlb_create_debugfs

2021-05-10 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH v6 01/15] swiotlb: Refactor swiotlb init functions

2021-05-10 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [XEN PATCH 0/8] Fix libxl with QEMU 6.0 + remove some more deprecated usages.

2021-05-10 Thread Anthony PERARD
On Mon, May 03, 2021 at 10:13:57AM -0400, Jason Andryuk wrote: > On Fri, Apr 23, 2021 at 12:16 PM Anthony PERARD > wrote: > > > > Patch series available in this git branch: > > https://xenbits.xen.org/git-http/people/aperard/xen-unstable.git > > br.deprecated-qemu-qmp-and-cmd-v1 > > > > The Xen

Re: [XEN PATCH 1/8] libxl: Replace deprecated QMP command by "query-cpus-fast"

2021-05-10 Thread Anthony PERARD
On Wed, Apr 28, 2021 at 12:53:12PM -0400, Jason Andryuk wrote: > On Fri, Apr 23, 2021 at 12:16 PM Anthony PERARD > wrote: > > +static int qmp_parse_query_cpus_fast(libxl__gc *gc, > > + libxl_domid domid, > > + const

Re: [PATCH v2 13/13] vtpm: Correct timeout units and command duration

2021-05-10 Thread Daniel P. Smith
On 5/6/21 9:59 AM, Jason Andryuk wrote: > Add two patches: > vtpm-microsecond-duration.patch fixes the units for timeouts and command > durations. > vtpm-command-duration.patch increases the timeout linux uses to allow > commands to succeed. > > Linux works around low timeouts, but not low

Re: [PATCH v2 12/13] vtpmmgr: Check req_len before unpacking command

2021-05-10 Thread Daniel P. Smith
On 5/6/21 9:59 AM, Jason Andryuk wrote: > vtpm_handle_cmd doesn't ensure there is enough space before unpacking > the req buffer. Add a minimum size check. Called functions will have > to do their own checking if they need more data from the request. > > The error case is tricky since

Re: [PATCH 1/3] xen: check required Xen features

2021-05-10 Thread Juergen Gross
On 10.05.21 14:11, Boris Ostrovsky wrote: On 4/22/21 11:10 AM, Juergen Gross wrote: +/* + * Linux kernel expects at least Xen 4.0. + * + * Assume some features to be available for that reason (depending on guest + * mode, of course). + */ +#define chk_feature(f) {

Re: [PATCH v2 11/13] vtpmmgr: Fix owner_auth & srk_auth parsing

2021-05-10 Thread Daniel P. Smith
On 5/6/21 9:59 AM, Jason Andryuk wrote: > Argument parsing only matches to before ':' and then the string with > leading ':' is passed to parse_auth_string which fails to parse. Extend > the length to include the seperator in the match. > > While here, switch the seperator to "=". The man page

[xen-unstable test] 161888: tolerable FAIL

2021-05-10 Thread osstest service owner
flight 161888 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/161888/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking): test-armhf-armhf-examine 8 reboot fail pass in 161872 Tests which did not succeed,

Re: [PATCH v2 10/13] vtpmmgr: Remove bogus cast from TPM2_GetRandom

2021-05-10 Thread Daniel P. Smith
On 5/6/21 9:59 AM, Jason Andryuk wrote: > The UINT32 <-> UINT16 casting in TPM2_GetRandom is incorrect. Use a > local UINT16 as needed for the TPM hardware command and assign the > result. > > Suggested-by: Samuel Thibault > Signed-off-by: Jason Andryuk > --- Reviewed-by: Daniel P. Smith >

Re: [PATCH v2 09/13] vtpmmgr: Support GetRandom passthrough on TPM 2.0

2021-05-10 Thread Daniel P. Smith
On 5/6/21 9:59 AM, Jason Andryuk wrote: > GetRandom passthrough currently fails when using vtpmmgr with a hardware > TPM 2.0. > vtpmmgr (8): INFO[VTPM]: Passthrough: TPM_GetRandom > vtpm (12): vtpm_cmd.c:120: Error: TPM_GetRandom() failed with error code (30) > > When running on TPM 2.0 hardware,

Re: [PATCH v2 08/13] vtpmmgr: Shutdown more gracefully

2021-05-10 Thread Daniel P. Smith
On 5/6/21 9:59 AM, Jason Andryuk wrote: > vtpmmgr uses the default, weak app_shutdown, which immediately calls the > shutdown hypercall. This short circuits the vtpmmgr clean up logic. We > need to perform the clean up to actually Flush our key out of the tpm. > > Setting do_shutdown is one

Re: [PATCH v2 07/13] vtpmmgr: Flush all transient keys

2021-05-10 Thread Daniel P. Smith
On 5/6/21 9:59 AM, Jason Andryuk wrote: > We're only flushing 2 transients, but there are 3 handles. Use <= to also > flush the third handle since TRANSIENT_LAST is inclusive > > The number of transient handles/keys is hardware dependent, so this > should query for the limit. And assignment of

Re: [PATCH v2 06/13] vtpmmgr: Flush transient keys on shutdown

2021-05-10 Thread Daniel P. Smith
On 5/6/21 9:59 AM, Jason Andryuk wrote: > Remove our key so it isn't left in the TPM for someone to come along > after vtpmmgr shutsdown. > > Signed-off-by: Jason Andryuk > Reviewed-by: Samuel Thibault > --- Reviewed-by: Daniel P. Smith > stubdom/vtpmmgr/init.c | 8 > 1 file

Re: [PATCH 1/3] xen: check required Xen features

2021-05-10 Thread Boris Ostrovsky
On 4/22/21 11:10 AM, Juergen Gross wrote: > > +/* > + * Linux kernel expects at least Xen 4.0. > + * > + * Assume some features to be available for that reason (depending on guest > + * mode, of course). > + */ > +#define chk_feature(f) { \ > +

Re: [PATCH v2 04/13] vtpmmgr: Allow specifying srk_handle for TPM2

2021-05-10 Thread Daniel P. Smith
On 5/6/21 9:59 AM, Jason Andryuk wrote: > Bypass taking ownership of the TPM2 if an srk_handle is specified. > > This srk_handle must be usable with Null auth for the time being. > > Signed-off-by: Jason Andryuk > --- Reviewed-by: Daniel P. Smith > v2: Use "=" seperator > --- >

Re: [PATCH 0/3] xen: remove some checks for always present Xen features

2021-05-10 Thread Peter Zijlstra
On Mon, May 10, 2021 at 09:34:18AM +0200, Juergen Gross wrote: > On 22.04.21 17:10, Juergen Gross wrote: > > Some features of Xen can be assumed to be always present, so add a > > central check to verify this being true and remove the other checks. > > > > Juergen Gross (3): > >xen: check

Re: [PATCH v5 00/16] Restricted DMA

2021-05-10 Thread Claire Chang
v6: https://lore.kernel.org/patchwork/cover/1423201/

[PATCH v6 15/15] of: Add plumbing for restricted DMA pool

2021-05-10 Thread Claire Chang
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 --- drivers/of/address.c| 25 + drivers/of/device.c | 3 +++ drivers/of/of_private.h | 5 + 3

[PATCH v6 14/15] dt-bindings: of: Add restricted DMA pool

2021-05-10 Thread Claire Chang
Introduce the new compatible string, restricted-dma-pool, for restricted DMA. One can specify the address and length of the restricted DMA memory region by restricted-dma-pool in the reserved-memory node. Signed-off-by: Claire Chang --- .../reserved-memory/reserved-memory.txt | 27

[PATCH v6 12/15] swiotlb: Add restricted DMA alloc/free support.

2021-05-10 Thread Claire Chang
Add the functions, swiotlb_{alloc,free} to support the memory allocation from restricted DMA pool. Signed-off-by: Claire Chang --- include/linux/swiotlb.h | 4 kernel/dma/swiotlb.c| 35 +-- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git

[PATCH v6 13/15] dma-direct: Allocate memory from restricted DMA pool if available

2021-05-10 Thread Claire Chang
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 data leakage and system memory corruption, the system needs to provide a way to lock

[PATCH v6 11/15] dma-direct: Add a new wrapper __dma_direct_free_pages()

2021-05-10 Thread Claire Chang
Add a new wrapper __dma_direct_free_pages() that will be useful later for swiotlb_free(). Signed-off-by: Claire Chang --- kernel/dma/direct.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c index

[PATCH v6 10/15] swiotlb: Refactor swiotlb_tbl_unmap_single

2021-05-10 Thread Claire Chang
Add a new function, release_slots, to make the code reusable for supporting different bounce buffer pools, e.g. restricted DMA pool. Signed-off-by: Claire Chang --- kernel/dma/swiotlb.c | 35 --- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git

[PATCH v6 09/15] swiotlb: Move alloc_size to find_slots

2021-05-10 Thread Claire Chang
Move the maintenance of alloc_size to find_slots for better code reusability later. Signed-off-by: Claire Chang --- kernel/dma/swiotlb.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index 3f1ad080a4bc..ef04d8f7708f

[PATCH v6 08/15] swiotlb: Bounce data from/to restricted DMA pool if available

2021-05-10 Thread Claire Chang
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 data leakage and system memory corruption, the system

[PATCH v6 07/15] swiotlb: Update is_swiotlb_active to add a struct device argument

2021-05-10 Thread Claire Chang
Update is_swiotlb_active to add a struct device argument. This will be useful later to allow for restricted DMA pool. Signed-off-by: Claire Chang --- drivers/gpu/drm/i915/gem/i915_gem_internal.c | 2 +- drivers/gpu/drm/nouveau/nouveau_ttm.c| 2 +- drivers/pci/xen-pcifront.c

[PATCH v6 06/15] swiotlb: Update is_swiotlb_buffer to add a struct device argument

2021-05-10 Thread Claire Chang
Update is_swiotlb_buffer to add a struct device argument. This will be useful later to allow for restricted DMA pool. Signed-off-by: Claire Chang --- drivers/iommu/dma-iommu.c | 12 ++-- drivers/xen/swiotlb-xen.c | 2 +- include/linux/swiotlb.h | 6 +++--- kernel/dma/direct.c

[PATCH v6 05/15] swiotlb: Add a new get_io_tlb_mem getter

2021-05-10 Thread Claire Chang
Add a new getter, get_io_tlb_mem, to help select the io_tlb_mem struct. The restricted DMA pool is preferred if available. Signed-off-by: Claire Chang --- include/linux/swiotlb.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h

[PATCH v6 04/15] swiotlb: Add restricted DMA pool initialization

2021-05-10 Thread Claire Chang
Add the initialization function to create restricted DMA pools from matching reserved-memory nodes. Signed-off-by: Claire Chang --- include/linux/device.h | 4 +++ include/linux/swiotlb.h | 3 +- kernel/dma/swiotlb.c| 79 + 3 files changed, 85

[PATCH v6 03/15] swiotlb: Add DMA_RESTRICTED_POOL

2021-05-10 Thread Claire Chang
Add a new kconfig symbol, DMA_RESTRICTED_POOL, for restricted DMA pool. Signed-off-by: Claire Chang --- kernel/dma/Kconfig | 14 ++ 1 file changed, 14 insertions(+) diff --git a/kernel/dma/Kconfig b/kernel/dma/Kconfig index 77b405508743..3e961dc39634 100644 --- a/kernel/dma/Kconfig

[PATCH v6 02/15] swiotlb: Refactor swiotlb_create_debugfs

2021-05-10 Thread Claire Chang
Split the debugfs creation to make the code reusable for supporting different bounce buffer pools, e.g. restricted DMA pool. Signed-off-by: Claire Chang --- kernel/dma/swiotlb.c | 22 -- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/kernel/dma/swiotlb.c

[PATCH v6 01/15] swiotlb: Refactor swiotlb init functions

2021-05-10 Thread Claire Chang
Add a new function, swiotlb_init_io_tlb_mem, for the io_tlb_mem struct initialization to make the code reusable. Note that we now also call set_memory_decrypted in swiotlb_init_with_tbl. Signed-off-by: Claire Chang --- kernel/dma/swiotlb.c | 51 ++-- 1

[PATCH v6 00/15] Restricted DMA

2021-05-10 Thread Claire Chang
From: Claire Chang This series implements mitigations for lack of DMA access control on systems without an IOMMU, which could result in the DMA accessing the system memory at unexpected times and/or unexpected addresses, possibly leading to data leakage or corruption. For example, we plan to

Re: [PATCH] xen/gntdev: fix gntdev_mmap() error exit path

2021-05-10 Thread Juergen Gross
On 23.04.21 07:40, Juergen Gross wrote: Commit d3eeb1d77c5d0af ("xen/gntdev: use mmu_interval_notifier_insert") introduced an error in gntdev_mmap(): in case the call of mmu_interval_notifier_insert_locked() fails the exit path should not call mmu_interval_notifier_remove(), as this might result

Re: [PATCH 1/1] xen/unpopulated-alloc: fix error return code in fill_list()

2021-05-10 Thread Juergen Gross
On 08.05.21 04:19, Zhen Lei wrote: Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: a4574f63edc6 ("mm/memremap_pages: convert to 'struct range'") Reported-by: Hulk Robot Signed-off-by: Zhen Lei Pushed to xen/tip.git

[PATCH v6 9/9] docs/doxygen: doxygen documentation for grant_table.h

2021-05-10 Thread Luca Fancellu
Modification to include/public/grant_table.h: 1) Add doxygen tags to: - Create Grant tables section - include variables in the generated documentation - Used @keepindent/@endkeepindent to enclose comment section that are indented using spaces, to keep the indentation. 2) Add .rst file

[PATCH v6 7/9] docs: Change Makefile and sphinx configuration for doxygen

2021-05-10 Thread Luca Fancellu
Modify docs/Makefile to call doxygen and generate sphinx html documentation given the doxygen XML output. Modify docs/conf.py sphinx configuration file to setup the breathe extension that works as bridge between sphinx and doxygen. Add some files to the .gitignore to ignore some generated files

[PATCH v6 6/9] docs: add doxygen preprocessor and related files

2021-05-10 Thread Luca Fancellu
Add preprocessor called by doxygen before parsing headers, it will include in every header a doxygen_include.h file that provides missing defines and includes that are usually passed by the compiler. Add doxy_input.list that is a text file containing the relative path to the source code file to

[PATCH v6 8/9] docs: hypercalls sphinx skeleton for generated html

2021-05-10 Thread Luca Fancellu
Create a skeleton for the documentation about hypercalls Signed-off-by: Luca Fancellu --- v6 changes: - Now every platform has the same sections in .rst files --- .gitignore | 1 + docs/Makefile | 4 docs/hypercall-interfaces/arm32.rst

[PATCH v6 5/9] docs: add checks to configure for sphinx and doxygen

2021-05-10 Thread Luca Fancellu
Add checks in the configure files to see if the system is capable of generate the sphinx html docs using doxygen and sphinx-breathe tools. Signed-off-by: Luca Fancellu --- config/Docs.mk.in | 2 + docs/configure| 258 ++ docs/configure.ac | 15

[PATCH v6 2/9] docs: add Xen png logo for the doxygen documentation

2021-05-10 Thread Luca Fancellu
Add the xen-doxygen folder for the doxygen template and add the Xen png logo in it. Signed-off-by: Luca Fancellu Acked-by: Stefano Stabellini --- docs/xen-doxygen/xen_project_logo_165x67.png | Bin 0 -> 18223 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644

[PATCH v6 4/9] m4/python: add function to docs_tool.m4 and new m4 module

2021-05-10 Thread Luca Fancellu
Add ax_python_module.m4 to have a way to check if a python module is installed in the system. Add a function to docs_tool.m4 to throw an error if the required docs tool is missing. Signed-off-by: Luca Fancellu --- m4/ax_python_module.m4 | 56 ++

[PATCH v6 0/9] Use Doxygen and sphinx for html documentation

2021-05-10 Thread Luca Fancellu
This serie introduce doxygen in the sphinx html docs generation. One benefit is to keep most of the documentation in the source files of xen so that it's more maintainable, on the other hand there are some limitation of doxygen that should be addressed modifying the current codebase (for example

[PATCH v6 3/9] docs: add doxygen templates

2021-05-10 Thread Luca Fancellu
Add doxygen templates for the doxygen documentation. Signed-off-by: Luca Fancellu Acked-by: Stefano Stabellini --- docs/xen-doxygen/customdoxygen.css | 36 +++ docs/xen-doxygen/footer.html | 21 +++ docs/xen-doxygen/header.html | 56

[PATCH v6 1/9] docs: add doxygen configuration file

2021-05-10 Thread Luca Fancellu
Add xen.doxyfile.in as template for the doxygen configuration file, it will be used to generate the doxygen documentation. Signed-off-by: Luca Fancellu Acked-by: Stefano Stabellini --- docs/xen.doxyfile.in | 2316 ++ 1 file changed, 2316 insertions(+)

Re: Regression when booting 5.15 as dom0 on arm64 (WAS: Re: [linux-linus test] 161829: regressions - FAIL)

2021-05-10 Thread Christoph Hellwig
On Sat, May 08, 2021 at 12:32:37AM +0100, Julien Grall wrote: > The pointer dereferenced seems to suggest that the swiotlb hasn't been > allocated. From what I can tell, this may be because swiotlb_force is set > to SWIOTLB_NO_FORCE, we will still enable the swiotlb when running on top > of

Re: [PATCH v1] tools: add newlines to xenstored WRL_LOG

2021-05-10 Thread Juergen Gross
On 10.05.21 10:34, Olaf Hering wrote: Am Mon, 10 May 2021 09:31:41 +0200 schrieb Juergen Gross : Mind doing the same for the two syslog() calls in xenstored_core.c lacking the newline? I will send a separate patch for them. Okay, in this case you can add my Reviewed-by: Juergen Gross to

[PATCH v3 5/5] tools/ocaml: Fix redefinition errors

2021-05-10 Thread Costin Lupu
If PAGE_SIZE is already defined in the system (e.g. in /usr/include/limits.h header) then gcc will trigger a redefinition error because of -Werror. This patch replaces usage of PAGE_* macros with XC_PAGE_* macros in order to avoid confusion between control domain page granularity (PAGE_*

[PATCH v3 4/5] tools/libs/gnttab: Fix PAGE_SIZE redefinition error

2021-05-10 Thread Costin Lupu
If PAGE_SIZE is already defined in the system (e.g. in /usr/include/limits.h header) then gcc will trigger a redefinition error because of -Werror. This patch replaces usage of PAGE_* macros with XC_PAGE_* macros in order to avoid confusion between control domain page granularity (PAGE_*

[PATCH v3 2/5] tools/libfsimage: Fix PATH_MAX redefinition error

2021-05-10 Thread Costin Lupu
If PATH_MAX is already defined in the system (e.g. in /usr/include/limits.h header) then gcc will trigger a redefinition error because of -Werror. Signed-off-by: Costin Lupu Reviewed-by: Julien Grall --- tools/libfsimage/ext2fs/fsys_ext2fs.c | 2 ++

[PATCH v3 1/5] tools/debugger: Fix PAGE_SIZE redefinition error

2021-05-10 Thread Costin Lupu
If PAGE_SIZE is already defined in the system (e.g. in /usr/include/limits.h header) then gcc will trigger a redefinition error because of -Werror. This patch replaces usage of PAGE_* macros with KDD_PAGE_* macros in order to avoid confusion between control domain page granularity (PAGE_*

[PATCH v3 3/5] tools/libs/foreignmemory: Fix PAGE_SIZE redefinition error

2021-05-10 Thread Costin Lupu
If PAGE_SIZE is already defined in the system (e.g. in /usr/include/limits.h header) then gcc will trigger a redefinition error because of -Werror. This patch replaces usage of PAGE_* macros with XC_PAGE_* macros in order to avoid confusion between control domain page granularity (PAGE_*

[PATCH v3 0/5] Fix redefinition errors for toolstack libs

2021-05-10 Thread Costin Lupu
For replication I used gcc 10.3 on an Alpine system. In order to replicate the redefinition error for PAGE_SIZE one should install the 'fortify-headers' package which will change the chain of included headers by indirectly including /usr/include/limits.h where PAGE_SIZE and PATH_MAX are defined.

Re: [PATCH v1] tools: add newlines to xenstored WRL_LOG

2021-05-10 Thread Olaf Hering
Am Mon, 10 May 2021 09:31:41 +0200 schrieb Juergen Gross : > Mind doing the same for the two syslog() calls in xenstored_core.c > lacking the newline? I will send a separate patch for them. Olaf pgprie3uURGQV.pgp Description: Digitale Signatur von OpenPGP

[linux-linus test] 161887: regressions - FAIL

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

Re: [PATCH 1/4] x86/xen/entry: Rename xenpv_exc_nmi to noist_exc_nmi

2021-05-10 Thread Juergen Gross
On 27.04.21 01:09, Lai Jiangshan wrote: From: Lai Jiangshan There is no any functionality change intended. Just rename it and move it to arch/x86/kernel/nmi.c so that we can resue it later in next patch for early NMI and kvm. Cc: Thomas Gleixner Cc: Paolo Bonzini Cc: Sean Christopherson

Re: [PATCH] tools/xenstored: Prevent a buffer overflow in dump_state_node_perms()

2021-05-10 Thread Juergen Gross
On 06.05.21 18:12, Julien Grall wrote: From: Julien Grall ASAN reported one issue when Live Updating Xenstored: = ==873==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffc194f53e0 at pc 0x555c6b323292 bp

Re: [PATCH 0/3] xen: remove some checks for always present Xen features

2021-05-10 Thread Juergen Gross
On 22.04.21 17:10, Juergen Gross wrote: Some features of Xen can be assumed to be always present, so add a central check to verify this being true and remove the other checks. Juergen Gross (3): xen: check required Xen features xen: assume XENFEAT_mmu_pt_update_preserve_ad being set for

Re: [PATCH v1] tools: add newlines to xenstored WRL_LOG

2021-05-10 Thread Juergen Gross
On 03.05.21 17:47, Olaf Hering wrote: According to syslog(3) the fmt string does not need a newline. The mini-os implementation of syslog requires the trailing newline. Other calls to syslog do include the newline already, add it also to WRL_LOG. Mind doing the same for the two syslog() calls

Re: [PATCH 1/1] xen/unpopulated-alloc: fix error return code in fill_list()

2021-05-10 Thread Juergen Gross
On 08.05.21 04:19, Zhen Lei wrote: Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: a4574f63edc6 ("mm/memremap_pages: convert to 'struct range'") Reported-by: Hulk Robot Signed-off-by: Zhen Lei Reviewed-by: Juergen

[libvirt test] 161889: regressions - FAIL

2021-05-10 Thread osstest service owner
flight 161889 libvirt real [real] http://logs.test-lab.xenproject.org/osstest/logs/161889/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-armhf-libvirt 6 libvirt-buildfail REGR. vs. 151777 build-amd64-libvirt

[qemu-mainline test] 161886: regressions - FAIL

2021-05-10 Thread osstest service owner
flight 161886 qemu-mainline real [real] http://logs.test-lab.xenproject.org/osstest/logs/161886/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-qemuu-freebsd11-amd64 16 guest-saverestore fail REGR. vs. 152631