Age | Commit message (Collapse) | Author |
|
In order to separate the statclock from the clock interrupt subsystem
we need to move all statclock state out into the broader kernel.
Start by replacing the CL_RNDSTAT flag with a new global variable,
"statclock_is_randomized", in kern_clock.c. Update all clockintr_init()
callers to set the boolean instead of passing the flag.
Thread: https://marc.info/?l=openbsd-tech&m=169428749720476&w=2
|
|
interrupts. This makes MSI/MSI-X work on platforms like the Ampere Altra
which have an ITS instance for each PCI domain.
also tested by cheloha@
ok kettenis@ patrick@
|
|
the right ITS to use when establishing interrupts.
ok kettenis@ patrick@
|
|
ok kettenis@ patrick@
|
|
ok jsg
|
|
avoids a General-Protection Exception on patch loader wrmsr with
A10-5700, TN-A1 00610f01 15-10-01
the alignment requirement is not present on at least
Ryzen 5 2600X, PiR-B2 00800f82 17-08-02
problem reported and fix tested by espie@
|
|
7.3 is long gone, you must have new bootloaders and new kernels.
Zaps both condition and else block, unindent and merge lines where fit.
Feedback OK kettenis
Tests OK denis
|
|
generates a (spurious) error about it in certain contexts. This is fixed
in later versions (see https://reviews.llvm.org/D156351) but it is easier
to just drop the option.
ok miod@, jsg@
|
|
To remove an ioctl(2) from the vcpu thread hotpath in vmd(8), add
a flag in the vm_run_params structure to indicate if there's another
interrupt pending. This reduces latency in vcpu work related to
i/o as we save a trip into the kernel just to flip the interrupt
pending flag on or off.
Tested by phessler@, mbuhl@, stsp@, and Mischa Peters.
ok mlarkin@
|
|
no longer needed with zlib 1.3
ok tb@
|
|
dv points out that there are other bits there that imply the existence
of other MSRs, so switching this to an include list is a better idea.
|
|
The driver will work with both formats for now but we plan to remove
the old one in the future.
ok kettenis@
|
|
On newer Ryzen/EPYC, we need to hide the HwPstate CPUID 80000007:EDX
field for HwPstate, or guests will try to access the MSRs associated
with those, and that will fail with #GP.
ok deraadt
|
|
1. in pmap_enter() no need to call tlb_flush_page() if we don't actually
insert a pted
2. all callers of pmap_pte_remove() already call tlb_flush_page()
This seems to result in some performance improvement (18mn -> 17mn15)
while building libc on a Hifive Unmatched). Also zap whitespace and
useless comments to further reduce the diff with arm64/pmap.c
ok kettenis@
|
|
As noted by drahn@ the compiler did inline said functions, but it also
provided them as unused symbols.
ok miod@ mlarkin@ kettenis@
|
|
This brings riscv64/pmap.c in line with arm64/pmap.c, original fix by
drahn@
ok miod@ kettenis@ mlarkin@
|
|
ok jsing@
|
|
preliminary bindings will be removed in a couple of weeks.
ok kevlo@, jsing@, jmatthew@
|
|
as argument to the tuagg_locked function.
- Remove incorrect use of p_rtime in other parts of the tree. p_rtime was
almost always 0 so including it in any sum did not alter the result.
- In main() the update of time can be further simplified since at that time
only the primary cpu is running.
- Add missing nanouptime() call in cpu_hatch() for hppa
- Rename tuagg_unlocked to tuagg_locked like it is done in the rest of
the tree.
OK cheloha@ dlg@
|
|
|
|
Make glxclk(4) functional again. The MFGPT provides the CPU core
an external clock interrupt. This interrupt enables a later change
that reduces energy usage when the system is idle. Also, the use
of the external clock fixes timekeeping when the core clock
frequency is adjusted.
|
|
To give the primary CPU an opportunity to perform clock interrupt
preparation in a machine-independent manner we need to separate the
"initialization" parts of cpu_initclocks() from the "start the clock
interrupt" parts. Currently, cpu_initclocks() does everything all at
once, so there is no space for this MI setup.
Many platforms have more-or-less already done this separation by
implementing a separate routine named "cpu_startclock()". This patch
promotes cpu_startclock() from de facto standard to mandatory API.
- Prototype cpu_startclock() in sys/systm.h alongside cpu_initclocks().
The separation of responsibility between the two routines is a bit
fuzzy but the basic guidelines are as follows:
+ cpu_initclocks() must initialize hz, stathz, and profhz, and call
clockintr_init().
+ cpu_startclock() must call clockintr_cpu_init() and start the clock
interrupt cycle on the calling CPU.
These guidelines will shift in the future, but that's the way things
stand as of *this* commit.
- In initclocks(): first call cpu_initclocks(), then do MI setup, and
last call cpu_startclock().
- On platforms where cpu_startclock() already exists: don't call
cpu_startclock() from cpu_initclocks() anymore.
- On platforms where cpu_startclock() doesn't yet exist: implement it.
Usually this is as simple as dividing cpu_initclocks() in two.
Tested on amd64 (i8254, lapic), arm64, i386 (i8254, lapic), macppc,
mips64/octeon, and sparc64. Tested on arm/armv7 (agtimer(4)) by
phessler@ and jmatthew@. Tested on m88k/luna88k by aoyama@. Tested
on powerpc64 by gkoehler@ and mlarkin@. Tested on riscv64 by
jmatthew@.
Thread: https://marc.info/?l=openbsd-tech&m=169195251322149&w=2
|
|
Setting IPL_MPSAFE for the i8254/mc146818 IRQs appeases a KASSERT in
apic_intr_establish() and allows the system to boot via the i8254
path. This makes testing changes to the i8254/mc146818 code much
easier on modern hardware without mucking with the GENERIC config. We
already set IPL_MPSAFE for these IRQs in the equivalent amd64 code.
Now, setting IPL_MPSAFE is a lie: the i8254 and mc146818 IRQs are not
MP-safe. However, the lie is harmless because we only reach
i8254_initclocks() if (a) there is no APIC at all, or (b) we fail to
calibrate the local APIC timer.
Thread: https://marc.info/?l=openbsd-tech&m=169258915227321&w=2
ok mlarkin@
|
|
|
|
alpha is the only platform still running an independent schedclock().
Disabling it brings alpha's scheduling behavior into line with that of
every other platform.
With this patch, all platforms call schedclock() from statclock() at
an effective schedhz of ~12.5.
|
|
with no-op macros.
ok gkoehler@
|
|
If the core failed to start (because opal_start_cpu didn't return
OPAL_SUCCESS), or failed to identify, then don't use the core.
Eduardo Pires told ppc@ in April 2023 about a machine that froze at
boot; cpu1 had failed to start with error -14 OPAL_WRONG_STATE. See
https://marc.info/?l=openbsd-ppc&m=168106893329069&w=2
ok miod@
|
|
the pentium msr list in the sdm does not include it
|
|
Paul de Weerd reported it isn't implemented on ALIX with
cpu0: Geode(TM) Integrated Processor by AMD PCS ("AuthenticAMD" 586-class) 499 MHz, 05-0a-02
the earliest amd microcode update files I can find are for family 0fh (K8)
ok guenther@
|
|
mentioned in
https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/technical-documentation/gather-data-sampling.html
|
|
sthen mentioned it is out of space. ok deraadt@
|
|
|
|
unknown option character.
|
|
|
|
|
|
For consistency with other delay(9) implementations, agtimer(4/arm64)
ought to call CPU_BUSY_CYCLE() as it spins.
kettenis@ notes that we could reduce the power consumed in
agtimer_delay() by enabling CNTKCTL_EL1.EVNTEN and configuring
ENTKCTL_EL1.EVNTI.
kettenis@ also notes that Armv8.7 adds FEAT_WFxT, which will, when the
feature appears in real hardware, make it even easier to save power in
agtimer_delay().
With input from drahn@ and kettenis@.
Thread: https://marc.info/?l=openbsd-tech&m=169146193022516&w=2
ok kettenis@
|
|
Converting from microseconds to timer cycles is much simpler with
64-bit arithmetic.
Thread: https://marc.info/?l=openbsd-tech&m=169146193022516&w=2
ok drahn@ kettenis@
|
|
immediately if there is a pending interrupt to fix a potential race
in the idle loop.
ok guenther@
|
|
But other machines that use the same SoC work just fine. So instead of
disabling this feature on all CPUs that implement the architectured
algorithm, add an SMBIOS-based check that just disables the feature on
these machines. This means we need to attach smbios0 before cpu0, which
in turn means attaching efi0 earlier.
tested by patrick@
|
|
|
|
ok guenther@ deraadt@
|
|
reuse the prom mapping here is a bad idea because we alter its writeability
and the prom will not always expect this.
Repairs powerdown on Tapdole Ultrabook IIe.
discussed with and ok kettenis@
|
|
away the calls
ok jca@
|
|
away the calls
ok jca@
|
|
WSDISPLAYIO_GETSUPPORTEDDEPTH ioctl.
This is needed to use recent updated wsfb(4) driver in 8bpp mode.
We can use 1bpp X server on 8bpp framebuffer by 'startx -- -depth 1'.
Tested by me.
|
|
are 64-bit loads and stores and may hit aligned-to-32-bits-but-not-64-bits
addresses.
|
|
ok jsing@
|
|
OK guenther@
|
|
from jon at elytron dot openbsd dot amsterdam
feedback and ok miod@
|
|
or IBT enabled the kernel, the hardware should the attacks which
retpolines were created to prevent. In those cases, retpolines
should be a net negative for security as they are an indirect branch
gadget. They're also slower.
* use -mretpoline-external-thunk to give us control of the code
used for indirect branches
* default to using a retpoline as before, but marks it and the
other ASM kernel retpolines for code patching
* if the CPU has eIBRS, then enable it
* if the CPU has eIBRS *or* IBT, then codepatch the three different
retpolines to just indirect jumps
make clean && make config required after this
ok kettenis@
|