Port-m68k archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: New pmap module for m68k



> > Is the 2 GiB a hard limit of this new design (rather than the QEmu
> > machine model), or would it be possible to go beyond that by using
> > "tricks" on the physical side, such as using the UPA bit as additional
> > address bits ? (The pins are driven by the bits in the MMU IIRC, so I
> > think in theory they could be used to generate a 2^34 bytes physical
> > address space, should that be potentially useful.)
> 
> No hard limit I know if, it's just what I tried.  The Qemu virt68k machine
> does have some sort of limit, because the I/O devices are at the top of the
> physical address space.  Obviously can't put RAM there.

isaki@ said Qemu/virt68k used the last 4KB space for I/O devices and
theoretically it could handle ~4GB RAMs, but last time I tried qemu 9.1.2
it complained around ~3200MB even on the NetBSD/amd64 10.1 host:

> qemu-system-m68k: Too much memory for this machine: 3407872 KiB, maximum 3399672 KiB

Qemu 10.1.0 seems to have the same limit.

Note with the old 4.4BSD derived Hiblers pmap, it's neccessary to bump
MAXKL2SIZE in sys/arch/m68k/include/pmap_motorola.h from 32 to 128 to
handle whole 4GB RAMs in the kernel VM space on 68040.
 https://github.com/NetBSD/src/blob/c62d834b8a616d81ae9145d5d3ed44f22e3d6bde/sys/arch/m68k/include/pmap_motorola.h#L179-L186

Here is my (a bit old) dmesg (patched kernel to return faked "10.1" version to
build package binaries with 10.1 mvme68k userland):

% cat qemu.sh 
#! /bin/sh
#FILE=NetBSD-10.1-virt68k.img
#FORMAT=raw
FILE=NetBSD-10.1-virt68k.qcow2
FORMAT=qcow2
KERNEL=netbsd
qemu-system-m68k -machine virt -m 3319m \
-drive file=${FILE},format=${FORMAT},if=none,id=disk \
-device virtio-blk-device,drive=disk \
-netdev user,id=net,hostfwd=tcp::11022-:22 \
-device virtio-net-device,netdev=net \
-kernel ${KERNEL} -append root=ld0 -nographic
% sh qemu.sh
[   1.0000000] Initialized Goldfish TTY console @ 0xff008000
[   1.0000000] Memory segment 0: addr=0x005d4000 size=0xcf12c000
[   1.0000000] entropy: ready
[   1.0000000] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
[   1.0000000]     2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013,
[   1.0000000]     2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023,
[   1.0000000]     2024, 2025
[   1.0000000]     The NetBSD Foundation, Inc.  All rights reserved.
[   1.0000000] Copyright (c) 1982, 1986, 1989, 1991, 1993
[   1.0000000]     The Regents of the University of California.  All rights reserved.

[   1.0000000] NetBSD 10.1 (GENERIC) #6: Tue Mar 11 17:26:48 JST 2025
[   1.0000000]  tsutsui@mirage:/s/tsutsui/netbsd-src/sys/arch/virt68k/compile/obj.virt68k/GENERIC
[   1.0000000] Qemu 10.1.0: MC68040+MMU+FPU, 4k+4k on-chip physical I/D caches
[   1.0000000] total memory = 3319 MB
[   1.0000000] avail memory = 3277 MB
[   1.0000000] mainbus0 (root)
[   1.0000000] gfpic0 at mainbus0 addr 0xff000000: Google Goldfish PIC
[   1.0000000] gfpic0: interrupting at IPL 1
[   1.0000000] gfpic1 at mainbus0 addr 0xff001000: Google Goldfish PIC
[   1.0000000] gfpic1: interrupting at IPL 2
[   1.0000000] gfpic2 at mainbus0 addr 0xff002000: Google Goldfish PIC
[   1.0000000] gfpic2: interrupting at IPL 3
[   1.0000000] gfpic3 at mainbus0 addr 0xff003000: Google Goldfish PIC
[   1.0000000] gfpic3: interrupting at IPL 4
[   1.0000000] gfpic4 at mainbus0 addr 0xff004000: Google Goldfish PIC
[   1.0000000] gfpic4: interrupting at IPL 5
[   1.0000000] gfpic5 at mainbus0 addr 0xff005000: Google Goldfish PIC
[   1.0000000] gfpic5: interrupting at IPL 6
[   1.0000000] gfrtc0 at mainbus0 addr 0xff006000: Google Goldfish RTC + timer
[   1.0000000] gfrtc0: hardclock interrupting at gfpic5 irq 1 (IPL 6)
[   1.0000000] gfrtc0: Using as delay() timer.
[   1.0000000] gfrtc1 at mainbus0 addr 0xff007000: Google Goldfish RTC + timer
[   1.0000000] gfrtc1: using as Time of Day Register.
[   1.0000000] gftty0 at mainbus0 addr 0xff008000: Google Goldfish TTY
[   1.0000000] gftty0: console
[   1.0000000] gftty0: interrupting at gfpic0 irq 32 (IPL 1)
[   1.0000000] virtctrl0 at mainbus0 addr 0xff009000: Qemu Virtual System Controller
[   1.0000000] virtctrl0: features=0x00000001
[   1.0000000] virtio0 at mainbus0 addr 0xff01fc00
[   1.0000000] virtio0: VirtIO-MMIO-v2
[   1.0000000] virtio0: network device (id 1, rev. 0x01)
[   1.0000000] vioif0 at virtio0: features: 0x130870020<V1,EVENT_IDX,INDIRECT_DESC,CTRL_MAC,CTRL_RX,CTRL_VQ,STATUS,MAC>
[   1.0000000] vioif0: Ethernet address 52:54:00:12:34:56
[   1.0000000] virtio0: interrupting at gfpic4 irq 31 (IPL 5)
[   1.0000000] virtio1 at mainbus0 addr 0xff01fe00
[   1.0000000] virtio1: VirtIO-MMIO-v2
[   1.0000000] virtio1: block device (id 2, rev. 0x01)
[   1.0000000] ld0 at virtio1: features: 0x110002a54<V1,INDIRECT_DESC,DISCARD,CONFIG_WCE,FLUSH,BLK_SIZE,GEOMETRY,SEG_MAX>
[   1.0000000] ld0: max 254 segs of max 65536 bytes
[   1.0000000] virtio1: interrupting at gfpic4 irq 32 (IPL 5)
[   1.0000000] ld0: 20480 MB, 16383 cyl, 16 head, 63 sec, 512 bytes/sect x 41943040 sectors
[   1.0000000] No statclock; using hardclock.
[   1.0000000] Initialzing hardclock: freq=100 Hz, interval=10000 usec
[   1.2200030] swwdog0: software watchdog initialized
[   1.2900030] root on ld0a dumps on ld0b
[   1.3200030] root file system type: ffs
[   1.3300030] kern.module.path=/stand/virt68k/10.1/modules
Mon Nov 10 14:51:01 UTC 2025
Starting root file system check:

 :

---
Izumi Tsutsui


Home | Main Index | Thread Index | Old Index