Bug #1545

amd64: ed(4) won't load

Added by qhwt+dfly almost 5 years ago. Updated almost 5 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:qhwt+dfly% Done:

0%

Category:-
Target version:-

Description

Hi.
I've tried amd64 ISO on Parallels(an emulator which runs on Mac OS X).
The installation went fine, but so far I have two problems:

- the network driver won't work out-of-box; it's recognized as ed(4),
but the driver won't load because of missing kvtop() function

- SMP kernel works, but not with APIC_IO; Parallels reported that the
virtual machine crashed shortly after the following message is displayed
on the console
APIC_IO: MP table broken: ExtINT entry corrupt!

(this is not specific to amd64, but it happens to i386, too)

I faked up the kvtop() function as follows and it seems to work,
although I haven't tried it under load, just a few `git fetch' or
NFS mounts(to share the source tree between Mac OS X and DragonFly).
I hope someone with knowledge has time to work on fixing ed(4)
for amd64 someday.

Best Regards,
YONETANI Tomokazu.

diff --git a/sys/dev/netif/ed/if_ed.c b/sys/dev/netif/ed/if_ed.c
index 60159a1..01f40f2 100644
--- a/sys/dev/netif/ed/if_ed.c
+++ b/sys/dev/netif/ed/if_ed.c
@@ -68,6 +68,7 @@
#include <net/bpf.h>

#include <machine/md_var.h>
+#include <vm/pmap.h>

#include "if_edreg.h"
#include "if_edvar.h"
@@ -192,6 +193,20 @@ ed_probe_generic8390(struct ed_softc *sc)
}

/*
+ * Convert kernel VA to physical address
+ */
+vm_paddr_t
+kvtop(void *addr)
+{
+ vm_paddr_t pa;
+
+ pa = pmap_extract(&kernel_pmap, (vm_offset_t)addr);
+ if (pa == 0)
+ panic("kvtop: zero page frame");
+ return (pa);
+}
+
+/*
* Probe and vendor-specific initialization routine for SMC/WD80x3 boards
*/
int

History

#1 Updated by dillon almost 5 years ago

:I faked up the kvtop() function as follows and it seems to work,
:although I haven't tried it under load, just a few `git fetch' or
:NFS mounts(to share the source tree between Mac OS X and DragonFly).
:I hope someone with knowledge has time to work on fixing ed(4)
:for amd64 someday.
:
:Best Regards,
:YONETANI Tomokazu.

Feel free to add/commit your kvtop() to platform/pc64/amd64/vm_machdep.c.
I'd like to have as many developers involved in bringing the 64-bit
build up to snuff as possible. Nobody has a lock on any of the code.

-Matt
Matthew Dillon
<>

#2 Updated by qhwt+dfly almost 5 years ago

OK, turned out that kvtop() was common among platforms.

Also available in: Atom PDF