Re: [PATCH] floppy: remove unused function fdctrl_format_sector

2021-03-13 Thread Hervé Poussineau
Le 12/03/2021 à 07:45, John Snow a écrit : On 1/8/21 6:01 PM, Alexander Bulekov wrote: fdctrl_format_sector was added in baca51faff ("updated floppy driver: formatting code, disk geometry auto detect (Jocelyn Mayer)") The single callsite is guarded by a check: fdctrl->data_state &

[PATCH] ui/cocoa: Do not raise keys before QEMU resigns active

2021-03-13 Thread Akihiko Odaki
ui/cocoa used to raise all keys before it resigns active to prevent a stuck key problem caused by key up events it does not see while it is inactive. The problem is solved by checking -[NSEvent modifierFlags] in commit 6d73bb643aa725348aabe6a885ac5fb0b7f70252, which is better because it handles

[PATCH] fuzz: add a am53c974 generic-fuzzer config

2021-03-13 Thread Alexander Bulekov
Signed-off-by: Alexander Bulekov --- Fuzzing this device might lead to better coverage over the general scsi code. tests/qtest/fuzz/generic_fuzz_configs.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/tests/qtest/fuzz/generic_fuzz_configs.h

[PATCH v3 00/22] ppc: qemu: Add eTSEC support

2021-03-13 Thread Bin Meng
QEMU ppce500 machine can dynamically instantiate an eTSEC device if "-device eTSEC" is given to QEMU. This series updates the fixed-link ethernet PHY driver as well as the Freescale eTSEC driver to support the QEMU ppce500 board. 3 patches related to fixed phy in v1 are dropped in v2 as the

Re: [PATCH 0/2] fuzz: add a script to help build reproducers

2021-03-13 Thread Alexander Bulekov
Here are examples of code generated by the script: https://lists.gnu.org/archive/html/qemu-devel/2021-02/msg06027.html https://lists.gnu.org/archive/html/qemu-devel/2021-02/msg06028.html https://lists.gnu.org/archive/html/qemu-devel/2021-02/msg06029.html On 210313 2323, Alexander Bulekov wrote: >

[PATCH 2/2] fuzz: add instructions for building reproducers

2021-03-13 Thread Alexander Bulekov
We have several scripts that help build reproducers, but no documentation for how they should be used. Add some documentation Signed-off-by: Alexander Bulekov --- docs/devel/fuzzing.rst | 45 ++ 1 file changed, 45 insertions(+) diff --git

[PATCH 1/2] fuzz: add a script to build reproducers

2021-03-13 Thread Alexander Bulekov
Currently, bash and C crash reproducers are be built manually. This is a problem, as we want to integrate reproducers into the tree, for regression testing. This patch adds a script that converts a sequence of QTest commands into a pasteable Bash reproducer, or a libqtest-based C program. This

[PATCH 0/2] fuzz: add a script to help build reproducers

2021-03-13 Thread Alexander Bulekov
Hello, This series adds a script that can be handy for reporting fuzzer bugs and creating regression-tests, based on crash reproducers. Patch 1 adds a script that can help create bash and C reproducers for crashes. Patch 2 documents the process of building reproducers. Alexander Bulekov (2):

[PATCH 8/8] tools/virtiofsd: Replacing malloc-like calls with GLib's variants

2021-03-13 Thread Mahmoud Mandour
Changed calls to malloc(), calloc(), and realloc() with their equivalent allocation functions in GLib, and replaced their respective free() calls with g_free(). Allocation and deallocation of fuse_req structs, fuse_pollhandle structs, fuse_session structs and many local variables are now

[PATCH 6/8] tools/virtiofsd/buffer.c: replaced a calloc call with GLib's g_try_new0

2021-03-13 Thread Mahmoud Mandour
Replaced a call to calloc() and its respective free() call with GLib's g_try_new0() and g_free() calls. Signed-off-by: Mahmoud Mandour --- tools/virtiofsd/buffer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/virtiofsd/buffer.c b/tools/virtiofsd/buffer.c index

[PATCH 7/8] tools/virtiofsd/fuse_opt.c: Replaced a malloc with GLib's g_try_malloc

2021-03-13 Thread Mahmoud Mandour
Replaced a malloc() call and its respective free() with GLib's g_try_malloc() and g_free() calls. Signed-off-by: Mahmoud Mandour --- tools/virtiofsd/fuse_opt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/virtiofsd/fuse_opt.c b/tools/virtiofsd/fuse_opt.c index

[PATCH 4/8] target/xtensa: Replaced malloc/free with GLib's variants

2021-03-13 Thread Mahmoud Mandour
Replaced the calls to malloc() and their respective calls to free() with GLib's allocation and deallocation functions. Removed null checking before calling g_free() because it's not necessary and generates style errors. Signed-off-by: Mahmoud Mandour --- target/xtensa/xtensa-isa.c | 53

[PATCH 5/8] util/compatfd.c: Replaced a malloc with GLib's variant

2021-03-13 Thread Mahmoud Mandour
Replaced a malloc() call and its respective free() call with GLib's g_try_malloc() and g_free(). Also, did slight styling changes that were producing style errors when using the checkpatch.pl script against the file. Signed-off-by: Mahmoud Mandour --- util/compatfd.c | 10 +- 1 file

[PATCH 2/8] hw/audio/fmopl.c: Fixing some style errors

2021-03-13 Thread Mahmoud Mandour
Fixed style errors on the relevant lines in which I will introduce changes. Signed-off-by: Mahmoud Mandour --- hw/audio/fmopl.c | 58 ++-- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/hw/audio/fmopl.c b/hw/audio/fmopl.c index

[PATCH 3/8] hw/audio/fmopl.c: Replaced calls to malloc with GLib's variants

2021-03-13 Thread Mahmoud Mandour
Replaced calls to malloc(), and free() to their equivalent allocation functions from GLib. Also added checking for null after ENV_CURVE allocation following the same pattern of checking on preceeding table allocations. Signed-off-by: Mahmoud Mandour --- hw/audio/fmopl.c | 42

[PATCH 1/8] bsd-user/elfload.c: Replaced calls to malloc/free with GLib variants

2021-03-13 Thread Mahmoud Mandour
Replaced the calls to malloc(), realloc(), and free() to their equivalents in GLib's allocation functions in various places. Signed-off-by: Mahmoud Mandour --- bsd-user/elfload.c | 74 +++--- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git

[PATCH 0/8] Replacing malloc and the like with GLib's variants

2021-03-13 Thread Mahmoud Mandour
Inspired by the task in the Bite-sized tasks page, I've tried to change some of the occurrences of malloc(), calloc(), and realloc() calls and their respective free() calls. I also included some minor style improvements that caused errors and warnings when supplied to the checkpatch.pl script.

Re: [PATCH 4/9] pc-bios/s390-ccw/netmain.c: Changed a malloc/free to GLib's variants

2021-03-13 Thread Mahmoud Mandour
> > Nack. > > This is BIOS code and it does not have glib. > Thank you so much for the helping notice. This did not cause build problems nor was mentioned in the bite-sized tasks page as a place to not change. In any case, there are some more problems with this series so I was going to resend it

Re: [PATCH v8 29/35] Hexagon (target/hexagon) translation

2021-03-13 Thread Richard Henderson
On 3/13/21 6:40 PM, Taylor Simpson wrote: -Original Message- From: Richard Henderson Sent: Sunday, February 14, 2021 7:04 PM To: Taylor Simpson ; qemu-devel@nongnu.org Cc: phi...@redhat.com; alex.ben...@linaro.org; laur...@vivier.eu; a...@rev.ng; Brian Cain Subject: Re: [PATCH v8

Re: [PATCH v8 26/35] Hexagon (target/hexagon) TCG generation

2021-03-13 Thread Richard Henderson
On 3/13/21 6:39 PM, Taylor Simpson wrote: BTW, how can I generate an assert via TCG? You can't, as such. You can call a helper function, which can do whatever. Except for HEX_DEBUG, why would we not know whether or not a predicate has been written twice? It seems like we shouldn't need

RE: [PATCH v8 27/35] Hexagon (target/hexagon) TCG for instructions with multiple definitions

2021-03-13 Thread Taylor Simpson
> -Original Message- > From: Richard Henderson > Sent: Sunday, February 14, 2021 6:34 PM > To: Taylor Simpson ; qemu-devel@nongnu.org > Cc: phi...@redhat.com; alex.ben...@linaro.org; laur...@vivier.eu; > a...@rev.ng; Brian Cain > Subject: Re: [PATCH v8 27/35] Hexagon (target/hexagon)

RE: [PATCH v8 29/35] Hexagon (target/hexagon) translation

2021-03-13 Thread Taylor Simpson
> -Original Message- > From: Richard Henderson > Sent: Sunday, February 14, 2021 7:04 PM > To: Taylor Simpson ; qemu-devel@nongnu.org > Cc: phi...@redhat.com; alex.ben...@linaro.org; laur...@vivier.eu; > a...@rev.ng; Brian Cain > Subject: Re: [PATCH v8 29/35] Hexagon (target/hexagon)

RE: [PATCH v8 26/35] Hexagon (target/hexagon) TCG generation

2021-03-13 Thread Taylor Simpson
> -Original Message- > From: Richard Henderson > Sent: Sunday, February 14, 2021 6:07 PM > To: Taylor Simpson ; qemu-devel@nongnu.org > Cc: phi...@redhat.com; alex.ben...@linaro.org; laur...@vivier.eu; > a...@rev.ng; Brian Cain > Subject: Re: [PATCH v8 26/35] Hexagon (target/hexagon)

RE: [PATCH v8 25/35] Hexagon (target/hexagon) instruction classes

2021-03-13 Thread Taylor Simpson
> -Original Message- > From: Richard Henderson > Sent: Sunday, February 14, 2021 5:41 PM > To: Taylor Simpson ; qemu-devel@nongnu.org > Cc: phi...@redhat.com; alex.ben...@linaro.org; laur...@vivier.eu; > a...@rev.ng; Brian Cain > Subject: Re: [PATCH v8 25/35] Hexagon (target/hexagon)

Re: [PATCH v16 00/23] i386 cleanup PART 2

2021-03-13 Thread Philippe Mathieu-Daudé
Hi Claudio, On 2/4/21 5:39 PM, Claudio Fontana wrote: > v15 -> v16: > > * cpu: Move synchronize_from_tb() to tcg_ops: > - adjusted comments (Alex) > > * cpu: tcg_ops: move to tcg-cpu-ops.h, keep a pointer in CPUClass: > - remove forward decl. of AccelCPUClass, should be in a later patch.

Re: [RFC PATCH v2 0/8] cpu: Move CPUClass::has_work() to TCGCPUOps

2021-03-13 Thread Philippe Mathieu-Daudé
Hi Richard, On 3/4/21 11:23 PM, Philippe Mathieu-Daudé wrote: > Hi, > > cpu_has_work() isn't used out of TCG, so restrict it to it. > RFC because maybe it could? > > Since v1: > - finished PPC > - check cc->tcg_ops->has_work non-null (thuth) > > Based-on:

Re: [PATCH v5 00/13] target/mips: Extract MXU code to new mxu_translate.c file

2021-03-13 Thread Philippe Mathieu-Daudé
On 2/26/21 10:30 AM, Philippe Mathieu-Daudé wrote: > Series fully reviewed. > Philippe Mathieu-Daud=C3=A9 (13): > target/mips/meson: Introduce mips_tcg source set > target/mips/meson: Restrict mips-semi.c to TCG > target/mips: Rewrite complex ifdef'ry > target/mips: Remove XBurst Media

[PATCH v2 0/3] fuzz: Add a sparse-memory device to accelerate fuzzing

2021-03-13 Thread Alexander Bulekov
v2: - Make the device a TYPE_SYS_BUS_DEVICE device - Remove the qtest (the device cannot be enabled for testing outside of the fuzzing code). - Since this will only be used for short-lived fuzzing processes, do not keep track of empty regions. - Move some DMA callbacks

Re: [PATCH] migration: Remove time_t cast for OpenBSD

2021-03-13 Thread Brad Smith
On 3/11/2021 1:39 PM, Daniel P. Berrangé wrote: On Thu, Mar 11, 2021 at 06:28:57PM +, Dr. David Alan Gilbert wrote: * Laurent Vivier (laur...@vivier.eu) wrote: Le 08/03/2021 à 12:46, Thomas Huth a écrit : On 22/02/2021 08.28, Brad Smith wrote: OpenBSD has supported 64-bit time_t across

[PATCH v2 3/3] fuzz: move some DMA hooks

2021-03-13 Thread Alexander Bulekov
For the sparse-mem device, we want the fuzzer to populate entire DMA reads from sparse-mem, rather than hooking into the individual MMIO memory_region_dispatch_read operations. Otherwise, the fuzzer will treat each sequential read separately (and populate it with a separate pattern). Work around

[PATCH v2 2/3] fuzz: configure a sparse-mem device, by default

2021-03-13 Thread Alexander Bulekov
The generic-fuzzer often provides randomized DMA addresses to virtual-devices. For a 64-bit address-space, the chance of these randomized addresses coinciding with RAM regions, is fairly small. Even though the fuzzer's instrumentation eventually finds valid addresses, this can take some-time, and

[PATCH v2 1/3] memory: add a sparse memory device for fuzzing

2021-03-13 Thread Alexander Bulekov
For testing, it can be useful to simulate an enormous amount of memory (e.g. 2^64 RAM). This adds an MMIO device that acts as sparse memory. When something writes a nonzero value to a sparse-mem address, we allocate a block of memory. This block is kept around, until all of the bytes within the

Re: [PATCH 09/11] hw/avr/arduino: Replace magic number by gpio_port_index() call

2021-03-13 Thread Philippe Mathieu-Daudé
On 3/13/21 9:02 PM, Richard Henderson wrote: > On 3/13/21 10:54 AM, Philippe Mathieu-Daudé wrote: >> +static unsigned gpio_port_index(char c) >> +{ >> +    assert(c >= 'A' && c < 'A' + GPIO_MAX); >> +    return c - 'A'; >> +} > > If you're not going to use this for anything else, isn't > >

Re: [PATCH 00/11] AVR patch queue for QEMU 6.0

2021-03-13 Thread Michael Rolnik
Reviewed-by: Michael Rolnik On Sat, Mar 13, 2021 at 6:54 PM Philippe Mathieu-Daudé wrote: > Hi, > > This series contains all the AVR patches I could find on the list. > > Niteesh, I fixed minor issues. Do you mind reviewing on top? > > Pull request planned for Monday if no problem arises. > >

Re: [PATCH] utils: Reduce chance of rounding inaccuracy in qemu_strtosz.

2021-03-13 Thread Richard Henderson
On 3/11/21 2:07 PM, Eric Blake wrote: +/* + * Add in a fudge-factor (2^53 when double is IEEE format) for + * all scales less than P (2^50), so that things like + * 12.345M with unit 1000 produce 12345000 instead of + * 12344999. + */ +if

Re: [PATCH 06/11] hw/gpio/avr_gpio: Simplify avr_gpio_write_port using extract32()

2021-03-13 Thread Richard Henderson
On 3/13/21 10:54 AM, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- hw/gpio/avr_gpio.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH 05/11] hw/gpio/avr_gpio: Add 'id' field in AVRGPIOState

2021-03-13 Thread Richard Henderson
On 3/13/21 10:54 AM, Philippe Mathieu-Daudé wrote: +if (s->id == UINT8_MAX) { +error_setg(errp, "property 'id' not set"); +return; +} This error message would be a tad confusing if one set the id to 255. What's the point? r~

Re: [PATCH 01/11] hw/misc/led: Add yellow LED

2021-03-13 Thread Richard Henderson
On 3/13/21 10:54 AM, Philippe Mathieu-Daudé wrote: Add the yellow "lime" LED. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/misc/led.h | 1 + hw/misc/led.c | 1 + 2 files changed, 2 insertions(+) Reviewed-by: Richard Henderson r~

[PULL 26/27] target/mips: Remove 'C790 Multimedia Instructions' dead code

2021-03-13 Thread Philippe Mathieu-Daudé
We have almost 400 lines of code full of /* TODO */ comments which end calling gen_reserved_instruction(). As we are not going to implement them, and all the caller's switch() default cases already call gen_reserved_instruction(), we can remove this altogether. Signed-off-by: Philippe

[PULL 27/27] target/mips/tx79: Salvage instructions description comment

2021-03-13 Thread Philippe Mathieu-Daudé
This comment describing the tx79 opcodes is helpful. As we will implement these instructions in tx79_translate.c, move the comment there. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20210214175912.732946-15-f4...@amsat.org> Signed-off-by: Philippe

[PULL 25/27] target/mips/tx79: Move PCPYLD / PCPYUD opcodes to decodetree

2021-03-13 Thread Philippe Mathieu-Daudé
Move PCPYLD (Parallel Copy Lower Doubleword) and PCPYUD (Parallel Copy Upper Doubleword) to decodetree. Remove unnecessary code / comments. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20210214175912.732946-13-f4...@amsat.org> Signed-off-by: Philippe

[PULL 24/27] target/mips/tx79: Move PCPYH opcode to decodetree

2021-03-13 Thread Philippe Mathieu-Daudé
Move the existing PCPYH opcode (Parallel Copy Halfword) to decodetree. Remove unnecessary code / comments. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20210214175912.732946-12-f4...@amsat.org> Signed-off-by: Philippe Mathieu-Daudé ---

[PULL 20/27] target/mips/tx79: Move MFHI1 / MFLO1 opcodes to decodetree

2021-03-13 Thread Philippe Mathieu-Daudé
Introduce decodetree structure to decode the tx79 opcodes. Start it by moving the existing MFHI1 and MFLO1 opcodes. Remove unnecessary comments. As the TX79 share opcodes with the TX19/TX39/TX49 CPUs, we introduce the decode_ext_txx9() dispatcher where we will add the other decoders later.

[PULL 23/27] target/mips/translate: Simplify PCPYH using deposit_i64()

2021-03-13 Thread Philippe Mathieu-Daudé
Simplify the PCPYH (Parallel Copy Halfword) instruction by using multiple calls to deposit_i64() which can be optimized by some TCG backends. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id:

Re: [PATCH 09/11] hw/avr/arduino: Replace magic number by gpio_port_index() call

2021-03-13 Thread Richard Henderson
On 3/13/21 10:54 AM, Philippe Mathieu-Daudé wrote: +static unsigned gpio_port_index(char c) +{ +assert(c >= 'A' && c < 'A' + GPIO_MAX); +return c - 'A'; +} If you're not going to use this for anything else, isn't #define PORT_B 1 enough? r~

[PULL 12/27] target/mips: Use OPC_MUL instead of OPC__MXU_MUL

2021-03-13 Thread Philippe Mathieu-Daudé
We already have a macro and definition to extract / check the Special2 MUL opcode. Use it instead of the unnecessary OPC__MXU_MUL macro. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/mips/translate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)

Re: [PATCH 04/11] hw/gpio/avr_gpio: Add migration VMstate

2021-03-13 Thread Richard Henderson
On 3/13/21 10:54 AM, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- hw/gpio/avr_gpio.c | 14 ++ 1 file changed, 14 insertions(+) Reviewed-by: Richard Henderson r~

[PULL 22/27] target/mips/translate: Make gen_rdhwr() public

2021-03-13 Thread Philippe Mathieu-Daudé
We will use gen_rdhwr() outside of translate.c, make it public. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20210214175912.732946-28-f4...@amsat.org> Signed-off-by: Philippe Mathieu-Daudé --- target/mips/translate.h | 2 ++ target/mips/translate.c | 2 +-

[PULL 10/27] target/mips: Remove unused CPUMIPSState* from MXU functions

2021-03-13 Thread Philippe Mathieu-Daudé
None of these MXU functions use their CPUMIPSState* env argument, remove it. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/mips/translate.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/target/mips/translate.c

Re: [PATCH 03/11] hw/avr: Add limited support for avr gpio registers

2021-03-13 Thread Richard Henderson
On 3/13/21 10:54 AM, Philippe Mathieu-Daudé wrote: +#define AVR_GPIO_COUNT 8 + +struct AVRGPIOState { +/*< private >*/ +SysBusDevice parent_obj; + +/*< public >*/ +MemoryRegion mmio; + +struct { +uint8_t pin; +uint8_t ddr; +uint8_t port; +} reg; +

[PULL 16/27] target/mips: Simplify decode_opc_mxu() ifdef'ry

2021-03-13 Thread Philippe Mathieu-Daudé
By making the prototype public and checking 'TARGET_LONG_BITS == 32' we let the compiler elide the decode_opc_mxu() call. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/mips/translate.h | 3 +++ target/mips/translate.c | 6 ++ 2 files changed, 5

[PULL 21/27] target/mips/tx79: Move MTHI1 / MTLO1 opcodes to decodetree

2021-03-13 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20210214175912.732946-10-f4...@amsat.org> Signed-off-by: Philippe Mathieu-Daudé --- target/mips/tx79.decode | 3 +++ target/mips/translate.c | 25 - target/mips/tx79_translate.c

[PULL 08/27] target/mips: Rewrite complex ifdef'ry

2021-03-13 Thread Philippe Mathieu-Daudé
No need for this obfuscated ifdef'ry, KISS. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/mips/translate.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/target/mips/translate.c b/target/mips/translate.c index

[PULL 13/27] target/mips: Move MUL opcode check from decode_mxu() to decode_legacy()

2021-03-13 Thread Philippe Mathieu-Daudé
Move the check for MUL opcode from decode_opc_mxu() callee to decode_opc_legacy() caller, so we can simplify the ifdef'ry and elide the call in few commits. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/mips/translate.c | 19 +-- 1 file

[PULL 07/27] target/mips/meson: Restrict mips-semi.c to TCG

2021-03-13 Thread Philippe Mathieu-Daudé
Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/mips/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/mips/meson.build b/target/mips/meson.build index 75c16524606..53580633ce0 100644 --- a/target/mips/meson.build +++

Re: [PATCH 02/11] hw/avr/arduino: List board schematic links

2021-03-13 Thread Richard Henderson
On 3/13/21 10:54 AM, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- hw/avr/arduino.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) Reviewed-by: Richard Henderson r~

[PULL 17/27] target/mips: Introduce mxu_translate_init() helper

2021-03-13 Thread Philippe Mathieu-Daudé
Extract the MXU register initialization code from mips_tcg_init() as a new mxu_translate_init() helper. Make it public and replace !TARGET_MIPS64 ifdef'ry by the 'TARGET_LONG_BITS == 32' check to elide this code at preprocessing time. Reviewed-by: Richard Henderson Signed-off-by: Philippe

[PULL 11/27] target/mips: Pass instruction opcode to decode_opc_mxu()

2021-03-13 Thread Philippe Mathieu-Daudé
In the next commit we'll make decode_opc_mxu() match decodetree prototype by returning a boolean. First pass ctx->opcode as an argument. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/mips/translate.c | 14 +++--- 1 file changed, 7 insertions(+), 7

[PULL 06/27] target/mips/meson: Introduce mips_tcg source set

2021-03-13 Thread Philippe Mathieu-Daudé
Introduce the 'mips_tcg' source set to collect TCG specific files. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/mips/meson.build | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/target/mips/meson.build b/target/mips/meson.build index

[PULL 15/27] target/mips: Convert decode_ase_mxu() to decodetree prototype

2021-03-13 Thread Philippe Mathieu-Daudé
To easily convert MXU code to decodetree, making it return a boolean. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/mips/translate.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/target/mips/translate.c b/target/mips/translate.c

[PULL 18/27] target/mips: Extract MXU code to new mxu_translate.c file

2021-03-13 Thread Philippe Mathieu-Daudé
Extract 1600+ lines from the big translate.c into a new file. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/mips/mxu_translate.c | 1609 +++ target/mips/translate.c | 1605 --

[PULL 09/27] target/mips: Remove XBurst Media eXtension Unit dead code

2021-03-13 Thread Philippe Mathieu-Daudé
All these unimplemented MXU opcodes end up calling gen_reserved_instruction() which is the default switch case in decode_opc_mxu(). The translate.c file is already big enough and hard to maintain, remove 1300 lines of unnecessary code and /* TODO */ comments. Reviewed-by: Richard Henderson

[PULL 14/27] target/mips: Rename decode_opc_mxu() as decode_ase_mxu()

2021-03-13 Thread Philippe Mathieu-Daudé
Use "decode_{isa,ase,ext}_$name()" function name pattern for public decodetree entrypoints. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/mips/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/mips/translate.c

[PULL 19/27] target/mips: Use gen_load_gpr[_hi]() when possible

2021-03-13 Thread Philippe Mathieu-Daudé
Use gen_load_gpr[_hi]() instead of open coding it. Patch generated using the following spatch script: @gen_load_gpr@ identifier reg_idx; expression tcg_reg; @@ -if (reg_idx == 0) { -tcg_gen_movi_tl(tcg_reg, 0); -} else { -tcg_gen_mov_tl(tcg_reg, cpu_gpr[reg_idx]); -}

[PULL 04/27] hw/mips/gt64xxx: Rename trace events related to interrupt registers

2021-03-13 Thread Philippe Mathieu-Daudé
We want to trace all register accesses. First rename the current gt64120_read / gt64120_write events with '_intreg' suffix, as they are restricted to interrupt registers. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: BALATON Zoltan Message-Id: <20210309142630.728014-5-f4...@amsat.org> ---

[PULL 05/27] hw/mips/gt64xxx: Trace accesses to ISD registers

2021-03-13 Thread Philippe Mathieu-Daudé
Trace all accesses to Internal Space Decode (ISD) registers. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: BALATON Zoltan Message-Id: <20210309142630.728014-6-f4...@amsat.org> --- hw/mips/gt64xxx_pci.c | 2 ++ hw/mips/trace-events | 2 ++ 2 files changed, 4 insertions(+) diff --git

[PULL 02/27] hw/mips/gt64xxx: Simplify ISD MemoryRegion read/write handlers

2021-03-13 Thread Philippe Mathieu-Daudé
The ISD MemoryRegion is implemented for 32-bit accesses. Simplify it by setting the MemoryRegionOps::impl min/max access size fields. Since the region is registered with a size of 0x1000 bytes, we can remove the hwaddr mask. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: BALATON Zoltan

[PULL 01/27] hw/mips/gt64xxx: Initialize ISD I/O memory region in DeviceRealize()

2021-03-13 Thread Philippe Mathieu-Daudé
The ISD I/O region belongs to the TYPE_GT64120_PCI_HOST_BRIDGE, so initialize it before it is realized, not after. Rename the region as 'gt64120-isd' so it is clearer to realize it belongs to the GT64120 in the memory tree view. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: BALATON Zoltan

[PULL 00/27] MIPS patches for 2021-03-13

2021-03-13 Thread Philippe Mathieu-Daudé
The following changes since commit 3f8d1885e48e4d72eab0688f604de62e0aea7a38: Merge remote-tracking branch 'remotes/kraxel/tags/ui-20210311-pull-request' into staging (2021-03-12 13:53:44 +) are available in the Git repository at: https://github.com/philmd/qemu.git tags/mips-20210313

[PULL 03/27] hw/mips/gt64xxx: Fix typos in qemu_log_mask() formats

2021-03-13 Thread Philippe Mathieu-Daudé
Fix the following typos: - GT_PCI1_CFGDATA is not a timer register but a PCI one, - zero-padding flag is out of the format Fixes: 641ca2bfcd5 ("hw/mips/gt64xxx_pci: Use qemu_log_mask() instead of debug printf()") Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: BALATON Zoltan Message-Id:

Re: [PATCH] hw/display/bcm2835_fb: Remove DeviceReset() call in DeviceRealize()

2021-03-13 Thread Richard Henderson
On 3/13/21 11:01 AM, Philippe Mathieu-Daudé wrote: When QDev objects have their DeviceReset handler set, they shouldn't worry about calling it at realization stage (it is handled by hw/core/qdev.c::device_set_realized). Remove the pointless/confusing bcm2835_fb_reset() call. Signed-off-by:

Re: [PATCH 12/26] tcg: Create tcg_init

2021-03-13 Thread Richard Henderson
On 3/13/21 1:27 PM, Philippe Mathieu-Daudé wrote: On 3/11/21 1:21 AM, Richard Henderson wrote: Perform both tcg_context_init and tcg_region_init. Do not leave this split to the caller. Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 3 +-- tcg/internal.h| 1 +

Re: [PATCH for-6.0 0/2] arm: Make M-profile VTOR loads on reset handle memory aliasing

2021-03-13 Thread Peter Maydell
On Sat, 13 Mar 2021 at 19:05, Richard Henderson wrote: > > On 3/12/21 12:59 PM, Peter Maydell wrote: > > On Fri, 12 Mar 2021 at 17:29, Peter Maydell > > wrote: > >> This series handles the possibility of aliasing by iterating through > >> the whole FlatView of the CPU's address space checking

Re: [PATCH 12/26] tcg: Create tcg_init

2021-03-13 Thread Philippe Mathieu-Daudé
On 3/11/21 1:21 AM, Richard Henderson wrote: > Perform both tcg_context_init and tcg_region_init. > Do not leave this split to the caller. > > Signed-off-by: Richard Henderson > --- > include/tcg/tcg.h | 3 +-- > tcg/internal.h| 1 + > accel/tcg/translate-all.c | 3 +-- >

Re: [PATCH for-6.0 0/2] arm: Make M-profile VTOR loads on reset handle memory aliasing

2021-03-13 Thread Richard Henderson
On 3/12/21 12:59 PM, Peter Maydell wrote: On Fri, 12 Mar 2021 at 17:29, Peter Maydell wrote: This series handles the possibility of aliasing by iterating through the whole FlatView of the CPU's address space checking for other mappings of the MemoryRegion corresponding to the location of the

Re: [PATCH for-6.0 2/2] target/arm: Make M-profile VTOR loads on reset handle memory aliasing

2021-03-13 Thread Richard Henderson
On 3/12/21 2:17 PM, Philippe Mathieu-Daudé wrote: +static int find_rom_cb(Int128 start, Int128 len, const MemoryRegion *mr, + hwaddr offset_in_region, void *opaque) Return bool maybe? Yes, it might be worth changing with the first patch, while we're changing all (one)

Re: [PATCH 4/9] pc-bios/s390-ccw/netmain.c: Changed a malloc/free to GLib's variants

2021-03-13 Thread Christian Borntraeger
On 13.03.21 17:36, Mahmoud Mandour wrote: Changed a call to malloc() and its respective calls free() with GLib's allocation and deallocation functions. Signed-off-by: Mahmoud Mandour Nack. This is BIOS code and it does not have glib. --- pc-bios/s390-ccw/netmain.c | 6 +++--- 1 file

Re: [PATCH 10/26] accel/tcg: Move alloc_code_gen_buffer to tcg/region.c

2021-03-13 Thread Richard Henderson
On 3/10/21 6:21 PM, Richard Henderson wrote: Buffer management is integral to tcg. Do not leave the allocation to code outside of tcg/. This is code movement, with further cleanups to follow. Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 2 +- accel/tcg/translate-all.c

Re: [PATCH 02/26] meson: Move disas/tci.c to disas/meson.build

2021-03-13 Thread Richard Henderson
On 3/10/21 6:21 PM, Richard Henderson wrote: There's no reason to do this in the main meson.build. Signed-off-by: Richard Henderson --- meson.build | 1 - disas/meson.build | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) I'm going to drop this one because it conflicts with

[Bug 1846816] Re: Booting error on AIX 6.1 "Illegal Trap Instruction Interrupt in Kernel""

2021-03-13 Thread Chin
I saw comments about support for virtio devices on AIX 7.2, was it not available on AIX 7.1? With AIX 7.1 also, I am getting similar issue as faced by other users with AIX 6.1. qemu-system-ppc64 -cpu POWER8 -machine pseries -m 2048 -d unimp -serial stdio -drive

KVM guest physical address and its corresponding host virtual address

2021-03-13 Thread Lorenzo Susini
Hi all, I'm a student and I'm new to QEMU and virtualization. I would like to locate the Interrupt Descriptor Table of the guest from the host and so I want to obtain a host virtual address pointing to it. I don't know if I've found the right way to do that, but till now I'm doing like this from

[Bug 1919036] [NEW] Assertion failure in fifo8_push_all() through am53c974

2021-03-13 Thread Cheolwoo,Myung
Public bug reported: Hello, Using hypervisor fuzzer, hyfuzz, I found an assertion failure through am53c974 emulator. A malicious guest user/process could use this flaw to abort the QEMU process on the host, resulting in a denial of service. This was found in version 5.2.0 (master, 3f8d1885e4)

Re: [PATCH 24/26] util/osdep: Add qemu_mprotect_rw

2021-03-13 Thread Philippe Mathieu-Daudé
On 3/11/21 1:21 AM, Richard Henderson wrote: > For --enable-tcg-interpreter on Windows, we will need this. > > Signed-off-by: Richard Henderson > --- > include/qemu/osdep.h | 1 + > util/osdep.c | 9 + > 2 files changed, 10 insertions(+) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 15/26] tcg: Introduce tcg_max_ctxs

2021-03-13 Thread Philippe Mathieu-Daudé
On 3/11/21 1:21 AM, Richard Henderson wrote: > Finish the divorce of tcg/ from hw/, and do not take > the max cpu value from MachineState; just rememver what Typo "remember" > we were passed in tcg_init. > > Signed-off-by: Richard Henderson > --- > tcg/internal.h | 3 ++- > tcg/region.c |

Re: [PATCH 14/26] accel/tcg: Pass down max_cpus to tcg_init

2021-03-13 Thread Philippe Mathieu-Daudé
On 3/11/21 1:21 AM, Richard Henderson wrote: > Start removing the include of hw/boards.h from tcg/. > Pass down the max_cpus value from tcg_init_machine, > where we have the MachineState already. > > Signed-off-by: Richard Henderson > --- > include/tcg/tcg.h | 2 +- > tcg/internal.h |

Re: [PATCH 03/26] meson: Split out fpu/meson.build

2021-03-13 Thread Philippe Mathieu-Daudé
On 3/11/21 1:21 AM, Richard Henderson wrote: > Signed-off-by: Richard Henderson > --- > meson.build | 4 +--- > fpu/meson.build | 1 + > 2 files changed, 2 insertions(+), 3 deletions(-) > create mode 100644 fpu/meson.build Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 11/26] accel/tcg: Rename tcg_init to tcg_init_machine

2021-03-13 Thread Philippe Mathieu-Daudé
On 3/11/21 1:21 AM, Richard Henderson wrote: > We shortly want to use tcg_init for something else. > Since the hook is called init_machine, match that. > > Signed-off-by: Richard Henderson > --- > accel/tcg/tcg-all.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by:

Re: [PATCH 09/26] accel/tcg: Inline cpu_gen_init

2021-03-13 Thread Philippe Mathieu-Daudé
On 3/11/21 1:21 AM, Richard Henderson wrote: > It consists of one function call and has only one caller. > > Signed-off-by: Richard Henderson > --- > accel/tcg/translate-all.c | 7 +-- > 1 file changed, 1 insertion(+), 6 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 05/26] tcg: Remove error return from tcg_region_initial_alloc__locked

2021-03-13 Thread Philippe Mathieu-Daudé
On 3/11/21 1:21 AM, Richard Henderson wrote: > All callers immediately assert on error, so move the assert > into the function itself. > > Signed-off-by: Richard Henderson > --- > tcg/tcg.c | 19 ++- > 1 file changed, 6 insertions(+), 13 deletions(-) Reviewed-by: Philippe

Re: [PATCH 01/26] meson: Split out tcg/meson.build

2021-03-13 Thread Philippe Mathieu-Daudé
On 3/11/21 1:21 AM, Richard Henderson wrote: > Signed-off-by: Richard Henderson > --- > meson.build | 9 ++--- > tcg/meson.build | 13 + > 2 files changed, 15 insertions(+), 7 deletions(-) > create mode 100644 tcg/meson.build Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 02/26] meson: Move disas/tci.c to disas/meson.build

2021-03-13 Thread Philippe Mathieu-Daudé
On 3/11/21 1:21 AM, Richard Henderson wrote: > There's no reason to do this in the main meson.build. > > Signed-off-by: Richard Henderson > --- > meson.build | 1 - > disas/meson.build | 2 ++ > 2 files changed, 2 insertions(+), 1 deletion(-) Reviewed-by: Philippe Mathieu-Daudé

[Bug 1919035] [NEW] Assertion failure in fifo8_pop_buf() through am53c974

2021-03-13 Thread Cheolwoo,Myung
Public bug reported: Hello, Using hypervisor fuzzer, hyfuzz, I found an assertion failure through am53c974 emulator. A malicious guest user/process could use this flaw to abort the QEMU process on the host, resulting in a denial of service. This was found in version 5.2.0 (master, 3f8d1885e4)

Re: [PATCH 08/11] hw/avr/arduino: Add D13 LED

2021-03-13 Thread Niteesh G. S.
Reviewed-by: Niteesh G S On Sat, Mar 13, 2021 at 10:32 PM Niteesh G. S. wrote: > Hii Phil, > > Just a few mins earlier than me :) > > Thanks, > Niteesh > > On Sat, Mar 13, 2021 at 10:25 PM Philippe Mathieu-Daudé > wrote: > >> From: G S Niteesh Babu >> >> Signed-off-by: G S Niteesh Babu >>

Re: [PATCH 0/3] hw: Constify VMStateDescription

2021-03-13 Thread Richard Henderson
On 3/13/21 11:11 AM, Philippe Mathieu-Daudé wrote: Philippe Mathieu-Daudé (3): hw/arm: Constify VMStateDescription hw/display/qxl: Constify VMStateDescription hw/usb: Constify VMStateDescription Reviewed-by: Richard Henderson r~

[PATCH] hw/display/bcm2835_fb: Remove DeviceReset() call in DeviceRealize()

2021-03-13 Thread Philippe Mathieu-Daudé
When QDev objects have their DeviceReset handler set, they shouldn't worry about calling it at realization stage (it is handled by hw/core/qdev.c::device_set_realized). Remove the pointless/confusing bcm2835_fb_reset() call. Signed-off-by: Philippe Mathieu-Daudé --- hw/display/bcm2835_fb.c | 2

Re: [PATCH 07/11] hw/gpio/avr_gpio: Add tracing for reads and writes

2021-03-13 Thread Niteesh G. S.
Reviewed-by: Niteesh G S On Sat, Mar 13, 2021 at 10:25 PM Philippe Mathieu-Daudé wrote: > From: G S Niteesh Babu > > Added tracing for gpio read, write, and update output irq. > > 1) trace_avr_gpio_update_ouput_irq > 2) trace_avr_gpio_read > 3) trace_avr_gpio_write > > Signed-off-by: G S

Re: [PATCH 0/2] MAINTAINERS: Mark Renesas hardware emulation orphan

2021-03-13 Thread Richard Henderson
On 3/12/21 9:55 AM, Philippe Mathieu-Daudé wrote: Philippe Mathieu-Daudé (2): MAINTAINERS: Mark RX hardware emulation orphan MAINTAINERS: Mark SH-4 hardware emulation orphan Acked-by: Richard Henderson r~

[PATCH 3/3] hw/usb: Constify VMStateDescription

2021-03-13 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- hw/usb/ccid-card-passthru.c | 2 +- hw/usb/dev-smartcard-reader.c | 8 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c index c1a90fcc7a5..7212d0d7fb5 100644 ---

[PATCH 08/11] hw/avr/arduino: Add D13 LED

2021-03-13 Thread Philippe Mathieu-Daudé
From: G S Niteesh Babu Signed-off-by: G S Niteesh Babu Reviewed-by: Michael Rolnik Message-Id: <20210311135539.10206-4-niteesh...@gmail.com> [PMD: Added ArduinoMachineClass::d13_led_portb_bit] Signed-off-by: Philippe Mathieu-Daudé --- hw/avr/arduino.c | 18 ++ hw/avr/Kconfig

[PATCH 2/3] hw/display/qxl: Constify VMStateDescription

2021-03-13 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- hw/display/qxl.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/display/qxl.c b/hw/display/qxl.c index 93907e82a33..2ba75637ec3 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -2384,7 +2384,7 @@ static bool

  1   2   >