[RFC PATCH v2 0/2] cputlb: implement load_helper_unaligned() for unaligned loads

Philippe Mathieu-Daudé posted 2 patches 3 days, 8 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/next-importer-push tags/patchew/20210609141010.1066750-1-f4bug@amsat.org
accel/tcg/cputlb.c | 106 ++++++++++++++++++++++++++++++++++++---------
1 file changed, 85 insertions(+), 21 deletions(-)

[RFC PATCH v2 0/2] cputlb: implement load_helper_unaligned() for unaligned loads

Posted by Philippe Mathieu-Daudé 3 days, 8 hours ago
Reposting Mark's patch:
https://www.mail-archive.com/qemu-devel@nongnu.org/msg814227.html
but split in 2 patches for easier review.

Mark Cave-Ayland (1):
  cputlb: implement load_helper_unaligned() for unaligned loads

Philippe Mathieu-Daudé (1):
  accel/tcg/cputlb: Extract load_helper_unaligned() from load_helper()

 accel/tcg/cputlb.c | 106 ++++++++++++++++++++++++++++++++++++---------
 1 file changed, 85 insertions(+), 21 deletions(-)

-- 
2.31.1


Re: [RFC PATCH v2 0/2] cputlb: implement load_helper_unaligned() for unaligned loads

Posted by Mark Cave-Ayland 3 days, 6 hours ago
On 09/06/2021 15:10, Philippe Mathieu-Daudé wrote:

(Added gitlab issue email)

> Reposting Mark's patch:
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg814227.html
> but split in 2 patches for easier review.
> 
> Mark Cave-Ayland (1):
>    cputlb: implement load_helper_unaligned() for unaligned loads
> 
> Philippe Mathieu-Daudé (1):
>    accel/tcg/cputlb: Extract load_helper_unaligned() from load_helper()
> 
>   accel/tcg/cputlb.c | 106 ++++++++++++++++++++++++++++++++++++---------
>   1 file changed, 85 insertions(+), 21 deletions(-)

Thanks Phil. I'm replying to this to keep track of a few thoughts that came up in our 
discussion on IRC:

- Should these unaligned accesses be handled by the memory API?

- There is an overlap with Andrew Jeffrey's unaligned access patchset for the memory 
API at 
http://patchwork.ozlabs.org/project/qemu-devel/patch/20170630030058.28943-1-andrew@aj.id.au/. 
This would certainly benefit devices which currently handle unaligned accesses 
themselves.

- Currently there aren't any qtests to cover the unaligned access cputlb path

- How would using the memory API implementation interact with MemoryRegionOps 
.valid.unaligned and .impl.unaligned?

- The current cputlb store_helper_unaligned() and also load_helper_unaligned() 
proposed by this patchset always use byte accesses, i.e they do not honour the target 
MemoryRegion min_access_size. Switching to the memory API could therefore cause some 
existing cases to break, although -d guest_errors should now log these.

- Phil thinks that using the memory API could break ISA bus accesses


ATB,

Mark.