Age | Commit message (Collapse) | Author |
|
This diff exposes parts of clock_gettime(2) and gettimeofday(2) to
userland via libc eliberating processes from the need for a context
switch everytime they want to count the passage of time.
If a timecounter clock can be exposed to userland than it needs to set
its tc_user member to a non-zero value. Tested with one or multiple
counters per architecture.
The timing data is shared through a pointer found in the new ELF
auxiliary vector AUX_openbsd_timekeep containing timehands information
that is frequently updated by the kernel.
Timing differences between the last kernel update and the current time
are adjusted in userland by the tc_get_timecount() function inside the
MD usertc.c file.
This permits a much more responsive environment, quite visible in
browsers, office programs and gaming (apparently one is are able to fly
in Minecraft now).
Tested by robert@, sthen@, naddy@, kmos@, phessler@, and many others!
OK from at least kettenis@, cheloha@, naddy@, sthen@
|
|
intr_barrier() now uses the argument so directly call sched_barrier(NULL)
which is what intr_barrier(NULL) used to do until recently.
From Todd Carson on bugs@
ok dlg@
|
|
|
|
immediately before initializing the only field in the struct.
|
|
As a result remove unneeded variable
OK kn@, millert@
|
|
time_second(9) and time_uptime(9) are widely used in the kernel to
quickly get the system UTC or system uptime as a time_t. However,
time_t is 64-bit everywhere, so it is not generally safe to use them
on 32-bit platforms: you have a split-read problem if your hardware
cannot perform atomic 64-bit reads.
This patch replaces time_second(9) with gettime(9), a safer successor
interface, throughout the kernel. Similarly, time_uptime(9) is replaced
with getuptime(9).
There is a performance cost on 32-bit platforms in exchange for
eliminating the split-read problem: instead of two register reads you
now have a lockless read loop to pull the values from the timehands.
This is really not *too* bad in the grand scheme of things, but
compared to what we were doing before it is several times slower.
There is no performance cost on 64-bit (__LP64__) platforms.
With input from visa@, dlg@, and tedu@.
Several bugs squashed by visa@.
ok kettenis@
|
|
aassigned to adapter_buswidth to indicate the adapter is not a target
on the bus.
ok dlg@ as part of a larger diff.
|
|
indicate the adapter is not a target on the bus.
ok dlg@ as part of a larger diff.
|
|
set/trust the scsiconf.c probing limits. Same as was done to
vioblk(4).
ok dlg@
|
|
this is a step toward deprecating softclock based livelock detection.
|
|
tweak adapter_target and adapter_buswidth values to provide desired
semantic of providing only target 0/lun 0 device per vioblk(4) device.
Tested by sf@
|
|
conversion steps). it only contains kernel prototypes for 4 interfaces,
all of which legitimately belong in sys/systm.h, which are already included
by all enqueue_randomness() users.
|
|
ESXi doesn't carry the guest info over when a guest gets moved to a
different host, and this appears to be the only hint the guest gets
that this has happened.
ok dlg@
|
|
as (64 * 1024). Reduce confusion by using
MAXPHYS (a.k.a. (64 * 1024)) as other drivers
do.
|
|
Upon a failed task_add, the adjusted reference counter needs
to be decremented.
xen_intr_schedule should follow the same logic as xen_intr.
Tested by Niklas Hallqvist. Ok mpi@
|
|
scsi drivers. i.e. eliminate the struct scsi_adapter member in the
softc and rely on the pointer to a static scsi_adapter in the struct
scsi_link member.
|
|
'minphys()'. Just use & check for NULL instead, since 'minphys()' is
always called on the code path ([cd|sd|st]minphys) that calls
physio().
|
|
inducing. Rename scsi_adapter member 'scsi_minphys' to 'dev_minphys'
to reflect what it is supposed to do. Use consistent naming convention
(<dev>_minphys) for the actual device functions.
No functional change.
|
|
ok tedu@ krw@ deraadt@
|
|
in drivers. Terse one liners, NULLs instead of 0's, explicitly specify
all members, etc.
Nuke #ifdef notyet blocks related to the scsi_adapter in aic.
No intentional functional change.
ok tedu@
|
|
|
|
|
|
ok kn@
|
|
|
|
There is an existing allocsize variable tracking size of allocations,
turns out we can pass it to free in the error path.
OK florian@, mpi@
|
|
Attaches pvclock with lower priority (500) in case of unstable tsc
(PVCLOCK_FLAG_TSC_STABLE) instead of not attaching at all. In this state, we do
make sure to return a monotonically increasing number.
This mostly helps openbsd guests on openbsd vmm(4) where a pvclock with unstable
tsc is still better than i8254.
ok mlarkin@
|
|
xen_intr_unmask_release was not decrementing the reference counter
on the interrupt source structure when bailing out early which led
to the refcnt overflow.
From niklas, ok mlarkin
|
|
|
|
Tested by Andre Stoebe and Remi Locherer.
ok deraadt, tb
|
|
now unneeded version_to_spc() mapping array, a duplicate #define
and a couple of magic numbers. Toss in some comments for future
generations of spelunkers.
Makes it possible to check for specific SPC versions when new
features or eliminated features require such a check.
No intentional functional change.
|
|
SPC version. Use raw data in version field to check the SPC level
until SCSISPC() is straightened out. Actually a bit clearer to read as
the raw data is what is manipulated in adjacent code.
|
|
to start the rx tick did not work since we use if_rxr_get(). An
easy fix is to start the rx timeout every second unconditionally.
OK dlg@
|
|
virtio 1.0 for virtio_mmio it not yet implemented, but 0.9 devices
continue to work.
|
|
Add a sc_driver_features field that is automatically used by
virtio_negotiate_features() and during reinit.
Make virtio_negotiate_features() return an error code. Virtio 1.0 has a
special status bit for feature negotiation that means that negotiation
can fail. Make virtio_negotiate_features() return an error code instead
of the features.
Make virtio_reinit_start() automatically call
virtio_negotiate_features().
Add a convenience function virtio_has_feature() to make checking bits
easier.
Add an error check in viomb for virtio_negotiate_features because it has
some feature bits that may cause negotiation to fail. More error
checking in the child drivers is still missing.
ok mlarkin@
|
|
Emulate kvm pvclock in vmm(4). Compatible with pvclock(4) in OpenBSD. Linux
does not attach to this (yet).
Fixes by reyk@ and tested extensively by reyk@, tb@ and phessler@
ok mlarkin@ phessler@ reyk@
|
|
|
|
Reported by Gary Zibrat
|
|
ok mlarkin@
|
|
virtio 1.0 supports an arbitrary number of feature bits. However, so far
no more than 64 are used (compared to 32 in virtio 0.9). Adjust data
types to support 64 feature bits.
Later, we may want to use bitmaps and setbit(), ... to support even more
feature bits.
ok mlarkin@
|
|
Make it take an address instead of a PFN.
Pass the virtqueue pointer. In virtio 1.0, more information has to be
configured in the device. Also call virtio_setup_queue() after the
information has been filled in.
ok mlarkin@
|
|
|
|
VIRTIO_F_RING_INDIRECT_DESC is always negotiated by the transport
driver, no need to specify it explicitly.
VIRTIO_BALLOON_F_MUST_TELL_HOST is not offered but is handled in the
code. Offer it during negotiation, too.
|
|
It accidentally contained a part of a different diff.
|
|
Also add some virtio 1.0 status and feature bits
|
|
|
|
And fix some comments
|
|
|
|
They are only used if VIRTIO_DEBUG is enabled.
This should make the kernel slightly smaller.
|
|
I falsely assumed that the KVM_FEATURE_CLOCKSOURCE_STABLE_BIT
indicates that the actual clock values are stable, but it turned out
that this isn't always the case. To detect if the clock value is
stable, we now read it once in pvclock_attach() and check for the
PVCLOCK_FLAG_TSC_STABLE flag. This needs further investigation.
Reported and fix tested by johnw.mail at gmail.com
OK chris@ phessler@
|
|
tested by brynet@
OK reyk@
|