qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/17] target/avr: Increase page size
@ 2025-03-23 17:37 Richard Henderson
  2025-03-23 17:37 ` [PATCH 01/17] hw/core/cpu: Use size_t for memory_rw_debug len argument Richard Henderson
                   ` (16 more replies)
  0 siblings, 17 replies; 45+ messages in thread
From: Richard Henderson @ 2025-03-23 17:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: mrolnik, philmd, pierrick.bouvier

For single-binary, we would really like to have a common
TARGET_PAGE_BITS_MIN.  A value of 10 will suffice for armv4
and will just fit required page flags and alignment.

AVR's use of TARGET_PAGE_BITS == 8 is unfortunate, and is due to
having memory mapped i/o in the first 256 or 512 bytes and sram
starting immediately afterward -- the softmmu page table mapping
really doesn't like mixed i/o and sram on the same page.

My solution is to bias the entire AVR address space up in the
QEMU address space.  This places sram at the start of the second
QEMU page, and the i/o immediately beforehand, at the end of
the first QEMU page.

Once the bias exists, we can choose any value we like.
Use this to select a larger page size, based on the size of sram.
This minimizes the number of pages required to span flash and sram.

There are also two bugs fixed in the avr disassembler.


r~


Richard Henderson (17):
  hw/core/cpu: Use size_t for memory_rw_debug len argument
  target/avr: Fix buffer read in avr_print_insn
  target/avr: Improve decode of LDS, STS
  target/avr: Remove OFFSET_CPU_REGISTERS
  target/avr: Move cpu register accesses into system memory
  target/avr: Use cpu_stb_mmuidx_ra in helper_fullwr
  target/avr: Use do_stb in avr_cpu_do_interrupt
  target/avr: Add offset-io cpu property
  target/avr: Introduce gen_data_{load,store}_raw
  target/avr: Update cpu_sp after push and pop
  target/avr: Implement CPUState.memory_rw_debug
  target/avr: Handle offset_io in helper.c
  target/avr: Handle offset_io in avr_cpu_realizefn
  hw/avr: Set offset_io and increase page size to 1k
  hw/avr: Pass mcu_type to class_base_init via .class_data
  hw/avr: Move AtmegaMcuClass to atmega.h
  target/avr: Enable TARGET_PAGE_BITS_VARY

 hw/avr/atmega.h           |  20 +++
 include/hw/core/cpu.h     |   2 +-
 target/avr/cpu-param.h    |  13 +-
 target/avr/cpu.h          |  11 +-
 target/avr/helper.h       |   3 -
 target/sparc/cpu.h        |   2 +-
 hw/avr/arduino.c          |  31 ++++-
 hw/avr/atmega.c           |  76 ++++++-----
 target/avr/cpu.c          |  49 +++++++
 target/avr/disas.c        |  21 ++-
 target/avr/helper.c       | 263 +++++++++++++++++---------------------
 target/avr/translate.c    | 106 +++++++++------
 target/sparc/mmu_helper.c |   2 +-
 target/avr/insn.decode    |   7 +-
 14 files changed, 346 insertions(+), 260 deletions(-)

-- 
2.43.0



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

end of thread, other threads:[~2025-03-25 14:35 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-23 17:37 [PATCH 00/17] target/avr: Increase page size Richard Henderson
2025-03-23 17:37 ` [PATCH 01/17] hw/core/cpu: Use size_t for memory_rw_debug len argument Richard Henderson
2025-03-23 21:25   ` Philippe Mathieu-Daudé
2025-03-25  0:43   ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 02/17] target/avr: Fix buffer read in avr_print_insn Richard Henderson
2025-03-25  0:52   ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 03/17] target/avr: Improve decode of LDS, STS Richard Henderson
2025-03-25  0:53   ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 04/17] target/avr: Remove OFFSET_CPU_REGISTERS Richard Henderson
2025-03-23 21:27   ` Philippe Mathieu-Daudé
2025-03-25  0:55   ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 05/17] target/avr: Move cpu register accesses into system memory Richard Henderson
2025-03-25  1:07   ` Pierrick Bouvier
2025-03-25 13:48     ` Richard Henderson
2025-03-25 14:34       ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 06/17] target/avr: Use cpu_stb_mmuidx_ra in helper_fullwr Richard Henderson
2025-03-25  1:08   ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 07/17] target/avr: Use do_stb in avr_cpu_do_interrupt Richard Henderson
2025-03-23 21:31   ` Philippe Mathieu-Daudé
2025-03-25  1:09   ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 08/17] target/avr: Add offset-io cpu property Richard Henderson
2025-03-25  1:10   ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 09/17] target/avr: Introduce gen_data_{load,store}_raw Richard Henderson
2025-03-25  1:12   ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 10/17] target/avr: Update cpu_sp after push and pop Richard Henderson
2025-03-25  1:36   ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 11/17] target/avr: Implement CPUState.memory_rw_debug Richard Henderson
2025-03-23 21:33   ` Philippe Mathieu-Daudé
2025-03-25  1:19   ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 12/17] target/avr: Handle offset_io in helper.c Richard Henderson
2025-03-23 21:34   ` Philippe Mathieu-Daudé
2025-03-25  1:20   ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 13/17] target/avr: Handle offset_io in avr_cpu_realizefn Richard Henderson
2025-03-23 21:35   ` Philippe Mathieu-Daudé
2025-03-23 21:38     ` Philippe Mathieu-Daudé
2025-03-25  1:20   ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 14/17] hw/avr: Set offset_io and increase page size to 1k Richard Henderson
2025-03-25  1:21   ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 15/17] hw/avr: Pass mcu_type to class_base_init via .class_data Richard Henderson
2025-03-23 21:38   ` Philippe Mathieu-Daudé
2025-03-25  1:25   ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 16/17] hw/avr: Move AtmegaMcuClass to atmega.h Richard Henderson
2025-03-25  1:22   ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 17/17] target/avr: Enable TARGET_PAGE_BITS_VARY Richard Henderson
2025-03-25  1:24   ` Pierrick Bouvier

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).