On 7/3/19 7:00 PM, Thomas Huth wrote: > On 02/07/2019 19.43, Thomas Huth wrote: >> On 29/06/2019 14.26, Philippe Mathieu-Daudé wrote: >>> On 6/28/19 8:15 PM, Thomas Huth wrote: > [...] >>>> +static uint32_t mmio_readb(NeXTState *s, hwaddr addr) >>>> +{ >>>> + switch (addr) { >>>> + case 0xc000: >>>> + return (s->scr1 >> 24) & 0xFF; >>>> + case 0xc001: >>>> + return (s->scr1 >> 16) & 0xFF; >>>> + case 0xc002: >>>> + return (s->scr1 >> 8) & 0xFF; >>>> + case 0xc003: >>>> + return (s->scr1 >> 0) & 0xFF; >>> >>> So you have a 32-bit implementation (DMA accessed device?). >>> >>> memory::access_with_adjusted_size() already does this work >>> for you if you use: >>> >>> .impl.min_access_size = 4, >>> .valid.min_access_size = 1, >>> .valid.max_access_size = 4, >> >> Yeah, it's old code from 2011 ... I'll try to rework it as you suggested. > > That does not really seem to work. I'm then still seeing accesses to > 0xc002 in my "readl" handler. Looks like access_with_adjusted_size() is > not really ready for that yet (see the FIXME in that function - it does > not take care of unaligned accesses yet).
I was convinced the unaligned series [*] was already merged. Anyway you give me a good news, we have new a test for it :) [*] https://lists.gnu.org/archive/html/qemu-devel/2017-06/msg06957.html