On Mon, Aug 15, 2016 at 09:56:09PM +0200, Mark Kettenis wrote:
> The functions that clean/invalidate the caches by virtual address,
> bail out after cleaning 32k worth of data. The 32k matches the L1
> cache of most of the CPUs we current run on. But the Cortex-A7 has an
> integrated L2 cache that is larger. And if you only flush it
> partially you may get into trouble. And now that we actually use the
> cache that matters. Many of the more recent ARMv7 CPUs include such a
> L2 cache. And some of them even have L1 caches that are larger than
> 32k. So drop the shortcut and simply clean/invalidate what we were
> asked to clean/invalidate. Most of the calls should be covering a
> single page or less anyway.
>
> This fixes the core dumps and illegal instructions that I see when
> booting from a SATA disk.
Just saw this commited. It makes Cubieboard2 fully useable so far.
Kernel rebuild with fs on ahci:
(...)
ld -T ldscript --warn-common -nopie -S -o bsd ${SYSTEM_HEAD} vers.o ${OBJS}
text data bss dec hex
3744040 139412 479308 4362760 429208
25m50.10s real 17m18.26s user 1m28.06s system
Just as a comparison, it takes around 20 min on Wandboard with fs on nfs and
around 23 min on BeagleBone Black with fs also on nfs.
Thank you.
--
U-Boot SPL 2016.07 (Aug 05 2016 - 23:44:57)
DRAM: 1024 MiB
CPU: 912000000Hz, AXI/AHB/APB: 3/2/2
Trying to boot from MMC1
U-Boot 2016.07 (Aug 05 2016 - 23:44:57 -0600) Allwinner Technology
CPU: Allwinner A20 (SUN7I)
Model: Cubietech Cubieboard2
I2C: ready
DRAM: 1 GiB
MMC: SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment
In: serial
Out: serial
Err: serial
SCSI: Target spinup took 0 ms.
AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part ccc apst
Net: eth0: ethernet@01c50000
starting USB...
USB0: USB EHCI 1.00
USB1: USB OHCI 1.0
USB2: USB EHCI 1.00
USB3: USB OHCI 1.0
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 2 for devices... 1 USB Device(s) found
Hit any key to stop autoboot: 0
=>
=> setenv devnum 0
=> run scsi_boot
scanning bus for devices...
Device 0: (0:0) Vendor: ATA Prod.: TOSHIBA MK1235GS Rev: PV01
Type: Hard Disk
Capacity: 114473.4 MB = 111.7 GB (234441648 x 512)
Found 1 device(s).
Device 0: (0:0) Vendor: ATA Prod.: TOSHIBA MK1235GS Rev: PV01
Type: Hard Disk
Capacity: 114473.4 MB = 111.7 GB (234441648 x 512)
... is now current device
Scanning scsi 0:1...
Found EFI removable media binary efi/boot/bootarm.efi
reading efi/boot/bootarm.efi
65276 bytes read in 23 ms (2.7 MiB/s)
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
## Starting EFI application at 0x42000000 ...
Scanning disks on scsi...
Scanning disks on usb...
Scanning disks on mmc...
MMC Device 1 not found
MMC Device 2 not found
MMC Device 3 not found
Found 6 disks
>> OpenBSD/armv7 BOOTARM 0.1
boot>
booting sd0a:/bsd: 3743840+139408+479308 [64+501824+238352]=0x4e3de0
OpenBSD/armv7 booting ...
arg0 0x40000000 arg1 0x10bb arg2 0x48000000
Allocating page tables
freestart = 0x407e4000, free_pages = 260124 (0x0003f81c)
IRQ stack: p0x40812000 v0xc0812000
ABT stack: p0x40813000 v0xc0813000
UND stack: p0x40814000 v0xc0814000
SVC stack: p0x40815000 v0xc0815000
Creating L1 page table at 0x407e4000
Mapping kernel
Constructing L2 page tables
undefined page pmap [ using 740612 bytes of bsd ELF symbol table ]
board type: 4283
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.
Copyright (c) 1995-2016 OpenBSD. All rights reserved. http://www.OpenBSD.org
OpenBSD 6.0-current (GENERIC) #1: Mon Aug 15 19:34:05 BRT 2016
[email protected]:/usr/src/sys/arch/armv7/compile/GENERIC
real mem = 1073741824 (1024MB)
avail mem = 1044480000 (996MB)
mainbus0 at root: Cubietech Cubieboard2
cpu0 at mainbus0: ARM Cortex A7 rev 4 (ARMv7 core)
cpu0: DC enabled IC enabled WB disabled EABT branch prediction enabled
cpu0: 32KB(32b/l,2way) I-cache, 32KB(64b/l,4way) wr-back D-cache
cortex0 at mainbus0
sunxi0 at mainbus0
sxipio0 at sunxi0: 175 pins
sxiccmu0 at sunxi0
gpio0 at sxipio0: 18 pins
gpio1 at sxipio0: 24 pins
gpio2 at sxipio0: 25 pins
gpio3 at sxipio0: 28 pins
gpio4 at sxipio0: 12 pins
gpio5 at sxipio0: 6 pins
gpio6 at sxipio0: 12 pins
gpio7 at sxipio0: 28 pins
gpio8 at sxipio0: 22 pins
agtimer0 at mainbus0: tick rate 24000 KHz
simplebus0 at mainbus0: "soc"
ehci0 at simplebus0
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Allwinner EHCI root hub" rev 2.00/1.00 addr 1
sxiahci0 at simplebus0: AHCI 1.1
sxiahci0: port 0: 3.0Gb/s
scsibus0 at sxiahci0: 32 targets
sd0 at scsibus0 targ 0 lun 0: <ATA, TOSHIBA MK1235GS, PV01> SCSI3 0/direct
fixed naa.50000391d4f841be
sd0: 114473MB, 512 bytes/sector, 234441648 sectors
ehci1 at simplebus0
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 "Allwinner EHCI root hub" rev 2.00/1.00 addr 1
sxidog0 at simplebus0
sxirtc0 at simplebus0
sxiuart0 at simplebus0: console
dwge0 at simplebus0
dwge0: Ethernet address: 02:16:0b:01:94:4c
rlphy0 at dwge0 phy 1: RTL8201L 10/100 PHY, rev. 1
ampintc0 at simplebus0 nirq 160
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
scsibus2 at softraid0: 256 targets
boot device: sd0
root on sd0a (754fcabcf81f9dab.a) swap on sd0b dump on sd0b
WARNING: preposterous time in file system
WARNING: CHECK AND RESET THE DATE!
Automatic boot in progress: starting file system checks.
/dev/sd0a (754fcabcf81f9dab.a): file system is clean; not checking
/dev/sd0l (754fcabcf81f9dab.l): file system is clean; not checking
/dev/sd0d (754fcabcf81f9dab.d): file system is clean; not checking
/dev/sd0f (754fcabcf81f9dab.f): file system is clean; not checking
/dev/sd0g (754fcabcf81f9dab.g): file system is clean; not checking
/dev/sd0h (754fcabcf81f9dab.h): file system is clean; not checking
/dev/sd0k (754fcabcf81f9dab.k): file system is clean; not checking
/dev/sd0j (754fcabcf81f9dab.j): file system is clean; not checking
/dev/sd0e (754fcabcf81f9dab.e): file system is clean; not checking
setting tty flags
pf enabled
starting network
DHCPREQUEST on dwge0 to 255.255.255.255
DHCPACK from 192.168.1.254 (14:cc:20:de:4b:cb)
bound to 192.168.1.140 -- renewal in 43200 seconds.
reordering libraries: done.
starting early daemons: syslogd pflogd ntpd.
starting RPC daemons:.
savecore: no core dump
checking quotas: done.
clearing /tmp
kern.securelevel: 0 -> 1
creating runtime link editor directory cache.
preserving editor files.
starting network daemons: sshd smtpd sndiod.
starting local daemons: cron.
Wed Dec 31 21:13:21 BRT 1969
OpenBSD/armv7 (cb2.lan) (console)
login:
--
db