Skip to content

int128: reparing broken 128 bit memory calculations

Pierre Morel qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7int128: use unsigned 128 bit arithmeticinclude/qemu/int128.h+45 -500 replies
2/7memory: modify memory size for an unsigned 128bit intinclude/exec/memory.h memory.c memory_mapping.c+95 -950 replies
3/7128bit: adapt core files for unsigned 128bitsexec.c kvm-all.c+24 -240 replies
4/7128bit: adapt sparc mmu_helper for UInt128target-sparc/mmu_helper.c+1 -10 replies
5/7128bit: adapt VFIO for UInt128 arithmetichw/vfio/common.c+10 -100 replies
6/7128bit: adapt Virtio for UInt128 arithmetichw/virtio/dataplane/vring.c hw/virtio/vhost.c hw/virtio/virtio-balloon.c+4 -40 replies
7/7128bits: some HW components use 128bit arithmetic.hw/core/loader.c hw/display/exynos4210_fimd.c hw/display/framebuffer.c +2 more+8 -80 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/7] int128: reparing broken 128 bit memory calculations

The size of a memory area can never be negative. It follows it must be defined as an unsigned value.

Let's modify the memory regions size to unsigned 128 integer and modify accordingly the 128 bit arithmetic.

This makes memory size calculations easier and easier to understand.

I fear loud protest but really, it is a broken concept that obfuscate the code.

Pierre Morel (7):
int128: use unsigned 128 bit arithmetic
memory: modify memory size for an unsigned 128bit int 128bit: adapt core files for unsigned 128bits 128bit: adapt sparc mmu_helper for UInt128 128bit: adapt VFIO for UInt128 arithmetic 128bit: adapt Virtio for UInt128 arithmetic 128bits: some HW components use 128bit arithmetic.

 exec.c                       |   32 ++++----
 hw/core/loader.c             |    2 +-
 hw/display/exynos4210_fimd.c |    4 +-
 hw/display/framebuffer.c     |    2 +-
 hw/mem/pc-dimm.c             |    6 +-
 hw/pci-host/ppce500.c        |    2 +-
 hw/vfio/common.c             |   20 +++---
 hw/virtio/dataplane/vring.c  |    2 +-
 hw/virtio/vhost.c            |    4 +-
 hw/virtio/virtio-balloon.c   |    2 +-
 include/exec/memory.h        |    4 +-
 include/qemu/int128.h        |   95 ++++++++++-----------
 kvm-all.c                    |   16 ++--
 memory.c                     |  184 +++++++++++++++++++++---------------------
 memory_mapping.c             |    2 +-
 target-sparc/mmu_helper.c    |    2 +-
 16 files changed, 187 insertions(+), 192 deletions(-)