summaryrefslogtreecommitdiff
path: root/sys/arch/loongson
AgeCommit message (Collapse)Author
2018-10-31Bring over gapdummy.c changes from amd64/amr64/armv7/i386.Mark Kettenis
ok deraadt@, mortimer@, visa@
2018-09-26Fix controller name.Visa Hankala
2018-09-14add gapdummy.c to the "clean" target like other generated filesChristian Weisgerber
ok visa@ jsg@ phessler@
2018-08-22Enable uscom(4) where uslcom(4) is already present.Martin Pieuchot
Based on a submisison from Jan Klemkow.
2018-08-20Remove unused spllock().Visa Hankala
OK deraadt@ mpi@
2018-06-21Save and restore retguard area during hibernate unpack. This copies theMike Larkin
original retguard data to the piglet and bcopys it back in place immediately before resuming via the ACPI Sx trampoline. ok deraadt, guenther, tested by many.
2018-06-03Enable bwfm(4) for USB devices on RAMDISK as well.Frederic Cambus
Requested by visa@.
2018-05-31Enable bwfm(4) on Loongson for USB devices.Frederic Cambus
Tested on a Lemote Yeeloong 8101B. OK visa@
2018-04-24Enable em(4) on loongson.Visa Hankala
2018-04-20Add a workaround that lets loongson bootblocks work with PMON thatVisa Hankala
uses the O32 calling convention. Such firmware comes at least on some Loongson 3A development boards. This differs from the LS2F-based machines made by Lemote whose PMON uses the GCC O64 calling convention.
2018-04-20Make loongson bootblocks use disklabel duid instead of PMON device nameVisa Hankala
when indicating the boot device to the kernel. This should reduce ambiguity in root device selection.
2018-02-24Declare ci_ipl volatile to prevent the compiler from optimizingVisa Hankala
or reordering accesses to the variable. Assume that the assembler preserves the correct sequence of instructions, which allows the removal of the explicit noreorder/reorder toggles from the C code. With ci_ipl being volatile, drop mips_sync() calls that follow the accesses of the variable. The sync is redundant as a compiler barrier. In addition, the MIPS64 CPU designs should not need the sync for pipeline or write buffer control. According to miod@, the use of the instruction is a carryover from code targeting early MIPS designs that lack tight integration with the cache and write buffer. Discussed with and testing help from miod@. Tested on CN5020, CN6120, CN7130, CN7360, Loongson 2F and 3A1000, R4400, R8000, R10000 and R16000.
2018-02-09Check for the existence of /bsd before trying to back it up to /obsd.Theo Buehler
Fixes 'make install' when /bsd is not present for some reason. ok rob florian, "fine with me" deraadt
2018-01-27Sync the nam2blk entries with the bdevsw table, which is theChristian Weisgerber
definitive list of block devices supported on an architecture. ok kettenis@ deraadt@
2018-01-23Always lock the kernel lock with non-MP-safe interrupt handlers.Visa Hankala
Suggested by kettenis@
2018-01-22Include <sys/mutex.h> instead of <machine/mutex.h>Martin Pieuchot
required by upcoming MI mutex change.
2018-01-11Add size for free.Visa Hankala
OK mpi@
2017-12-30Delete unnecessary <sys/file.h> includesPhilip Guenther
ok millert@ krw@
2017-12-11In uvm Chuck decided backing store would not be allocated proactivelyTheo de Raadt
for blocks re-fetchable from the filesystem. However at reboot time, filesystems are unmounted, and since processes lack backing store they are killed. Since the scheduler is still running, in some cases init is killed... which drops us to ddb [noted by bluhm]. Solution is to convert filesystems to read-only [proposed by kettenis]. The tale follows: sys_reboot() should pass proc * to MD boot() to vfs_shutdown() which completes current IO with vfs_busy VB_WRITE|VB_WAIT, then calls VFS_MOUNT() with MNT_UPDATE | MNT_RDONLY, soon teaching us that *fs_mount() calls a copyin() late... so store the sizes in vfsconflist[] and move the copyin() to sys_mount()... and notice nfs_mount copyin() is size-variant, so kill legacy struct nfs_args3. Next we learn ffs_mount()'s MNT_UPDATE code is sharp and rusty especially wrt softdep, so fix some bugs adn add ~MNT_SOFTDEP to the downgrade. Some vnodes need a little more help, so tie them to &dead_vnops. ffs_mount calling DIOCCACHESYNC is causing a bit of grief still but this issue is seperate and will be dealt with in time. couple hundred reboots by bluhm and myself, advice from guenther and others at the hut
2017-11-04Since rev 1.502 of rc(8) it creates a /bsd.booted hard link. At theFlorian Obser
end of rc we call reorder_kernel which creates a /obsd hard link to the same kernel. In the past obsd was only created when doing a manual make install in the kernel sources. There is no need for two backup hard links during boot, rearange the kernel Makefiles to restore previous behaviour and thus stopping reorder_kernel from scribbling over /obsd. Makes muscle memory of some kernel developers work again: /obsd can serve as a known good kernel; and there was much rejoycing... Discussed at length with benno, rpe, phessler and tb at p2k17. Seems like a good idea to deraadt. OK benno, phessler, rpe, tb
2017-09-28When option DDB_STRUCTINFO was removed from the kernel, too much fromPatrick Wildt
the kernel makefiles was removed which lead to C files not being re- compiled when a dependency changed. This can lead to panics in odd places and generally a broken system. ok deraadt@
2017-09-12Remove option DDB_STRUCTINFO. Now that ddb(4) is CTF aware, similarMartin Pieuchot
functionnalities are available in GENERIC. ok jasper@, deraadt@, guenther@, dlg@
2017-08-28swap ualea for urngJasper Lievisse Adriaanse
2017-08-26Use macros for Config1 bits.Visa Hankala
2017-08-12Use ctfstrip(1) by default to strip kernels.Martin Pieuchot
ok deraadt@, jasper@
2017-08-12Add a dummy (for now) <machine/reloc.h> for mips64 to fix build.Visa Hankala
OK guenther@
2017-07-30Define MAXCPUS per mips64 port.Visa Hankala
2017-07-18Stop automatically regenerating gap.o (and hence linking a new kernel)Theo Buehler
whenever make is issued. Only do this when there are actual source changes below /sys. This restores the behavior prior to the KARL implementation. Problem noticed and patiently explained by mpi implementation with a lot of help from espie ok mpi, espie, deraadt
2017-07-16Pass the linker from make environment to makegap.sh. This is (only)Visa Hankala
a partial solution to cross compiling the kernel with KARL. OK deraadt@ a while ago
2017-07-12remove CPU_LIDSUSPEND/machdep.lidsuspendMartin Natano
"fire away!" tedu
2017-06-29put SYSTEM_SWAP_DEP out of its misery, it died in 1997, along with config.oldMarc Espie
"go for it" deraadt@
2017-06-25dull dependency for copying makegap.sh to obj, so that installsTheo de Raadt
without src and comp work. That is what we've designed for, but since we always have src and comp on our systems it is so easy to slide... problem first noted by rpe.
2017-06-22Generate a gap.link script, and use that to generate gap.o. On multi-ABITheo de Raadt
architectures we must also link against a gapdummy.o to repair the ABI of the resulting .o file. Woe is me. Also repair install: target to update the linkkit & hash when a kernel is installed. ok rpe tb mlarkin and tested by others also
2017-06-13newbsd: target which re-links a kernel. We cannot use the bsd: targetTheo de Raadt
since it has source dependencies, and relinking doesn't have any. Also the bsd: target is created by config(8)... worked on with rpe.
2017-06-11make vers.o not depend on gap.o using a trick, because it is piece ofTheo de Raadt
fiction participating only in the linkphase. tricks from rpe and espie
2017-06-11Use umask 077 instead of cp -p when installing the kernel as root.Alexander Bluhm
Otherwise owner of /bsd could be the build user with permissions inherited from the compile directory. OK deraadt@ tb@
2017-06-11Define register_splx_handler() in one place.Visa Hankala
2017-06-08Move loongson/octeon/sgi unmap_startup() under arch/mips64.Visa Hankala
2017-06-08Split early startup code out of locore.S into locore0.S. Adjust linkVisa Hankala
run so that this locore0.o is always at the start of the executable. But randomize the link order of all other .o files in the kernel, so that their exec/rodata/data/bss segments land all over the place. Late during kernel boot, smash the startup code with traps so that it does not point to the other randomly placed code. It has be smashed, because loongson runs in the kseg0 space. As a result, the internal layout of every newly build bsd kernel is different from past kernels. Internal relative offsets are not known to an outside attacker. Ramdisk kernels cannot be compiled like this, because they are gzip'd. When the internal pointer references change, the compression dictionary bloats and results in poorer compression.
2017-06-05The arm* architectures edit the ld.script, creating a copy in the compileTheo de Raadt
directories. Copy it in the same way on other architectures, for the same effect. Something upcoming will want that file there anyways.
2017-06-03Create gap.S and gap.o with umask 077. Create lorder and bsd* with umask 007.Theo de Raadt
Prying eyes cannot look at the kernels in the compile directory. ok tb rpe, kernel developers seem unimpacted
2017-05-23Rate limit messages about spurious ISA interrupts on yeeloong systems.Visa Hankala
On suspend, the USB driver is put to polling mode and it no longer claims interrupt requests. If the USB controller keeps raising new requests faster than spurious interrupt messages can be printed, interrupt processing hogs all CPU time and the suspend code gets stuck. The rate limiting should prevent this from happening. Suspend issue with USB Wi-Fi reported by fcambus@ Fix tested by and OK fcambus@
2017-05-21Tweak style.Visa Hankala
2017-05-21Enable radeondrm(4) on loongson to get accelerated graphicsVisa Hankala
with the RS780E chipset. OK kettenis@, jsg@
2017-05-17Make IPL_MPSAFE effective on loongson.Visa Hankala
Testing help from fcambus@
2017-05-10Hook up HPET as a timecounter.Visa Hankala
2017-05-10Add a PCI attach hook mechanism for htb(4), similar to the oneVisa Hankala
in bonito(4). Use the hook for setting up the PIC. Discussed with miod@ long ago
2017-05-09Whitelist SMBus IO addresses to let the driver, piixpm(4), work again.Visa Hankala
2017-05-09Fix range check.Visa Hankala
2017-05-08add a BUS_DMA_64BIT flag to bus_dma on all our archs.David Gwynne
this is so drivers can advertise that they can handle 64 dma addresses to the platform. it may choose to handle dmamaps differently based on this flag. tweaks and ok tom@ ok kettenis@