qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/8] machine: Unified CPU type check
@ 2023-07-26  0:31 Gavin Shan
  2023-07-26  0:31 ` [PATCH v2 1/8] machine: Use error handling when CPU type is checked Gavin Shan
                   ` (7 more replies)
  0 siblings, 8 replies; 21+ messages in thread
From: Gavin Shan @ 2023-07-26  0:31 UTC (permalink / raw)
  To: qemu-arm
  Cc: qemu-devel, qemu-riscv, peter.maydell, b.galvani,
	strahinja.p.jankovic, sundeep.lkml, kfting, wuhaotsh,
	nieklinnenbank, rad, quic_llindhol, marcin.juszkiewicz, eduardo,
	marcel.apfelbaum, philmd, wangyanan55, laurent, vijai, palmer,
	alistair.francis, bin.meng, liweiwei, dbarboza, zhiwei_liu,
	imammedo, cohuck, richard.henderson, pbonzini, shan.gavin

There are two places where the user specified CPU type is checked to see
if it's supported or allowed by the board: machine_run_board_init() and
mc->init(). We don't have to maintain two duplicate sets of logic. This
series intends to move the check to machine_run_board_init().

PATCH[1-3] Improves the check in machine_run_board_init()
PATCH[4-8] Move the check mc->init() to machine_run_board_init()

v1: https://lists.nongnu.org/archive/html/qemu-arm/2023-07/msg00302.html

Testing
=======

With the following command lines, the output messages are varied before
and after the series is applied.

  /home/gshan/sandbox/src/qemu/main/build/qemu-system-aarch64 \
  -accel tcg -machine virt,gic-version=3,nvdimm=on            \
  -cpu cortex-a8 -smp maxcpus=2,cpus=1                        \
    :

Before the series is applied:

  qemu-system-aarch64: mach-virt: CPU type cortex-a8-arm-cpu not supported

After the series is applied:

  qemu-system-aarch64: Invalid CPU type: cortex-a8-arm-cpu
  The valid models are: cortex-a7, cortex-a15, cortex-a35, cortex-a55,
                        cortex-a72, cortex-a76, a64fx, neoverse-n1,
                        neoverse-v1, cortex-a53, cortex-a57, max

Changelog
=========
v2:
  * Constify mc->valid_cpu_types                                (Richard)
  * Print the supported CPU models, instead of typenames        (Peter)
  * Misc improvements for the hleper to do the check            (Igor)
  * More patches to move the check                              (Marcin)

Gavin Shan (8):
  machine: Use error handling when CPU type is checked
  machine: Introduce helper is_cpu_type_supported()
  machine: Print supported CPU models instead of typenames
  hw/arm/virt: Check CPU type in machine_run_board_init()
  hw/arm/virt: Unsupported host CPU model on TCG
  hw/arm/sbsa-ref: Check CPU type in machine_run_board_init()
  hw/arm: Check CPU type in machine_run_board_init()
  hw/riscv/shakti_c: Check CPU type in machine_run_board_init()

 hw/arm/bananapi_m2u.c   | 18 ++++++---
 hw/arm/cubieboard.c     | 18 ++++++---
 hw/arm/mps2-tz.c        | 34 ++++++++++++++---
 hw/arm/mps2.c           | 44 ++++++++++++++++++---
 hw/arm/msf2-som.c       | 18 ++++++---
 hw/arm/musca.c          | 19 ++++++----
 hw/arm/npcm7xx_boards.c | 19 ++++++----
 hw/arm/orangepi.c       | 18 ++++++---
 hw/arm/sbsa-ref.c       | 29 ++++++--------
 hw/arm/virt.c           | 43 ++++++++++++---------
 hw/core/machine.c       | 84 +++++++++++++++++++++++------------------
 hw/m68k/q800.c          |  8 +++-
 hw/riscv/shakti_c.c     | 17 ++++++---
 include/hw/boards.h     |  3 +-
 14 files changed, 243 insertions(+), 129 deletions(-)

-- 
2.41.0



^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2023-08-31  9:03 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-26  0:31 [PATCH v2 0/8] machine: Unified CPU type check Gavin Shan
2023-07-26  0:31 ` [PATCH v2 1/8] machine: Use error handling when CPU type is checked Gavin Shan
2023-07-26  0:31 ` [PATCH v2 2/8] machine: Introduce helper is_cpu_type_supported() Gavin Shan
2023-07-26 23:03   ` Richard Henderson
2023-07-26  0:32 ` [PATCH v2 3/8] machine: Print supported CPU models instead of typenames Gavin Shan
2023-07-26 23:08   ` Richard Henderson
2023-07-27  5:16     ` Gavin Shan
2023-07-27  9:00       ` Igor Mammedov
2023-07-31  5:07         ` Gavin Shan
2023-08-28 14:46           ` Igor Mammedov
2023-08-29  6:28             ` Gavin Shan
2023-08-29  9:03               ` Igor Mammedov
2023-08-30  7:34                 ` Gavin Shan
2023-08-31  9:02                   ` Igor Mammedov
2023-07-27 14:27       ` Richard Henderson
2023-07-31  5:33         ` Gavin Shan
2023-07-26  0:32 ` [PATCH v2 4/8] hw/arm/virt: Check CPU type in machine_run_board_init() Gavin Shan
2023-07-26  0:32 ` [PATCH v2 5/8] hw/arm/virt: Unsupported host CPU model on TCG Gavin Shan
2023-07-26  0:32 ` [PATCH v2 6/8] hw/arm/sbsa-ref: Check CPU type in machine_run_board_init() Gavin Shan
2023-07-26  0:32 ` [PATCH v2 7/8] hw/arm: " Gavin Shan
2023-07-26  0:32 ` [PATCH v2 8/8] hw/riscv/shakti_c: " Gavin Shan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).