OpenBSD Journal

Developer Blog - kettenis@: MacPPC SMP

Contributed by johan on from the MP-takes-its-time dept.

Mark Kettenis (kettenis@) sent us this very interesting blog about the latest development in the MacPPC port.

Looks like very few people have noticed it, but about two weeks ago bsd.mp appeared in the OpenBSD/macppc snapshots directory on the ftp mirrors. This actually means what you think it is: OpenBSD/macppc now has SMP support!

The work on this started quite a while ago. Initial progress was fast, since the PowerPC CPUs in multi-processor Macs have some builtin features that take away headaches like TLB shootdowns, which you have to deal with on other SMP architectures. However, soon after all the ground work was laid and the second CPU on my dual G4 started spinning up I got stuck. Really stuck. We always ended up in ddb in a state that was just impossible. Dale Rahn and I spent a fair amount of time at last year's hackathon trying to find the problem, but we didn't get very far. We had some hope the new machine-independent way of scheduling would help but it didn't...

...until a few weeks ago Dale spotted that we didn't properly initialize the per-CPU scheduling data on the secondary CPUs. Fixing that instantly made us go multi-user, although the machine would still crash when you actually put some load on it. A few days later I spotted that a crucial part of the low-level assembler code was still using the same bit of memory as a stack for all CPUs. With that fixed our dual G4 systems started working pretty reliable.

So macppc GENERIC.MP seems to work just fine on dual G4 systems (although we see some wdc soft errors much more often than with GENERIC, we're currently working on fixing that). There are probably a few small remaining bugs. You can help us fixing those running GENERIC.MP if you have a suitable machine.

Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2008 OpenBSD. All rights reserved.  http://www.OpenBSD.org

OpenBSD 4.3-current (GENERIC.MP) #7: Sun May  4 18:50:45 CEST 2008
    kettenis@ravel.sibelius.xs4all.nl:/usr/src/sys/arch/macppc/compile/GENERIC.MP
real mem = 536870912 (512MB)
avail mem = 510021632 (486MB)
mainbus0 at root: model PowerMac3,3
cpu0 at mainbus0: 7400 (Revision 0x209): 450 MHz: 1MB backside cache
cpu1 at mainbus0: 7400 (Revision 0x209): 450 MHz: 1MB backside cache
mem0 at mainbus0
spdmem0 at mem0: 128MB SDRAM non-parity PC100CL3
spdmem1 at mem0: 128MB SDRAM non-parity PC100CL3
spdmem2 at mem0: 128MB SDRAM non-parity PC100CL3
spdmem3 at mem0: 128MB SDRAM non-parity PC100CL3
memc0 at mainbus0: uni-n
kiic0 at memc0 offset 0xf8001000
iic0 at kiic0
mpcpcibr0 at mainbus0 pci: uni-north, Revision 0xff
pci0 at mpcpcibr0 bus 0
pchb0 at pci0 dev 11 function 0 "Apple Uni-N AGP" rev 0x00
vgafb0 at pci0 dev 16 function 0 "ATI Rage Fury" rev 0x00, mmio
wsdisplay0 at vgafb0 mux 1: console (std, vt100 emulation)
mpcpcibr1 at mainbus0 pci: uni-north, Revision 0xff
pci1 at mpcpcibr1 bus 0
pchb1 at pci1 dev 11 function 0 "Apple Uni-N" rev 0x00
ppb0 at pci1 dev 13 function 0 "DEC 21154 PCI-PCI" rev 0x05
pci2 at ppb0 bus 1
macobio0 at pci2 dev 7 function 0 "Apple Keylargo" rev 0x03
openpic0 at macobio0 offset 0x40000: version 0x4614 little endian
macgpio0 at macobio0 offset 0x50
macgpio1 at macgpio0 irq 47
"programmer-switch" at macgpio0 not configured
"escc-legacy" at macobio0 offset 0x12000 not configured
zsc0 at macobio0 offset 0x13000: irq 22,50
zstty0 at zsc0 channel 0
zstty1 at zsc0 channel 1
awacs0 at macobio0 offset 0x14000: irq 24,9,10 headphones
audio0 at awacs0
"timer" at macobio0 offset 0x15000 not configured
adb0 at macobio0 offset 0x16000 irq 25: via-pmu, 0 targets
apm0 at adb0: battery flags 0x9, 0% charged
kiic1 at macobio0 offset 0x18000
iic1 at kiic1
wdc0 at macobio0 offset 0x1f000 irq 19: DMA
wd0 at wdc0 channel 0 drive 0: 
wd0: 16-sector PIO, LBA, 78167MB, 160086528 sectors
wd0(wdc0:0:0): using PIO mode 4, DMA mode 2, Ultra-DMA mode 4
wdc1 at macobio0 offset 0x20000 irq 20: DMA
atapiscsi0 at wdc1 channel 0 drive 0
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0:  ATAPI 5/cdrom removable
cd0(wdc1:0:0): using BIOS timings, DMA mode 2
wdc2 at macobio0 offset 0x21000 irq 21: DMA
ohci0 at pci2 dev 8 function 0 "Apple USB" rev 0x00: irq 27, version 1.0
ohci1 at pci2 dev 9 function 0 "Apple USB" rev 0x00: irq 28, version 1.0
"TI TSB12LV26 FireWire" rev 0x00 at pci2 dev 10 function 0 not configured
usb0 at ohci0: USB revision 1.0
uhub0 at usb0 "Apple OHCI root hub" rev 1.00/1.00 addr 1
usb1 at ohci1: USB revision 1.0
uhub1 at usb1 "Apple OHCI root hub" rev 1.00/1.00 addr 1
mpcpcibr2 at mainbus0 pci: uni-north, Revision 0x16
pci3 at mpcpcibr2 bus 0
pchb2 at pci3 dev 11 function 0 "Apple Uni-N Eth" rev 0x00
gem0 at pci3 dev 15 function 0 "Apple Uni-N GMAC" rev 0x01: irq 41, address 00:30:65:b7:54:b2
brgphy0 at gem0 phy 0: BCM5400 1000baseT PHY, rev. 7
softraid0 at root
bootpath: /pci@f2000000/@d/mac-io@7/ata-4@1f000/disk@0/bsd
root on wd0a swap on wd0b dump on wd0b

Thanks Mark and Dale for making this, the fifth, SMP capable OpenBSD port happen.

(Comments are closed)


Comments
  1. By Anonymous Coward (76.179.19.79) on

    Great work! I have an old dual PPC G3 that I can't wait to try this on.

  2. By dingo (70.8.100.222) dingo@1984.ws on http://1984.ws

    I'm always excited to see newer, stranger porting efforts by rahn and kettinis.

    I tried to donate a dual 550 G4 cpu for a hackathon, but sadly there wern't any available G4 machines at the time to match it up with. I should resend my offer.

    One of the great things about the G4 design is the ability to take out a single 400Mhz powerpc cpu card, and upgrade it as far as a Dual 1.8Ghz without changing the motherboard.

  3. By Anonymous Coward (90.204.110.44) on

    I'm intrigued to hear more about the new machine independent scheduling system....

    Comments
    1. By dingo (70.8.100.222) dingo@1984.ws on http://1984.ws

      > I'm intrigued to hear more about the new machine independent scheduling system....

      read more about it here,

      http://kerneltrap.org/mailarchive/openbsd-tech/2007/9/25/303208

    2. By Anonymous Coward (207.59.237.106) on

      > I'm intrigued to hear more about the new machine independent scheduling system....

      art@'s commit:

      http://marc.info/?l=openbsd-cvs&m=119203193606433&w=2

  4. By Anonymous Coward (87.194.34.157) on

    Congrats Marc and Dale, although I don't have access to a MacPPC its always good to see more SMP support as there's no doubt that other architectures will benefit from SMP bug fixes and such in the long run.

    Thanks for the hard work

Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]