[PATCH v2 00/11] target/avr: Increase page size

Richard Henderson posted 11 patches 6 days, 9 hours ago
hw/avr/atmega.h           |   1 +
include/hw/core/cpu.h     |   2 +-
target/avr/cpu-param.h    |   8 +-
target/avr/cpu.h          |  21 ++-
target/avr/helper.h       |   3 -
target/sparc/cpu.h        |   2 +-
hw/avr/atmega.c           |  39 +++++-
target/avr/cpu.c          |  16 +++
target/avr/disas.c        |  21 ++-
target/avr/helper.c       | 262 ++++++++++++++++----------------------
target/avr/translate.c    |  44 ++++---
target/sparc/mmu_helper.c |   2 +-
target/avr/insn.decode    |   7 +-
13 files changed, 222 insertions(+), 206 deletions(-)
[PATCH v2 00/11] target/avr: Increase page size
Posted by Richard Henderson 6 days, 9 hours ago
For single-binary, we would really like to have a common TARGET_PAGE_BITS_MIN.

AVR's use of TARGET_PAGE_BITS == 8 is unfortunately too small.  This was due
to having mmio in the first 256 or 512 bytes and RAM starting immediately
afterward -- the softmmu page table mapping really doesn't like mixed i/o
and sram on the same page.

For v2, my solution is to map the balance of the first page with a ram device
instead of normal ram.  This way, the entire first page is always i/o.
In addition, add some symbolic names for the cpu registers in i/o 0x38-0x3f.


r~


Richard Henderson (11):
  target/avr: Fix buffer read in avr_print_insn
  target/avr: Improve decode of LDS, STS
  hw/core/cpu: Use size_t for memory_rw_debug len argument
  target/avr: Remove OFFSET_CPU_REGISTERS
  target/avr: Remove NUMBER_OF_IO_REGISTERS
  target/avr: Add defines for i/o port 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
  hw/avr: Prepare for TARGET_PAGE_SIZE > 256
  target/avr: Increase TARGET_PAGE_BITS to 10

 hw/avr/atmega.h           |   1 +
 include/hw/core/cpu.h     |   2 +-
 target/avr/cpu-param.h    |   8 +-
 target/avr/cpu.h          |  21 ++-
 target/avr/helper.h       |   3 -
 target/sparc/cpu.h        |   2 +-
 hw/avr/atmega.c           |  39 +++++-
 target/avr/cpu.c          |  16 +++
 target/avr/disas.c        |  21 ++-
 target/avr/helper.c       | 262 ++++++++++++++++----------------------
 target/avr/translate.c    |  44 ++++---
 target/sparc/mmu_helper.c |   2 +-
 target/avr/insn.decode    |   7 +-
 13 files changed, 222 insertions(+), 206 deletions(-)

-- 
2.43.0
Re: [PATCH v2 00/11] target/avr: Increase page size
Posted by Philippe Mathieu-Daudé 13 hours ago
On 25/3/25 23:43, Richard Henderson wrote:

> Richard Henderson (11):
>    target/avr: Fix buffer read in avr_print_insn

Patch 1 queued for 10.1, thanks!
Re: [PATCH v2 00/11] target/avr: Increase page size
Posted by Philippe Mathieu-Daudé 13 hours ago
On 31/3/25 20:48, Philippe Mathieu-Daudé wrote:
> On 25/3/25 23:43, Richard Henderson wrote:
> 
>> Richard Henderson (11):
>>    target/avr: Fix buffer read in avr_print_insn

 >>    hw/core/cpu: Use size_t for memory_rw_debug len argument

> Patch 1 queued for 10.1, thanks!

Also patch 3 ;)