[PATCH-for-8.2? 0/6] hw/arm/stm32xxx: Report error when incorrect CPU is used

Philippe Mathieu-Daudé posted 6 patches 1 year ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20231115232154.4515-1-philmd@linaro.org
Maintainers: Subbaraya Sundeep <sundeep.lkml@gmail.com>, Peter Maydell <peter.maydell@linaro.org>, Alistair Francis <alistair@alistair23.me>, Tyrone Ting <kfting@nuvoton.com>, Hao Wu <wuhaotsh@google.com>, Felipe Balbi <balbi@kernel.org>, Alexandre Iooss <erdnaxe@crans.org>
There is a newer version of this series
include/hw/arm/msf2-soc.h      |  3 ---
include/hw/arm/stm32f100_soc.h |  4 ----
include/hw/arm/stm32f205_soc.h |  4 ----
include/hw/arm/stm32f405_soc.h |  4 ----
hw/arm/msf2-soc.c              |  3 +--
hw/arm/msf2-som.c              | 16 ++++++----------
hw/arm/musca.c                 | 13 +++++--------
hw/arm/netduino2.c             |  7 ++++++-
hw/arm/netduinoplus2.c         |  7 ++++++-
hw/arm/npcm7xx_boards.c        | 13 +++++--------
hw/arm/olimex-stm32-h405.c     |  8 ++++++--
hw/arm/stm32f100_soc.c         |  9 ++-------
hw/arm/stm32f205_soc.c         |  9 ++-------
hw/arm/stm32f405_soc.c         |  8 +-------
hw/arm/stm32vldiscovery.c      |  7 ++++++-
15 files changed, 46 insertions(+), 69 deletions(-)
[PATCH-for-8.2? 0/6] hw/arm/stm32xxx: Report error when incorrect CPU is used
Posted by Philippe Mathieu-Daudé 1 year ago
Hi,

While reviewing this [1] series from Arnaud and Inès,
I realized STM32 based boards don't check the requested
CPU type is correct, and ignore it. Possibly confusing
users.
Since these simple boards code is used as template,
I took the opportunity to sanitize it a bit, using the
MachineClass::valid_cpu_types which seems simpler (to me)
for newcomers.

First 3 patches are candidate for 8.2 but this is a long
standing issue, not a regression from 8.1.

Other patches are similar cleanups, for 9.0. Besides, the
CPU list output will be nicer with Gavin Shan work [2]
integrated.

Regards,

Phil.

[1] https://lore.kernel.org/qemu-devel/170003673257.14701.8139061802716120109-0@git.sr.ht/
[2] https://lore.kernel.org/qemu-devel/20231114235628.534334-1-gshan@redhat.com/

Philippe Mathieu-Daudé (6):
  hw/arm/stm32f405: Report error when incorrect CPU is used
  hw/arm/stm32f205: Report error when incorrect CPU is used
  hw/arm/stm32f100: Report error when incorrect CPU is used
  hw/arm/msf2: Simplify setting MachineClass::valid_cpu_types[]
  hw/arm/npcm7xx_boards: Simplify setting
    MachineClass::valid_cpu_types[]
  hw/arm/musca: Simplify setting MachineClass::valid_cpu_types[]

 include/hw/arm/msf2-soc.h      |  3 ---
 include/hw/arm/stm32f100_soc.h |  4 ----
 include/hw/arm/stm32f205_soc.h |  4 ----
 include/hw/arm/stm32f405_soc.h |  4 ----
 hw/arm/msf2-soc.c              |  3 +--
 hw/arm/msf2-som.c              | 16 ++++++----------
 hw/arm/musca.c                 | 13 +++++--------
 hw/arm/netduino2.c             |  7 ++++++-
 hw/arm/netduinoplus2.c         |  7 ++++++-
 hw/arm/npcm7xx_boards.c        | 13 +++++--------
 hw/arm/olimex-stm32-h405.c     |  8 ++++++--
 hw/arm/stm32f100_soc.c         |  9 ++-------
 hw/arm/stm32f205_soc.c         |  9 ++-------
 hw/arm/stm32f405_soc.c         |  8 +-------
 hw/arm/stm32vldiscovery.c      |  7 ++++++-
 15 files changed, 46 insertions(+), 69 deletions(-)

-- 
2.41.0


Re: [PATCH-for-8.2? 0/6] hw/arm/stm32xxx: Report error when incorrect CPU is used
Posted by Richard Henderson 1 year ago
On 11/15/23 15:21, Philippe Mathieu-Daudé wrote:
> Philippe Mathieu-Daudé (6):
>    hw/arm/stm32f405: Report error when incorrect CPU is used
>    hw/arm/stm32f205: Report error when incorrect CPU is used
>    hw/arm/stm32f100: Report error when incorrect CPU is used
>    hw/arm/msf2: Simplify setting MachineClass::valid_cpu_types[]
>    hw/arm/npcm7xx_boards: Simplify setting
>      MachineClass::valid_cpu_types[]
>    hw/arm/musca: Simplify setting MachineClass::valid_cpu_types[]

With the const fix,

Series
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~