[PATCH] util/log: Always send errors to logfile when daemonized

2022-10-13 Thread Greg Kurz
When QEMU is started with `-daemonize`, all stdio descriptors get redirected to `/dev/null`. This basically means that anything printed with `error_report()` and friends is lost. One could hope that passing `-D ${logfile}` would cause the messages to go to `${logfile}`, as the documentation tends

Re: [PATCH v3] target/i386: Set maximum APIC ID to KVM prior to vCPU creation

2022-10-13 Thread Michael S. Tsirkin
On Fri, Oct 14, 2022 at 09:01:02AM +0800, Zeng Guang wrote: > PING again ! > This QEMU patch is to optimize max APIC ID set for current VM session > introduced since linux v6.0. It's also compatible with previous linux > version. > > Thanks. > > On 9/5/2022 9:27 AM, Zeng Guang wrote: > > Kindly P

Re: [PATCH 0/3] iothread and irqfd support

2022-10-13 Thread Jinhao Fan
I also came across the Interrupt Coalescing feature in NVMe (5.21.1.8 in Spec 1.4c). It seems to suggest an algorithm based on thresholds for the maximum interrupt delay time and minimum number of coalesced interrupts. Klaus, based on your experience, how does this algorithm work? Is is commonly u

Re: [PATCH] target/riscv: pmp: Fixup TLB size calculation

2022-10-13 Thread Alistair Francis
On Wed, Oct 12, 2022 at 11:15 AM Alistair Francis wrote: > > From: Alistair Francis > > Since commit 4047368938f6 "accel/tcg: Introduce tlb_set_page_full" we > have been seeing this assert > > ../accel/tcg/cputlb.c:1294: tlb_set_page_with_attrs: Assertion > `is_power_of_2(size)' failed. > >

[PATCH v3] tcg/loongarch64: Add direct jump support

2022-10-13 Thread Qi Hu
Similar to the ARM64, LoongArch has PC-relative instructions such as PCADDU18I. These instructions can be used to support direct jump for LoongArch. Additionally, if instruction "B offset" can cover the target address(target is within ±128MB range), a single "B offset" plus a nop will be used by "t

Re: [PATCH v2] tcg/loongarch64: Add direct jump support

2022-10-13 Thread Qi Hu
On 2022/10/14 02:52, Richard Henderson wrote: On 10/13/22 20:01, Qi Hu wrote: Similar to the ARM64, LoongArch has PC-relative instructions such as PCADDU18I. These instructions can be used to support direct jump for LoongArch. Additionally, if instruction "B offset" can cover the target addres

Re: [PATCH RFC] virtio-net: fix bottom-half packet TX on asynchronous completion

2022-10-13 Thread Jason Wang
On Thu, Oct 13, 2022 at 10:48 PM Michael S. Tsirkin wrote: > > On Thu, Oct 13, 2022 at 04:00:57PM +0200, Laurent Vivier wrote: > > When virtio-net is used with the socket netdev backend, the backend > > can be busy and not able to collect new packets. > > > > In this case, net_socket_receive() ret

[PATCH v3 8/8] mips: re-randomize rng-seed on reboot

2022-10-13 Thread Jason A. Donenfeld
When the system reboots, the rng-seed that the FDT has should be re-randomized, so that the new boot gets a new seed. Since the FDT is in the ROM region at this point, we add a hook right after the ROM has been added, so that we have a pointer to that copy of the FDT. Cc: Aleksandar Rikalo Cc: Pa

[PATCH v3 4/8] arm: re-randomize rng-seed on reboot

2022-10-13 Thread Jason A. Donenfeld
When the system reboots, the rng-seed that the FDT has should be re-randomized, so that the new boot gets a new seed. Since the FDT is in the ROM region at this point, we add a hook right after the ROM has been added, so that we have a pointer to that copy of the FDT. Cc: Peter Maydell Cc: qemu-.

[PATCH v3 6/8] openrisc: re-randomize rng-seed on reboot

2022-10-13 Thread Jason A. Donenfeld
When the system reboots, the rng-seed that the FDT has should be re-randomized, so that the new boot gets a new seed. Since the FDT is in the ROM region at this point, we add a hook right after the ROM has been added, so that we have a pointer to that copy of the FDT. Cc: Stafford Horne Signed-of

[PATCH v3 7/8] rx: re-randomize rng-seed on reboot

2022-10-13 Thread Jason A. Donenfeld
When the system reboots, the rng-seed that the FDT has should be re-randomized, so that the new boot gets a new seed. Since the FDT is in the ROM region at this point, we add a hook right after the ROM has been added, so that we have a pointer to that copy of the FDT. Cc: Yoshinori Sato Signed-of

[PATCH v3 3/8] device-tree: add re-randomization helper function

2022-10-13 Thread Jason A. Donenfeld
When the system reboots, the rng-seed that the FDT has should be re-randomized, so that the new boot gets a new seed. Several architectures require this functionality, so export a function for injecting a new seed into the given FDT. Cc: Alistair Francis Cc: David Gibson Signed-off-by: Jason A.

[PATCH v3 1/8] reset: allow registering handlers that aren't called by snapshot loading

2022-10-13 Thread Jason A. Donenfeld
Snapshot loading only expects to call deterministic handlers, not non-deterministic ones. So introduce a way of registering handlers that won't be called when reseting for snapshots. Signed-off-by: Jason A. Donenfeld --- hw/arm/aspeed.c| 4 ++-- hw/arm/mps2-tz.c | 4 ++--

qemu-devel@nongnu.org

2022-10-13 Thread Jason A. Donenfeld
When the system reboots, the rng seed that QEMU passes should be re-randomized, so that the new boot gets a new seed. This series wires that up for FDT. Then, since the record&replay subsystem makes use of reset as well, we add a new reset cause for record&replay, so that we can avoid re-randomizi

[PATCH v3 5/8] riscv: re-randomize rng-seed on reboot

2022-10-13 Thread Jason A. Donenfeld
When the system reboots, the rng-seed that the FDT has should be re-randomized, so that the new boot gets a new seed. Since the FDT is in the ROM region at this point, we add a hook right after the ROM has been added, so that we have a pointer to that copy of the FDT. Cc: Palmer Dabbelt Cc: Alist

[PATCH v3 2/8] x86: do not re-randomize RNG seed on snapshot load

2022-10-13 Thread Jason A. Donenfeld
Snapshot loading is supposed to be deterministic, so we shouldn't re-randomize the various seeds used. Signed-off-by: Jason A. Donenfeld --- hw/i386/x86.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/x86.c b/hw/i386/x86.c index 1148f70c03..bd50a064a3 100644 --- a/h

qemu-devel@nongnu.org

2022-10-13 Thread Jason A. Donenfeld
On Fri, Oct 14, 2022 at 05:13:58AM +1100, Richard Henderson wrote: > On 10/12/22 13:46, Jason A. Donenfeld wrote: > > When the system reboots, the rng seed that QEMU passes should be > > re-randomized, so that the new boot gets a new seed. This series wires > > that up for FDT. > > > > Then, since

Re: [PATCH v3] target/i386: Set maximum APIC ID to KVM prior to vCPU creation

2022-10-13 Thread Zeng Guang
PING again ! This QEMU patch is to optimize max APIC ID set for current VM session introduced since linux v6.0. It's also compatible with previous linux version. Thanks. On 9/5/2022 9:27 AM, Zeng Guang wrote: Kindly PING! On 8/25/2022 10:52 AM, Zeng Guang wrote: Specify maximum possible AP

Re: [RFC PATCH 3/6] hw/cxl/cxl-events: Add CXL mock events

2022-10-13 Thread Ira Weiny
On Tue, Oct 11, 2022 at 11:07:59AM +0100, Jonathan Cameron wrote: > On Mon, 10 Oct 2022 15:29:41 -0700 > ira.we...@intel.com wrote: > > > From: Ira Weiny > > > > To facilitate testing of guest software add mock events and code to > > support iterating through the event logs. > > > > Signed-off-

[BUG] cxl,i386: e820 mappings may not be correct for cxl

2022-10-13 Thread Gregory Price
Context included below from prior discussion - `cxl create-region` would fail on inability to allocate memory - traced this down to the memory region being marked RESERVED - E820 map marks the CXL fixed memory window as RESERVED Re: x86 errors, I found that region worked with this pat

Re: [PATCH v2] vhost-vdpa: allow passing opened vhostfd to vhost-vdpa

2022-10-13 Thread Si-Wei Liu
Jason, On 10/12/2022 10:02 PM, Jason Wang wrote: 在 2022/10/12 13:59, Si-Wei Liu 写道: On 10/11/2022 8:09 PM, Jason Wang wrote: On Tue, Oct 11, 2022 at 1:18 AM Si-Wei Liu  wrote: On 10/8/2022 10:43 PM, Jason Wang wrote: On Sat, Oct 8, 2022 at 5:04 PM Si-Wei Liu  wrote: Similar to other vh

Re: [RFC PATCH 2/6] qemu/uuid: Add UUID static initializer

2022-10-13 Thread Ira Weiny
On Tue, Oct 11, 2022 at 10:13:17AM +0100, Jonathan Cameron wrote: > On Mon, 10 Oct 2022 15:29:40 -0700 > ira.we...@intel.com wrote: > > > From: Ira Weiny > > > > UUID's are defined as network byte order fields. No static initializer > > was available for UUID's in their standard big endian form

Re: [RFC PATCH 1/6] qemu/bswap: Add const_le64()

2022-10-13 Thread Ira Weiny
On Tue, Oct 11, 2022 at 10:03:00AM +0100, Jonathan Cameron wrote: > On Mon, 10 Oct 2022 15:29:39 -0700 > ira.we...@intel.com wrote: > > > From: Ira Weiny > > > > Gcc requires constant versions of cpu_to_le* calls. > > > > Add a 64 bit version. > > > > Signed-off-by: Ira Weiny > > Seems reaso

Re: [RFC PATCH 1/6] qemu/bswap: Add const_le64()

2022-10-13 Thread Ira Weiny
On Tue, Oct 11, 2022 at 04:45:57PM +0100, Peter Maydell wrote: > On Tue, 11 Oct 2022 at 16:22, Richard Henderson > wrote: > > On 10/11/22 02:48, Peter Maydell wrote: > > > This is kind of a weird API, because: > > > * it only exists for little-endian, not big-endian > > > * we use it in exactl

Re: [PATCH] vmstate-static-checker:remove this redundant return

2022-10-13 Thread John Snow
On Wed, Sep 28, 2022 at 5:06 AM dinglimin wrote: > > Jump statements, such as return and continue let you > change the default flow of program execution, > but jump statements that direct the control flow to > the original direction are just a waste of keystrokes. > > Signed-off-by: dinglimin > -

[PATCH 33/35] tests/tcg: extend SSE tests to AVX

2022-10-13 Thread Paolo Bonzini
Extracted from a patch by Paul Brook . Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- tests/tcg/i386/Makefile.target | 2 +- tests/tcg/i386/test-avx.c | 201 ++--- tests/tcg/i386/test-avx.py | 5 +- 3 files changed, 113 insertions(+), 95

[PATCH 32/35] target/i386: Enable AVX cpuid bits when using TCG

2022-10-13 Thread Paolo Bonzini
From: Paul Brook Include AVX, AVX2 and VAES in the guest cpuid features supported by TCG. Signed-off-by: Paul Brook Message-Id: <20220424220204.2493824-40-p...@nowt.org> Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 10 +- 1 file changed, 5 inser

[PATCH 35/35] target/i386: remove old SSE decoder

2022-10-13 Thread Paolo Bonzini
With all SSE (and AVX!) instructions now implemented in disas_insn_new, it's possible to remove gen_sse, as well as the helpers for instructions that now use gvec. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/ops_sse.h| 124 --- target/i386/ops_sse_he

[PATCH 30/35] target/i386: implement XSAVE and XRSTOR of AVX registers

2022-10-13 Thread Paolo Bonzini
Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/fpu_helper.c | 78 ++-- 1 file changed, 75 insertions(+), 3 deletions(-) diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c index 5f3f7a1085..7670739abe 100644 -

Re: [RFC v2 00/10] Introduce an extensible static analyzer

2022-10-13 Thread Paolo Bonzini
On Fri, Jul 29, 2022 at 3:01 PM Alberto Faria wrote: > Performance isn't great, but with some more optimization, the analyzer > should be fast enough to be used iteratively during development, given > that it avoids reanalyzing unmodified translation units, and that users > can restrict the set of

[PATCH 29/35] target/i386: reimplement 0x0f 0x28-0x2f, add AVX

2022-10-13 Thread Paolo Bonzini
Here the code is a bit uglier due to the truncation and extension of registers to and from 32-bit. There is also a mistake in the manual with respect to the size of the memory operand of CVTPS2PI and CVTTPS2PI, reported by Ricky Zhou. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini

[PATCH 22/35] target/i386: reimplement 0x0f 0xd0-0xd7, 0xe0-0xe7, 0xf0-0xf7, add AVX

2022-10-13 Thread Paolo Bonzini
The more complicated ones here are d6-d7, e6-e7, f7. The others are trivial. For LDDQU, using gen_load_sse directly might corrupt the register if the second part of the load fails. Therefore, add a custom X86_TYPE_WM value; like X86_TYPE_W it does call gen_load(), but it also rejects a value of

[PATCH 34/35] target/i386: move 3DNow to the new decoder

2022-10-13 Thread Paolo Bonzini
This adds another kind of weirdness when you thought you had seen it all: an opcode byte that comes _after_ the address, not before. It's not worth adding a new X86_SPECIAL_* constant for it, but it's actually not unlike VCMP; so, forgive me for exploiting the similarity and just deciding to dispa

[PATCH 27/35] target/i386: reimplement 0x0f 0xc2, 0xc4-0xc6, add AVX

2022-10-13 Thread Paolo Bonzini
Nothing special going on here, for once. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.c.inc | 5 +++ target/i386/tcg/emit.c.inc | 75 target/i386/tcg/translate.c | 1 + 3 files changed, 81 insertions(+)

[PATCH 26/35] target/i386: reimplement 0x0f 0x38, add AVX

2022-10-13 Thread Paolo Bonzini
There are several special cases here: 1) extending moves have different widths for the helpers vs. for the memory loads, and the width for memory loads depends on VEX.L too. This is represented by X86_SPECIAL_AVXExtMov. 2) some instructions, such as variable-width shifts, select the vector elemen

[PATCH 13/35] target/i386: support operand merging in binary scalar helpers

2022-10-13 Thread Paolo Bonzini
Compared to Paul's implementation, the new decoder will use a different approach to implement AVX's merging of dst with src1 on scalar operations. Adjust the helpers to provide this functionality. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/ops_sse.h | 16 ++

[PATCH 19/35] target/i386: reimplement 0x0f 0x50-0x5f, add AVX

2022-10-13 Thread Paolo Bonzini
These are mostly floating-point SSE operations. The odd ones out are MOVMSK and CVTxx2yy, the others are straightforward. Unary operations are a bit special in AVX because they have 2 operands for PD/PS operands (VEX. must be b), and 3 operands for SD/SS. They are handled using X86_OP_GRO

[PATCH 14/35] target/i386: provide 3-operand versions of unary scalar helpers

2022-10-13 Thread Paolo Bonzini
Compared to Paul's implementation, the new decoder will use a different approach to implement AVX's merging of dst with src1 on scalar operations. Adjust the old SSE decoder to be compatible with new-style helpers. The affected instructions are CVTSx2Sx, ROUNDSx, RSQRTSx, SQRTSx, RCPSx. Reviewed

[PATCH 23/35] target/i386: clarify (un)signedness of immediates from 0F3Ah opcodes

2022-10-13 Thread Paolo Bonzini
Three-byte opcodes from the 0F3Ah area all have an immediate byte which is usually unsigned. Clarify in the helper code that it is unsigned; the new decoder treats immediates as signed by default, and seeing an intN_t in the prototype might give the wrong impression that one can use decode->immedi

[PATCH 25/35] target/i386: Use tcg gvec ops for pmovmskb

2022-10-13 Thread Paolo Bonzini
From: Richard Henderson As pmovmskb is used by strlen et al, this is the third highest overhead sse operation at %0.8. Signed-off-by: Richard Henderson [Reorganize to generate code for any vector size. - Paolo] Signed-off-by: Paolo Bonzini --- target/i386/tcg/emit.c.inc | 88 +

[PATCH 24/35] target/i386: reimplement 0x0f 0x3a, add AVX

2022-10-13 Thread Paolo Bonzini
The more complicated operations here are insertions and extractions. Otherwise, there are just more entries than usual because the PS/PD/SS/SD variations are encoded in the opcode rater than in the prefixes. These three-byte opcodes also include AVX new instructions, whose implementation in the he

[PATCH 10/35] target/i386: move scalar 0F 38 and 0F 3A instruction to new decoder

2022-10-13 Thread Paolo Bonzini
Because these are the only VEX instructions that QEMU supports, the new decoder is entered on the first byte of a valid VEX prefix, and VEX decoding only needs to be done in decode-new.c.inc. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.c.inc | 59

[PATCH 15/35] target/i386: implement additional AVX comparison operators

2022-10-13 Thread Paolo Bonzini
The new implementation of SSE will cover AVX from the get go, so include the 24 extra comparison operators that are only available with the VEX prefix. Based on a patch by Paul Brook . Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/ops_sse.h| 38 +++

[PATCH 31/35] target/i386: implement VLDMXCSR/VSTMXCSR

2022-10-13 Thread Paolo Bonzini
These are exactly the same as the non-VEX version, but one has to be careful that only VEX.L=0 is allowed. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.c.inc | 25 + target/i386/tcg/emit.c.inc | 20

[PATCH 28/35] target/i386: reimplement 0x0f 0x10-0x17, add AVX

2022-10-13 Thread Paolo Bonzini
These are mostly moves, and yet are a total pain. The main issue is that: 1) some instructions are selected by mod==11 (register operand) vs. mod=00/01/10 (memory operand) 2) stores to memory are two-operand operations, while the 3-register and load-from-memory versions operate on the entire con

[PATCH 21/35] target/i386: reimplement 0x0f 0x70-0x77, add AVX

2022-10-13 Thread Paolo Bonzini
This includes shifts by immediate, which use bits 3-5 of the ModRM byte as an opcode extension. With the exception of 128-bit shifts, they are implemented using gvec. This also covers VZEROALL and VZEROUPPER, which use the same opcode as EMMS. If we were wanting to optimize out gen_clear_ymmh th

[PATCH 18/35] target/i386: reimplement 0x0f 0xd8-0xdf, 0xe8-0xef, 0xf8-0xff, add AVX

2022-10-13 Thread Paolo Bonzini
These are more simple integer instructions present in both MMX and SSE/AVX, with no holes that were later occupied by newer instructions. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.c.inc | 28 target/i386/tcg/emit.c.in

[PATCH 16/35] target/i386: Introduce 256-bit vector helpers

2022-10-13 Thread Paolo Bonzini
The new implementation of SSE will cover AVX from the get go, because all the work for the helper functions is already done. We just need to build them. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/helper.h | 2 ++ target/i386/ops_sse.h| 5 +

[PATCH 08/35] target/i386: validate VEX prefixes via the instructions' exception classes

2022-10-13 Thread Paolo Bonzini
Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.c.inc | 164 ++- target/i386/tcg/decode-new.h | 32 ++ target/i386/tcg/emit.c.inc | 37 ++- target/i386/tcg/translate.c | 18 ++-- 4 files changed, 239

[PATCH 20/35] target/i386: reimplement 0x0f 0x78-0x7f, add AVX

2022-10-13 Thread Paolo Bonzini
These are a mixed batch, including the first two horizontal (66 and F2 only) operations, more moves, and SSE4a extract/insert. Because SSE4a is pretty rare, I chose to leave the helper as they are, but it is possible to unify them by loading index and length from the source XMM register and genera

[PATCH 12/35] target/i386: extend helpers to support VEX.V 3- and 4- operand encodings

2022-10-13 Thread Paolo Bonzini
Add to the helpers all the operands that are needed to implement AVX. Extracted from a patch by Paul Brook . Message-Id: <20220424220204.2493824-26-p...@nowt.org> Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/ops_sse.h| 173 +---

Re: [PATCH v2 4/8] hw/arm/virt: Fix devicetree warning about the gpio-key node

2022-10-13 Thread Rob Herring
On Tue, Sep 27, 2022 at 6:56 AM Peter Maydell wrote: > > On Tue, 27 Sept 2022 at 11:12, Jean-Philippe Brucker > wrote: > > The node name of the gpio-key devicetree node should be "key-poweroff": > > > > gpio-keys: 'poweroff' does not match any of the regexes: > > '^(button|event|key|switch|(bu

[PATCH 17/35] target/i386: reimplement 0x0f 0x60-0x6f, add AVX

2022-10-13 Thread Paolo Bonzini
These are both MMX and SSE/AVX instructions, except for vmovdqu. In both cases the inputs and output is in s->ptr{0,1,2}, so the only difference between MMX, SSE, and AVX is which helper to call. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.c.inc |

[PATCH 11/35] target/i386: Prepare ops_sse_header.h for 256 bit AVX

2022-10-13 Thread Paolo Bonzini
From: Paul Brook Adjust all #ifdefs to match the ones in ops_sse.h. Signed-off-by: Paul Brook Message-Id: <20220424220204.2493824-23-p...@nowt.org> Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/ops_sse_header.h | 114 +++ 1 file c

[PATCH 07/35] target/i386: add AVX_EN hflag

2022-10-13 Thread Paolo Bonzini
From: Paul Brook Add a new hflag bit to determine whether AVX instructions are allowed Signed-off-by: Paul Brook Message-Id: <20220424220204.2493824-4-p...@nowt.org> Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/cpu.h| 3 +++ target/i386/helper.c

[PATCH 06/35] target/i386: add CPUID feature checks to new decoder

2022-10-13 Thread Paolo Bonzini
Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.c.inc | 55 target/i386/tcg/decode-new.h | 20 2 files changed, 75 insertions(+) diff --git a/target/i386/tcg/decode-new.c.inc b/target/i386/tcg/decode-ne

[PATCH 05/35] target/i386: add CPUID[EAX=7, ECX=0].ECX to DisasContext

2022-10-13 Thread Paolo Bonzini
TCG will shortly implement VAES instructions, so add the relevant feature word to the DisasContext. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/tra

[PATCH 09/35] target/i386: validate SSE prefixes directly in the decoding table

2022-10-13 Thread Paolo Bonzini
Many SSE and AVX instructions are only valid with specific prefixes (none, 66, F3, F2). Introduce a direct way to encode this in the decoding table to avoid using decode groups too much. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.c.inc | 37 +

[PATCH 03/35] target/i386: add core of new i386 decoder

2022-10-13 Thread Paolo Bonzini
The new decoder is based on three principles: - use mostly table-driven decoding, using tables derived as much as possible from the Intel manual. Centralizing the decode the operands makes it more homogeneous, for example all immediates are signed. All modrm handling is in one function, an

[PATCH v3 00/35] target/i386: new decoder + AVX implementation

2022-10-13 Thread Paolo Bonzini
Both PC-relative translation blocks and XSAVE state support in linux-user signal handlers are in; as mentioned in the post of v2, this is the time for a (mostly) final version of the AVX patches, with more review comments addressed and a few more bugs fixed. Paolo v2->v3: - removed patches that a

[PATCH 04/35] target/i386: add ALU load/writeback core

2022-10-13 Thread Paolo Bonzini
Add generic code generation that takes care of preparing operands around calls to decode.e.gen in a table-driven manner, so that ALU operations need not take care of that. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.c.inc | 33 ++- target/i386

[PATCH 02/35] target/i386: make ldo/sto operations consistent with ldq

2022-10-13 Thread Paolo Bonzini
ldq takes a pointer to the first byte to load the 64-bit word in; ldo takes a pointer to the first byte of the ZMMReg. Make them consistent, which will be useful in the new SSE decoder's load/writeback routines. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/tr

[PATCH 01/35] target/i386: Define XMMReg and access macros, align ZMM registers

2022-10-13 Thread Paolo Bonzini
From: Richard Henderson This will be used for emission and endian adjustments of gvec operations. Signed-off-by: Richard Henderson Message-Id: <2022083722.1697758-2-richard.hender...@linaro.org> Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 56 --

Re: [PATCH v2 8/8] hw/arm/virt: Fix devicetree warnings about node names

2022-10-13 Thread Rob Herring
On Tue, Sep 27, 2022 at 6:28 AM Peter Maydell wrote: > > On Tue, 27 Sept 2022 at 11:12, Jean-Philippe Brucker > wrote: > > > > The devicetree specification requires that nodes use a generic name > > where appropriate. Fix the corresponding dt-validate warnings: > > Either: > (1) guests are lookin

Re: [PATCH 03/10] mac_{old|new}world: Set default values for some local variables

2022-10-13 Thread Mark Cave-Ayland
On 03/10/2022 23:08, BALATON Zoltan wrote: On Thu, 29 Sep 2022, Mark Cave-Ayland wrote: On 25/09/2022 10:16, BALATON Zoltan wrote: On Sun, 25 Sep 2022, Mark Cave-Ayland wrote: On 17/09/2022 00:07, BALATON Zoltan wrote: Some lines can be dropped making the code flow simpler and easier to foll

Re: [PATCH v2 0/9] target/i386: Use atomic operations for pte updates

2022-10-13 Thread Paolo Bonzini
Queued, thanks. Paolo

Re: [RFC PATCH v2 1/1] block: add vhost-blk backend

2022-10-13 Thread Michael S. Tsirkin
On Thu, Oct 13, 2022 at 11:31:30PM +0300, Andrey Zhadchenko wrote: > Although QEMU virtio is quite fast, there is still some room for > improvements. Disk latency can be reduced if we handle virito-blk requests > in host kernel istead of passing them to QEMU. The patch adds vhost-blk > backend whic

Re: [PATCH] tests/tcg: include CONFIG_PLUGIN in config-host.mak

2022-10-13 Thread Paolo Bonzini
On Thu, Oct 13, 2022 at 10:35 PM Alex Bennée wrote: > > > Paolo Bonzini writes: > > > Signed-off-by: Paolo Bonzini > > --- > > configure | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/configure b/configure > > index f4ff1cf305..a5af9c524f 100755 > > --- a/configure > > +++ b/

Re: [PATCH] hw/i386: Use device_cold_reset() to reset the APIC

2022-10-13 Thread Paolo Bonzini
This conflicts with "hyperv: fix SynIC SINT assertion failure on guest reset", but the resolution is simply to do the change in a new function x86_cpu_after_reset(); adjusted and queued, thanks. Paolo

Re: [PATCH v3] hyperv: fix SynIC SINT assertion failure on guest reset

2022-10-13 Thread Paolo Bonzini
Queued, thanks. Paolo

Re: [PATCH 1/1] tcg: add perfmap and jitdump

2022-10-13 Thread Richard Henderson
On 10/12/22 22:18, Ilya Leoshkevich wrote: Add ability to dump /tmp/perf-.map and jit-.dump. The first one allows the perf tool to map samples to each individual translation block. The second one adds the ability to resolve symbol names, line numbers and inspect JITed code. Example of use:

Re: [PATCH 0/2] scsi: Switch to bus_cold_reset() and device_cold_reset()

2022-10-13 Thread Paolo Bonzini
Queued, thanks. Paolo

[RFC PATCH v2 1/1] block: add vhost-blk backend

2022-10-13 Thread Andrey Zhadchenko via
Although QEMU virtio is quite fast, there is still some room for improvements. Disk latency can be reduced if we handle virito-blk requests in host kernel istead of passing them to QEMU. The patch adds vhost-blk backend which sets up vhost-blk kernel module to process requests. test setup and resu

Re: [PATCH] tests/tcg: include CONFIG_PLUGIN in config-host.mak

2022-10-13 Thread Alex Bennée
Paolo Bonzini writes: > Signed-off-by: Paolo Bonzini > --- > configure | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/configure b/configure > index f4ff1cf305..a5af9c524f 100755 > --- a/configure > +++ b/configure > @@ -2474,6 +2474,9 @@ echo "HOST_CC=$host_cc" >> $config_host_ma

[RFC PATCH v2 0/1] block: vhost-blk backend

2022-10-13 Thread Andrey Zhadchenko via
Sending second version of this patchset as @stefanha requested. The main difference from the previous version is added vhost multithreading support. Also I must note currently there are several problems which I intend to reconsider/fix later: - vmsd is present but migration is not supported - Bl

Re: [PULL 0/7] Win32 patches

2022-10-13 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/7.2 for any user-visible changes. signature.asc Description: PGP signature

[PATCH] configure: don't enable firmware for targets that are not built

2022-10-13 Thread Paolo Bonzini
This avoids the unfortunate effect of building pc-bios blobs even for targets the user isn't interested in. Due to the bi-arch nature of x86 and PPC firmware, check for the desired target by hand, and don't just look for the compilation target in $target_list. Signed-off-by: Paolo Bonzini --- c

Re: [PULL 00/16] qtest patches (and one unit test and one avocado fix)

2022-10-13 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/7.2 for any user-visible changes. signature.asc Description: PGP signature

Re: [PULL 00/37] SCSI, i386 patches for 2022-10-11

2022-10-13 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/7.2 for any user-visible changes. signature.asc Description: PGP signature

Re: [PATCH v2 4/7] configure: don't enable cross compilers unless in target_list

2022-10-13 Thread Paolo Bonzini
On 10/13/22 21:48, Alex Bennée wrote: + case " $target_list " in +" $1 ") ;; +*) return 1 ;; + esac + this of course prevents building of roms by actually disabling all target compilers... Yeah, two asterisks are missing. I'll send out a proper patch. Paolo

Re: [PULL 00/26] Kraxel 20221013 patches

2022-10-13 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/7.2 for any user-visible changes. signature.asc Description: PGP signature

Re: [PATCH v2] configure: Avoid using strings binary

2022-10-13 Thread Paolo Bonzini
On 10/13/22 15:43, Michal Privoznik wrote: When determining the endiandness of the target architecture we're building for a small program is compiled, which in an obfuscated way declares two strings. Then, we look which string is in correct order (using strings binary) and deduct the endiandness.

Re: [PATCH v2 4/7] configure: don't enable cross compilers unless in target_list

2022-10-13 Thread Alex Bennée
Alex Bennée writes: > This avoids the unfortunate effect of always builds the pc-bios blobs > for targets the user isn't interested in. > > Suggested-by: Paolo Bonzini > Signed-off-by: Alex Bennée > --- > configure | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/configure b/con

Re: [PATCH 5/5] hw/mem/cxl_type3: Refactor CDAT sub-table entry initialization into a function

2022-10-13 Thread Gregory Price
> > /* For now, no memory side cache, plausiblish numbers */ > > -*dslbis_nonvolatile1 = (CDATDslbis) { > > +*dslbis1 = (CDATDslbis) { > > .header = { > > .type = CDAT_TYPE_DSLBIS, > > -.length = sizeof(*dslbis_nonvolatile1), > > +.length =

Re: [PATCH] hw/hyperv/hyperv.c: Use device_cold_reset() instead of device_legacy_reset()

2022-10-13 Thread Maciej S. Szmigiero
On 13.10.2022 19:18, Peter Maydell wrote: The semantic difference between the deprecated device_legacy_reset() function and the newer device_cold_reset() function is that the new function resets both the device itself and any qbuses it owns, whereas the legacy function resets just the device itse

Re: [PATCH] disas/mips: Fix branch displacement for BEQZC and BNEZC

2022-10-13 Thread Richard Henderson
On 10/14/22 07:52, Philippe Mathieu-Daudé wrote: +/* Sign extend the displacement with 21 bits. */ +delta = l & 0x1F; +if (delta & 0x10) { +delta |= ~0x1F; +} delta = sextract32(l, 0, 21); r~

[PATCH v7 08/13] numa: use QLIST_FOREACH_SAFE() for RAM block notifiers

2022-10-13 Thread Stefan Hajnoczi
Make list traversal work when a callback removes a notifier mid-traversal. This is a cleanup to prevent bugs in the future. Signed-off-by: Stefan Hajnoczi Reviewed-by: David Hildenbrand --- hw/core/numa.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/core/numa.

[PATCH v7 09/13] block: add BlockRAMRegistrar

2022-10-13 Thread Stefan Hajnoczi
Emulated devices and other BlockBackend users wishing to take advantage of blk_register_buf() all have the same repetitive job: register RAMBlocks with the BlockBackend using RAMBlockNotifier. Add a BlockRAMRegistrar API to do this. A later commit will use this from hw/block/virtio-blk.c. Signed-

[PATCH v7 07/13] block: return errors from bdrv_register_buf()

2022-10-13 Thread Stefan Hajnoczi
Registering an I/O buffer is only a performance optimization hint but it is still necessary to return errors when it fails. Later patches will need to detect errors when registering buffers but an immediate advantage is that error_report() calls are no longer needed in block driver .bdrv_register_

[PATCH v7 06/13] block: add BDRV_REQ_REGISTERED_BUF request flag

2022-10-13 Thread Stefan Hajnoczi
Block drivers may optimize I/O requests accessing buffers previously registered with bdrv_register_buf(). Checking whether all elements of a request's QEMUIOVector are within previously registered buffers is expensive, so we need a hint from the user to avoid costly checks. Add a BDRV_REQ_REGISTER

[PATCH v7 04/13] block: pass size to bdrv_unregister_buf()

2022-10-13 Thread Stefan Hajnoczi
The only implementor of bdrv_register_buf() is block/nvme.c, where the size is not needed when unregistering a buffer. This is because util/vfio-helpers.c can look up mappings by address. Future block drivers that implement bdrv_register_buf() may not be able to do their job given only the buffer

[PATCH v7 13/13] virtio-blk: use BDRV_REQ_REGISTERED_BUF optimization hint

2022-10-13 Thread Stefan Hajnoczi
Register guest RAM using BlockRAMRegistrar and set the BDRV_REQ_REGISTERED_BUF flag so block drivers can optimize memory accesses in I/O requests. This is for vdpa-blk, vhost-user-blk, and other I/O interfaces that rely on DMA mapping/unmapping. Signed-off-by: Stefan Hajnoczi --- include/hw/vir

[PATCH v7 03/13] numa: call ->ram_block_removed() in ram_block_notifer_remove()

2022-10-13 Thread Stefan Hajnoczi
When a RAMBlockNotifier is added, ->ram_block_added() is called with all existing RAMBlocks. There is no equivalent ->ram_block_removed() call when a RAMBlockNotifier is removed. The util/vfio-helpers.c code (the sole user of RAMBlockNotifier) is fine with this asymmetry because it does not rely o

[PATCH v7 12/13] blkio: implement BDRV_REQ_REGISTERED_BUF optimization

2022-10-13 Thread Stefan Hajnoczi
Avoid bounce buffers when QEMUIOVector elements are within previously registered bdrv_register_buf() buffers. The idea is that emulated storage controllers will register guest RAM using bdrv_register_buf() and set the BDRV_REQ_REGISTERED_BUF on I/O requests. Therefore no blkio_map_mem_region() cal

[PATCH v7 02/13] blkio: add libblkio block driver

2022-10-13 Thread Stefan Hajnoczi
libblkio (https://gitlab.com/libblkio/libblkio/) is a library for high-performance disk I/O. It currently supports io_uring, virtio-blk-vhost-user, and virtio-blk-vhost-vdpa with additional drivers under development. One of the reasons for developing libblkio is that other applications besides QEM

[PATCH v7 11/13] stubs: add qemu_ram_block_from_host() and qemu_ram_get_fd()

2022-10-13 Thread Stefan Hajnoczi
The blkio block driver will need to look up the file descriptor for a given pointer. This is possible in softmmu builds where the RAMBlock API is available for querying guest RAM. Add stubs so tools like qemu-img that link the block layer still build successfully. In this case there is no guest RA

[PATCH v7 01/13] coroutine: add flag to re-queue at front of CoQueue

2022-10-13 Thread Stefan Hajnoczi
When a coroutine wakes up it may determine that it must re-queue. Normally coroutines are pushed onto the back of the CoQueue, but for fairness it may be necessary to push it onto the front of the CoQueue. Add a flag to specify that the coroutine should be pushed onto the front of the CoQueue. A l

[PATCH v7 05/13] block: use BdrvRequestFlags type for supported flag fields

2022-10-13 Thread Stefan Hajnoczi
Use the enum type so GDB displays the enum members instead of printing a numeric constant. Signed-off-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella --- include/block/block_int-common.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/block/block_int-comm

[PATCH v7 10/13] exec/cpu-common: add qemu_ram_get_fd()

2022-10-13 Thread Stefan Hajnoczi
Add a function to get the file descriptor for a RAMBlock. Device emulation code typically uses the MemoryRegion APIs but vhost-style code may use RAMBlock directly for sharing guest memory with another process. This new API will be used by the libblkio block driver so it can share guest memory via

[PATCH v7 00/13] blkio: add libblkio BlockDriver

2022-10-13 Thread Stefan Hajnoczi
v7: - Add nvme-io_uring and virtio-blk-vhost-user syntax examples to commit description [Markus] - Add missing nvme-io_uring QAPI [Markus, Alberto] - Rename mem-regions-pinned to may-pin-mem-regions [Alberto] - Fix value/bs->bl.max_iov mix-up [Stefano] v6: - Add untested nvme-io_uring driver. Plea

  1   2   3   >