Re: [PATCH 1/1] virtio-gpu: CONTEXT_INIT feature

2021-09-27 Thread Gerd Hoffmann
> @@ -212,6 +212,8 @@ virtio_gpu_base_get_features(VirtIODevice *vdev, uint64_t > features, > features |= (1 << VIRTIO_GPU_F_RESOURCE_BLOB); > } > > +features |= (1 << VIRTIO_GPU_F_CONTEXT_INIT); This needs a config option, simliar to the other features. It is a

Re: [PATCH v2 0/2] modules: Improve modinfo.c support

2021-09-27 Thread Gerd Hoffmann
On Mon, Sep 27, 2021 at 11:11:58AM -0300, Jose R. Ziviani wrote: > This patchset introduces the modinfo_need and changes > modinfo-generate.py/meson.build to generate/link one modinfo per target. > > modinfo-generate.py will know, thanks to modinfo_need, which modules are > currently enabled for

[PATCH v11 13/14] machine: Move smp_prefer_sockets to struct SMPCompatProps

2021-09-27 Thread Yanan Wang
Now we have a common structure SMPCompatProps used to store information about SMP compatibility stuff, so we can also move smp_prefer_sockets there for cleaner code. No functional change intended. Signed-off-by: Yanan Wang Acked-by: David Gibson Reviewed-by: Andrew Jones --- hw/arm/virt.c

[PATCH v11 04/14] machine: Set the value of cpus to match maxcpus if it's omitted

2021-09-27 Thread Yanan Wang
Currently we directly calculate the omitted cpus based on the given incomplete collection of parameters. This makes some cmdlines like: -smp maxcpus=16 -smp sockets=2,maxcpus=16 -smp sockets=2,dies=2,maxcpus=16 -smp sockets=2,cores=4,maxcpus=16 not work. We should probably set the value of

[PATCH v11 09/14] machine: Use ms instead of global current_machine in sanity-check

2021-09-27 Thread Yanan Wang
In the sanity-check of smp_cpus and max_cpus against mc in function machine_set_smp(), we are now using ms->smp.max_cpus for the check but using current_machine->smp.max_cpus in the error message. Tweak this by uniformly using the local ms. Signed-off-by: Yanan Wang Reviewed-by: Andrew Jones

[PATCH v11 14/14] machine: Put all sanity-check in the generic SMP parser

2021-09-27 Thread Yanan Wang
Put both sanity-check of the input SMP configuration and sanity-check of the output SMP configuration uniformly in the generic parser. Then machine_set_smp() will become cleaner, also all the invalid scenarios can be tested only by calling the parser. Signed-off-by: Yanan Wang Reviewed-by:

[PATCH v11 06/14] qtest/numa-test: Use detailed -smp CLIs in pc_dynamic_cpu_cfg

2021-09-27 Thread Yanan Wang
Since commit 80d7835749 (qemu-options: rewrite help for -smp options), the preference of sockets/cores in -smp parsing is considered liable to change, and actually we are going to change it in a coming commit. So it'll be more stable to use detailed -smp CLIs in testing if we have strong

[PATCH v11 03/14] machine: Uniformly use maxcpus to calculate the omitted parameters

2021-09-27 Thread Yanan Wang
We are currently using maxcpus to calculate the omitted sockets but using cpus to calculate the omitted cores/threads. This makes cmdlines like: -smp cpus=8,maxcpus=16 -smp cpus=8,cores=4,maxcpus=16 -smp cpus=8,threads=2,maxcpus=16 work fine but the ones like: -smp

[PATCH v11 11/14] machine: Make smp_parse generic enough for all arches

2021-09-27 Thread Yanan Wang
Currently the only difference between smp_parse and pc_smp_parse is the support of dies parameter and the related error reporting. With some arch compat variables like "bool dies_supported", we can make smp_parse generic enough for all arches and the PC specific one can be removed. Making

[PATCH v11 12/14] machine: Remove smp_parse callback from MachineClass

2021-09-27 Thread Yanan Wang
Now we have a generic smp parser for all arches, and there will not be any other arch specific ones, so let's remove the callback from MachineClass and call the parser directly. Signed-off-by: Yanan Wang Reviewed-by: Andrew Jones --- hw/core/machine.c | 3 +-- include/hw/boards.h | 5 -

[PATCH v11 08/14] machine: Prefer cores over sockets in smp parsing since 6.2

2021-09-27 Thread Yanan Wang
In the real SMP hardware topology world, it's much more likely that we have high cores-per-socket counts and few sockets totally. While the current preference of sockets over cores in smp parsing results in a virtual cpu topology with low cores-per-sockets counts and a large number of sockets,

[PATCH v11 07/14] qtest/numa-test: Use detailed -smp CLIs in test_def_cpu_split

2021-09-27 Thread Yanan Wang
Since commit 80d7835749 (qemu-options: rewrite help for -smp options), the preference of sockets/cores in -smp parsing is considered liable to change, and actually we are going to change it in a coming commit. So it'll be more stable to use detailed -smp CLIs in the testcases that have strong

[PATCH v11 02/14] machine: Minor refactor/fix for the smp parsers

2021-09-27 Thread Yanan Wang
To pave the way for the functional improvement in later patches, make some refactor/cleanup for the smp parsers, including using local maxcpus instead of ms->smp.max_cpus in the calculation, defaulting dies to 0 initially like other members, cleanup the sanity check for dies. We actually also fix

[PATCH v11 10/14] machine: Tweak the order of topology members in struct CpuTopology

2021-09-27 Thread Yanan Wang
Now that all the possible topology parameters are integrated in struct CpuTopology, tweak the order of topology members to be "cpus/sockets/ dies/cores/threads/maxcpus" for readability and consistency. We also tweak the comment by adding explanation of dies parameter. Signed-off-by: Yanan Wang

[PATCH v11 00/14] machine: smp parsing fixes and improvement

2021-09-27 Thread Yanan Wang
Hi, This is a new version (v11) with some update in patch 11/14 suggested by Daniel. Please have another look, Thanks! Summary of v11: 1) Specifying a CPU topology parameter as zero was implicitly allowed but undocumented before, while now it's explicitly deprecated. 2) Refactor/fixes of the

[PATCH v11 05/14] machine: Improve the error reporting of smp parsing

2021-09-27 Thread Yanan Wang
We have two requirements for a valid SMP configuration: the product of "sockets * cores * threads" must represent all the possible cpus, i.e., max_cpus, and then must include the initially present cpus, i.e., smp_cpus. So we only need to ensure 1) "sockets * cores * threads == maxcpus" at first

[PATCH v11 01/14] machine: Deprecate "parameter=0" SMP configurations

2021-09-27 Thread Yanan Wang
In the SMP configuration, we should either provide a topology parameter with a reasonable value (greater than zero) or just omit it and QEMU will compute the missing value. The users shouldn't provide a configuration with any parameter of it specified as zero (e.g. -smp 8,sockets=0) which could

[PATCH 0/1] hw: aspeed_gpio: Fix GPIO array indexing

2021-09-27 Thread pdel
From: Peter Delevoryas Hey everyone, I think there might be a bug in aspeed_gpio_update, where it's selecting a GPIO IRQ to update. The indexing that maps from GPIO pin to IRQ leads to an out-of-bounds array access and a segfault after that. tl;dr There's 8 rows of 32 pins (8 * 32 == 256

[PATCH 1/1] hw: aspeed_gpio: Fix GPIO array indexing

2021-09-27 Thread pdel
From: Peter Delevoryas The gpio array is declared as a dense array: qemu_irq gpios[ASPEED_GPIO_NR_PINS]; (AST2500 has 228, AST2400 has 216, AST2600 has 208) However, this array is used like a matrix of GPIO sets (e.g. gpio[NR_SETS][NR_PINS_PER_SET] = gpio[8][32]) size_t offset = set *

[PATCH 1/1] hw: aspeed_gpio: Fix pin I/O type declarations

2021-09-27 Thread pdel
From: Peter Delevoryas Some of the pin declarations in the Aspeed GPIO module were incorrect, probably because of confusion over which bits in the input and output uint32_t's correspond to which groups in the label array. Since the uint32_t literals are in big endian, it's sort of the opposite

[PATCH 0/1] hw: aspeed_gpio: Fix pin I/O type declarations

2021-09-27 Thread pdel
From: Peter Delevoryas In the Aspeed chips, the GPIO pins are mostly labeled in groups of 8, but some of the groups only have 4 elements. Also, most pins have input and output capabilities, but some are strictly input or strictly output pins. We have some arrays that describe the I/O

[PATCH v4 23/25] linux-user/sparc: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
Create and record the two signal trampolines. Use them when the guest does not use SA_RESTORER. Cc: Mark Cave-Ayland Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/sparc/target_signal.h | 4 linux-user/sparc/signal.c| 40

[PATCH v4 22/25] linux-user/sh4: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
Create and record the two signal trampolines. Use them when the guest does not use SA_RESTORER. Cc: Yoshinori Sato Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/sh4/target_signal.h | 2 ++ linux-user/sh4/signal.c| 40

[PATCH v4 24/25] linux-user/xtensa: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
Create and record the rt signal trampoline. Use it when the guest does not use SA_RESTORER. Reviewed-by: Max Filippov Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/xtensa/target_signal.h | 2 ++ linux-user/xtensa/signal.c| 56

[PATCH v4 19/25] linux-user/ppc: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
Create and record the two signal trampolines. Cc: qemu-...@nongnu.org Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/ppc/target_signal.h | 2 ++ linux-user/ppc/signal.c| 34 ++ 2 files changed, 20 insertions(+), 16

[PATCH v4 25/25] linux-user: Remove default for TARGET_ARCH_HAS_SIGTRAMP_PAGE

2021-09-27 Thread Richard Henderson
All targets now define TARGET_ARCH_HAS_SIGTRAMP_PAGE. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/elfload.c | 4 1 file changed, 4 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 459a26ef1d..2404d482ba 100644 ---

[PATCH v4 20/25] linux-user/riscv: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
Create and record the rt signal trampoline. This fixes a bug wrt libgcc fallback unwinding. It expects the stack pointer to point to the siginfo_t, whereas we had inexplicably placed our private signal trampoline at the start of the signal frame instead of the end. Now moot because we have

[PATCH v4 15/25] linux-user/mips: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
Create and record the two signal trampolines. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/mips/target_signal.h | 1 + linux-user/mips64/target_signal.h | 2 ++ linux-user/mips/signal.c | 34 ++- 3 files changed,

[PATCH v4 21/25] linux-user/s390x: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
Create and record the two signal trampolines. Use them when the guest does not use SA_RESTORER. Cc: qemu-s3...@nongnu.org Tested-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/s390x/target_signal.h | 2 ++ linux-user/s390x/signal.c

[PATCH v4 18/25] linux-user/ppc: Simplify encode_trampoline

2021-09-27 Thread Richard Henderson
The sigret parameter is never 0, and even if it was the encoding of the LI instruction would still work. Reported-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/ppc/signal.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-)

[PATCH v4 17/25] linux-user/openrisc: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
Create and record the rt signal trampoline. Reviewed-by: Stafford Horne Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/openrisc/target_signal.h | 2 ++ linux-user/openrisc/signal.c| 22 ++ 2 files changed, 16 insertions(+), 8

[PATCH v4 13/25] linux-user/microblaze: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
Create and record the rt signal trampoline. Cc: Edgar E. Iglesias Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/microblaze/target_signal.h | 2 ++ linux-user/microblaze/signal.c| 24 +--- 2 files changed, 19 insertions(+), 7

[PATCH v4 14/25] linux-user/mips: Tidy install_sigtramp

2021-09-27 Thread Richard Henderson
The return value is constant 0, and unused as well -- change to void. Drop inline marker. Change tramp type to uint32_t* for clarity. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/mips/signal.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-)

[PATCH v4 07/25] linux-user/cris: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
Split out setup_sigreturn so that we can continue to initialize the words on the stack, as documented. However, use the off-stack trampoline. Cc: Edgar E. Iglesias Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/cris/target_signal.h | 2 ++

[PATCH v4 16/25] linux-user/nios2: Document non-use of setup_sigtramp

2021-09-27 Thread Richard Henderson
Signed-off-by: Richard Henderson --- linux-user/nios2/target_signal.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-user/nios2/target_signal.h b/linux-user/nios2/target_signal.h index aebf749f12..fe266c4c51 100644 --- a/linux-user/nios2/target_signal.h +++

[PATCH v4 09/25] linux-user/hppa: Document non-use of setup_sigtramp

2021-09-27 Thread Richard Henderson
We cannot use a raw sigtramp page for hppa, but must wait for full vdso support. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/hppa/target_signal.h | 14 ++ 1 file changed, 14 insertions(+) diff --git

[PATCH v4 01/25] linux-user: Add infrastructure for a signal trampoline page

2021-09-27 Thread Richard Henderson
Allocate a page to hold the signal trampoline(s). Invoke a guest-specific hook to fill in the contents of the page before marking it read-execute again. Reviewed-by: Max Filippov Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson ---

[PATCH v4 12/25] linux-user/m68k: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
Create and record the two signal trampolines. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/m68k/target_signal.h | 2 ++ linux-user/m68k/signal.c| 47 +++-- 2 files changed, 24 insertions(+), 25 deletions(-) diff --git

[PATCH v4 11/25] linux-user/x86_64: Raise SIGSEGV if SA_RESTORER not set

2021-09-27 Thread Richard Henderson
This has been a fixme for some time. The effect of returning -EFAULT from the kernel code is to raise SIGSEGV. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/i386/signal.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git

[PATCH v4 08/25] linux-user/hexagon: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
Continue to initialize the words on the stack, as documented. However, use the off-stack trampoline. Reviewed-by: Taylor Simpson Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/hexagon/target_signal.h | 2 ++ linux-user/hexagon/signal.c| 19

[PATCH v4 10/25] linux-user/i386: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
Create and record the two signal trampolines. Use them when the guest does not use SA_RESTORER. Note that x86_64 does not use this code. Signed-off-by: Richard Henderson --- linux-user/i386/target_signal.h | 2 ++ linux-user/x86_64/target_signal.h | 3 ++ linux-user/i386/signal.c |

[PATCH v4 02/25] linux-user/aarch64: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
Create and record the rt signal trampoline. Use it when the guest does not use SA_RESTORER. Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/aarch64/target_signal.h | 2 ++ linux-user/aarch64/signal.c| 34

[PATCH v4 00/25] linux-user: Move signal trampolines to new page

2021-09-27 Thread Richard Henderson
Changes for v4: * Drop nios2 changes -- I still haven't built a full toolchain. * Clean up arm changes. * Minur i386 pointer type changes. Changes for v3: * Drop vdsos, reinstate setup_sigtramp for all targets. * Incorporate nios2 kuser page emulation, which contains the sigtramp

[PATCH v4 05/25] linux-user/arm: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
Mirror what the kernel does in arch/arm/kernel/signal.h, using the old sigframe struct in the rt sigframe struct. Update the trampoline code to match the kernel: this uses sp-relative accesses rather than pc-relative. Copy the code into frame->retcode from the trampoline page. This minimises the

[PATCH v4 03/25] linux-user/arm: Drop v1 signal frames

2021-09-27 Thread Richard Henderson
Version 2 signal frames are used from 2.6.12 and since cbc14e6f286, we have set UNAME_MINIMUM_RELEASE to 2.6.32. Suggested-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/arm/signal.c | 220 +--- 1 file

[PATCH v4 04/25] linux-user/arm: Drop "_v2" from symbols in signal.c

2021-09-27 Thread Richard Henderson
Since we no longer support "v1", there's no need to distinguish "v2". Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/arm/signal.c | 155 +--- 1 file changed, 65 insertions(+), 90 deletions(-) diff --git

[PATCH v4 06/25] linux-user/alpha: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
Create and record the two signal trampolines. Use them when the guest does not use ka_restorer. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/alpha/target_signal.h | 1 + linux-user/alpha/signal.c| 34 +++- 2 files

Re: [PATCH v3 10/27] linux-user/i386: Implement setup_sigtramp

2021-09-27 Thread Richard Henderson
On 9/24/21 2:01 PM, Philippe Mathieu-Daudé wrote: +static void install_sigtramp(void *tramp) +{ +    /* This is popl %eax ; movl $syscall,%eax ; int $0x80 */ +    __put_user(0xb858, (uint16_t *)(tramp + 0)); +    __put_user(TARGET_NR_sigreturn, (int *)(tramp + 2)); I know this is mostly code

Re: [PATCH v10 11/14] machine: Make smp_parse generic enough for all arches

2021-09-27 Thread wangyanan (Y)
On 2021/9/27 18:12, Daniel P. Berrangé wrote: On Sun, Sep 26, 2021 at 04:45:38PM +0800, Yanan Wang wrote: Currently the only difference between smp_parse and pc_smp_parse is the support of dies parameter and the related error reporting. With some arch compat variables like "bool

Re: Fw: [EXTERNAL] Re: [RFC PATCH 00/13] Add support for Mirror VM.

2021-09-27 Thread Ashish Kalra
On Tue, Aug 24, 2021 at 06:00:51PM -0400, Tobin Feldman-Fitzthum wrote: > On Mon, Aug 16, 2021 at 04:15:46PM +0200, Paolo Bonzini wrote: > > > Hi, > > > > first of all, thanks for posting this work and starting the discussion. > > > > However, I am not sure if the in-guest migration helper vCPUs

Re: [PATCH v3 02/15] target/ppc: add user write access control for PMU SPRs

2021-09-27 Thread Daniel Henrique Barboza
On 9/27/21 02:08, David Gibson wrote: On Thu, Sep 23, 2021 at 11:39:14AM -0300, Daniel Henrique Barboza wrote: On 9/6/21 22:38, David Gibson wrote: On Fri, Sep 03, 2021 at 05:31:03PM -0300, Daniel Henrique Barboza wrote: The PMU needs to enable writing of its uregs to userspace,

[PATCH v4 1/3] vhost-user-rng: Add vhost-user-rng implementation

2021-09-27 Thread Mathieu Poirier
Introduce a random number generator (RNG) backend that communicates with a vhost-user server to retrieve entropy. That way other VMM that comply with the vhost user protocl can use the same vhost-user daemon without having to write yet another RNG driver. Reviewed-by: Alex Bennée Signed-off-by:

[PATCH v4 0/3] virtio: Add vhost-user based RNG

2021-09-27 Thread Mathieu Poirier
This set implements a random number generator (RNG) device that follows the vhost-user protocol. The main difference between V3 is the absence of the vhost-user daemon implemenation. It was dropped to favour the rust implementation currently being considered under the vhost-device crate[1] of

[PULL 20/20] nbd/server: Add --selinux-label option

2021-09-27 Thread Eric Blake
From: "Richard W.M. Jones" Under SELinux, Unix domain sockets have two labels. One is on the disk and can be set with commands such as chcon(1). There is a different label stored in memory (called the process label). This can only be set by the process creating the socket. When using SELinux

[PULL 13/20] nbd/server: Allow LIST_META_CONTEXT without STRUCTURED_REPLY

2021-09-27 Thread Eric Blake
The NBD protocol just relaxed the requirements on NBD_OPT_LIST_META_CONTEXT: https://github.com/NetworkBlockDevice/nbd/commit/13a4e33a87 Since listing is not stateful (unlike SET_META_CONTEXT), we don't care if a client asks for meta contexts without first requesting structured replies.

[PULL 18/20] block/nbd: drop connection_co

2021-09-27 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy OK, that's a big rewrite of the logic. Pre-patch we have an always running coroutine - connection_co. It does reply receiving and reconnecting. And it leads to a lot of difficult and unobvious code around drained sections and context switch. We also abuse

[PATCH v4 3/3] docs: Add documentation for vhost based RNG implementation

2021-09-27 Thread Mathieu Poirier
Add description and example for the vhost-user based RNG implementation. Signed-off-by: Mathieu Poirier --- docs/system/devices/vhost-user-rng.rst | 39 ++ 1 file changed, 39 insertions(+) create mode 100644 docs/system/devices/vhost-user-rng.rst diff --git

[PATCH v4 2/3] vhost-user-rng-pci: Add vhost-user-rng-pci implementation

2021-09-27 Thread Mathieu Poirier
This patch provides a PCI bus interface to the vhost-user-rng backend. Reviewed-by: Alex Bennée Signed-off-by: Mathieu Poirier --- hw/virtio/meson.build | 1 + hw/virtio/vhost-user-rng-pci.c | 79 ++ 2 files changed, 80 insertions(+) create mode

[PULL 15/20] block/nbd: nbd_channel_error() shutdown channel unconditionally

2021-09-27 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy Don't rely on connection being totally broken in case of -EIO. Safer and more correct is to just shut down the channel anyway, since we change the state and plan on reconnecting. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake Message-Id:

[PULL 14/20] nbd/client-connection: nbd_co_establish_connection(): fix non set errp

2021-09-27 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy When we don't have a connection and blocking is false, we return NULL but don't set errp. That's wrong. We have two paths for calling nbd_co_establish_connection(): 1. nbd_open() -> nbd_do_establish_connection() -> ... but that will never set blocking=false

[PULL 11/20] block: use int64_t instead of int in driver discard handlers

2021-09-27 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy We are generally moving to int64_t for both offset and bytes parameters on all io paths. Main motivation is realization of 64-bit write_zeroes operation for fast zeroing large disk chunks, up to the whole disk. We chose signed type, to be consistent with

[PULL 12/20] block/io: allow 64bit discard requests

2021-09-27 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy Now that all drivers are updated by the previous commit, we can drop the last limiter on pdiscard path: INT_MAX in bdrv_co_pdiscard(). Now everything is prepared for implementing incredibly cool and fast big-discard requests in NBD and qcow2. And any other

[PULL 17/20] block/nbd: refactor nbd_recv_coroutines_wake_all()

2021-09-27 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy Split out nbd_recv_coroutine_wake_one(), as it will be used separately. Rename the function and add a possibility to wake only first found sleeping coroutine. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id:

[PULL 07/20] block: make BlockLimits::max_pwrite_zeroes 64bit

2021-09-27 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy We are going to support 64 bit write-zeroes requests. Now update the limit variable. It's absolutely safe. The variable is set in some drivers, and used in bdrv_co_do_pwrite_zeroes(). Update also max_write_zeroes variable in bdrv_co_do_pwrite_zeroes(), so that

[PULL 08/20] block: use int64_t instead of int in driver write_zeroes handlers

2021-09-27 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy We are generally moving to int64_t for both offset and bytes parameters on all io paths. Main motivation is realization of 64-bit write_zeroes operation for fast zeroing large disk chunks, up to the whole disk. We chose signed type, to be consistent with

[PULL 05/20] block: use int64_t instead of uint64_t in driver write handlers

2021-09-27 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy We are generally moving to int64_t for both offset and bytes parameters on all io paths. Main motivation is realization of 64-bit write_zeroes operation for fast zeroing large disk chunks, up to the whole disk. We chose signed type, to be consistent with

[PULL 16/20] block/nbd: move nbd_recv_coroutines_wake_all() up

2021-09-27 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy We are going to use it in nbd_channel_error(), so move it up. Note, that we are going also refactor and rename nbd_recv_coroutines_wake_all() in future anyway, so keeping it where it is and making forward declaration doesn't make real sense. Signed-off-by:

[PULL 04/20] block: use int64_t instead of uint64_t in driver read handlers

2021-09-27 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy We are generally moving to int64_t for both offset and bytes parameters on all io paths. Main motivation is realization of 64-bit write_zeroes operation for fast zeroing large disk chunks, up to the whole disk. We chose signed type, to be consistent with

[PULL 10/20] block: make BlockLimits::max_pdiscard 64bit

2021-09-27 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy We are going to support 64 bit discard requests. Now update the limit variable. It's absolutely safe. The variable is set in some drivers, and used in bdrv_co_pdiscard(). Update also max_pdiscard variable in bdrv_co_pdiscard(), so that bdrv_co_pdiscard() is

[PULL 19/20] block/nbd: check that received handle is valid

2021-09-27 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy If we don't have active request, that waiting for this handle to be received, we should report an error. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20210902103805.25686-6-vsement...@virtuozzo.com> Reviewed-by: Eric Blake Signed-off-by: Eric

[PULL 06/20] block: use int64_t instead of uint64_t in copy_range driver handlers

2021-09-27 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy We are generally moving to int64_t for both offset and bytes parameters on all io paths. Main motivation is realization of 64-bit write_zeroes operation for fast zeroing large disk chunks, up to the whole disk. We chose signed type, to be consistent with

[PULL 02/20] block/io: bring request check to bdrv_co_(read, write)v_vmstate

2021-09-27 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy Only qcow2 driver supports vmstate. In qcow2 these requests go through .bdrv_co_p{read,write}v_part handlers. So, let's do our basic check for the request on vmstate generic handlers. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake

[PULL 00/20] NBD patches through 2021-09-27

2021-09-27 Thread Eric Blake
The following changes since commit 9b03a1178204598055f23f24e438fdddb5935df9: Merge remote-tracking branch 'remotes/vivier2/tags/trivial-branch-for-6.2-pull-request' into staging (2021-09-27 11:08:36 +0100) are available in the Git repository at: https://repo.or.cz/qemu/ericb.git

[PULL 09/20] block/io: allow 64bit write-zeroes requests

2021-09-27 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy Now that all drivers are updated by previous commit, we can drop two last limiters on write-zeroes path: INT_MAX in bdrv_co_do_pwrite_zeroes() and bdrv_check_request32() in bdrv_co_pwritev_part(). Now everything is prepared for implementing incredibly cool and

[PULL 01/20] qemu-nbd: Change default cache mode to writeback

2021-09-27 Thread Eric Blake
From: Nir Soffer Both qemu and qemu-img use writeback cache mode by default, which is already documented in qemu(1). qemu-nbd uses writethrough cache mode by default, and the default cache mode is not documented. According to the qemu-nbd(8): --cache=CACHE The cache mode to be

[PULL 03/20] qcow2: check request on vmstate save/load path

2021-09-27 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy We modify the request by adding an offset to vmstate. Let's check the modified request. It will help us to safely move .bdrv_co_preadv_part and .bdrv_co_pwritev_part to int64_t type of offset and bytes. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by:

Re: [PATCH v11 00/16] target/riscv: Update QEmu for Zb[abcs] 1.0.0

2021-09-27 Thread Vineet Gupta
On 9/27/21 1:23 PM, Jim Wilson wrote: On Mon, Sep 27, 2021 at 1:01 PM Vineet Gupta > wrote: So I obviously forgot to get the equivalent binutils branch, but the only rvb branch on sifive fork feels dated

Re: [PATCH v2] nbd/server: Add --selinux-label option

2021-09-27 Thread Richard W.M. Jones
On Mon, Sep 27, 2021 at 04:18:34PM -0500, Eric Blake wrote: > On Fri, Jul 23, 2021 at 11:33:03AM +0100, Richard W.M. Jones wrote: > > Under SELinux, Unix domain sockets have two labels. One is on the > > disk and can be set with commands such as chcon(1). There is a > > different label stored in

Re: [PATCH v2] nbd/server: Add --selinux-label option

2021-09-27 Thread Eric Blake
On Fri, Jul 23, 2021 at 11:33:03AM +0100, Richard W.M. Jones wrote: > Under SELinux, Unix domain sockets have two labels. One is on the > disk and can be set with commands such as chcon(1). There is a > different label stored in memory (called the process label). This can > only be set by the

Re: [PATCH v11 00/16] target/riscv: Update QEmu for Zb[abcs] 1.0.0

2021-09-27 Thread Jim Wilson
On Mon, Sep 27, 2021 at 1:01 PM Vineet Gupta wrote: > So I obviously forgot to get the equivalent binutils branch, but the > only rvb branch on sifive fork feels dated > > > https://github.com/riscv-collab/riscv-binutils-gdb/tree/riscv-binutils-2.35-rvb That is the right branch to use with the

Re: [PATCH] hw/arm/virt: Allow additions to the generated device tree

2021-09-27 Thread Simon Glass
Hi Peter, On Mon, 27 Sept 2021 at 10:50, Peter Maydell wrote: > > On Mon, 27 Sept 2021 at 17:04, Simon Glass wrote: > > On Mon, 27 Sept 2021 at 09:46, Peter Maydell > > wrote: > > > > My take is that this is u-boot doing weird custom things with > > > the DTB that aren't "describe the

Re: [PATCH v11 00/16] target/riscv: Update QEmu for Zb[abcs] 1.0.0

2021-09-27 Thread Vineet Gupta
Hi, On 9/11/21 7:00 AM, Philipp Tomsich wrote: The Zb[abcs] extensions have complete public review and are nearing ratifications. These individual extensions are one part of what was previously though of as the "BitManip" (B) extension, leaving the final details of future Zb* extensions open

[PULL 26/32] python/aqmp: add LineProtocol tests

2021-09-27 Thread John Snow
Tests a real connect, a real accept, and really sending and receiving a message over a UNIX socket. Brings coverage of protocol.py up to ~93%. Signed-off-by: John Snow Message-id: 20210915162955.333025-27-js...@redhat.com Signed-off-by: John Snow --- python/tests/protocol.py | 48

[PULL 09/32] python/aqmp: add AsyncProtocol.accept() method

2021-09-27 Thread John Snow
It's a little messier than connect, because it wasn't designed to accept *precisely one* connection. Such is life. Signed-off-by: John Snow Reviewed-by: Eric Blake Message-id: 20210915162955.333025-10-js...@redhat.com Signed-off-by: John Snow --- python/qemu/aqmp/protocol.py | 89

[PULL 23/32] python/aqmp: add scary message

2021-09-27 Thread John Snow
Add a warning whenever AQMP is used to steer people gently away from using it for the time-being. Signed-off-by: John Snow Message-id: 20210915162955.333025-24-js...@redhat.com Signed-off-by: John Snow --- python/qemu/aqmp/__init__.py | 14 ++ 1 file changed, 14 insertions(+) diff

[PULL 32/32] python/aqmp-tui: Add syntax highlighting

2021-09-27 Thread John Snow
From: G S Niteesh Babu Add syntax highlighting for the incoming and outgoing QMP messages. This is achieved using the pygments module which was added in a previous commit. The current implementation is a really simple one which doesn't allow for any configuration. In future this has to be

[PULL 28/32] python: Add dependencies for AQMP TUI

2021-09-27 Thread John Snow
From: G S Niteesh Babu Added dependencies for the upcoming AQMP TUI under the optional 'tui' group. The same dependencies have also been added under the devel group since no work around has been found for optional groups to imply other optional groups. Signed-off-by: G S Niteesh Babu

[PULL 21/32] python/aqmp: add _raw() execution interface

2021-09-27 Thread John Snow
This is added in anticipation of wanting it for a synchronous wrapper for the iotest interface. Normally, execute() and execute_msg() both raise QMP errors in the form of Python exceptions. Many iotests expect the entire reply as-is. To reduce churn there, add a private execution interface that

[PULL 29/32] python/aqmp-tui: Add AQMP TUI

2021-09-27 Thread John Snow
From: G S Niteesh Babu Added AQMP TUI. Implements the follwing basic features: 1) Command transmission/reception. 2) Shows events asynchronously. 3) Shows server status in the bottom status bar. 4) Automatic retries on disconnects and error conditions. Also added type annotations and necessary

[PULL 22/32] python/aqmp: add asyncio_run compatibility wrapper

2021-09-27 Thread John Snow
As a convenience. It isn't used by the library itself, but it is used by the test suite. It will also come in handy for users of the library still on Python 3.6. Signed-off-by: John Snow Message-id: 20210915162955.333025-23-js...@redhat.com Signed-off-by: John Snow --- python/qemu/aqmp/util.py

[PULL 19/32] python/aqmp: Add message routing to QMP protocol

2021-09-27 Thread John Snow
Add the ability to handle and route messages in qmp_protocol.py. The interface for actually sending anything still isn't added until next commit. Signed-off-by: John Snow Message-id: 20210915162955.333025-20-js...@redhat.com Signed-off-by: John Snow --- python/qemu/aqmp/qmp_client.py | 122

[PULL 27/32] python/aqmp: Add Coverage.py support

2021-09-27 Thread John Snow
I'm not exposing this via the Makefile help, it's not likely to be useful to passersby. Switch the avocado runner to the 'legacy' runner for now, as the new runner seems to obscure coverage reports, again. Usage is to enter your venv of choice and then: `make check-coverage && xdg-open

Re: [PATCH v6 12/40] accel/nvmm: Implement AccelOpsClass::has_work()

2021-09-27 Thread Kamil Rytarowski
On 24.09.2021 11:38, Philippe Mathieu-Daudé wrote: > Since there is no specific NVMM handling for cpu_has_work() in > cpu_thread_is_idle(), implement NVMM has_work() handler as a > simple 'return false' code. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Kamil Rytarowski > --- >

[PULL 20/32] python/aqmp: add execute() interfaces

2021-09-27 Thread John Snow
Add execute() and execute_msg(). _execute() is split into _issue() and _reply() halves so that hypothetical subclasses of QMP that want to support different execution paradigms can do so. I anticipate a synchronous interface may have need of separating the send/reply phases. However, I do not

[PULL 18/32] python/pylint: disable no-member check

2021-09-27 Thread John Snow
mypy handles this better -- but we only need the workaround because pylint under Python 3.6 does not understand that a MutableMapping really does have a .get() method attached. We could remove this again once 3.7 is our minimum. Signed-off-by: John Snow Message-id:

[PULL 25/32] python/aqmp: add AsyncProtocol unit tests

2021-09-27 Thread John Snow
This tests most of protocol.py -- From a hacked up Coverage.py run, it's at about 86%. There's a few error cases that aren't very well tested yet, they're hard to induce artificially so far. I'm working on it. Signed-off-by: John Snow Message-id: 20210915162955.333025-26-js...@redhat.com

[PULL 31/32] python: add optional pygments dependency

2021-09-27 Thread John Snow
From: G S Niteesh Babu Added pygments as optional dependency for AQMP TUI. This is required for the upcoming syntax highlighting feature in AQMP TUI. The dependency has also been added in the devel optional group. Added mypy 'ignore_missing_imports' for pygments since it does not have any type

[PULL 13/32] python/aqmp: add QMP Message format

2021-09-27 Thread John Snow
The Message class is here primarily to serve as a solid type to use for mypy static typing for unambiguous annotation and documentation. We can also stuff JSON serialization and deserialization into this class itself so it can be re-used even outside this infrastructure. Signed-off-by: John Snow

[PULL 11/32] python/aqmp: add _cb_inbound and _cb_outbound logging hooks

2021-09-27 Thread John Snow
Add hooks designed to log/filter incoming/outgoing messages. The primary intent for these is to be able to support iotests which may want to log messages with specific filters for reproducible output. Another use is for plugging into Urwid frameworks; all messages in/out can be automatically

[PULL 30/32] python: Add entry point for aqmp-tui

2021-09-27 Thread John Snow
From: G S Niteesh Babu Add an entry point for aqmp-tui. This will allow it to be run from the command line using "aqmp-tui localhost:1234" More options available in the TUI can be found using "aqmp-tui -h" Signed-off-by: G S Niteesh Babu Message-Id:

  1   2   3   4   >