Re: [PATCH 6/6] reset: Add RESET_TYPE_SNAPSHOT_LOAD

2024-04-16 Thread Luc Michel
set type for the ShutdownCause it is passed. This > allows us to get rid of the device_reset_reason global we > were using to implement qemu_register_reset_nosnapshotload(). > > Signed-off-by: Peter Maydell Reviewed-by: Luc Michel > --- > docs/devel/reset.rst| 17 +++

Re: [PATCH 1/6] hw/misc: Don't special case RESET_TYPE_COLD in npcm7xx_clk, gcr

2024-04-16 Thread Luc Michel
't know > about should be handled like RESET_TYPE_COLD"; switch these > devices to do that. Then adding a new reset type will only > need to touch those devices where its behaviour really needs > to be different from the standard cold reset. > > Signed-off-by: Peter Maydell

Re: [PATCH 4/6] hw, target: Add ResetType argument to hold and exit phase methods

2024-04-16 Thread Luc Michel
--sp-file scripts/coccinelle/reset-type.cocci \ > --keep-comments --smpl-spacing --in-place \ > --include-headers --dir $dir; done > > and no manual edits. > > Signed-off-by: Peter Maydell Reviewed-by: Luc Michel > --- > include/h

Re: [PATCH 5/6] docs/devel/reset: Update to new API for hold and exit phase methods

2024-04-16 Thread Luc Michel
On 17:08 Fri 12 Apr , Peter Maydell wrote: > Update the reset documentation's example code to match the new API > for the hold and exit phase method APIs where they take a ResetType > argument. > > Signed-off-by: Peter Maydell Reviewed-by: Luc Michel > --- > doc

Re: [PATCH 3/6] scripts/coccinelle: New script to add ResetType to hold and exit phases

2024-04-16 Thread Luc Michel
et method directly >calls the implementation of a different device's method > > Signed-off-by: Peter Maydell Reviewed-by: Luc Michel (I'm not a coccinelle expert but LGTM) > --- > The structure here is a bit of an experiment: usually I would make > the coccinelle script c

Re: [PATCH 2/6] allwinner-i2c, adm1272: Use device_cold_reset() for software-triggered reset

2024-04-16 Thread Luc Michel
d exit reset methods. > > Signed-off-by: Peter Maydell Reviewed-by: Luc Michel > --- > hw/i2c/allwinner-i2c.c | 3 +-- > hw/sensor/adm1272.c| 2 +- > 2 files changed, 2 insertions(+), 3 deletions(-) > > diff --git a/hw/i2c/allwinner-i2c.c b/hw/i2c/allwinner-i2c.c >

Re: [PATCH for-9.0] Fix some typos in documentation (found by codespell)

2024-04-02 Thread Luc Michel
On 18:15 Sun 31 Mar , Stefan Weil wrote: > Signed-off-by: Stefan Weil Reviewed-by: Luc Michel > --- > docs/devel/atomics.rst | 2 +- > docs/devel/ci-jobs.rst.inc | 2 +- > docs/devel/clocks.rst | 2 +- > docs/system/i386/sgx.rst | 2 +- > qapi/qom.json

Re: [PATCH-for-9.0 1/2] hw/clock: Let clock_set_mul_div() return boolean value

2024-03-25 Thread Luc Michel
On 09:40 Mon 25 Mar , Luc Michel wrote: > On 16:58 Fri 22 Mar , Philippe Mathieu-Daudé wrote: > > Let clock_set_mul_div() return a boolean value whether the > > clock has been updated or not, similarly to clock_set(). > > > > Signed-off-by: Philippe Mathie

Re: [PATCH-for-9.0 2/2] hw/misc/stm32l4x5_rcc: Propagate period when enabling a clock

2024-03-25 Thread Luc Michel
On 16:39 Fri 22 Mar , Peter Maydell wrote: > On Fri, 22 Mar 2024 at 15:59, Philippe Mathieu-Daudé > wrote: > > > > From: Arnaud Minier > > > > The "clock_set_mul_div" function doesn't propagate the clock period > > to the children if it is changed (e.g. by enabling/disabling a clock > >

Re: [PATCH-for-9.0 1/2] hw/clock: Let clock_set_mul_div() return boolean value

2024-03-25 Thread Luc Michel
On 16:58 Fri 22 Mar , Philippe Mathieu-Daudé wrote: > Let clock_set_mul_div() return a boolean value whether the > clock has been updated or not, similarly to clock_set(). > > Signed-off-by: Philippe Mathieu-Daudé Acked-by: Luc Michel > --- > include/hw/clock.h |

Re: [PATCH v5 09/12] contrib/plugins/hotblocks: migrate to new per_vcpu API

2024-03-01 Thread Luc Michel
On 14:33 Thu 29 Feb , Alex Bennée wrote: > Caution: This message originated from an External Source. Use proper caution > when opening attachments, clicking links, or responding. > > > Luc Michel writes: > > > On 15:09 Tue 27 Feb , Pierrick Bouvier wrote: >

Re: [PATCH v5 06/12] tests/plugin/mem: migrate to new per_vcpu API

2024-02-27 Thread Luc Michel
On 14:56 Tue 27 Feb , Pierrick Bouvier wrote: > Hi Luc, > > On 2/27/24 1:35 PM, Luc Michel wrote: > > Hi Pierrick, > > > > On 13:14 Mon 26 Feb , Pierrick Bouvier wrote: > > > Signed-off-by: Pierrick Bouvier >

Re: [PATCH v5 09/12] contrib/plugins/hotblocks: migrate to new per_vcpu API

2024-02-27 Thread Luc Michel
On 15:09 Tue 27 Feb , Pierrick Bouvier wrote: > On 2/27/24 2:54 PM, Luc Michel wrote: > > Hi Pierrick, > > > > On 13:14 Mon 26 Feb , Pierrick Bouvier wrote: > > > Signed-off-by: Pierrick Bouvier > > > --- &

Re: [PATCH v5 09/12] contrib/plugins/hotblocks: migrate to new per_vcpu API

2024-02-27 Thread Luc Michel
Hi Pierrick, On 13:14 Mon 26 Feb , Pierrick Bouvier wrote: > Signed-off-by: Pierrick Bouvier > --- > contrib/plugins/hotblocks.c | 50 ++--- > 1 file changed, 30 insertions(+), 20 deletions(-) > > diff --git a/contrib/plugins/hotblocks.c

Re: [PATCH v5 08/12] tests/plugin/bb: migrate to new per_vcpu API

2024-02-27 Thread Luc Michel
On 13:14 Mon 26 Feb , Pierrick Bouvier wrote: > Signed-off-by: Pierrick Bouvier Reviewed-by: Luc Michel > --- > tests/plugin/bb.c | 63 +++ > 1 file changed, 26 insertions(+), 37 deletions(-) > > diff --git a/tests/plugin/b

Re: [PATCH v5 07/12] tests/plugin/insn: migrate to new per_vcpu API

2024-02-27 Thread Luc Michel
On 13:14 Mon 26 Feb , Pierrick Bouvier wrote: > Signed-off-by: Pierrick Bouvier Reviewed-by: Luc Michel > --- > tests/plugin/insn.c | 106 +--- > 1 file changed, 50 insertions(+), 56 deletions(-) > > diff --git a/tests/plugin/ins

Re: [PATCH v5 06/12] tests/plugin/mem: migrate to new per_vcpu API

2024-02-27 Thread Luc Michel
Hi Pierrick, On 13:14 Mon 26 Feb , Pierrick Bouvier wrote: > Signed-off-by: Pierrick Bouvier > --- > tests/plugin/mem.c | 40 +--- > 1 file changed, 25 insertions(+), 15 deletions(-) > > diff --git a/tests/plugin/mem.c b/tests/plugin/mem.c > index

Re: [PATCH 0/7] hw/i386: Cleanups around 'hw/i386/pc.h'

2024-02-13 Thread Luc Michel
| 1 - > target/i386/monitor.c | 1 - > 9 files changed, 8 insertions(+), 12 deletions(-) > > -- > 2.41.0 > > For the series: Reviewed-by: Luc Michel

[PATCH v2] hw/arm/smmuv3: add support for stage 1 access fault

2024-02-13 Thread Luc Michel
An access fault is raised when the Access Flag is not set in the looked-up PTE and the AFFD field is not set in the corresponding context descriptor. This was already implemented for stage 2. Implement it for stage 1 as well. Signed-off-by: Luc Michel --- v2: drop erroneous submodule

[PATCH] hw/arm/smmuv3: add support for stage 1 access fault

2024-02-09 Thread Luc Michel
An access fault is raised when the Access Flag is not set in the looked-up PTE and the AFFD field is not set in the corresponding context descriptor. This was already implemented for stage 2. Implement it for stage 1 as well. Signed-off-by: Luc Michel --- hw/arm/smmuv3-internal.h | 1

Re: [PATCH for-9.0] docs/devel/docs: Document .hx file syntax

2023-12-14 Thread Luc Michel
cess works, > or anything else that developers might need to know about > how to add documentation. > > Make the .hx files refer to this doc file, and clean > up their header comments to be more accurate for the > usage in each file and less cut-n-pasted. > > Signed-off-by: Peter May

Re: Questions about clocks emulation

2023-12-13 Thread Luc Michel
Hi, On 20:13 Wed 13 Dec , Philippe Mathieu-Daudé wrote: > Caution: This message originated from an External Source. Use proper caution > when opening attachments, clicking links, or responding. > > > Hi Arnaud, > > (Cc'ing Peter and Luc) > > On 12/12/23 14:05, Arnaud Minier wrote: > > Hi

Re: [PATCH trivial 13/21] hw/net/cadence_gem.c: spelling fixes: Octects

2023-11-15 Thread Luc Michel
On 19:58 Tue 14 Nov , Michael Tokarev wrote: > Fixes: c755c943aa2e "hw/net/cadence_gem: use REG32 macro for register > definitions" > Cc: Luc Michel > Cc: Peter Maydell > Signed-off-by: Michael Tokarev Reviewed-by: Luc Michel > --- > hw/net/cadence_gem.c

Re: [PATCH 10/10] hw/arm/xlnx-zynqmp: Remove 'hw/arm/boot.h' from header

2023-10-25 Thread Luc Michel
On 08:53 Wed 25 Oct , Philippe Mathieu-Daudé wrote: > "hw/arm/boot.h" is only required on the source file. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Luc Michel > --- > include/hw/arm/xlnx-zynqmp.h | 1 - > hw/arm/xlnx-zcu102.c | 1 + >

Re: [PATCH 08/10] hw/arm/fsl-imx7: Remove 'hw/arm/boot.h' from header

2023-10-25 Thread Luc Michel
On 08:53 Wed 25 Oct , Philippe Mathieu-Daudé wrote: > "hw/arm/boot.h" is only required on the source file. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Luc Michel > --- > include/hw/arm/fsl-imx7.h | 1 - > hw/arm/mcimx7d-sabre.c| 1 + > 2 f

Re: [PATCH 09/10] hw/arm/xlnx-versal: Remove 'hw/arm/boot.h' from header

2023-10-25 Thread Luc Michel
On 08:53 Wed 25 Oct , Philippe Mathieu-Daudé wrote: > "hw/arm/boot.h" is only required on the source file. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Luc Michel > --- > include/hw/arm/xlnx-versal.h | 1 - > hw/arm/xlnx-versal-virt.c| 1 + >

Re: [PATCH 07/10] hw/arm/fsl-imx6ul: Remove 'hw/arm/boot.h' from header

2023-10-25 Thread Luc Michel
On 08:53 Wed 25 Oct , Philippe Mathieu-Daudé wrote: > "hw/arm/boot.h" is only required on the source file. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Luc Michel > --- > include/hw/arm/fsl-imx6ul.h | 1 - > hw/arm/mcimx6ul-evk.c | 1 + >

Re: [PATCH 05/10] hw/arm/fsl-imx31: Remove 'hw/arm/boot.h' from header

2023-10-25 Thread Luc Michel
On 08:53 Wed 25 Oct , Philippe Mathieu-Daudé wrote: > "hw/arm/boot.h" is only required on the source file. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Luc Michel > --- > include/hw/arm/fsl-imx31.h | 1 - > hw/arm/kzm.c | 1 + > 2 f

Re: [PATCH 06/10] hw/arm/fsl-imx6: Remove 'hw/arm/boot.h' from header

2023-10-25 Thread Luc Michel
On 08:53 Wed 25 Oct , Philippe Mathieu-Daudé wrote: > "hw/arm/boot.h" is only required on the source file. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Luc Michel > --- > include/hw/arm/fsl-imx6.h | 1 - > hw/arm/sabrelite.c| 1 + > 2 f

Re: [PATCH 03/10] hw/arm/allwinner-r40: Remove 'hw/arm/boot.h' from header

2023-10-25 Thread Luc Michel
On 08:53 Wed 25 Oct , Philippe Mathieu-Daudé wrote: > "hw/arm/boot.h" is only required on the source file. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Luc Michel > --- > include/hw/arm/allwinner-r40.h | 1 - > hw/arm/bananapi_m2u.c

Re: [PATCH 02/10] hw/arm/allwinner-h3: Remove 'hw/arm/boot.h' from header

2023-10-25 Thread Luc Michel
On 08:53 Wed 25 Oct , Philippe Mathieu-Daudé wrote: > "hw/arm/boot.h" is only required on the source file. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Luc Michel > --- > include/hw/arm/allwinner-h3.h | 1 - > hw/arm/orangepi.c | 1 + >

Re: [PATCH 04/10] hw/arm/fsl-imx25: Remove 'hw/arm/boot.h' from header

2023-10-25 Thread Luc Michel
On 08:53 Wed 25 Oct , Philippe Mathieu-Daudé wrote: > "hw/arm/boot.h" is only required on the source file. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Luc Michel > --- > include/hw/arm/fsl-imx25.h | 1 - > hw/arm/imx25_pdk.c | 1 + > 2 f

Re: [PATCH 01/10] hw/arm/allwinner-a10: Remove 'hw/arm/boot.h' from header

2023-10-25 Thread Luc Michel
On 08:53 Wed 25 Oct , Philippe Mathieu-Daudé wrote: > "hw/arm/boot.h" is only required on the source file. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Luc Michel > --- > include/hw/arm/allwinner-a10.h | 1 - > hw/arm/cubieboard.c

[PATCH 09/11] hw/net/cadence_gem: use FIELD to describe PHYMNTNC register fields

2023-10-17 Thread Luc Michel
Use the FIELD macro to describe the PHYMNTNC register fields. Signed-off-by: Luc Michel --- hw/net/cadence_gem.c | 27 ++- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index 955a8da134..4c5fe10316 100644

[PATCH 02/11] hw/net/cadence_gem: use FIELD for screening registers

2023-10-17 Thread Luc Michel
Describe screening registers fields using the FIELD macros. Signed-off-by: Luc Michel --- hw/net/cadence_gem.c | 92 ++-- 1 file changed, 47 insertions(+), 45 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index 0e5744ecd7

[PATCH 03/11] hw/net/cadence_gem: use FIELD to describe NWCTRL register fields

2023-10-17 Thread Luc Michel
Use the FIELD macro to describe the NWCTRL register fields. Signed-off-by: Luc Michel --- hw/net/cadence_gem.c | 53 +--- 1 file changed, 40 insertions(+), 13 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index f01c81de97

[PATCH 08/11] hw/net/cadence_gem: use FIELD to describe DESCONF6 register fields

2023-10-17 Thread Luc Michel
Use the FIELD macro to describe the DESCONF6 register fields. Signed-off-by: Luc Michel --- hw/net/cadence_gem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index 6d084a3b31..955a8da134 100644 --- a/hw/net/cadence_gem.c

[PATCH 04/11] hw/net/cadence_gem: use FIELD to describe NWCFG register fields

2023-10-17 Thread Luc Michel
Use de FIELD macro to describe the NWCFG register fields. Signed-off-by: Luc Michel --- hw/net/cadence_gem.c | 60 1 file changed, 39 insertions(+), 21 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index 2864f0940e

[PATCH 00/11] Various updates for the Cadence GEM model

2023-10-17 Thread Luc Michel
on a write to the PHYMNTNC register (as the real hardware does). Patch 11 fixes a potential bug on hosts where unsigned would not be 32 bits. Thanks, -- Luc Luc Michel (11): hw/net/cadence_gem: use REG32 macro for register definitions hw/net/cadence_gem: use FIELD for screening registers hw/net

[PATCH 11/11] hw/net/cadence_gem: enforce 32 bits variable size for CRC

2023-10-17 Thread Luc Michel
The CRC was stored in an unsigned variable in gem_receive. Change it for a uint32_t to ensure we have the correct variable size here. Signed-off-by: Luc Michel --- hw/net/cadence_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/cadence_gem.c b/hw/net

[PATCH 05/11] hw/net/cadence_gem: use FIELD to describe DMACFG register fields

2023-10-17 Thread Luc Michel
Use de FIELD macro to describe the DMACFG register fields. Signed-off-by: Luc Michel --- hw/net/cadence_gem.c | 48 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index 09f570b6fb

[PATCH 10/11] hw/net/cadence_gem: perform PHY access on write only

2023-10-17 Thread Luc Michel
The MDIO access is done only on a write to the PHYMNTNC register. A subsequent read is used to retrieve the result but does not trigger an MDIO access by itself. Refactor the PHY access logic to perform all accesses (MDIO reads and writes) at PHYMNTNC write time. Signed-off-by: Luc Michel

[PATCH 07/11] hw/net/cadence_gem: use FIELD to describe IRQ register fields

2023-10-17 Thread Luc Michel
Use de FIELD macro to describe the IRQ related register fields. Signed-off-by: Luc Michel --- hw/net/cadence_gem.c | 51 +--- 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index 0acee1d544

[PATCH 06/11] hw/net/cadence_gem: use FIELD to describe [TX|RX]STATUS register fields

2023-10-17 Thread Luc Michel
Use de FIELD macro to describe the TXSTATUS and RXSTATUS register fields. Signed-off-by: Luc Michel --- hw/net/cadence_gem.c | 34 +- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index 5c386adff2

[PATCH 01/11] hw/net/cadence_gem: use REG32 macro for register definitions

2023-10-17 Thread Luc Michel
Replace register defines with the REG32 macro from registerfields.h in the Cadence GEM device. Signed-off-by: Luc Michel --- hw/net/cadence_gem.c | 527 +-- 1 file changed, 261 insertions(+), 266 deletions(-) diff --git a/hw/net/cadence_gem.c b/hw/net

[PATCH v2] mailmap: update email addresses for Luc Michel

2023-09-29 Thread Luc Michel
Map my old and now invalid work email addresses to my personal one. Signed-off-by: Luc Michel --- Please ignore v1 sent with wrong e-mail address. --- .mailmap | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.mailmap b/.mailmap index 64ef9f4de6..49f581bafd 100644 --- a/.mailmap +++ b

Re: [PATCH] MAINTAINERS: update my email address for the clock framework

2023-02-13 Thread Luc Michel
On 10:53 Mon 13 Feb , Damien Hedde wrote: > Also update mailmap > > Signed-off-by: Damien Hedde Reviewed-by: Luc Michel > --- > MAINTAINERS | 2 +- > .mailmap| 1 + > 2 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/MAINTAINERS b/MAI

Re: [PATCH v4 27/53] semihosting: Split out semihost_sys_open

2022-06-27 Thread Luc Michel
On 08:05 Wed 22 Jun , Richard Henderson wrote: > On 6/22/22 02:35, Luc Michel wrote: > > On 13:45 Tue 07 Jun , Richard Henderson wrote: > > > Split out the non-ARM specific portions of SYS_OPEN to a > > > reusable function. This handles gdb and host file i/

Re: [PATCH v4 24/53] semihosting: Split out common-semi-target.h

2022-06-27 Thread Luc Michel
On 13:45 Tue 07 Jun , Richard Henderson wrote: > Move the ARM and RISCV specific helpers into > their own header file. > > Signed-off-by: Richard Henderson Reviewed-by: Luc Michel > --- > target/arm/common-semi-target.h | 62 > target/riscv

Re: [PATCH v4 53/53] semihosting: Create semihost_sys_poll_one

2022-06-27 Thread Luc Michel
On 13:45 Tue 07 Jun , Richard Henderson wrote: > This will be used for implementing the xtensa select_one > system call. Choose "poll" over "select" so that we can > reuse Glib's g_poll constants and to avoid struct timeval. > > Signed-off-by: Richard

Re: [PATCH v4 51/53] semihosting: Use console_out_gf for SYS_WRITE0

2022-06-27 Thread Luc Michel
On 13:45 Tue 07 Jun , Richard Henderson wrote: > Signed-off-by: Richard Henderson Reviewed-by: Luc Michel > --- > semihosting/arm-compat-semi.c | 11 +-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/semihosting/arm-compat-semi.c b/semi

Re: [PATCH v4 52/53] semihosting: Remove qemu_semihosting_console_outs

2022-06-27 Thread Luc Michel
On 13:45 Tue 07 Jun , Richard Henderson wrote: > This function has been replaced by *_write. > > Signed-off-by: Richard Henderson Reviewed-by: Luc Michel > --- > include/semihosting/console.h | 13 -- > linux-user/semihost.c | 17 >

Re: [PATCH v4 50/53] semihosting: Remove qemu_semihosting_console_outc

2022-06-27 Thread Luc Michel
On 13:45 Tue 07 Jun , Richard Henderson wrote: > This function has been replaced by *_write. > > Signed-off-by: Richard Henderson Reviewed-by: Luc Michel > --- > include/semihosting/console.h | 13 - > linux-user/semihost.c | 16 -

Re: [PATCH v4 49/53] semihosting: Use console_out_gf for SYS_WRITEC

2022-06-27 Thread Luc Michel
On 13:45 Tue 07 Jun , Richard Henderson wrote: > Signed-off-by: Richard Henderson Reviewed-by: Luc Michel > --- > semihosting/arm-compat-semi.c | 20 > 1 file changed, 16 insertions(+), 4 deletions(-) > > diff --git a/semihosting/arm-compat-semi.c

Re: [PATCH v4 48/53] semihosting: Use console_in_gf for SYS_READC

2022-06-27 Thread Luc Michel
On 13:45 Tue 07 Jun , Richard Henderson wrote: > Signed-off-by: Richard Henderson Reviewed-by: Luc Michel > --- > semihosting/arm-compat-semi.c | 27 ++- > 1 file changed, 18 insertions(+), 9 deletions(-) > > diff --git a/semihosting/a

Re: [PATCH v4 47/53] semihosting: Create qemu_semihosting_guestfd_init

2022-06-27 Thread Luc Michel
by: Richard Henderson Reviewed-by: Luc Michel > --- > include/semihosting/guestfd.h | 7 + > include/semihosting/semihost.h | 1 + > linux-user/main.c | 9 ++ > semihosting/console.c | 2 ++ > semihosting/guestfd.c | 52 ++

Re: [PATCH v4 46/53] semihosting: Add GuestFDConsole

2022-06-27 Thread Luc Michel
iptor > exposed to the guest. > > Signed-off-by: Richard Henderson Reviewed-by: Luc Michel > --- > include/semihosting/guestfd.h | 7 ++-- > semihosting/syscalls.c| 68 +++ > 2 files changed, 72 insertions(+), 3 deletions(-) &

Re: [PATCH v4 45/53] semihosting: Create qemu_semihosting_console_write

2022-06-27 Thread Luc Michel
On 13:45 Tue 07 Jun , Richard Henderson wrote: > Will replace qemu_semihosting_console_{outs,outc}, > but we need more plumbing first. > > Signed-off-by: Richard Henderson Reviewed-by: Luc Michel > --- > include/semihosting/console.h | 12 >

Re: [PATCH v4 44/53] semihosting: Cleanup chardev init

2022-06-24 Thread Luc Michel
which lets us drop > semihosting_get_chardev. > > Signed-off-by: Richard Henderson Reviewed-by: Luc Michel > --- > include/semihosting/semihost.h | 13 ++--- > semihosting/config.c | 17 +++-- > semihosting/console.c | 31

Re: [PATCH v4 43/53] semihosting: Expand qemu_semihosting_console_inc to read

2022-06-24 Thread Luc Michel
On 13:45 Tue 07 Jun , Richard Henderson wrote: > Allow more than one character to be read at one time. > Will be used by m68k and nios2 semihosting for stdio. > > Signed-off-by: Richard Henderson Reviewed-by: Luc Michel > --- > include/semihosting/console.h | 12 +++

Re: [PATCH v4 40/53] gdbstub: Adjust gdb_syscall_complete_cb declaration

2022-06-24 Thread Luc Michel
uot;)", > - __func__, err); > +if (err) { > +qemu_log("%s: gdb console output failed (%d)", __func__, err); While you're at it, this qemu_log() call probably lacks a '\n'. Reviewed-by: Luc Michel > } > }

Re: [PATCH v4 42/53] semihosting: Pass CPUState to qemu_semihosting_console_inc

2022-06-24 Thread Luc Michel
On 13:45 Tue 07 Jun , Richard Henderson wrote: > We don't need CPUArchState, and we do want the CPUState of the > thread performing the operation -- use this instead of current_cpu. > > Reviewed-by: Peter Maydell > Signed-off-by: Richard Henderson Reviewed-by: Luc Michel &

Re: [PATCH v4 41/53] semihosting: Fix docs comment for qemu_semihosting_console_inc

2022-06-24 Thread Luc Michel
On 13:45 Tue 07 Jun , Richard Henderson wrote: > The implementation of qemu_semihosting_console_inc does not > defer to gdbstub, but only reads from the fifo in console.c. > > Signed-off-by: Richard Henderson Reviewed-by: Luc Michel > --- > include/semihos

Re: [PATCH v4 38/53] semihosting: Create semihost_sys_{stat,fstat}

2022-06-24 Thread Luc Michel
On 13:45 Tue 07 Jun , Richard Henderson wrote: > These syscalls will be used by m68k and nios2 semihosting. > > Signed-off-by: Richard Henderson Reviewed-by: Luc Michel > --- > include/semihosting/syscalls.h | 7 ++ > semihosting/syscal

Re: [PATCH v4 39/53] semihosting: Create semihost_sys_gettimeofday

2022-06-24 Thread Luc Michel
On 13:45 Tue 07 Jun , Richard Henderson wrote: > This syscall will be used by m68k and nios2 semihosting. > > Signed-off-by: Richard Henderson Reviewed-by: Luc Michel > --- > include/semihosting/syscalls.h | 3 +++ > semihosting/sysca

Re: [PATCH v4 38/53] semihosting: Create semihost_sys_{stat,fstat}

2022-06-24 Thread Luc Michel
On 13:45 Tue 07 Jun , Richard Henderson wrote: > These syscalls will be used by m68k and nios2 semihosting. > > Signed-off-by: Richard Henderson Reviewed-by: Luc Michel > --- > include/semihosting/syscalls.h | 7 ++ > semihosting/syscal

Re: [PATCH v4 37/53] semihosting: Split out semihost_sys_system

2022-06-24 Thread Luc Michel
On 13:45 Tue 07 Jun , Richard Henderson wrote: > Split out the non-ARM specific portions of SYS_SYSTEM to a > reusable function. > > Signed-off-by: Richard Henderson Reviewed-by: Luc Michel > --- > include/semihosting/syscalls.h | 3 +++ > semihosting/ar

Re: [PATCH v4 35/53] semihosting: Split out semihost_sys_remove

2022-06-24 Thread Luc Michel
On 13:45 Tue 07 Jun , Richard Henderson wrote: > Split out the non-ARM specific portions of SYS_REMOVE to a > reusable function. > > Signed-off-by: Richard Henderson Reviewed-by: Luc Michel > --- > include/semihosting/syscalls.h | 3 +++ > semihosting/ar

Re: [PATCH v4 36/53] semihosting: Split out semihost_sys_rename

2022-06-24 Thread Luc Michel
On 13:45 Tue 07 Jun , Richard Henderson wrote: > Split out the non-ARM specific portions of SYS_RENAME to a > reusable function. > > Signed-off-by: Richard Henderson Reviewed-by: Luc Michel > --- > include/semihosting/syscalls.h | 4 +++ > semihosting/ar

Re: [PATCH v4 34/53] semihosting: Split out semihost_sys_flen

2022-06-24 Thread Luc Michel
On 13:45 Tue 07 Jun , Richard Henderson wrote: > The ARM-specific SYS_FLEN isn't really something that can be > reused by other semihosting apis, but there are parts that can > reused for the implementation of semihost_sys_fstat. > > Signed-off-by: Richard Henderson Reviewed

Re: [PATCH v2 2/7] semihosting: add the semihosting_exit_request function

2022-06-23 Thread Luc Michel
On 20:09 Wed 22 Jun , Peter Maydell wrote: > On Tue, 21 Jun 2022 at 13:59, Luc Michel wrote: > > > > Add the semihosting_exit_request function to be used by targets when > > handling an `exit' semihosted syscall. This function calls gdb_exit to > > clo

Re: [PATCH v4 33/53] semihosting: Split out semihost_sys_isatty

2022-06-22 Thread Luc Michel
gt; success result. > > Signed-off-by: Richard Henderson Reviewed-by: Luc Michel > --- > include/semihosting/syscalls.h | 3 +++ > semihosting/arm-compat-semi.c | 40 -- > semihosting/syscalls.c | 36 ++ >

Re: [PATCH v4 32/53] semihosting: Split out semihost_sys_lseek

2022-06-22 Thread Luc Michel
the internal type of the offset to int64_t, and > provide the whence argument, which will be required by > m68k and nios2 semihosting. > > Note that gdb_do_syscall %x reads target_ulong, not int. > > Signed-off-by: Richard Henderson Reviewed-by: Luc Michel > --- > include/

Re: [PATCH v4 31/53] semihosting: Bound length for semihost_sys_{read, write}

2022-06-22 Thread Luc Michel
rson Reviewed-by: Luc Michel > --- > semihosting/syscalls.c | 16 > 1 file changed, 16 insertions(+) > > diff --git a/semihosting/syscalls.c b/semihosting/syscalls.c > index 5cb12d6adc..eefbae74f1 100644 > --- a/semihosting/syscalls.c > +++ b/semihosting

Re: [PATCH v4 30/53] semihosting: Split out semihost_sys_write

2022-06-22 Thread Luc Michel
> > Signed-off-by: Richard Henderson Reviewed-by: Luc Michel > --- > include/semihosting/syscalls.h | 6 > semihosting/arm-compat-semi.c | 52 +--- > semihosting/syscalls.c | 54 ++ > 3 files cha

Re: [PATCH v4 29/53] semihosting: Split out semihost_sys_read

2022-06-22 Thread Luc Michel
rw_cb(CPUState *cs, target_ulong ret, target_ulong > err) > +{ > +/* Recover the original length from the third argument. */ > +CPUArchState *env G_GNUC_UNUSED = cs->env_ptr; > +target_ulong args = common_semi_arg(cs, 1); > +target_ulong arg2; > +GET_ARG(2); > +

Re: [PATCH v4 28/53] semihosting: Split out semihost_sys_close

2022-06-22 Thread Luc Michel
On 13:45 Tue 07 Jun , Richard Henderson wrote: > Split out the non-ARM specific portions of SYS_CLOSE to a > reusable function. This handles all GuestFD. > > Note that gdb_do_syscall %x reads target_ulong, not int. > > Signed-off-by: Richard Henderson Revie

Re: [PATCH v4 27/53] semihosting: Split out semihost_sys_open

2022-06-22 Thread Luc Michel
On 13:45 Tue 07 Jun , Richard Henderson wrote: > Split out the non-ARM specific portions of SYS_OPEN to a > reusable function. This handles gdb and host file i/o. > > Add helpers to validate the length of the filename string. > Prepare for usage by other semihosting by allowing the >

Re: [PATCH v4 25/53] semihosting: Use env more often in do_common_semihosting

2022-06-22 Thread Luc Michel
On 13:45 Tue 07 Jun , Richard Henderson wrote: > We've already loaded cs->env_ptr into a local variable; use it. > Since env is unconditionally used, we don't need a dummy use. > > Signed-off-by: Richard Henderson Reviewed-by: Luc Michel > --- > semihosting/

Re: [PATCH v4 19/53] gdbstub: Convert GDB error numbers to host error numbers

2022-06-22 Thread Luc Michel
On 13:45 Tue 07 Jun , Richard Henderson wrote: > Provide the callback with consistent state -- always use > host error numbers. The individual callback can then > decide if the errno requires conversion for the guest. > > Signed-off-by: Richard Henderson Reviewed

Re: [PATCH v4 05/53] accel/stubs: Add tcg stub for probe_access_flags

2022-06-22 Thread Luc Michel
On 13:45 Tue 07 Jun , Richard Henderson wrote: > Signed-off-by: Richard Henderson Reviewed-by: Luc Michel > --- > accel/stubs/tcg-stub.c | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c > index ea4a0dd2

Re: [PATCH v2 0/7] semihosting: proper QEMU exit on semihosted exit syscall

2022-06-22 Thread Luc Michel
On 07:37 Tue 21 Jun , Richard Henderson wrote: > On 6/21/22 05:59, Luc Michel wrote: > > v2: > >- fix linux-user compilation. Declare semihosting_exit_request "static > > inline G_NORETURN" on CONFIG_USER_ONLY side. Use > > g_assert_not_reac

[PATCH v2 7/7] target/xtensa: use semihosting_exit_request on semihosted exit syscall

2022-06-21 Thread Luc Michel
Use the new semihosting_exit_request instead of a call to exit when handling a semihosted exit syscall. Signed-off-by: Luc Michel --- target/xtensa/xtensa-semi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/xtensa/xtensa-semi.c b/target/xtensa/xtensa-semi.c index

[PATCH v2 6/7] target/nios2: use semihosting_exit_request on semihosted exit syscall

2022-06-21 Thread Luc Michel via
Use the new semihosting_exit_request instead of a call to exit when handling a semihosted exit syscall. Signed-off-by: Luc Michel --- target/nios2/nios2-semi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/nios2/nios2-semi.c b/target/nios2/nios2-semi.c index

[PATCH v2 0/7] semihosting: proper QEMU exit on semihosted exit syscall

2022-06-21 Thread Luc Michel
EXIT) used in this case. The CPU is stopped and returns to the main CPU loop so that no more instruction get executed (the semihosting_exit_request is declared G_NORETURN). All targets are converted to use this new function. Thanks, Luc Luc Michel (7): softmmu: add qemu_[set|get]_exit_status

[PATCH v2 1/7] softmmu: add qemu_[set|get]_exit_status functions

2022-06-21 Thread Luc Michel
Add the two function qemu_set_exit_status() and qemu_get_exit_status(). Use qemu_get_exit_status() in main instead of 0 as the return value. This is in preparation for the semihosting exit request implementation. Signed-off-by: Luc Michel --- include/sysemu/sysemu.h | 2 ++ softmmu/main.c

[PATCH v2 2/7] semihosting: add the semihosting_exit_request function

2022-06-21 Thread Luc Michel
not allow other CPU threads to exit properly, leading to e.g. at_exit callbacks being called while other CPUs still run. This can lead to strange bugs, especially in plugins with a registered at_exit function. Signed-off-by: Luc Michel --- qapi/run-state.json| 4 +++- include

[PATCH v2 5/7] target/mips: use semihosting_exit_request on semihosted exit syscall

2022-06-21 Thread Luc Michel
Use the new semihosting_exit_request instead of a call to exit when handling a semihosted exit syscall. Signed-off-by: Luc Michel --- target/mips/tcg/sysemu/mips-semi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/mips/tcg/sysemu/mips-semi.c b/target/mips/tcg

[PATCH v2 4/7] target/m68k: use semihosting_exit_request on semihosted exit syscall

2022-06-21 Thread Luc Michel
Use the new semihosting_exit_request instead of a call to exit when handling a semihosted exit syscall. Signed-off-by: Luc Michel --- target/m68k/m68k-semi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/m68k/m68k-semi.c b/target/m68k/m68k-semi.c index

[PATCH v2 3/7] semihosting/arm-compat-semi: use semihosting_exit_request

2022-06-21 Thread Luc Michel
Use the new semihosting_exit_request instead of a call to exit when handling a semihosted exit syscall. Signed-off-by: Luc Michel --- semihosting/arm-compat-semi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c

Re: [PATCH 0/7] semihosting: proper QEMU exit on semihosted exit syscall

2022-06-20 Thread Luc Michel
On 08:59 Mon 20 Jun , Richard Henderson wrote: > On 6/20/22 07:24, Luc Michel wrote: > > Hi, > > > > This series implements a clean way for semihosted exit syscalls to > > terminate QEMU with a given return code. > > > > Until now, exit syscalls im

Re: [PATCH 0/7] semihosting: proper QEMU exit on semihosted exit syscall

2022-06-20 Thread Luc Michel
On 15:35 Mon 20 Jun , Peter Maydell wrote: > On Mon, 20 Jun 2022 at 15:25, Luc Michel wrote: > > This series implements a clean way for semihosted exit syscalls to > > terminate QEMU with a given return code. > > > > Until now, exit syscalls implementation

Re: [PATCH] accel/tcg/cpu-exec: fix precise single-stepping after interrupt

2022-06-20 Thread Luc Michel
On 16:24 Mon 20 Jun , Luc Michel wrote: > In some cases, cpu->exit_request can be false after handling the > interrupt, leading to another TB being executed instead of returning > to the main loop. > > Fix this by returning true unconditionally when in single-ste

[PATCH 6/7] target/nios2: use semihosting_exit_request on semihosted exit syscall

2022-06-20 Thread Luc Michel
Use the new semihosting_exit_request instead of a call to exit when handling a semihosted exit syscall. Signed-off-by: Luc Michel --- target/nios2/nios2-semi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/nios2/nios2-semi.c b/target/nios2/nios2-semi.c index

[PATCH 3/7] semihosting/arm-compat-semi: use semihosting_exit_request

2022-06-20 Thread Luc Michel
Use the new semihosting_exit_request instead of a call to exit when handling a semihosted exit syscall. Signed-off-by: Luc Michel --- semihosting/arm-compat-semi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c

[PATCH 4/7] target/m68k: use semihosting_exit_request on semihosted exit syscall

2022-06-20 Thread Luc Michel
Use the new semihosting_exit_request instead of a call to exit when handling a semihosted exit syscall. Signed-off-by: Luc Michel --- target/m68k/m68k-semi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/m68k/m68k-semi.c b/target/m68k/m68k-semi.c index

[PATCH 0/7] semihosting: proper QEMU exit on semihosted exit syscall

2022-06-20 Thread Luc Michel
(the semihosting_exit_request is declared G_NORETURN). All targets are converted to use this new function. Thanks, Luc Luc Michel (7): softmmu: add qemu_[set|get]_exit_status functions semihosting: add the semihosting_exit_request function semihosting/arm-compat-semi: use semihosting_exit_request

[PATCH 1/7] softmmu: add qemu_[set|get]_exit_status functions

2022-06-20 Thread Luc Michel
Add the two function qemu_set_exit_status() and qemu_get_exit_status(). Use qemu_get_exit_status() in main instead of 0 as the return value. This is in preparation for the semihosting exit request implementation. Signed-off-by: Luc Michel --- include/sysemu/sysemu.h | 2 ++ softmmu/main.c

[PATCH 2/7] semihosting: add the semihosting_exit_request function

2022-06-20 Thread Luc Michel
not allow other CPU threads to exit properly, leading to e.g. at_exit callbacks being called while other CPUs still run. This can lead to strange bugs, especially in plugins with a registered at_exit function. Signed-off-by: Luc Michel --- qapi/run-state.json| 4 +++- include

[PATCH 7/7] target/xtensa: use semihosting_exit_request on semihosted exit syscall

2022-06-20 Thread Luc Michel
Use the new semihosting_exit_request instead of a call to exit when handling a semihosted exit syscall. Signed-off-by: Luc Michel --- target/xtensa/xtensa-semi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/xtensa/xtensa-semi.c b/target/xtensa/xtensa-semi.c index

  1   2   3   4   5   6   7   >