Commit graph

1639 commits

Author SHA1 Message Date
aiju 6f30420136 add dtracy support to mkdevc and enable dtracy with plan9.ini 2018-12-11 07:44:34 +00:00
aiju ca851bbb5e dtracy: call dtptrigger with a struct pointer rather than a list of arguments; put return value in arg9 2018-12-09 21:43:22 +00:00
aiju 58fa29447b dtracy: add support for aggregations 2018-12-08 15:07:53 +00:00
cinap_lenrek 6891093034 kernel: remove unused static variable "sofar" from timerintr() (thanks mischief) 2018-12-05 03:59:08 +01:00
cinap_lenrek d15aca0532 kernel: fix tprof on multiprocessor
segclock() has to be called from hzclock(), otherwise
only processes running on cpu0 would catche the interrupt
and the time delta would be wrong.

lock the segment when allocating Seg->profile as
profile ctl might be issued from multiple processes.
Proc->debug qlock is not sufficient.

Seg->profile can never be freed or reallocated once
set as the timer interrupt accesses it without any
locking.
2018-12-05 01:43:19 +01:00
cinap_lenrek c5393d612f bootrc: remove $ff references (was old parsed /boot/boot argument list) 2018-12-04 18:55:56 +01:00
cinap_lenrek 099da8cb82 devip: fix arpread, dont return partial entries 2018-11-28 12:41:18 +01:00
cinap_lenrek 4dee686ca5 pc, pc64: park application processors in rebootcode with mmu off
instead of having application processors spin in mpshutdown()
with mmu on, and be subject to reboot() overriding kernel text
and modifying page tables, park the application processors in
rebootcode idle loop with the mmu off.
2018-11-19 18:42:01 +01:00
cinap_lenrek 196da4ec6f devip: fix swapped tcp snd.scale and recv.scale in tcpstate() format (thanks joe9) 2018-11-18 04:14:41 +01:00
mischief a25418fddc devbridge: fix runt packets going through the bridge (thanks cinap)
linux will send small, unpadded arp packets which may arrive over
wifi, so allow small packets into the bridge and pad any packets that
are too small when going out.
2018-11-17 17:23:56 -08:00
mischief 744867de34 ether82563: ignore i82753 checksums, fixes T60 ethernet 2018-11-14 11:33:52 -08:00
aiju e6d99771e5 adding dtracy (crude early version) 2018-11-10 13:46:16 +00:00
cinap_lenrek 85afec4c2f bcm: intrenable() can happen from any cpu in case of dma interrupts 2018-11-08 20:26:32 +01:00
cinap_lenrek c0d21d35b1 bcm: cleanup timer code
- calculate hardcoded constants for more clarity
- avoid unneccesary modification of cntpns ctl register
- revert enabling IRQcntpns for cpu0
- remove unused Localintpending register offset constant
2018-11-07 17:02:09 +01:00
cinap_lenrek 385f52183c bcm: simplify irq handling by having per cpu Vctl chain 2018-11-07 16:49:50 +01:00
cinap_lenrek b0d226705c bcm: speed up co-processor operations by avoiding i+d cache flush on each operation
coproc.c generated the instrucitons anew each time,
requiering a i+d cache flush for each operation.

instead, we can speed this up like this:

given that the coprocessor registers are per cpu, we can
assume that interrupts have already been disabled by
the caller to prevent a process switch to another cpu.

we cache the instructions generated in a static append
only buffer and maintain separate end pointers for each
cpu.

the cache flushes only need to be done when new
operations have been added to the buffer.
2018-11-07 16:48:14 +01:00
aiju 0bd213b7b0 devvmx: remove bogus . direntry 2018-11-04 16:03:35 +00:00
cinap_lenrek 89c659d80b bcm: fix mysterious core clock resets under SMP (thanks richard miller)
reference: https://github.com/raspberrypi/firmware/issues/542

procsave(Proc* p)
{
	uvlong t;

	cycles(&t);
	p->pcycles += t;

// TODO: save and restore VFPv3 FP state once 5[cal] know the new registers.
	fpuprocsave(p);
	/*
	 * Prevent the following scenario:
	 *	pX sleeps on cpuA, leaving its page tables in mmul1
	 *	pX wakes up on cpuB, and exits, freeing its page tables
	 *  pY on cpuB allocates a freed page table page and overwrites with data
	 *  cpuA takes an interrupt, and is now running with bad page tables
	 * In theory this shouldn't hurt because only user address space tables
	 * are affected, and mmuswitch will clear mmul1 before a user process is
	 * dispatched.  But empirically it correlates with weird problems, eg
	 * resetting of the core clock at 0x4000001C which confuses local timers.
	 */
	if(conf.nmach > 1)
		mmuswitch(nil);
}
2018-11-04 16:00:32 +01:00
cinap_lenrek dd82b657c0 bcm: fix mistake in mkfile 2018-11-01 01:07:51 +01:00
cinap_lenrek 5608be398e bcm: fix /dev/reboot text/data corruption (thanks richard miller)
- clean dcache before turning off caches and mmu (rebootcode.s)
- use WFE and inter-core mailboxes for cpu startup (rebootcode.s)
- disable SMP during dcache invalidation before enabling caches and mmu (in armv7.s)
2018-10-31 19:48:16 +01:00
cinap_lenrek 8e9d2434e9 bcm: provide /dev/cputemp in a format stats can understand 2018-10-28 07:10:27 +01:00
cinap_lenrek b715c39bfa bcm: simplify reboot code
- synchronize rebootcode installation
- handle the 1MB identity map in mmu.c (mmuinit1())
- do not overlap CONFADDR with rebootcode, the non boot
  processors are parked there.
- make REBOOTADDR physical address
2018-10-28 06:16:10 +01:00
cinap_lenrek 0fc2adb43d bcm: cleanup clock code
- disable local clock on interrupt to prevent accidents when reenabling
- always regitster local clock interrupt handler, even for cpu0
- simplify microdelay()
- don't mess with watchdog
2018-10-28 06:09:05 +01:00
cinap_lenrek f17a5cc2cf bcm: fix l2 cache maintenance routines for raspi3 (armv8)
armv8 has 16-way l2, so adjust shift for the set-way cache
tag format.
2018-10-28 06:05:43 +01:00
cinap_lenrek 2ee4c08974 devuart: don't sleep in uartdrainoutput() when called splhi or without a process
uartdrainoutput() might be called in early initialization
from uartctl() without a process.
2018-10-27 20:00:12 +02:00
23hiro 05021e0579 add Centrino Wireless-N 1030 (thanks lksmk from brazil) 2018-10-25 08:09:10 +02:00
cinap_lenrek 83e20b4df1 bcm: import changes for raspi2/3 from richard miller 2018-10-20 19:56:31 +02:00
cinap_lenrek 796e5e6000 nusbrc: support for raspi3 ethernet 2018-10-20 19:53:57 +02:00
cinap_lenrek 37dcb25eee kernel: fix allocb for BLOCKALIGN*2 >= Hdrspc 2018-10-20 19:52:54 +02:00
cinap_lenrek c4ec69045e devusb: use Enotconf[] string constant 2018-10-20 19:41:37 +02:00
mischief 8eecdc9664 etheriwl: support type 2000 devices and the 2200 chip in x230t 2018-10-10 16:37:13 -07:00
mischief 67e14807e9 nusbrc: prevent nusb/kb from attaching to sony ps3 controller 2018-10-10 13:49:03 -07:00
cinap_lenrek 679a253931 usbxhci: only clear RW1C bits when set. 2018-10-08 07:10:59 +02:00
cinap_lenrek 2fecc5789e usbxhci: delay after reset, preserve reserved bits in legacy status control register in handoff()
when clering smi enable bits in the legacy control/status register,
preserve the reserved bits. clear the RW1C bits.

linux code claims intel xhci controller needs a 1ms delay before
accessing any register after reset.
2018-10-08 07:05:28 +02:00
cinap_lenrek c458216121 pc drivers: more pci cleanup 2018-10-07 23:38:41 +02:00
cinap_lenrek 9fec0e7360 pc drivers: use pcienable() to handle device power up and missing initialization 2018-10-07 22:28:21 +02:00
cinap_lenrek 4d7c195804 pc, pc64: add pcienable() and pcidisable() functions
pcienable() puts a device in fully powered on state
and does some missing initialization that UEFI might
have skipped such as I/O and Memory requests being
disabled.

pcidisable() is ment to shutdown the device, but
currently just disables dma to prevent accidents.
2018-10-07 21:52:53 +02:00
cinap_lenrek f9839ed0a2 usbehci, usbxhci: add *noehcihandoff= and *noxhcihandoff= parameters
on Samsung ATIV Smart PC Pro XE00T1C-A01CL, the EHCI handoff
causes the system to freeze in UEFI mode as soon as we assert
the os semaphore bit.

until a general solution is found, provide these parameters to
disable the handoff for now as it seems to otherwise work fine.
2018-10-06 00:29:05 +02:00
cinap_lenrek 83876083c9 pc, pc64: increase CONFADDR buffer from 4K to 24K
move APBOOTSTRAP and TMPADDR to make space available for
boot parameters. which can become quite long such as *e820.
2018-10-06 00:26:07 +02:00
cinap_lenrek b56450471f devip: remove unused QLock from udp and icmpv6 control blocks (thanks brho) 2018-10-03 00:47:34 +02:00
cinap_lenrek 02b867f01e devip: only add interface route for "on-link" prefixes
when a prefix is added with the onlink flag clear, packets
towards that prefix needs to be send to the default gateway
so we omit adding the interface route.

when the on-link flag gets changed to 1 later, we add the
interface route.

the on-link flag is sticky, so theres no way to clear it back
to zero except removing and re-adding the prefix.
2018-09-28 18:13:01 +02:00
cinap_lenrek 94333ce6a6 devip, ipconfig: avoid overflow on lifetime checks 2018-09-23 22:07:56 +02:00
cinap_lenrek 70c6bd0397 devip: valid and prefered life-time should be unsigned, add remove6 ctl command 2018-09-23 19:09:48 +02:00
cinap_lenrek 4a92a8f6b2 devip: fix default parameter calculation for router life-time
router life time is in seconds, while max ra interval is
in milliseconds!
2018-09-23 19:08:16 +02:00
cinap_lenrek 259ce5e3de devip: make updating ra6 router parameters atomic
when we fail to parse and validate the command, no update
should take place.
2018-09-23 17:24:59 +02:00
cinap_lenrek 6b9cc409de mtx, ppc: remove cistrcmp() and cistrncmp() redefinition 2018-09-18 19:34:29 +02:00
cinap_lenrek bd49212b46 kernel: fix livelock in rebalance (thanks Richard Miller)
Once a second rebalance() is called on cpu0 to adjust priorities,
so cpu-bound processes won't lock others out.  However it was only
adjusting processes which were running on cpu0.  This was observed
to lead to livelock, eg when a higher-priority process spin-waits
for a lock held by a lower priority one.
2018-09-18 00:53:05 +02:00
cinap_lenrek 2985d53b7a bootrc: add experimental reboot method to load another kernel
syntax: reboot!bootfile[!method...]

this echos bootfile to /dev/reboot, causing bootfile kernel
to be started.

when method is given, we first connect to the filesystem and
set bootargs so that bootfile can be loaded from the target
network or local fileserver.

note, when no bootfile is given, this causes the kernel to
reboot to bios.
2018-09-16 22:35:16 +02:00
mischief 5ea7337ae7 port: sync two longjmp fixes from drawterm
see drawterm commits f5e26ae93a6a and fa388286b4ca
2018-09-12 00:35:45 -07:00
cinap_lenrek b591ee195b devarch: reading msr 0xffffffff 2018-09-09 01:53:53 +02:00