Re: [PATCH -next] xen/pcpu: Use DEVICE_ATTR_RW macro

2021-05-24 Thread YueHaibing
On 2021/5/24 20:48, Boris Ostrovsky wrote: > > On 5/23/21 3:02 AM, YueHaibing wrote: >> Use DEVICE_ATTR_RW helper instead of plain DEVICE_ATTR, >> which makes the code a bit shorter and easier to read. >> >> Signed-off-by: YueHaibing > > > Do you think you can also make similar change in dri

[linux-linus test] 162144: regressions - FAIL

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

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

2021-05-24 Thread Claire Chang
On Mon, May 24, 2021 at 11:53 PM Konrad Rzeszutek Wilk wrote: > > > > do the set_memory_decrypted()+memset(). Is this okay or should > > > swiotlb_init_io_tlb_mem() add an additional argument to do this > > > conditionally? > > > > I'm actually not sure if this it okay. If not, will add an additio

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

2021-05-24 Thread Claire Chang
On Mon, May 24, 2021 at 11:51 PM Konrad Rzeszutek Wilk wrote: > > On Tue, May 18, 2021 at 02:51:52PM +0800, Claire Chang wrote: > > Still keep this function because directly using dev->dma_io_tlb_mem > > will cause issues for memory allocation for existing devices. The pool > > can't support atomi

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

2021-05-24 Thread Claire Chang
On Mon, May 24, 2021 at 11:49 PM Konrad Rzeszutek Wilk wrote: > > On Tue, May 18, 2021 at 02:48:35PM +0800, Claire Chang wrote: > > I didn't move this to a separate file because I feel it might be > > confusing for swiotlb_alloc/free (and need more functions to be > > non-static). > > Maybe instea

[qemu-mainline test] 162143: regressions - FAIL

2021-05-24 Thread osstest service owner
flight 162143 qemu-mainline real [real] http://logs.test-lab.xenproject.org/osstest/logs/162143/ 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 test-amd64-i3

[RESEND PATCH 11/12] golang/xenlight: do not negate ret when converting to Error

2021-05-24 Thread Nick Rosbrook
There are several locations where the return code from calling into C is negated when being converted to Error. This results in error strings like "libxl error: ", rather than the correct message. Fix all occurrances of this by running: gofmt -w -r 'Error(-ret) -> Error(ret)' xenlight.go from t

[RESEND PATCH 12/12] golang/xenlight: add NotifyDomainDeath method to Context

2021-05-24 Thread Nick Rosbrook
Add a helper function to wait for domain death events, and then write the events to a provided channel. This handles the enabling/disabling of the event type, freeing the event, and converting it to a Go type. The caller can then handle the event however they need to. This function will run until a

[RESEND PATCH 10/12] golang/xenlight: add SendTrigger wrapper

2021-05-24 Thread Nick Rosbrook
Add a warpper around libxl_send_trigger. Signed-off-by: Nick Rosbrook --- tools/golang/xenlight/xenlight.go | 11 +++ 1 file changed, 11 insertions(+) diff --git a/tools/golang/xenlight/xenlight.go b/tools/golang/xenlight/xenlight.go index 1e0ed109e4..d153feb851 100644 --- a/tools/gola

[RESEND PATCH 09/12] golang/xenlight: add DomainDestroy wrapper

2021-05-24 Thread Nick Rosbrook
Add a wrapper around libxl_domain_destroy. Signed-off-by: Nick Rosbrook --- tools/golang/xenlight/xenlight.go | 10 ++ 1 file changed, 10 insertions(+) diff --git a/tools/golang/xenlight/xenlight.go b/tools/golang/xenlight/xenlight.go index 65f93abe32..1e0ed109e4 100644 --- a/tools/gol

[RESEND PATCH 08/12] golang/xenlight: add functional options to configure Context

2021-05-24 Thread Nick Rosbrook
Add a ContextOption type to support functional options in NewContext. Then, add a variadic ContextOption parameter to NewContext, which allows callers to specify 0 or more configuration options. For now, just add the WithLogLevel option so that callers can set the log level of the Context's xentoo

[RESEND PATCH 07/12] golang/xenlight: add logging conveniences for within xenlight

2021-05-24 Thread Nick Rosbrook
Add some logging methods to Context to provide easy use of the Contenxt's xentoollog_logger. These are not exported, but the LogLevel type is so that a later commit can allow the Context's log level to be configurable. Becuase cgo does not support calling C functions with variable arguments, e.g.

[RESEND PATCH 06/12] golang/xenlight: rename Ctx receivers to ctx

2021-05-24 Thread Nick Rosbrook
As a matter of style, it is strange to see capitalized receiver names, due to the significance of capitalized symbols in Go (although there is in fact nothing special about a capitalized receiver name). Fix this in xenlight.go by running: gofmt -w -r 'Ctx -> ctx' xenlight.go from tools/golang/x

[RESEND PATCH 05/12] golang/xenlight: use struct pointers in keyed union fields

2021-05-24 Thread Nick Rosbrook
Currently, when marshalig Go types with keyed union fields, we assign the value of the struct (e.g. DomainBuildInfoTypeUnionHvm) which implements the interface of the keyed union field (e.g. DomainBuildInfoTypeUnion). As-is, this means that if a populated DomainBuildInfo is marshaled to e.g. JSON,

[RESEND PATCH 04/12] golang/xenlight: export keyed union interface types

2021-05-24 Thread Nick Rosbrook
For structs that have a keyed union, e.g. DomainBuildInfo, the TypeUnion field must be exported so that package users can get/set the fields within. This means that users are aware of the existence of the interface type used in those fields (see [1]), so it is awkward that the interface itself is n

[RESEND PATCH 03/12] golang/xenlight: fix string conversion in generated toC functions

2021-05-24 Thread Nick Rosbrook
In gengotypes.py, the toC functions only set C string fields when the Go strings are non-empty. However, to prevent segfaults in some cases, these fields should always at least be set to nil so that the C memory is zeroed out. Update gengotypes.py so that the generated code always sets these field

[RESEND PATCH 02/12] golang/xenlight: fix StringList toC conversion

2021-05-24 Thread Nick Rosbrook
The current implementation of StringList.toC does not correctly account for how libxl_string_list is expected to be laid out in C, which is clear when one looks at libxl_string_list_length in libxl.c. In particular, StringList.toC does not account for the extra memory that should be allocated for t

[RESEND PATCH 01/12] golang/xenlight: update generated code

2021-05-24 Thread Nick Rosbrook
Re-generate code to reflect changes to libxl_types.idl from the following commits: 0570d7f276 x86/msr: introduce an option for compatible MSR behavior selection 7e5cffcd1e viridian: allow vCPU hotplug for Windows VMs 9835246710 viridian: remove implicit limit of 64 VPs per partition Signed-off-by

[RESEND PATCH 00/12] golang/xenlight: domain life cycle support

2021-05-24 Thread Nick Rosbrook
The primary goal of this patch series is to allow users of the xenlight package to manage a full domain life cycle. In particular, it provides support for receiving domain death events so that domain shutdown, reboot, destroy, etc. can be handled. And, it addresses issues found when using the packa

[linux-linus test] 162141: regressions - FAIL

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

[qemu-mainline test] 162139: regressions - FAIL

2021-05-24 Thread osstest service owner
flight 162139 qemu-mainline real [real] http://logs.test-lab.xenproject.org/osstest/logs/162139/ 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 test-amd64-i3

Re: [PATCH] x86/shadow: fix DO_UNSHADOW()

2021-05-24 Thread Tim Deegan
At 14:36 +0200 on 19 May (1621434982), Jan Beulich wrote: > When adding the HASH_CALLBACKS_CHECK() I failed to properly recognize > the (somewhat unusually formatted) if() around the call to > hash_domain_foreach()). Gcc 11 is absolutely right in pointing out the > apparently misleading indentation

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

2021-05-24 Thread Konrad Rzeszutek Wilk
> > do the set_memory_decrypted()+memset(). Is this okay or should > > swiotlb_init_io_tlb_mem() add an additional argument to do this > > conditionally? > > I'm actually not sure if this it okay. If not, will add an additional > argument for it. Any observations discovered? (Want to make sure my

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

2021-05-24 Thread Konrad Rzeszutek Wilk
On Tue, May 18, 2021 at 02:51:52PM +0800, Claire Chang wrote: > Still keep this function because directly using dev->dma_io_tlb_mem > will cause issues for memory allocation for existing devices. The pool > can't support atomic coherent allocation so we need to distinguish the > per device pool and

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

2021-05-24 Thread Konrad Rzeszutek Wilk
On Tue, May 18, 2021 at 02:48:35PM +0800, Claire Chang wrote: > I didn't move this to a separate file because I feel it might be > confusing for swiotlb_alloc/free (and need more functions to be > non-static). > Maybe instead of moving to a separate file, we can try to come up with > a better namin

[PATCH v4 1/4] xen/char: Default HAS_NS16550 to y only for X86 and ARM

2021-05-24 Thread Connor Davis
Defaulting to yes only for X86 and ARM reduces the requirements for a minimal build when porting new architectures. Signed-off-by: Connor Davis Reviewed-by: Alistair Francis --- xen/drivers/char/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/drivers/char/Kconfig b/xen/drivers/c

[PATCH v4 0/4] Minimal build for RISCV

2021-05-24 Thread Connor Davis
Hi all, This series introduces a minimal build for RISCV. It is based on Bobby's previous work from last year[0] rebased onto current Xen. This series provides the patches necessary to get a minimal build working. The build is "minimal" in the sense that it only supports building TARGET=head.o. T

[PATCH v4 4/4] automation: Add container for riscv64 builds

2021-05-24 Thread Connor Davis
Add a container for cross-compiling xen to riscv64. This just includes the cross-compiler and necessary packages for building xen itself (packages for tools, stubdoms, etc., can be added later). Signed-off-by: Connor Davis --- automation/build/archlinux/riscv64.dockerfile | 19 ++

[PATCH v4 3/4] xen: Add files needed for minimal riscv build

2021-05-24 Thread Connor Davis
Add arch-specific makefiles and configs needed to build for riscv. Also add a minimal head.S that is a simple infinite loop. head.o can be built with $ make XEN_TARGET_ARCH=riscv SUBSYSTEMS=xen -C xen tiny64_defconfig $ make XEN_TARGET_ARCH=riscv SUBSYSTEMS=xen -C xen TARGET=head.o No other TARGE

[PATCH v4 2/4] xen/common: Guard iommu symbols with CONFIG_HAS_PASSTHROUGH

2021-05-24 Thread Connor Davis
The variables iommu_enabled and iommu_dont_flush_iotlb are defined in drivers/passthrough/iommu.c and are referenced in common code, which causes the link to fail when !CONFIG_HAS_PASSTHROUGH. Guard references to these variables in common code so that xen builds when !CONFIG_HAS_PASSTHROUGH. Sign

[xen-unstable test] 162137: tolerable FAIL

2021-05-24 Thread osstest service owner
flight 162137 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/162137/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stopfail like 162126 test-armhf-armhf-libvirt 16 save

[qemu-mainline bisection] complete test-amd64-i386-freebsd10-i386

2021-05-24 Thread osstest service owner
branch xen-unstable xenbranch xen-unstable job test-amd64-i386-freebsd10-i386 testid guest-saverestore Tree: linux git://xenbits.xen.org/linux-pvops.git Tree: linuxfirmware git://xenbits.xen.org/osstest/linux-firmware.git Tree: ovmf git://xenbits.xen.org/osstest/ovmf.git Tree: qemu git://xenbits.x

Re: [XEN PATCH v1] libxl/arm: provide guests with random seed

2021-05-24 Thread Julien Grall
Hi, On 24/05/2021 09:00, Sergiy Kibrik wrote: Pass random seed via FDT, so that guests' CRNGs are better seeded early at boot. Depending on its configuration Linux can use the seed as device randomness or to just quickly initialize CRNG. In either case this will provide extra randomness to furth

[XEN PATCH v1] libxl/arm: provide guests with random seed

2021-05-24 Thread Sergiy Kibrik
Pass random seed via FDT, so that guests' CRNGs are better seeded early at boot. Depending on its configuration Linux can use the seed as device randomness or to just quickly initialize CRNG. In either case this will provide extra randomness to further harden CRNG. Signed-off-by: Sergiy Kibrik --

[XEN PATCH v1] libxl: use getrandom() syscall for random data extraction

2021-05-24 Thread Sergiy Kibrik
Simplify libxl__random_bytes() routine by using a newer dedicated syscall. This allows not only to substantially reduce its footprint, but syscall also considered to be safer and generally better solution: https://lwn.net/Articles/606141/ getrandom() available on Linux, FreeBSD and NetBSD. Signe

Re: [XEN PATCH v1] libxl: use getrandom() syscall for random data extraction

2021-05-24 Thread Julien Grall
Hi, On 24/05/2021 09:58, Sergiy Kibrik wrote: Simplify libxl__random_bytes() routine by using a newer dedicated syscall. This allows not only to substantially reduce its footprint, but syscall also considered to be safer and generally better solution: https://lwn.net/Articles/606141/ getrandom

Re: [PATCH -next] xen/pcpu: Use DEVICE_ATTR_RW macro

2021-05-24 Thread Boris Ostrovsky
On 5/23/21 3:02 AM, YueHaibing wrote: > Use DEVICE_ATTR_RW helper instead of plain DEVICE_ATTR, > which makes the code a bit shorter and easier to read. > > Signed-off-by: YueHaibing Do you think you can also make similar change in drivers/xen/xen-balloon.c and drivers/xen/xenbus/xenbus_probe

Re: [PATCH 05/10] xen/arm: introduce alloc_staticmem_pages

2021-05-24 Thread Julien Grall
On 24/05/2021 11:10, Penny Zheng wrote: Hi Julien Hi Penny, +if ( !pg ) +return NULL; + +for ( i = 0; i < nr_pfns; i++) +{ +/* + * Reference count must continuously be zero for free pages + * of static memory(PGC_reserved). + */ +

RE: [PATCH 05/10] xen/arm: introduce alloc_staticmem_pages

2021-05-24 Thread Penny Zheng
Hi Julien > -Original Message- > From: Penny Zheng > Sent: Wednesday, May 19, 2021 1:24 PM > To: Julien Grall ; xen-devel@lists.xenproject.org; > sstabell...@kernel.org > Cc: Bertrand Marquis ; Wei Chen > ; nd > Subject: RE: [PATCH 05/10] xen/arm: introduce alloc_staticmem_pages > > Hi J

[linux-linus test] 162136: regressions - FAIL

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

[libvirt test] 162138: regressions - FAIL

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