See the discussion at:

https://lists.debian.org/debian-hurd/2026/11/msg00007.html

There were 2 main problems that were created by the recent patch to
configure all physical memory addresses to 64 bit. As far as I can
tell, only hurd-i386 would be affected:

1) ddekit declared its own type for physical and virtual addresses:
ddekit_addr_t ('unsigned long'). On hurd-i386 architectures this is a
4 byte type which is a different size to the Linux 8 byte physical
address type. Additionally, ddekit_addr_t is used for both virtual and
physical addresses which are no longer the same size with the recent
patch. I changed the type to refer to only physical addresses and
added a virtual address type for virtual pointers.

2) Linux ioremap() has been re-implemented within the l4 arch code. It
didn't include the Linux declaration but rather declared it locally
using the explicit 'unsigned long' rather than the 'resource_size_t'
declared in Linux. These types were no longer the same when compiling
on hurd-i386.

This patch addresses both of the above issues and fixes a few printf
calls to use the correct format specified according to the arch. I
couldn't include 'mach/vm_types.h' nor 'stdint.h' since they both
result in a duplicate type declaration for uintptr_t which is
incompatible with the one declared by the Linux code. I had therefore
to declare ddekit_addr_t explicitly (rather than use physaddr_t) and
also define my own PRIx/PRId printf format specifiers.

João Pedro Malhado <[email protected]> and I have worked together to
find these problems. The patch has been tested by João successfully on
his i386 machine. I don't expect that 64 bit Hurd is affected by these
problems or the patch.

I think this should be a motivation to begin adding more drivers to
rumpnet so that the need for netdde can be reduced. I'll try to enable
an Atheros driver for rumpnet to test on my hardware
platform. Similarly an R8169 one for João who has offered to test on
his machine. These are subject to there being support in the NetBSD
code.

Whilst developing this patch, I did notice the code in:
hurd/libdde-linux26/lib/src/arch/l4/res.c:

static void l4dde26_release_mem_region(resource_size_t start, resource_size_t n)
{
        ddekit_release_mem(start, n);
        ddekit_pgtab_clear_region((void *)start, PTE_TYPE_OTHER);
}

I can't see how the call to ddekit_pgtab_clear_region can be correct
given that 'start' is the physical address and that the function
requires a virtual address. This function isn't called in my test
case, but I can make an additional patch if you agree that it is
required ?

Mike.

Reply via email to