Re: CXL volatile memory is not listed

2023-08-17 Thread Maverickk 78
Hi Jonathan, The use case of CXL switch will always need some sort of management agent + FM configuring the available CXL memory connected. In most cases it would be bmc controller configuring MLD/MHD's to host, and in very rare scenarios it may be one of the host interacting with FM firmware

Re: [PATCH] HDA codec: Fix wanted_r/w position overflow

2023-08-17 Thread Volker Rümelin
Hi, From: zeroway when the duration now - buft_start reach to some kind of value, which will get the multiply hda_bytes_per_second(st) * (now - buft_start) overflow, instead of calculate the wanted_r/wpos from start time to current time, here calculate the each timer tick delta data first in

Re: CXL volatile memory is not listed

2023-08-17 Thread Maverickk 78
Hi Fan Awesome, thanks for the info! On Fri, 11 Aug 2023 at 22:19, Fan Ni wrote: > > On Fri, Aug 11, 2023 at 07:52:25AM +0530, Maverickk 78 wrote: > > Thanks Fan, > > > > cxl create-region works like a charm :) > > > > Since this gets listed as "System Ram(kmem)", I guess the kernel > > treats

Re: [PATCH 4/4] replay: simple auto-snapshot mode for record

2023-08-17 Thread Pavel Dovgalyuk
On 14.08.2023 19:31, Nicholas Piggin wrote: record makes an initial snapshot when the machine is created, to enable reverse-debugging. Often the issue being debugged appears near the end of the trace, so it is important for performance to keep snapshots close to the end. This implements a

Re: [PATCH 3/4] replay: allow runstate shutdown->running when replaying trace

2023-08-17 Thread Pavel Dovgalyuk
Acked-by: Pavel Dovgalyuk On 14.08.2023 19:31, Nicholas Piggin wrote: When replaying a trace, it is possible to go from shutdown to running with a reverse-debugging step. This can be useful if the problem being debugged triggers a reset or shutdown. Signed-off-by: Nicholas Piggin ---

Re: [PATCH 2/4] tests/avocado: replay_linux.py add replay-dump.py test

2023-08-17 Thread Pavel Dovgalyuk
On 14.08.2023 19:31, Nicholas Piggin wrote: This runs replay-dump.py after recording a trace, and fails the test if the script fails. replay-dump.py is modified to exit with non-zero if an error is encountered while parsing. I would like to have separate test for replay-dump, because

Re: [PATCH 1/4] scripts/replay_dump.sh: Update to current rr record format

2023-08-17 Thread Pavel Dovgalyuk
On 14.08.2023 19:31, Nicholas Piggin wrote: This thing seems to have fallen by the wayside. This gets it working with the current format, although does not quite implement all events. Signed-off-by: Nicholas Piggin The code looks ok, therefore Rewieved-by: Pavel Dovgalyuk However, there is

[PATCH RESEND v5 13/26] hw/core/cpu: Return static value with gdb_arch_name()

2023-08-17 Thread Akihiko Odaki
All implementations of gdb_arch_name() returns dynamic duplicates of static strings. It's also unlikely that there will be an implementation of gdb_arch_name() that returns a truly dynamic value due to the nature of the function returning a well-known identifiers. Qualify the value gdb_arch_name()

[PATCH RESEND v5 24/26] contrib/plugins: Allow to log registers

2023-08-17 Thread Akihiko Odaki
This demonstrates how a register can be read from a plugin. Signed-off-by: Akihiko Odaki --- docs/devel/tcg-plugins.rst | 10 ++- contrib/plugins/execlog.c | 140 - 2 files changed, 117 insertions(+), 33 deletions(-) diff --git a/docs/devel/tcg-plugins.rst

[PATCH RESEND v5 08/26] target/arm: Use GDBFeature for dynamic XML

2023-08-17 Thread Akihiko Odaki
In preparation for a change to use GDBFeature as a parameter of gdb_register_coprocessor(), convert the internal representation of dynamic feature from plain XML to GDBFeature. Signed-off-by: Akihiko Odaki Acked-by: Richard Henderson --- target/arm/cpu.h | 20 +++---

[PATCH RESEND v5 23/26] plugins: Allow to read registers

2023-08-17 Thread Akihiko Odaki
It is based on GDB protocol to ensure interface stability. The timing of the vcpu init hook is also changed so that the hook will get called after GDB features are initialized. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1706 Signed-off-by: Akihiko Odaki ---

[PATCH RESEND v5 22/26] cpu: Call plugin hooks only when ready

2023-08-17 Thread Akihiko Odaki
The initialization and exit hooks will not affect the state of vCPU, but they may depend on the state of vCPU. Therefore, it's better to call plugin hooks after the vCPU state is fully initialized and before it gets uninitialized. Signed-off-by: Akihiko Odaki --- cpu.c| 11

[PATCH RESEND v5 26/26] contrib/plugins: Add cc plugin

2023-08-17 Thread Akihiko Odaki
This demonstrates how to write a plugin in C++. Signed-off-by: Akihiko Odaki --- docs/devel/tcg-plugins.rst | 8 configure | 15 --- contrib/plugins/Makefile | 5 + contrib/plugins/cc.cc | 17 + tests/tcg/Makefile.target | 3

[PATCH RESEND v5 12/26] gdbstub: Use GDBFeature for GDBRegisterState

2023-08-17 Thread Akihiko Odaki
Simplify GDBRegisterState by replacing num_regs and xml members with one member that points to GDBFeature. Signed-off-by: Akihiko Odaki --- gdbstub/gdbstub.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index

[PATCH RESEND v5 09/26] target/ppc: Use GDBFeature for dynamic XML

2023-08-17 Thread Akihiko Odaki
In preparation for a change to use GDBFeature as a parameter of gdb_register_coprocessor(), convert the internal representation of dynamic feature from plain XML to GDBFeature. Signed-off-by: Akihiko Odaki Reviewed-by: Richard Henderson --- target/ppc/cpu-qom.h | 3 +-- target/ppc/cpu.h

[PATCH v2] target/riscv: Allocate itrigger timers only once

2023-08-17 Thread Akihiko Odaki
riscv_trigger_init() had been called on reset events that can happen several times for a CPU and it allocated timers for itrigger. If old timers were present, they were simply overwritten by the new timers, resulting in a memory leak. Divide riscv_trigger_init() into two functions, namely

[PATCH RESEND v5 11/26] gdbstub: Use GDBFeature for gdb_register_coprocessor

2023-08-17 Thread Akihiko Odaki
This is a tree-wide change to introduce GDBFeature parameter to gdb_register_coprocessor(). The new parameter just replaces num_regs and xml parameters for now. GDBFeature will be utilized to simplify XML lookup in a following change. Signed-off-by: Akihiko Odaki Acked-by: Alex Bennée ---

[PATCH RESEND v5 15/26] gdbstub: Simplify XML lookup

2023-08-17 Thread Akihiko Odaki
Now we know all instances of GDBFeature that is used in CPU so we can traverse them to find XML. This removes the need for a CPU-specific lookup function for dynamic XMLs. Signed-off-by: Akihiko Odaki --- gdbstub/gdbstub.c | 24 1 file changed, 8 insertions(+), 16

[PATCH RESEND v5 00/26] plugins: Allow to read registers

2023-08-17 Thread Akihiko Odaki
I and other people in the University of Tokyo, where I research processor design, found TCG plugins are very useful for processor design exploration. The feature we find missing is the capability to read registers from plugins. In this series, I propose to add such a capability by reusing gdbstub

[PATCH RESEND v5 05/26] target/arm: Move the reference to arm-core.xml

2023-08-17 Thread Akihiko Odaki
Some subclasses overwrite gdb_core_xml_file member but others don't. Always initialize the member in the subclasses for consistency. This especially helps for AArch64; in a following change, the file specified by gdb_core_xml_file is always looked up even if it's going to be overwritten later.

[PATCH RESEND v5 02/26] gdbstub: Introduce GDBFeature structure

2023-08-17 Thread Akihiko Odaki
Before this change, the information from a XML file was stored in an array that is not descriptive. Introduce a dedicated structure type to make it easier to understand and to extend with more fields. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée

[PATCH RESEND v5 07/26] gdbstub: Introduce GDBFeatureBuilder

2023-08-17 Thread Akihiko Odaki
GDBFeatureBuilder unifies the logic to generate dynamic GDBFeature. Signed-off-by: Akihiko Odaki Reviewed-by: Richard Henderson --- include/exec/gdbstub.h | 20 ++ gdbstub/gdbstub.c | 59 ++ 2 files changed, 79 insertions(+) diff --git

[PATCH RESEND v5 25/26] plugins: Support C++

2023-08-17 Thread Akihiko Odaki
Make qemu-plugin.h consumable for C++ platform. Signed-off-by: Akihiko Odaki --- include/qemu/qemu-plugin.h | 4 1 file changed, 4 insertions(+) diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 214b12bfd6..8637e3d8cf 100644 --- a/include/qemu/qemu-plugin.h +++

[PATCH RESEND v5 10/26] target/riscv: Use GDBFeature for dynamic XML

2023-08-17 Thread Akihiko Odaki
In preparation for a change to use GDBFeature as a parameter of gdb_register_coprocessor(), convert the internal representation of dynamic feature from plain XML to GDBFeature. Signed-off-by: Akihiko Odaki --- target/riscv/cpu.h | 4 +-- target/riscv/cpu.c | 4 +--

[PATCH RESEND v5 14/26] gdbstub: Dynamically allocate target.xml buffer

2023-08-17 Thread Akihiko Odaki
There is no guarantee that target.xml fits in 1024 bytes, and the fixed buffer length requires tedious buffer overflow check. Dynamically allocate the target.xml buffer to resolve these problems. Suggested-by: Alex Bennée Signed-off-by: Akihiko Odaki --- gdbstub/internals.h | 2 +-

[PATCH RESEND v5 21/26] gdbstub: Expose functions to read registers

2023-08-17 Thread Akihiko Odaki
gdb_foreach_feature() enumerates features that are useful to identify registers. gdb_read_register() actually reads registers. Signed-off-by: Akihiko Odaki --- include/exec/gdbstub.h | 6 ++ gdbstub/gdbstub.c | 20 +++- 2 files changed, 25 insertions(+), 1 deletion(-)

[PATCH RESEND v5 19/26] target/ppc: Remove references to gdb_has_xml

2023-08-17 Thread Akihiko Odaki
GDB has XML support since 6.7 which was released in 2007. It's time to remove support for old GDB versions without XML support. Signed-off-by: Akihiko Odaki --- target/ppc/gdbstub.c | 12 1 file changed, 12 deletions(-) diff --git a/target/ppc/gdbstub.c b/target/ppc/gdbstub.c

[PATCH RESEND v5 20/26] gdbstub: Remove gdb_has_xml variable

2023-08-17 Thread Akihiko Odaki
GDB has XML support since 6.7 which was released in 2007. It's time to remove support for old GDB versions without XML support. Signed-off-by: Akihiko Odaki --- include/exec/gdbstub.h | 8 gdbstub/gdbstub.c | 13 - gdbstub/softmmu.c | 1 - gdbstub/user.c

[PATCH RESEND v5 18/26] target/arm: Remove references to gdb_has_xml

2023-08-17 Thread Akihiko Odaki
GDB has XML support since 6.7 which was released in 2007. It's time to remove support for old GDB versions without XML support. Signed-off-by: Akihiko Odaki --- target/arm/gdbstub.c | 32 ++-- 1 file changed, 2 insertions(+), 30 deletions(-) diff --git

[PATCH RESEND v5 16/26] hw/core/cpu: Remove gdb_get_dynamic_xml member

2023-08-17 Thread Akihiko Odaki
This function is no longer used. Signed-off-by: Akihiko Odaki --- include/hw/core/cpu.h | 4 target/arm/cpu.h | 6 -- target/ppc/cpu.h | 1 - target/arm/cpu.c | 1 - target/arm/gdbstub.c | 18 -- target/ppc/cpu_init.c | 3 --- target/ppc/gdbstub.c

[PATCH RESEND v5 06/26] hw/core/cpu: Replace gdb_core_xml_file with gdb_core_feature

2023-08-17 Thread Akihiko Odaki
This is a tree-wide change to replace gdb_core_xml_file, the path to GDB XML file with gdb_core_feature, the pointer to GDBFeature. This also replaces the values assigned to gdb_num_core_regs with the num_regs member of GDBFeature where applicable to remove magic numbers. A following change will

[PATCH RESEND v5 17/26] gdbstub: Add members to identify registers to GDBFeature

2023-08-17 Thread Akihiko Odaki
These members will be used to help plugins to identify registers. The added members in instances of GDBFeature dynamically generated by CPUs will be filled in later changes. Signed-off-by: Akihiko Odaki --- include/exec/gdbstub.h | 3 +++ gdbstub/gdbstub.c | 8 ++--

[PATCH RESEND v5 01/26] contrib/plugins: Use GRWLock in execlog

2023-08-17 Thread Akihiko Odaki
execlog had the following comment: > As we could have multiple threads trying to do this we need to > serialise the expansion under a lock. Threads accessing already > created entries can continue without issue even if the ptr array > gets reallocated during resize. However, when the ptr array

[PATCH RESEND v5 04/26] gdbstub: Introduce gdb_find_static_feature()

2023-08-17 Thread Akihiko Odaki
This function is useful to determine the number of registers exposed to GDB from the XML name. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson --- include/exec/gdbstub.h | 2 ++ gdbstub/gdbstub.c | 13

[PATCH RESEND v5 03/26] gdbstub: Add num_regs member to GDBFeature

2023-08-17 Thread Akihiko Odaki
Currently the number of registers exposed to GDB is written as magic numbers in code. Derive the number of registers GDB actually see from XML files to replace the magic numbers in code later. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée ---

[PATCH] HDA codec: Fix wanted_r/w position overflow

2023-08-17 Thread M_O_Bz
From: zeroway when the duration now - buft_start reach to some kind of value, which will get the multiply hda_bytes_per_second(st) * (now - buft_start) overflow, instead of calculate the wanted_r/wpos from start time to current time, here calculate the each timer tick delta data first in

Re: [PATCH v5 1/5] ebpf: Added eBPF map update through mmap.

2023-08-17 Thread Andrew Melnichenko
Hi all, On Wed, Aug 16, 2023 at 4:16 AM Jason Wang wrote: > > On Mon, Aug 14, 2023 at 4:36 PM Andrew Melnichenko wrote: > > > > Hi, all. > > > > I've researched an issue a bit. And what can we do? > > In the case of an "old" kernel 5.4, we need to load RSS eBPF without > > BPF_F_MAPPABLE > >

Re: [PATCH 5/6] linux-user: Remove ELF_START_MMAP and image_info.start_mmap

2023-08-17 Thread Warner Losh
On Thu, Aug 17, 2023 at 6:19 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 8/17/23 02:00, Philippe Mathieu-Daudé wrote: > > On 16/8/23 20:14, Richard Henderson wrote: > >> The start_mmap value is write-only. > >> Remove the field and the defines that populated it. > >>

Re: [PATCH 5/6] linux-user: Remove ELF_START_MMAP and image_info.start_mmap

2023-08-17 Thread Richard Henderson
On 8/17/23 02:00, Philippe Mathieu-Daudé wrote: On 16/8/23 20:14, Richard Henderson wrote: The start_mmap value is write-only. Remove the field and the defines that populated it. Logically, this has been replaced by task_unmapped_base. Signed-off-by: Richard Henderson ---   linux-user/qemu.h  

Re: [PATCH 3/6] linux-user: Adjust brk for load_bias

2023-08-17 Thread Richard Henderson
On 8/17/23 09:04, Michael Tokarev wrote: 16.08.2023 21:14, Richard Henderson wrote: PIE executables are usually linked at offset 0 and are relocated somewhere during load.  The hiaddr needs to be adjusted to keep the brk next to the executable. Cc: qemu-sta...@nongnu.org Fixes: 1f356e8c013

Re: [PATCH 3/6] linux-user: Adjust brk for load_bias

2023-08-17 Thread Richard Henderson
On 8/17/23 01:53, Philippe Mathieu-Daudé wrote: On 16/8/23 20:14, Richard Henderson wrote: PIE executables are usually linked at offset 0 and are relocated somewhere during load.  The hiaddr needs to be adjusted to keep the brk next to the executable. Cc: qemu-sta...@nongnu.org Fixes:

Re: [PATCH v7 9/9] docs/system: add basic virtio-gpu documentation

2023-08-17 Thread Gurchetan Singh
On Wed, Aug 16, 2023 at 10:28 PM Akihiko Odaki wrote: > On 2023/08/17 11:23, Gurchetan Singh wrote: > > From: Gurchetan Singh > > > > This adds basic documentation for virtio-gpu. > > > > Suggested-by: Akihiko Odaki > > Signed-off-by: Gurchetan Singh > > Tested-by: Alyssa Ross > > Tested-by:

[PATCH v8 9/9] docs/system: add basic virtio-gpu documentation

2023-08-17 Thread Gurchetan Singh
This adds basic documentation for virtio-gpu. Suggested-by: Akihiko Odaki Signed-off-by: Gurchetan Singh Tested-by: Alyssa Ross Tested-by: Emmanouil Pitsidianakis Reviewed-by: Emmanouil Pitsidianakis v2: - Incorporated suggestions by Akihiko Odaki - Listed the currently supported

Re: [PATCH 2/3] tcg: Fold deposit with zero to and

2023-08-17 Thread Richard Henderson
On 8/17/23 08:50, Peter Maydell wrote: +if (arg_is_const(op->args[1]) +&& arg_info(op->args[1])->val == 0 +&& op->args[3] == 0) { +uint64_t mask = MAKE_64BIT_MASK(0, op->args[4]); The docs for the TCG deposit op don't say what the restrictions on the immediate args

Re: [PATCH 1/3] tcg/i386: Drop BYTEH deposits for 64-bit

2023-08-17 Thread Richard Henderson
On 8/17/23 08:44, Peter Maydell wrote: On Wed, 16 Aug 2023 at 16:01, Richard Henderson wrote: It is more useful to allow low-part deposits into all registers than to restrict allocation for high-byte deposits. #define TCG_TARGET_deposit_i32_valid(ofs, len) \ -(((ofs) == 0 && (len) ==

Re: How to synchronize CPUs on MMIO read?

2023-08-17 Thread Richard Henderson
On 8/16/23 09:31, Igor Lesik wrote: Hi. I need to model some custom HW that synchronizes CPUs when they read MMIO register N: MMIO read does not return until another CPU writes to MMIO register M. I modeled this behavior with a) on MMIO read of N, save CPU into a list of waiting CPUs and put

Re: [PATCH v3 2/2] target/i386: Avoid overflow of the cache parameter enumerated by leaf 4

2023-08-17 Thread Isaku Yamahata
On Wed, Aug 16, 2023 at 04:06:58PM +0800, Qian Wen wrote: > According to SDM, CPUID.0x4:EAX[31:26] indicates the Maximum number of > addressable IDs for processor cores in the physical package. If we > launch over 64 cores VM, the 6-bit field will overflow, and the wrong > core_id number will be

Re: [PATCH v3 0/2] Fix overflow of the max number of IDs for logic processor and core

2023-08-17 Thread Isaku Yamahata
On Wed, Aug 16, 2023 at 04:06:56PM +0800, Qian Wen wrote: > CPUID.1.EBX[23:16]: Maximum number of addressable IDs for logical > processors in this physical package. > CPUID.4:EAX[31:26]: Maximum number of addressable IDs for processor cores > in the physical package. > > The current qemu code

Re: [PATCH v3 1/2] target/i386: Avoid cpu number overflow in legacy topology

2023-08-17 Thread Isaku Yamahata
On Wed, Aug 16, 2023 at 04:06:57PM +0800, Qian Wen wrote: > The legacy topology enumerated by CPUID.1.EBX[23:16] is defined in SDM > Vol2: > > Bits 23-16: Maximum number of addressable IDs for logical processors in > this physical package. > > When threads_per_socket > 255, it will 1)

Re: [PATCH 01/21] block: Remove unused BlockReopenQueueEntry.perms_checked

2023-08-17 Thread Eric Blake
On Thu, Aug 17, 2023 at 02:50:00PM +0200, Kevin Wolf wrote: > This field has been unused since commit 72373e40fbc ('block: > bdrv_reopen_multiple: refresh permissions on updated graph'). > Remove it. > > Signed-off-by: Kevin Wolf > --- > block.c | 1 - > 1 file changed, 1 deletion(-)

Re: Tips for local testing guestfwd

2023-08-17 Thread Felix Wu
Hi Samuel, Thanks for the clarification! I missed the email so didn't reply in time, but was able to figure it out. Hi everyone, IPv6 guestfwd works in my local test but it has a weird bug: if you send two requests, the first one gets the correct response, but the second one gets stuck. I am

Re: [PATCH V3 01/10] vl: start on wakeup request

2023-08-17 Thread Peter Xu
On Mon, Aug 14, 2023 at 11:54:27AM -0700, Steve Sistare wrote: > +void vm_wakeup(void) > +{ > +if (!vm_started) { > +vm_start(); (irrelevant of the global var that I wanted to remove..) Calling vm_start() is wrong here, IMHO. I think we need to notify everyone on the wakeup before

Re: [PATCH V3 00/10] fix migration of suspended runstate

2023-08-17 Thread Peter Xu
On Mon, Aug 14, 2023 at 11:54:26AM -0700, Steve Sistare wrote: > Migration of a guest in the suspended runstate is broken. The incoming > migration code automatically tries to wake the guest, which is wrong; > the guest should end migration in the same runstate it started. Further, > for a

Re: [PATCH V1 2/3] migration: fix suspended runstate

2023-08-17 Thread Peter Xu
On Wed, Aug 16, 2023 at 01:48:13PM -0400, Steven Sistare wrote: > On 8/14/2023 3:37 PM, Peter Xu wrote: > > On Mon, Aug 14, 2023 at 02:53:56PM -0400, Steven Sistare wrote: > >>> Can we just call vm_state_notify() earlier? > >> > >> We cannot. The guest is not running yet, and will not be until

Re: [PATCH 0/6] linux-user: Rewrite open_self_maps

2023-08-17 Thread Ilya Leoshkevich
On Wed, Aug 16, 2023 at 11:14:31AM -0700, Richard Henderson wrote: > Based-on: 20230816180338.572576-1-richard.hender...@linaro.org > ("[PATCH v4 00/18] linux-user: Implement VDSOs") > > As promised, a rewrite of /proc/self/{maps,smaps} emulation > using interval trees. > > Incorporate Helge's

Re: [PATCH] chardev/char-pty: Avoid losing bytes when the other side just (re-)connected

2023-08-17 Thread Thomas Huth
On 17/08/2023 15.47, Marc-André Lureau wrote: Hi On Thu, Aug 17, 2023 at 5:06 PM Daniel P. Berrangé wrote: On Thu, Aug 17, 2023 at 02:00:26PM +0200, Thomas Huth wrote: On 17/08/2023 12.32, Daniel P. Berrangé wrote: On Wed, Aug 16, 2023 at 11:07:43PM +0200, Thomas Huth wrote: When starting

Re: [PATCH 3/3] tests/tcg/s390x: Test VSTRS

2023-08-17 Thread Ilya Leoshkevich
On Thu, Aug 17, 2023 at 11:37:29AM +0200, Claudio Fontana wrote: > On 8/5/23 01:03, Ilya Leoshkevich wrote: > > Add a small test to prevent regressions. > > > > Signed-off-by: Ilya Leoshkevich > > Something seems off in the wiring of the make check target? > > I built with: > > ./configure

[PATCH v2 1/4] block: rename blk_io_plug_call() API to defer_call()

2023-08-17 Thread Stefan Hajnoczi
Prepare to move the blk_io_plug_call() API out of the block layer so that other subsystems call use this deferred call mechanism. Rename it to defer_call() but leave the code in block/plug.c. The next commit will move the code out of the block layer. Suggested-by: Ilya Maximets Signed-off-by:

Re: [PATCH for-8.1] vfio/display: Fix missing update to set backing fields

2023-08-17 Thread Kim, Dongwon
Ok, this regression happened not just because of renaming. Originally width and height were representing the size of whole surface that guest shares while scanout width and height are for the each scanout. We realized backing_width/height are more commonly used to specify the size of the whole

Re: [PATCH 3/6] linux-user: Adjust brk for load_bias

2023-08-17 Thread Michael Tokarev
16.08.2023 21:14, Richard Henderson wrote: PIE executables are usually linked at offset 0 and are relocated somewhere during load. The hiaddr needs to be adjusted to keep the brk next to the executable. Cc: qemu-sta...@nongnu.org Fixes: 1f356e8c013 ("linux-user: Adjust initial brk when

[PATCH v2 4/4] virtio-blk: remove batch notification BH

2023-08-17 Thread Stefan Hajnoczi
There is a batching mechanism for virtio-blk Used Buffer Notifications that is no longer needed because the previous commit added batching to virtio_notify_irqfd(). Note that this mechanism was rarely used in practice because it is only enabled when EVENT_IDX is not negotiated by the driver.

[PATCH v2 2/4] util/defer-call: move defer_call() to util/

2023-08-17 Thread Stefan Hajnoczi
The networking subsystem may wish to use defer_call(), so move the code to util/ where it can be reused. As a reminder of what defer_call() does: This API defers a function call within a defer_call_begin()/defer_call_end() section, allowing multiple calls to batch up. This is a performance

[PATCH v2 0/4] virtio-blk: use blk_io_plug_call() instead of notification BH

2023-08-17 Thread Stefan Hajnoczi
v2: - Rename blk_io_plug() to defer_call() and move it to util/ so the net subsystem can use it [Ilya] - Add defer_call_begin()/end() to thread_pool_completion_bh() to match Linux AIO and io_uring completion batching Replace the seldom-used virtio-blk notification BH mechanism with

[PATCH v2 3/4] virtio: use defer_call() in virtio_irqfd_notify()

2023-08-17 Thread Stefan Hajnoczi
virtio-blk and virtio-scsi invoke virtio_irqfd_notify() to send Used Buffer Notifications from an IOThread. This involves an eventfd write(2) syscall. Calling this repeatedly when completing multiple I/O requests in a row is wasteful. Use the defer_call() API to batch together

Re: [PATCH 3/3] tcg/i386: Allow immediate as input to deposit_*

2023-08-17 Thread Peter Maydell
On Wed, 16 Aug 2023 at 15:58, Richard Henderson wrote: > > We can use MOVB and MOVW with an immediate just as easily > as with a register input. > > Signed-off-by: Richard Henderson > --- Reviewed-by: Peter Maydell thanks -- PMM

Re: [PATCH 2/3] tcg: Fold deposit with zero to and

2023-08-17 Thread Peter Maydell
On Wed, 16 Aug 2023 at 15:58, Richard Henderson wrote: > > Inserting a zero into a value, or inserting a value > into zero at offset 0 my be implemented with AND. > > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 35 +++ > 1 file changed, 35

Re: [PATCH 1/3] tcg/i386: Drop BYTEH deposits for 64-bit

2023-08-17 Thread Peter Maydell
On Wed, 16 Aug 2023 at 16:01, Richard Henderson wrote: > > It is more useful to allow low-part deposits into all registers > than to restrict allocation for high-byte deposits. > #define TCG_TARGET_deposit_i32_valid(ofs, len) \ > -(((ofs) == 0 && (len) == 8) || ((ofs) == 8 && (len) == 8) ||

Re: [PATCH v1 1/3] softmmu/physmem: fallback to opening guest RAM file as readonly in a MAP_PRIVATE mapping

2023-08-17 Thread David Hildenbrand
On 17.08.23 17:31, Peter Xu wrote: On Thu, Aug 17, 2023 at 05:15:52PM +0200, David Hildenbrand wrote: I don't know how important that requirement was (that commit was a request from Kata Containers). Let me take a look if Kata passes "share=on,readonly=on" or "share=off,readonly=off". The

Re: [PATCH] hw/net/vmxnet3: Fix guest-triggerable assert()

2023-08-17 Thread Philippe Mathieu-Daudé
Hi Thomas, On 17/8/23 14:56, Thomas Huth wrote: The assert() that checks for valid MTU sizes can be triggered by the guest (e.g. with the reproducer code from the bug ticket https://gitlab.com/qemu-project/qemu/-/issues/517 ). Let's avoid this problem by simply logging the error and refusing to

Re: [PATCH v1 1/3] softmmu/physmem: fallback to opening guest RAM file as readonly in a MAP_PRIVATE mapping

2023-08-17 Thread Peter Xu
On Thu, Aug 17, 2023 at 05:15:52PM +0200, David Hildenbrand wrote: > > I don't know how important that requirement was (that commit was a > > request from Kata Containers). > > Let me take a look if Kata passes "share=on,readonly=on" or > "share=off,readonly=off". The question is whether it's

[PATCH] target/riscv: fix satp_mode_finalize() when satp_mode.supported = 0

2023-08-17 Thread Daniel Henrique Barboza
In the same emulated RISC-V host, the 'host' KVM CPU takes 4 times longer to boot than the 'rv64' KVM CPU. The reason is an unintended behavior of riscv_cpu_satp_mode_finalize() when satp_mode.supported = 0, i.e. when cpu_init() does not set satp_mode_max_supported(). satp_mode_max_from_map(map)

Re: [PATCH v1 1/3] softmmu/physmem: fallback to opening guest RAM file as readonly in a MAP_PRIVATE mapping

2023-08-17 Thread David Hildenbrand
Commit 86635aa4e9d627d5142b81c57a33dd1f36627d07 mentions that we don't want guests to be able to dirty pages on the host. The change you're proposing would not protect against guests that dirty the memory. The guest could write memory but not modify the file. Only with

Re: [PATCH v1 1/3] softmmu/physmem: fallback to opening guest RAM file as readonly in a MAP_PRIVATE mapping

2023-08-17 Thread David Hildenbrand
On 17.08.23 17:13, Stefan Hajnoczi wrote: On Thu, 17 Aug 2023 at 05:08, David Hildenbrand wrote: @Stefan, see below on a R/O NVDIMM question. We're discussing how to get MAPR_PRIVATE R/W mapping of a memory-backend-file running when using R/O files. This seems a good idea. I am good with

Re: [PATCH v1 1/3] softmmu/physmem: fallback to opening guest RAM file as readonly in a MAP_PRIVATE mapping

2023-08-17 Thread Stefan Hajnoczi
On Thu, 17 Aug 2023 at 05:08, David Hildenbrand wrote: > > @Stefan, see below on a R/O NVDIMM question. > > We're discussing how to get MAPR_PRIVATE R/W mapping of a > memory-backend-file running when using R/O files. > > > > > This seems a good idea. I am good with the solution you proposed > >

Re: [PATCH v1 1/3] softmmu/physmem: fallback to opening guest RAM file as readonly in a MAP_PRIVATE mapping

2023-08-17 Thread David Hildenbrand
On 17.08.23 16:41, Peter Xu wrote: On Thu, Aug 17, 2023 at 11:07:23AM +0200, David Hildenbrand wrote: @Stefan, see below on a R/O NVDIMM question. We're discussing how to get MAPR_PRIVATE R/W mapping of a memory-backend-file running when using R/O files. This seems a good idea. I am good

Re: [PATCH v3 1/7] vdpa: Use iovec for vhost_vdpa_net_load_cmd()

2023-08-17 Thread Hawkins Jiawei
在 2023/8/17 22:05, Eugenio Perez Martin 写道: > On Thu, Aug 17, 2023 at 2:42 PM Hawkins Jiawei wrote: >> >> On 2023/8/17 17:23, Eugenio Perez Martin wrote: >>> On Fri, Jul 7, 2023 at 5:27 PM Hawkins Jiawei wrote: According to VirtIO standard, "The driver MUST follow the

Re: [PATCH v1 1/3] softmmu/physmem: fallback to opening guest RAM file as readonly in a MAP_PRIVATE mapping

2023-08-17 Thread David Hildenbrand
On 17.08.23 16:45, Daniel P. Berrangé wrote: On Thu, Aug 17, 2023 at 04:37:52PM +0200, David Hildenbrand wrote: On 17.08.23 16:37, Daniel P. Berrangé wrote: On Thu, Aug 17, 2023 at 04:30:16PM +0200, David Hildenbrand wrote: @Stefan, do you have any concern when we would do 1) ? As far as I

Re: [PATCH v1 1/3] softmmu/physmem: fallback to opening guest RAM file as readonly in a MAP_PRIVATE mapping

2023-08-17 Thread Daniel P . Berrangé
On Thu, Aug 17, 2023 at 04:37:52PM +0200, David Hildenbrand wrote: > On 17.08.23 16:37, Daniel P. Berrangé wrote: > > On Thu, Aug 17, 2023 at 04:30:16PM +0200, David Hildenbrand wrote: > > > > > > > @Stefan, do you have any concern when we would do 1) ? > > > > > > > > As far as I can tell, we

Re: [PATCH v1 1/3] softmmu/physmem: fallback to opening guest RAM file as readonly in a MAP_PRIVATE mapping

2023-08-17 Thread Peter Xu
On Thu, Aug 17, 2023 at 11:07:23AM +0200, David Hildenbrand wrote: > @Stefan, see below on a R/O NVDIMM question. > > We're discussing how to get MAPR_PRIVATE R/W mapping of a > memory-backend-file running when using R/O files. > > > > > This seems a good idea. I am good with the solution you

Re: [PATCH v1 1/3] softmmu/physmem: fallback to opening guest RAM file as readonly in a MAP_PRIVATE mapping

2023-08-17 Thread David Hildenbrand
On 17.08.23 16:37, Daniel P. Berrangé wrote: On Thu, Aug 17, 2023 at 04:30:16PM +0200, David Hildenbrand wrote: @Stefan, do you have any concern when we would do 1) ? As far as I can tell, we have to set the nvdimm to "unarmed=on" either way: + "unarmed" controls the ACPI NFIT NVDIMM

Re: [PATCH v1 1/3] softmmu/physmem: fallback to opening guest RAM file as readonly in a MAP_PRIVATE mapping

2023-08-17 Thread Daniel P . Berrangé
On Thu, Aug 17, 2023 at 04:30:16PM +0200, David Hildenbrand wrote: > > > @Stefan, do you have any concern when we would do 1) ? > > > > As far as I can tell, we have to set the nvdimm to "unarmed=on" either way: > > > > + "unarmed" controls the ACPI NFIT NVDIMM Region Mapping Structure

Re: [PATCH] migrate/ram: let ram_save_target_page_legacy() return if qemu file got error

2023-08-17 Thread Guoyi Tu
I apologize for the previous email being cut off. I am resending it here. It sounds very reasonable. the return value of the QEMUFile interface cannot accurately reflect the actual situation, and the way these interfaces are being called during the migration process also is a little bit weird.

Re: [PATCH v1 1/3] softmmu/physmem: fallback to opening guest RAM file as readonly in a MAP_PRIVATE mapping

2023-08-17 Thread David Hildenbrand
@Stefan, do you have any concern when we would do 1) ? As far as I can tell, we have to set the nvdimm to "unarmed=on" either way: + "unarmed" controls the ACPI NFIT NVDIMM Region Mapping Structure "NVDIMM + State Flags" Bit 3 indicating that the device is "unarmed" and cannot accept +

Re: [PATCH] migrate/ram: let ram_save_target_page_legacy() return if qemu file got error

2023-08-17 Thread Guoyi Tu
Thank you for the reminder. There might be some issues with the company's email service. I also noticed this morning that I missed receiving an email in response from Fabiano. On 2023/8/17 21:35, 【外部账号】 Peter Xu wrote: On Thu, Aug 17, 2023 at 10:19:19AM +0800, Guoyi Tu wrote: On 2023/8/16

Re: [PATCH v1 2/2] ui/vdagent: Unregister input handler of mouse during finalization

2023-08-17 Thread Marc-André Lureau
On Thu, Aug 17, 2023 at 6:24 PM wrote: > > From: Guoyi Tu > > Input handler resource should be released when > VDAgentChardev object finalize > > Signed-off-by: Guoyi Tu > Signed-off-by: dengpengcheng Reviewed-by: Marc-André Lureau > --- > ui/vdagent.c | 3 +++ > 1 file changed, 3

Re: [PATCH v1 1/2] ui/vdagent: call vdagent_disconnect() when agent connection is lost

2023-08-17 Thread Marc-André Lureau
On Thu, Aug 17, 2023 at 6:24 PM wrote: > > From: Guoyi Tu > > when the agent connection is lost, the input handler of the mouse > doesn't deactivate, which results in unresponsive mouse events in > VNC windows. > > To fix this issue, call vdagent_disconnect() to reset the state > each time the

Re: [PATCH v3 2/7] vdpa: Restore MAC address filtering state

2023-08-17 Thread Eugenio Perez Martin
On Thu, Aug 17, 2023 at 2:47 PM Hawkins Jiawei wrote: > > On 2023/8/17 18:18, Eugenio Perez Martin wrote: > > On Fri, Jul 7, 2023 at 5:27 PM Hawkins Jiawei wrote: > >> > >> This patch refactors vhost_vdpa_net_load_mac() to > >> restore the MAC address filtering state at device's startup. > >> >

[PATCH v1 0/2] ui/vdagent: Fix two bugs about disconnect event handling

2023-08-17 Thread tugy
From: Guoyi Tu and resource leak Guoyi Tu (2): ui/vdagent: call vdagent_disconnect() when agent connection is lost ui/vdagent: Unregister input handler of mouse during finalization ui/vdagent.c | 6 ++ 1 file changed, 6 insertions(+) -- 2.27.0

[PATCH v1 2/2] ui/vdagent: Unregister input handler of mouse during finalization

2023-08-17 Thread tugy
From: Guoyi Tu Input handler resource should be released when VDAgentChardev object finalize Signed-off-by: Guoyi Tu Signed-off-by: dengpengcheng --- ui/vdagent.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/vdagent.c b/ui/vdagent.c index 4b9a1fb7c5..00d36a8677 100644 ---

[PATCH v1 1/2] ui/vdagent: call vdagent_disconnect() when agent connection is lost

2023-08-17 Thread tugy
From: Guoyi Tu when the agent connection is lost, the input handler of the mouse doesn't deactivate, which results in unresponsive mouse events in VNC windows. To fix this issue, call vdagent_disconnect() to reset the state each time the frontend disconncect Signed-off-by: Guoyi Tu

Re: [PATCH v1 1/3] softmmu/physmem: fallback to opening guest RAM file as readonly in a MAP_PRIVATE mapping

2023-08-17 Thread Daniel P . Berrangé
On Fri, Aug 11, 2023 at 09:00:54PM +0200, David Hildenbrand wrote: > On 11.08.23 07:49, ThinerLogoer wrote: > > At 2023-08-11 05:24:43, "Peter Xu" wrote: > > > On Fri, Aug 11, 2023 at 01:06:12AM +0800, ThinerLogoer wrote: > > > > > I think we have the following options (there might be more) > > >

Re: [PATCH v1 1/3] softmmu/physmem: fallback to opening guest RAM file as readonly in a MAP_PRIVATE mapping

2023-08-17 Thread Daniel P . Berrangé
On Thu, Aug 10, 2023 at 04:19:45PM +0200, David Hildenbrand wrote: > > > Most importantly, we won't be corrupting/touching the original file in any > > > case, because it is R/O. > > > > > > If we really want to be careful, we could clue that behavior to compat > > > machines. I'm not really sure

[ANNOUNCE] QEMU 8.1.0-rc4 is now available

2023-08-17 Thread Michael Roth
Hello, On behalf of the QEMU Team, I'd like to announce the availability of the fifth release candidate for the QEMU 8.1 release. This release is meant for testing purposes and should not be used in a production environment. http://download.qemu.org/qemu-8.1.0-rc4.tar.xz

Re: [PATCH v1 1/3] softmmu/physmem: fallback to opening guest RAM file as readonly in a MAP_PRIVATE mapping

2023-08-17 Thread David Hildenbrand
On 17.08.23 15:46, Daniel P. Berrangé wrote: On Fri, Aug 11, 2023 at 09:00:54PM +0200, David Hildenbrand wrote: On 11.08.23 07:49, ThinerLogoer wrote: At 2023-08-11 05:24:43, "Peter Xu" wrote: On Fri, Aug 11, 2023 at 01:06:12AM +0800, ThinerLogoer wrote: I think we have the following

[PATCH 01/21] block: Remove unused BlockReopenQueueEntry.perms_checked

2023-08-17 Thread Kevin Wolf
This field has been unused since commit 72373e40fbc ('block: bdrv_reopen_multiple: refresh permissions on updated graph'). Remove it. Signed-off-by: Kevin Wolf --- block.c | 1 - 1 file changed, 1 deletion(-) diff --git a/block.c b/block.c index a307c151a8..6376452768 100644 --- a/block.c +++

Re: [PATCH v1 1/3] softmmu/physmem: fallback to opening guest RAM file as readonly in a MAP_PRIVATE mapping

2023-08-17 Thread Daniel P . Berrangé
On Mon, Aug 07, 2023 at 09:07:32PM +0200, David Hildenbrand wrote: > From: Thiner Logoer > > Users may specify > * "-mem-path" or > * "-object memory-backend-file,share=off,readonly=off" > and expect such COW (MAP_PRIVATE) mappings to work, even if the user > does not have write permissions to

Re: [PATCH] chardev/char-pty: Avoid losing bytes when the other side just (re-)connected

2023-08-17 Thread Marc-André Lureau
Hi On Thu, Aug 17, 2023 at 5:06 PM Daniel P. Berrangé wrote: > > On Thu, Aug 17, 2023 at 02:00:26PM +0200, Thomas Huth wrote: > > On 17/08/2023 12.32, Daniel P. Berrangé wrote: > > > On Wed, Aug 16, 2023 at 11:07:43PM +0200, Thomas Huth wrote: > > > > When starting a guest via libvirt with

Re: [PATCH v1 1/3] softmmu/physmem: fallback to opening guest RAM file as readonly in a MAP_PRIVATE mapping

2023-08-17 Thread David Hildenbrand
On 17.08.23 15:37, Daniel P. Berrangé wrote: On Mon, Aug 07, 2023 at 09:07:32PM +0200, David Hildenbrand wrote: From: Thiner Logoer Users may specify * "-mem-path" or * "-object memory-backend-file,share=off,readonly=off" and expect such COW (MAP_PRIVATE) mappings to work, even if the user

Re: [PATCH v3 1/7] vdpa: Use iovec for vhost_vdpa_net_load_cmd()

2023-08-17 Thread Eugenio Perez Martin
On Thu, Aug 17, 2023 at 2:42 PM Hawkins Jiawei wrote: > > On 2023/8/17 17:23, Eugenio Perez Martin wrote: > > On Fri, Jul 7, 2023 at 5:27 PM Hawkins Jiawei wrote: > >> > >> According to VirtIO standard, "The driver MUST follow > >> the VIRTIO_NET_CTRL_MAC_TABLE_SET command by a le32 number, > >>

Re: [PATCH 2/2] ui/vdagent: Unregister input handler of mouse during finalization

2023-08-17 Thread Marc-André Lureau
On Thu, Aug 17, 2023 at 3:33 PM wrote: > > From: Guoyi Tu > > Input handler resource should be released when > VDAgentChardev object finalize > > Signed-off-by: Guoyi Tu > Signed-off-by: dengpengcheng Reviewed-by: Marc-André Lureau > --- > ui/vdagent.c | 3 +++ > 1 file changed, 3

  1   2   >