Your message dated Sat, 5 Apr 2025 19:29:09 +0200
with message-id
<waqc2xuh6t6nmmz3pec5ymyc3vlguzmqci3jyqwlgoi2yrpd75@mql3deszjehx>
and subject line Re: Bug#979108: memtool: 64 bit memory reads may be split on
32 bit systems
has caused the Debian Bug report #979108,
regarding memtool: 64 bit memory reads may be split on 32 bit systems
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
979108: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=979108
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: memtool
Severity: normal
Tags: upstream patch
Hello,
I tried memtool on a 32 bit ARM system, and the supposedly 64 bit reads
with the "-q" option are done by 2 separate 32 bit "ldr" instructions.
Adding a volatile qualifier to the pointers accessing the memory could
convince gcc to generate a single "ldrd" instruction instead, which uses
a 64 bit memory transfer. See below a proposed patch. Adding volatile to all
4 cases may be an overkill, but can't hurt. Cheers,
Gergely Peli
========
--- memtool-2016.10.0.orig/memtool.c
+++ memtool-2016.10.0/memtool.c
@@ -152,24 +152,24 @@ static int memory_display(const void *ad
for (i = 0; i < linebytes; i += width) {
if (width == 8) {
uint64_t res;
- res = (*uqp++ = *((uint64_t *)addr));
+ res = (*uqp++ = *((volatile uint64_t *)addr));
if (swab)
res = swab64(res);
count -= printf(" %016" PRIx64, res);
} else if (width == 4) {
uint32_t res;
- res = (*uip++ = *((uint *)addr));
+ res = (*uip++ = *((volatile uint *)addr));
if (swab)
res = swab32(res);
count -= printf(" %08" PRIx32, res);
} else if (width == 2) {
uint16_t res;
- res = (*usp++ = *((ushort *)addr));
+ res = (*usp++ = *((volatile ushort *)addr));
if (swab)
res = swab16(res);
count -= printf(" %04" PRIx16, res);
} else {
- count -= printf(" %02x", (*ucp++ = *((u_char
*)addr)));
+ count -= printf(" %02x", (*ucp++ = *((volatile
u_char *)addr)));
}
addr += width;
offs += width;
========
PS: the below specs are not for the tested system.
-- System Information:
Debian Release: 8.2
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.19.0-8-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_DK.UTF-8, LC_CTYPE=en_DK.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
--- End Message ---
--- Begin Message ---
Hello,
this bug doesn't affect memtool in oldstable and newer, so I close it.
Best regards
Uwe
signature.asc
Description: PGP signature
--- End Message ---