[PATCH] MAINTAINERS: Add myself as a reviewer for SDL audio

2021-10-29 Thread Thomas Huth
I've got some experience with the SDL library, so I can help reviewing patches here. Signed-off-by: Thomas Huth --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 894dc43105..a24dfbfd32 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2313,6 +2313,7

Re: [PULL 0/9] QAPI patches patches for 2021-10-29

2021-10-29 Thread Richard Henderson
On 10/29/21 12:30 PM, Markus Armbruster wrote: The following changes since commit c52d69e7dbaaed0ffdef8125e79218672c30161d: Merge remote-tracking branch 'remotes/cschoenebeck/tags/pull-9p-20211027' into staging (2021-10-27 11:45:18 -0700) are available in the Git repository at: git://re

[PATCH] target/riscv: machine: Sort the .subsections

2021-10-29 Thread Bin Meng
From: Bin Meng Move the codes around so that the order of .subsections matches the one they are referenced in vmstate_riscv_cpu. Signed-off-by: Bin Meng --- target/riscv/machine.c | 92 +- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/

Re: [PATCH 20/24] bsd-user/arm/target_arch_signal.h: arm set_sigtramp_args

2021-10-29 Thread Warner Losh
On Thu, Oct 28, 2021 at 4:41 PM Warner Losh wrote: > > > On Thu, Oct 28, 2021 at 11:25 AM Richard Henderson < > richard.hender...@linaro.org> wrote: > >> On 10/19/21 9:44 AM, Warner Losh wrote: >> > +regs->regs[TARGET_REG_PC] = ka->_sa_handler; >> >> Surely there should be some handling of th

Re: [PATCH 19/24] bsd-user/arm/target_arch_signal.h: arm user context and trapframe for signals

2021-10-29 Thread Warner Losh
On Thu, Oct 28, 2021 at 11:22 AM Richard Henderson < richard.hender...@linaro.org> wrote: > On 10/19/21 9:44 AM, Warner Losh wrote: > > Arm specific user context structures for signal handling and the closely > > related trap frame. > > > > Signed-off-by: Stacey Son > > Signed-off-by: Warner Losh

Re: [PULL 0/1] x86 CPU model queue, 2021-10-29

2021-10-29 Thread Richard Henderson
On 10/29/21 12:07 PM, Eduardo Habkost wrote: I should have flushed the queue a long time ago. Apologies for taking so long. A single patch, by now. Probably there are others I missed on the mailing list, and if necessary I will send another pull request. The following changes since commit a92

[PATCH v5 23/30] Hexagon HVX (target/hexagon) helper overrides - vector stores

2021-10-29 Thread Taylor Simpson
Acked-by: Richard Henderson Signed-off-by: Taylor Simpson --- target/hexagon/gen_tcg_hvx.h | 218 +++ 1 file changed, 218 insertions(+) diff --git a/target/hexagon/gen_tcg_hvx.h b/target/hexagon/gen_tcg_hvx.h index 2d1d778..cdcc938 100644 --- a/target/hex

[PATCH v5 27/30] Hexagon HVX (tests/tcg/hexagon) vector_add_int test

2021-10-29 Thread Taylor Simpson
Reviewed-by: Richard Henderson Signed-off-by: Taylor Simpson --- tests/tcg/hexagon/vector_add_int.c | 61 ++ tests/tcg/hexagon/Makefile.target | 3 ++ 2 files changed, 64 insertions(+) create mode 100644 tests/tcg/hexagon/vector_add_int.c diff --git a/test

[PATCH v5 26/30] Hexagon HVX (target/hexagon) import instruction encodings

2021-10-29 Thread Taylor Simpson
Acked-by: Richard Henderson Signed-off-by: Taylor Simpson --- target/hexagon/decode.c | 4 + target/hexagon/imported/allextenc.def| 20 + target/hexagon/imported/encode.def | 1 + target/hexagon/imported/mmvec/encode_ext.def | 794 +

[PATCH v5 22/30] Hexagon HVX (target/hexagon) helper overrides - vector loads

2021-10-29 Thread Taylor Simpson
Acked-by: Richard Henderson Signed-off-by: Taylor Simpson --- target/hexagon/gen_tcg_hvx.h | 150 +++ 1 file changed, 150 insertions(+) diff --git a/target/hexagon/gen_tcg_hvx.h b/target/hexagon/gen_tcg_hvx.h index 435c7b5..2d1d778 100644 --- a/target/hex

[PATCH v5 30/30] Hexagon HVX (tests/tcg/hexagon) histogram test

2021-10-29 Thread Taylor Simpson
Acked-by: Richard Henderson Signed-off-by: Taylor Simpson --- tests/tcg/hexagon/hvx_histogram_input.h | 717 tests/tcg/hexagon/hvx_histogram_row.h | 24 ++ tests/tcg/hexagon/hvx_histogram.c | 88 tests/tcg/hexagon/Makefile.target | 5 + tes

[PATCH v5 16/30] Hexagon HVX (target/hexagon) helper overrides - vector add & sub

2021-10-29 Thread Taylor Simpson
Reviewed-by: Richard Henderson Signed-off-by: Taylor Simpson --- target/hexagon/gen_tcg_hvx.h | 50 1 file changed, 50 insertions(+) diff --git a/target/hexagon/gen_tcg_hvx.h b/target/hexagon/gen_tcg_hvx.h index 916230e..ac2143e 100644 --- a/target/h

[PATCH v5 17/30] Hexagon HVX (target/hexagon) helper overrides - vector shifts

2021-10-29 Thread Taylor Simpson
Reviewed-by: Richard Henderson Signed-off-by: Taylor Simpson --- target/hexagon/gen_tcg_hvx.h | 122 +++ 1 file changed, 122 insertions(+) diff --git a/target/hexagon/gen_tcg_hvx.h b/target/hexagon/gen_tcg_hvx.h index ac2143e..e865410 100644 --- a/target/

[PATCH v5 11/30] Hexagon HVX (target/hexagon) helper functions

2021-10-29 Thread Taylor Simpson
Probe and commit vector stores (masked and scatter/gather) Log vector register writes Add the execution counters to the debug log Histogram instructions Reviewed-by: Richard Henderson Signed-off-by: Taylor Simpson --- target/hexagon/helper.h| 16 +++ target/hexagon/op_helper.c | 282 ++

[PATCH v5 25/30] Hexagon HVX (target/hexagon) instruction decoding

2021-10-29 Thread Taylor Simpson
Add new file to target/hexagon/meson.build Acked-by: Richard Henderson Signed-off-by: Taylor Simpson --- target/hexagon/mmvec/decode_ext_mmvec.h | 24 target/hexagon/decode.c | 24 +++- target/hexagon/mmvec/decode_ext_mmvec.c | 236 target

[PATCH v5 08/30] Hexagon HVX (target/hexagon) semantics generator - part 2

2021-10-29 Thread Taylor Simpson
Acked-by: Richard Henderson Signed-off-by: Taylor Simpson --- target/hexagon/gen_helper_funcs.py | 112 ++-- target/hexagon/gen_helper_protos.py | 16 ++- target/hexagon/gen_tcg_funcs.py | 254 ++-- 3 files changed, 360 insertions(+), 22 deletion

[PATCH v5 12/30] Hexagon HVX (target/hexagon) TCG generation

2021-10-29 Thread Taylor Simpson
Reviewed-by: Richard Henderson Signed-off-by: Taylor Simpson --- target/hexagon/translate.h | 61 target/hexagon/genptr.c| 15 +++ target/hexagon/translate.c | 239 - 3 files changed, 311 insertions(+), 4 deletions(-) diff --git a/t

[PATCH v5 28/30] Hexagon HVX (tests/tcg/hexagon) hvx_misc test

2021-10-29 Thread Taylor Simpson
Tests for packet semantics vector loads (aligned and unaligned) vector stores (aligned and unaligned) vector masked stores vector new value store maximum HVX temps in a packet vector operations Acked-by: Richard Henderson Signed-off-by: Taylor Simpson --- tests/tcg/h

[PATCH v5 10/30] Hexagon HVX (target/hexagon) instruction utility functions

2021-10-29 Thread Taylor Simpson
Functions to support scatter/gather Add new file to target/hexagon/meson.build Signed-off-by: Taylor Simpson --- target/hexagon/mmvec/system_ext_mmvec.h | 25 ++ target/hexagon/mmvec/system_ext_mmvec.c | 47 + target/hexagon/meson.build

[PATCH v5 29/30] Hexagon HVX (tests/tcg/hexagon) scatter_gather test

2021-10-29 Thread Taylor Simpson
Acked-by: Richard Henderson Signed-off-by: Taylor Simpson --- tests/tcg/hexagon/scatter_gather.c | 1011 tests/tcg/hexagon/Makefile.target |2 + 2 files changed, 1013 insertions(+) create mode 100644 tests/tcg/hexagon/scatter_gather.c diff --git a/test

[PATCH v5 21/30] Hexagon HVX (target/hexagon) helper overrides - vector splat and abs

2021-10-29 Thread Taylor Simpson
Reviewed-by: Richard Henderson Signed-off-by: Taylor Simpson --- target/hexagon/gen_tcg_hvx.h | 26 ++ 1 file changed, 26 insertions(+) diff --git a/target/hexagon/gen_tcg_hvx.h b/target/hexagon/gen_tcg_hvx.h index 32f8e20..435c7b5 100644 --- a/target/hexagon/gen_tcg_hvx

[PATCH v5 19/30] Hexagon HVX (target/hexagon) helper overrides - vector logical ops

2021-10-29 Thread Taylor Simpson
Reviewed-by: Richard Henderson Signed-off-by: Taylor Simpson --- target/hexagon/gen_tcg_hvx.h | 42 ++ 1 file changed, 42 insertions(+) diff --git a/target/hexagon/gen_tcg_hvx.h b/target/hexagon/gen_tcg_hvx.h index f548404..f53a7f2 100644 --- a/target/hex

[PATCH v5 05/30] Hexagon HVX (target/hexagon) macros

2021-10-29 Thread Taylor Simpson
macros to interface with the generator macros referenced in instruction semantics Acked-by: Richard Henderson Signed-off-by: Taylor Simpson --- target/hexagon/macros.h | 22 +++ target/hexagon/mmvec/macros.h | 354 ++ 2 files changed, 376 insertion

[PATCH v5 15/30] Hexagon HVX (target/hexagon) helper overrides - vector assign & cmov

2021-10-29 Thread Taylor Simpson
Reviewed-by: Richard Henderson Signed-off-by: Taylor Simpson --- target/hexagon/gen_tcg_hvx.h | 31 +++ 1 file changed, 31 insertions(+) diff --git a/target/hexagon/gen_tcg_hvx.h b/target/hexagon/gen_tcg_hvx.h index a560504..916230e 100644 --- a/target/hexagon/gen_tc

[PATCH v5 09/30] Hexagon HVX (target/hexagon) C preprocessor for decode tree

2021-10-29 Thread Taylor Simpson
Acked-by: Richard Henderson Signed-off-by: Taylor Simpson --- target/hexagon/gen_dectree_import.c | 13 + 1 file changed, 13 insertions(+) diff --git a/target/hexagon/gen_dectree_import.c b/target/hexagon/gen_dectree_import.c index 5b7ecfc..ee35467 100644 --- a/target/hexagon/gen_d

[PATCH v5 06/30] Hexagon HVX (target/hexagon) import macro definitions

2021-10-29 Thread Taylor Simpson
Imported from the Hexagon architecture library imported/allext_macros.def Top level macro include for all extensions imported/macros.def Scalar core macros (some HVX here) imported/mmvec/macros.defHVX macro definitions The macro definition files specify instru

[PATCH v5 04/30] Hexagon HVX (target/hexagon) instruction attributes

2021-10-29 Thread Taylor Simpson
Acked-by: Richard Henderson Signed-off-by: Taylor Simpson --- target/hexagon/attribs_def.h.inc | 22 ++ 1 file changed, 22 insertions(+) diff --git a/target/hexagon/attribs_def.h.inc b/target/hexagon/attribs_def.h.inc index e44a7ea..dc890a5 100644 --- a/target/hexagon/attrib

[PATCH v5 13/30] Hexagon HVX (target/hexagon) helper overrides infrastructure

2021-10-29 Thread Taylor Simpson
Build the infrastructure to create overrides for HVX instructions. We create a new empty file (gen_tcg_hvx.h) that will be populated in subsequent patches. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Taylor Simpson --- target/hexagon/gen_tcg_hvx.h|

[PATCH v5 20/30] Hexagon HVX (target/hexagon) helper overrides - vector compares

2021-10-29 Thread Taylor Simpson
Reviewed-by: Richard Henderson Signed-off-by: Taylor Simpson --- target/hexagon/gen_tcg_hvx.h | 103 +++ 1 file changed, 103 insertions(+) diff --git a/target/hexagon/gen_tcg_hvx.h b/target/hexagon/gen_tcg_hvx.h index f53a7f2..32f8e20 100644 --- a/target/

[PATCH v5 07/30] Hexagon HVX (target/hexagon) semantics generator

2021-10-29 Thread Taylor Simpson
Add HVX support to the semantics generator Acked-by: Richard Henderson Signed-off-by: Taylor Simpson --- target/hexagon/gen_semantics.c | 33 + target/hexagon/hex_common.py | 13 + 2 files changed, 46 insertions(+) diff --git a/target/hexagon/gen_s

[PATCH v5 14/30] Hexagon HVX (target/hexagon) helper overrides for histogram instructions

2021-10-29 Thread Taylor Simpson
Reviewed-by: Richard Henderson Signed-off-by: Taylor Simpson --- target/hexagon/gen_tcg_hvx.h | 106 +++ 1 file changed, 106 insertions(+) diff --git a/target/hexagon/gen_tcg_hvx.h b/target/hexagon/gen_tcg_hvx.h index b5c6cad..a560504 100644 --- a/target/

[PATCH v5 03/30] Hexagon HVX (target/hexagon) register names

2021-10-29 Thread Taylor Simpson
Reviewed-by: Richard Henderson Signed-off-by: Taylor Simpson --- target/hexagon/hex_regs.h | 1 + target/hexagon/cpu.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/target/hexagon/hex_regs.h b/target/hexagon/hex_regs.h index f291911..e1b3149 100644 --- a/target/hexag

[PATCH v5 00/30] Hexagon HVX (target/hexagon) patch series

2021-10-29 Thread Taylor Simpson
This series adds support for the Hexagon Vector eXtensions (HVX) These instructions are documented here https://developer.qualcomm.com/downloads/qualcomm-hexagon-v66-hvx-programmer-s-reference-manual Hexagon HVX is a wide vector engine with 128 byte vectors. See patch 01 Hexagon HVX README for m

[PATCH v5 01/30] Hexagon HVX (target/hexagon) README

2021-10-29 Thread Taylor Simpson
Signed-off-by: Taylor Simpson --- target/hexagon/README | 81 ++- 1 file changed, 80 insertions(+), 1 deletion(-) diff --git a/target/hexagon/README b/target/hexagon/README index b0b2435..372e247 100644 --- a/target/hexagon/README +++ b/target/hexa

[PATCH v5 18/30] Hexagon HVX (target/hexagon) helper overrides - vector max/min

2021-10-29 Thread Taylor Simpson
Reviewed-by: Richard Henderson Signed-off-by: Taylor Simpson --- target/hexagon/gen_tcg_hvx.h | 34 ++ 1 file changed, 34 insertions(+) diff --git a/target/hexagon/gen_tcg_hvx.h b/target/hexagon/gen_tcg_hvx.h index e865410..f548404 100644 --- a/target/hexagon/gen

[PATCH v5 02/30] Hexagon HVX (target/hexagon) add Hexagon Vector eXtensions (HVX) to core

2021-10-29 Thread Taylor Simpson
HVX is a set of wide vector instructions. Machine state includes vector registers (VRegs) vector predicate registers (QRegs) temporary registers for intermediate values store buffer (masked stores and scatter/gather) Acked-by: Richard Henderson Signed-off-by: Taylor Simpson ---

[PATCH] hvf: Fix OOB write in RDTSCP instruction decode

2021-10-29 Thread Cameron Esfahani
A guest could craft a specific stream of instructions that will have QEMU write 0xF9 to inappropriate locations in memory. Add additional asserts to check for this. Generate a #UD if there are more than 14 prefix bytes. Found by Julian Stecklina Signed-off-by: Cameron Esfahani --- target/i38

Re: [PATCH v5 60/67] tcg: Add helper_unaligned_{ld, st} for user-only sigbus

2021-10-29 Thread Philippe Mathieu-Daudé
On 10/15/21 06:10, Richard Henderson wrote: > To be called from tcg generated code on hosts that support > unaligned accesses natively, in response to an access that > is supposed to be aligned. > > Reviewed-by: Peter Maydell > Signed-off-by: Richard Henderson > --- > include/tcg/tcg-ldst.h |

Re: [PATCH v6 13/30] hw/char/sh_serial: QOM-ify

2021-10-29 Thread BALATON Zoltan
On Sat, 30 Oct 2021, Philippe Mathieu-Daudé wrote: On 10/29/21 23:02, BALATON Zoltan wrote: Signed-off-by: BALATON Zoltan --- hw/char/sh_serial.c | 98 +++-- hw/sh4/sh7750.c | 56 +++--- include/hw/sh4/sh.h | 9 + 3 files cha

Re: [PATCH v6 00/30] More SH4 clean ups (including code style series)

2021-10-29 Thread BALATON Zoltan
On Fri, 29 Oct 2021, Philippe Mathieu-Daudé wrote: On 10/29/21 23:02, BALATON Zoltan wrote: This now includes the previous code style clean up series so everything is in the series now. This got big enough for now so I'll wait until these are merged (hopefully before the freeze) before going on

Re: [PATCH v6 30/30] hw/timer/sh_timer: Remove use of hw_error

2021-10-29 Thread BALATON Zoltan
On Sat, 30 Oct 2021, Philippe Mathieu-Daudé wrote: On 10/29/21 23:02, BALATON Zoltan wrote: The hw_error function calls abort and is not meant to be used by devices. Use qemu_log_mask instead to log and ignore invalid accesses. Also fix format strings to allow dropping type casts of hwaddr and u

Re: [PATCH v5 53/67] linux-user/hppa: Remove POWERPC_EXCP_ALIGN handling

2021-10-29 Thread Philippe Mathieu-Daudé
Typo s/hppa/ppc/ in subject. On 10/15/21 06:10, Richard Henderson wrote: > We will raise SIGBUS directly from cpu_loop_exit_sigbus. > > Signed-off-by: Richard Henderson > --- > linux-user/ppc/cpu_loop.c | 8 > 1 file changed, 8 deletions(-) > > diff --git a/linux-user/ppc/cpu_loop.c b

Re: [PATCH v6 22/30] hw/intc/sh_intc: Inline and drop sh_intc_source() function

2021-10-29 Thread BALATON Zoltan
On Sat, 30 Oct 2021, Philippe Mathieu-Daudé wrote: On 10/29/21 23:02, BALATON Zoltan wrote: This function is very simple and provides no advantage. Call sites become simpler without it so just write it in line and drop the separate function. Signed-off-by: BALATON Zoltan --- hw/intc/sh_intc.c

Re: [PATCH v5 61/67] linux-user: Handle BUS_ADRALN in host_signal_handler

2021-10-29 Thread Philippe Mathieu-Daudé
On 10/15/21 06:10, Richard Henderson wrote: > Handle BUS_ADRALN via cpu_loop_exit_sigbus, but allow other SIGBUS > si_codes to continue into the host-to-guest signal coversion code. Typo "conversion". > > Signed-off-by: Richard Henderson > --- > linux-user/signal.c | 3 +++ > 1 file changed, 3

Re: [PATCH v5 58/67] accel/tcg: Report unaligned atomics for user-only

2021-10-29 Thread Philippe Mathieu-Daudé
On 10/15/21 06:10, Richard Henderson wrote: > Use the new cpu_loop_exit_sigbus for atomic_mmu_lookup, which > has access to complete alignment info from the TCGMemOpIdx arg. > > Reviewed-by: Alex Bennée > Signed-off-by: Richard Henderson > --- > accel/tcg/user-exec.c | 13 - > 1 fil

Re: [PATCH v5 51/67] target/ppc: Restrict ppc_cpu_do_unaligned_access to sysemu

2021-10-29 Thread Philippe Mathieu-Daudé
On 10/15/21 06:10, Richard Henderson wrote: > This is not used by, nor required by, user-only. > > Signed-off-by: Richard Henderson > --- > target/ppc/internal.h| 8 +++- > target/ppc/excp_helper.c | 8 +++- > 2 files changed, 6 insertions(+), 10 deletions(-) Reviewed-by: Philippe M

Re: [PATCH v5 52/67] target/s390x: Implement s390x_cpu_record_sigbus

2021-10-29 Thread Philippe Mathieu-Daudé
On 10/15/21 06:10, Richard Henderson wrote: > For s390x, the only unaligned accesses that are signaled are atomic, > and we don't actually want to raise SIGBUS for those, but instead > raise a SPECIFICATION error, which the kernel will report as SIGILL. > > Split out a do_unaligned_access function

RE: [PATCH v4 10/30] Hexagon HVX (target/hexagon) instruction utility functions

2021-10-29 Thread Taylor Simpson
> -Original Message- > From: Richard Henderson > Sent: Friday, October 29, 2021 1:53 PM > To: Taylor Simpson ; qemu-devel@nongnu.org > Cc: f4...@amsat.org; a...@rev.ng; Brian Cain > Subject: Re: [PATCH v4 10/30] Hexagon HVX (target/hexagon) instruction > utility functions > > On 10/12/2

Re: [PATCH v6 29/30] hw/timer/sh_timer: Fix timer memory region size

2021-10-29 Thread BALATON Zoltan
On Sat, 30 Oct 2021, Philippe Mathieu-Daudé wrote: On 10/29/21 23:02, BALATON Zoltan wrote: The timer memory region is only accessed via aliases that are 0x1000 bytes long, no need to have the timer region larger than that. Signed-off-by: BALATON Zoltan --- hw/timer/sh_timer.c | 3 +-- 1 file

Re: [PATCH v5 44/67] linux-user: Add cpu_loop_exit_sigbus

2021-10-29 Thread Philippe Mathieu-Daudé
On 10/15/21 06:10, Richard Henderson wrote: > This is a new interface to be provided by the os emulator for > raising SIGBUS on fault. Use the new record_sigbus target hook. > > Signed-off-by: Richard Henderson > --- > include/exec/exec-all.h | 14 ++ This header deserves a system/u

[PATCH v7 29/30] hw/timer/sh_timer: Fix timer memory region size

2021-10-29 Thread BALATON Zoltan
The timer unit only has registers that fit in a region 0x30 bytes long. No need to have the timer region larger than that. Signed-off-by: BALATON Zoltan --- hw/timer/sh_timer.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/timer/sh_timer.c b/hw/timer/sh_timer.c in

Re: [PATCH v5 16/67] target/arm: Fixup comment re handle_cpu_signal

2021-10-29 Thread Philippe Mathieu-Daudé
On 10/15/21 06:10, Richard Henderson wrote: > The named function no longer exists. It seems to be declared inlined since QEMU v0.1.0 in 2003! So it was likely a typo. Anyhow, Reviewed-by: Philippe Mathieu-Daudé > Refer to host_signal_handler instead. > > Signed-off-by: Richard Henderson > --

[PATCH v3 4/5] target/arm: Use tcg_constant_i64() in do_sat_addsub_64()

2021-10-29 Thread Philippe Mathieu-Daudé
The immediate value used for comparison is constant and read-only. Move it to the constant pool. This frees a TCG temporary for unsigned saturation opcodes. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/arm/translate-sve.c | 17 - 1 file changed

[PATCH v3 2/5] target/arm: Introduce store_cpu_field_constant() helper

2021-10-29 Thread Philippe Mathieu-Daudé
Similarly to the store_cpu_field() helper which takes a TCG temporary, store its value to the CPUState, introduce the store_cpu_field_constant() helper which store a constant to CPUState (without using any TCG temporary). Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé ---

[PATCH v3 3/5] target/arm: Use the constant variant of store_cpu_field() when possible

2021-10-29 Thread Philippe Mathieu-Daudé
When using a constant variable, we can replace the store_cpu_field() call by store_cpu_field_constant() which avoid using TCG temporaries. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/arm/translate.c | 21 ++--- 1 file changed, 6 insertions(+),

[PATCH v3 5/5] target/arm: Use tcg_constant_i32() in gen_rev16()

2021-10-29 Thread Philippe Mathieu-Daudé
Since the mask is a constant value, use tcg_constant_i32() instead of a TCG temporary. Signed-off-by: Philippe Mathieu-Daudé --- target/arm/translate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/arm/translate.c b/target/arm/translate.c index 52ba562c96b..98f5925

[PATCH v3 1/5] target/arm: Use tcg_constant_i32() in op_smlad()

2021-10-29 Thread Philippe Mathieu-Daudé
Avoid using a TCG temporary for a read-only constant. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/arm/translate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/arm/translate.c b/target/arm/translate.c index d6af5b1b039..083a6d6e

[PATCH v3 0/5] target/arm: Use tcg_constant_*

2021-10-29 Thread Philippe Mathieu-Daudé
Missing review: patches #2 & #5 (new) Introduce store_cpu_field_constant() helper to avoid using temporary when the value is constant (and read-only). Since v2: - Simplify store_cpu_field_constant(), do not modify store_cpu_field() - Added another use in gen_rev16() Philippe Mathieu-Daudé (5):

Re: [PATCH v2 2/4] target/arm: Introduce store_cpu_field_constant() helper

2021-10-29 Thread Philippe Mathieu-Daudé
On 10/28/21 03:17, Richard Henderson wrote: > On 10/26/21 9:56 PM, Philippe Mathieu-Daudé wrote: >> -static inline void store_cpu_offset(TCGv_i32 var, int offset) >> +static inline void store_cpu_offset(TCGv_i32 var, int offset, bool >> is_temp) >>   { >>   tcg_gen_st_i32(var, cpu_env, offset);

[PATCH 4/5] hw/core: Remove uses of QERR_PROPERTY_VALUE_BAD

2021-10-29 Thread Philippe Mathieu-Daudé
QERR_PROPERTY_VALUE_BAD definition is obsolete since 2015 (commit 4629ed1e989, "qerror: Finally unused, clean up"). Replace the two uses and drop the definition. Signed-off-by: Philippe Mathieu-Daudé --- include/qapi/qmp/qerror.h | 3 --- hw/core/qdev-properties.c | 2 +- target/i386/cpu.c

[PATCH 5/5] hw/core: Remove uses of QERR_INVALID_PARAMETER_VALUE

2021-10-29 Thread Philippe Mathieu-Daudé
QERR_INVALID_PARAMETER_VALUE definition is obsolete since 2015 (commit 4629ed1e989, "qerror: Finally unused, clean up"). Replace the definitions used in hw/core/. Signed-off-by: Philippe Mathieu-Daudé --- hw/core/qdev-properties-system.c | 2 +- monitor/misc.c | 3 +-- softmmu/

[PATCH 3/5] hw/core: Remove uses of QERR_DEVICE_NO_HOTPLUG

2021-10-29 Thread Philippe Mathieu-Daudé
QERR_DEVICE_NO_HOTPLUG definition is obsolete since 2015 (commit 4629ed1e989, "qerror: Finally unused, clean up"). Replace the two uses and drop the definition. Signed-off-by: Philippe Mathieu-Daudé --- include/qapi/qmp/qerror.h | 3 --- hw/core/qdev.c| 3 ++- softmmu/qdev-monitor.c

[PATCH 0/5] hw/core: Remove uses of obsolete QERR_ definitions

2021-10-29 Thread Philippe Mathieu-Daudé
QERR_ definitions are obsolete since 2015... Remove their uses in hw/core/. Philippe Mathieu-Daudé (5): hw/core: Remove use of QERR_UNSUPPORTED hw/core: Remove use of QERR_FEATURE_DISABLED hw/core: Remove uses of QERR_DEVICE_NO_HOTPLUG hw/core: Remove uses of QERR_PROPERTY_VALUE_BAD hw/c

[PATCH 2/5] hw/core: Remove use of QERR_FEATURE_DISABLED

2021-10-29 Thread Philippe Mathieu-Daudé
QERR_FEATURE_DISABLED definition is obsolete since 2015 (commit 4629ed1e989, "qerror: Finally unused, clean up"). Replace it. Signed-off-by: Philippe Mathieu-Daudé --- hw/core/machine-qmp-cmds.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/core/machine-qmp-cmds.c b/hw

[PATCH 1/5] hw/core: Remove use of QERR_UNSUPPORTED

2021-10-29 Thread Philippe Mathieu-Daudé
QERR_UNSUPPORTED definition is obsolete since 2015 (commit 4629ed1e989, "qerror: Finally unused, clean up"). Replace it. Signed-off-by: Philippe Mathieu-Daudé --- hw/core/nmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/core/nmi.c b/hw/core/nmi.c index 481c4b3c7e5..b4

Re: [PATCH v6 22/30] hw/intc/sh_intc: Inline and drop sh_intc_source() function

2021-10-29 Thread Philippe Mathieu-Daudé
On 10/29/21 23:02, BALATON Zoltan wrote: > This function is very simple and provides no advantage. Call sites > become simpler without it so just write it in line and drop the > separate function. > > Signed-off-by: BALATON Zoltan > --- > hw/intc/sh_intc.c| 54 ---

Re: [PATCH v6 13/30] hw/char/sh_serial: QOM-ify

2021-10-29 Thread Philippe Mathieu-Daudé
On 10/29/21 23:02, BALATON Zoltan wrote: > Signed-off-by: BALATON Zoltan > --- > hw/char/sh_serial.c | 98 +++-- > hw/sh4/sh7750.c | 56 +++--- > include/hw/sh4/sh.h | 9 + > 3 files changed, 101 insertions(+), 62 deletions(-)

Re: [PATCH v6 26/30] hw/intc/sh_intc: Remove unneeded local variable initialisers

2021-10-29 Thread Philippe Mathieu-Daudé
On 10/29/21 23:02, BALATON Zoltan wrote: > The sh_intc_locate function will either init these or not return so no > need to initialise them. > > Signed-off-by: BALATON Zoltan > --- > hw/intc/sh_intc.c | 21 ++--- > 1 file changed, 10 insertions(+), 11 deletions(-) Reviewed-by: P

Re: [PATCH v6 29/30] hw/timer/sh_timer: Fix timer memory region size

2021-10-29 Thread Philippe Mathieu-Daudé
On 10/29/21 23:02, BALATON Zoltan wrote: > The timer memory region is only accessed via aliases that are 0x1000 > bytes long, no need to have the timer region larger than that. > > Signed-off-by: BALATON Zoltan > --- > hw/timer/sh_timer.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-)

Re: [PATCH v6 25/30] hw/intc/sh_intc: Simplify allocating sources array

2021-10-29 Thread Philippe Mathieu-Daudé
On 10/29/21 23:02, BALATON Zoltan wrote: > Use g_new0 instead of g_malloc0 and avoid some unneeded temporary > variable assignments. > > Signed-off-by: BALATON Zoltan > --- > hw/intc/sh_intc.c | 15 --- > 1 file changed, 4 insertions(+), 11 deletions(-) Reviewed-by: Philippe Mathieu

Re: [PATCH v6 30/30] hw/timer/sh_timer: Remove use of hw_error

2021-10-29 Thread Philippe Mathieu-Daudé
On 10/29/21 23:02, BALATON Zoltan wrote: > The hw_error function calls abort and is not meant to be used by > devices. Use qemu_log_mask instead to log and ignore invalid accesses. > Also fix format strings to allow dropping type casts of hwaddr and use > __func__ instead of hard coding function na

Re: [PATCH v6 11/30] hw/char/sh_serial: Embed QEMUTimer in state struct

2021-10-29 Thread Philippe Mathieu-Daudé
On 10/29/21 23:02, BALATON Zoltan wrote: > Instead of allocating timer with timer_new store it directly in the > state struct. This makes it simpler to free it together with the device. > > Signed-off-by: BALATON Zoltan > --- > hw/char/sh_serial.c | 10 +- > 1 file changed, 5 insertions(

Re: [PATCH v6 12/30] hw/char/sh_serial: Split off sh_serial_reset() from sh_serial_init()

2021-10-29 Thread Philippe Mathieu-Daudé
On 10/29/21 23:02, BALATON Zoltan wrote: > Signed-off-by: BALATON Zoltan > --- > hw/char/sh_serial.c | 29 + > 1 file changed, 17 insertions(+), 12 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH v6 00/30] More SH4 clean ups (including code style series)

2021-10-29 Thread Philippe Mathieu-Daudé
On 10/29/21 23:02, BALATON Zoltan wrote: > This now includes the previous code style clean up series so > everything is in the series now. This got big enough for now so I'll > wait until these are merged (hopefully before the freeze) before going > on so I don't have to carry them in my tree. Only

[PATCH v6 26/30] hw/intc/sh_intc: Remove unneeded local variable initialisers

2021-10-29 Thread BALATON Zoltan
The sh_intc_locate function will either init these or not return so no need to initialise them. Signed-off-by: BALATON Zoltan --- hw/intc/sh_intc.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/hw/intc/sh_intc.c b/hw/intc/sh_intc.c index 3603b448c2..

[PATCH v6 27/30] hw/timer/sh_timer: Rename sh_timer_state to SHTimerState

2021-10-29 Thread BALATON Zoltan
According to coding style types should be camel case, also remove unneded casts from void *. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé --- The tmu012_state is left for now, that's the real exported object with SHTimerState being an internal object for a single timer. I'll

[PATCH v6 22/30] hw/intc/sh_intc: Inline and drop sh_intc_source() function

2021-10-29 Thread BALATON Zoltan
This function is very simple and provides no advantage. Call sites become simpler without it so just write it in line and drop the separate function. Signed-off-by: BALATON Zoltan --- hw/intc/sh_intc.c| 54 hw/sh4/sh7750.c | 4 +-- inclu

[PATCH v6 28/30] hw/timer/sh_timer: Do not wrap lines that are not too long

2021-10-29 Thread BALATON Zoltan
It's more readable to keep things on one line if it fits the length limit. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé --- hw/timer/sh_timer.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/hw/timer/sh_timer.c b/hw/timer/sh_timer.c index 2038a

[PATCH v6 29/30] hw/timer/sh_timer: Fix timer memory region size

2021-10-29 Thread BALATON Zoltan
The timer memory region is only accessed via aliases that are 0x1000 bytes long, no need to have the timer region larger than that. Signed-off-by: BALATON Zoltan --- hw/timer/sh_timer.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/timer/sh_timer.c b/hw/timer/sh_timer.

[PATCH v6 24/30] hw/intc/sh_intc: Avoid using continue in loops

2021-10-29 Thread BALATON Zoltan
Instead of if !expr continue else do something it is more straight forward to say if expr then do something, especially if the action is just a few lines. Remove such uses of continue to make the code easier to follow. Signed-off-by: BALATON Zoltan Reviewed-by: Richard Henderson --- hw/intc/sh_

[PATCH v6 16/30] hw/intc/sh_intc: Turn some defines into an enum

2021-10-29 Thread BALATON Zoltan
Turn the INTC_MODE defines into an enum and clean up the function returning these to make it clearer by removing nested ifs and superfluous parenthesis. The one remaining #define is a flag which is moved further apart by changing its value from 8 to 0x80 to leave some spare bits as this is or-ed wi

[PATCH v6 14/30] hw/char/sh_serial: Add device id to trace output

2021-10-29 Thread BALATON Zoltan
Normally there are at least two sh_serial instances. Add device id to trace messages to make it clear which instance they belong to otherwise its not possible to tell which serial device is accessed. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson

[PATCH v6 10/30] hw/char/sh_serial: Rename type sh_serial_state to SHSerialState

2021-10-29 Thread BALATON Zoltan
Coding style says types should be camel case. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/char/sh_serial.c | 24 +++- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/hw/char/sh_serial.c b/hw/char/sh

[PATCH v6 21/30] hw/intc/sh_intc: Use array index instead of pointer arithmetics

2021-10-29 Thread BALATON Zoltan
Address of element i is one word thus clearer than array + i. Signed-off-by: BALATON Zoltan Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- hw/intc/sh_intc.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/hw/intc/sh_int

[PATCH v6 17/30] hw/intc/sh_intc: Rename iomem region

2021-10-29 Thread BALATON Zoltan
Rename the iomem region to "intc" from "interrupt-controller" which makes the info mtree output less wide as it is already too wide because of all the aliases. Also drop the format macro which was only used twice in close proximity so we can just use the literal string instead without a macro defin

[PATCH v6 03/30] hw/sh4: Coding style: White space fixes

2021-10-29 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Yoshinori Sato --- hw/char/sh_serial.c | 23 ++- hw/intc/sh_intc.c| 39 +++ hw/pci-host/sh_pci.c | 10 -- hw/sh4/r2d.c | 39

[PATCH v6 07/30] hw/sh4: Change debug printfs to traces

2021-10-29 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan Reviewed-by: Richard Henderson --- hw/char/sh_serial.c | 13 ++- hw/char/trace-events | 4 +++ hw/intc/sh_intc.c | 79 +++ hw/intc/trace-events | 8 + hw/sh4/sh7750.c | 8 ++--- hw/sh4/trace-events |

[PATCH v6 30/30] hw/timer/sh_timer: Remove use of hw_error

2021-10-29 Thread BALATON Zoltan
The hw_error function calls abort and is not meant to be used by devices. Use qemu_log_mask instead to log and ignore invalid accesses. Also fix format strings to allow dropping type casts of hwaddr and use __func__ instead of hard coding function name in the message which were wrong in two cases.

[PATCH v6 15/30] hw/intc/sh_intc: Use existing macro instead of local one

2021-10-29 Thread BALATON Zoltan
The INTC_A7 local macro does the same as the A7ADDR from include/sh/sh.h so use the latter and drop the local macro definition. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/intc/sh_intc.c | 12 +--- 1 file changed, 5 insertions

[PATCH v6 25/30] hw/intc/sh_intc: Simplify allocating sources array

2021-10-29 Thread BALATON Zoltan
Use g_new0 instead of g_malloc0 and avoid some unneeded temporary variable assignments. Signed-off-by: BALATON Zoltan --- hw/intc/sh_intc.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/hw/intc/sh_intc.c b/hw/intc/sh_intc.c index d7cc61b42b..3603b448c2 1006

[PATCH v6 13/30] hw/char/sh_serial: QOM-ify

2021-10-29 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan --- hw/char/sh_serial.c | 98 +++-- hw/sh4/sh7750.c | 56 +++--- include/hw/sh4/sh.h | 9 + 3 files changed, 101 insertions(+), 62 deletions(-) diff --git a/hw/char/sh_serial.c b/hw/char/sh_serial.

[PATCH v6 06/30] hw/sh4: Fix typos in a comment

2021-10-29 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- hw/timer/sh_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/timer/sh_timer.c b/hw/timer/sh_timer.c index 02eb865908..cc7c1897a8 100644 --- a/hw/timer/sh_timer.c ++

[PATCH v6 11/30] hw/char/sh_serial: Embed QEMUTimer in state struct

2021-10-29 Thread BALATON Zoltan
Instead of allocating timer with timer_new store it directly in the state struct. This makes it simpler to free it together with the device. Signed-off-by: BALATON Zoltan --- hw/char/sh_serial.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/char/sh_serial.c b/

[PATCH v6 12/30] hw/char/sh_serial: Split off sh_serial_reset() from sh_serial_init()

2021-10-29 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan --- hw/char/sh_serial.c | 29 + 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/hw/char/sh_serial.c b/hw/char/sh_serial.c index 5ee93dc732..80a548d19d 100644 --- a/hw/char/sh_serial.c +++ b/hw/char/sh_serial.c @@ -381,18 +3

[PATCH v6 23/30] hw/intc/sh_intc: Replace abort() with g_assert_not_reached()

2021-10-29 Thread BALATON Zoltan
All the places that call abort should not happen which is better marked by g_assert_not_reached. Signed-off-by: BALATON Zoltan Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- hw/intc/sh_intc.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hw

[PATCH v6 09/30] hw/char/sh_serial: Do not abort on invalid access

2021-10-29 Thread BALATON Zoltan
Replace fprintf with qemu_log_mask LOG_GUEST_ERROR as the intention is to handle valid accesses in these functions so if we get to these errors then it's an invalid access. Do not abort as that would allow the guest to crash QEMU and the practice in other devices is to not do that just log and igno

[PATCH v6 04/30] hw/sh4: Coding style: Add missing braces

2021-10-29 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Yoshinori Sato --- hw/char/sh_serial.c | 48 ++ hw/intc/sh_intc.c| 87 ++-- hw/sh4/r2d.c | 15 --- hw/sh4/sh7750.c | 24 ++

[PATCH v6 08/30] hw/sh4/r2d: Use error_report instead of fprintf to stderr

2021-10-29 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- hw/sh4/r2d.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c index 57ccae7249..72759413f3 100644 --- a/hw/sh4/r2d.c +++ b/hw/sh4/r2d.c @@ -26

[PATCH v6 00/30] More SH4 clean ups (including code style series)

2021-10-29 Thread BALATON Zoltan
This now includes the previous code style clean up series so everything is in the series now. This got big enough for now so I'll wait until these are merged (hopefully before the freeze) before going on so I don't have to carry them in my tree. Only plan to submit another version if needed from re

[PATCH v6 18/30] hw/intc/sh_intc: Drop another useless macro

2021-10-29 Thread BALATON Zoltan
The INT_REG_PARAMS macro was only used a few times within one function on adjacent lines and is actually more complex than writing out the parameters so simplify it by expanding the macro at call sites and dropping the #define. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé Re

  1   2   3   4   5   >