| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
To be consistent with that of the others.
No functional change.
Sponsored by: The FreeBSD Foundation
|
| |
|
|
|
|
|
|
|
| |
Set controls to maximum performance to avoid regressions now that CPPC
is activated by default and to match what the P-state support does.
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55253
|
| |
|
|
|
|
|
|
|
| |
If that MSR cannot be read, we fallback to defaults specified by the
ACPI specification, as we are already doing when the minimum and maximum
values in there look bogus.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55252
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If writing to the CPPC_REQUEST MSR fails, make sure we do not set the
softc's 'cppc.request' field to the intended new value. Both
set_cppc_request_cb() and enable_cppc_cb() were changed to this effect.
In case enable_cppc_cb() could not read CPPC_REQUEST, mark that through
a new softc flag, HWPFL_CPPC_REQUEST_NOT_READ, so that we do not keep
and use a wrong value when the content of CPPC_REQUEST is read/written
through sysctl(9) knobs, but instead retry reading the MSR (this is the
purpose of the new get_cppc_request() sub-function).
When setting CPPC_REQUEST has failed, distinguish the case where it
could not be read at all from the case where it could not be written, by
respectively returning EIO and EOPNOTSUPP in these cases. The previous
return value of EFAULT was confusing as sysctl(3) documents it as
happening if the passed arguments are invalid.
While here, add some herald comment before sysctl_cppc_dump_handler()
clarifying that the intent of this function is to always query the
hardware directly, bypassing any cached value in the softc.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55251
|
| |
|
|
|
|
| |
No functional change (intended).
Sponsored by: The FreeBSD Foundation
|
| |
|
|
|
|
|
|
|
|
| |
This is to better reflect that we are really enabling CPPC in these
functions and because we are likely to stop activating CPPC autonomous
mode by default in the near future.
No functional change (intended).
Sponsored by: The FreeBSD Foundation
|
| |
|
|
|
|
|
|
| |
While here, also rename check_cppc_enabled() => check_cppc_in_use().
No functional change (intended).
Sponsored by: The FreeBSD Foundation
|
| |
|
|
|
|
|
|
| |
Align it like the rest.
No functional change (intended).
Sponsored by: The FreeBSD Foundation
|
| |
|
|
| |
Sponsored by: The FreeBSD Foundation
|
| |
|
|
|
|
| |
And separate includes from the rest with an additional newline.
Sponsored by: The FreeBSD Foundation
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This will allow experimentations and finer-grained tuning to the full
extent allowed by the hardware, which is especially important given that
the spec leaves to hardware implementors an important leeway in
interpreting CPPC's numeric parameters, causing the same settings to
have different effects on different CPU models.
PR: 292615
Reviewed by: aokblast (older version)
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55010
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We were using percents, for compatibility with hwpstate_intel(4), but
this looses granularity that might be important in some scenarios or
with specific CPU models.
For consistency, hwpstate_intel(4) should be changed accordingly, at the
expense of breaking compatibility.
For release notes: Introduction of hwpstate_amd(4) deserves a release
note, even if the original commit was not tagged. Functionality
introduced by recent commits tagged with "Relnotes" should be mentioned
along that one.
PR: 292615
Reviewed by: aokblast
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55009
|
| |
|
|
|
|
|
|
|
|
|
|
| |
In preparation for creating other knobs to tweak values in this register
beyond just the EPP (Efficiency/Performance Preference).
While here, add a herald comment before the softc structure indicating
how we achieve atomicity when modifying the softc.
Reviewed by: aokblast
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55008
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the CPPC_CAPABILITY_1 register stays at its reset value (0) even
after enabling CPPC, as observed in the field (see the referenced PR
below), use sane min/max performance limits as hinted by the ACPI spec,
i.e., all 0s for the minimum value and all 1s for the maximum one.
While here, let's cope upfront with some more insane situations, where
the minimum value would be greater than the maximum one, but also if
they would be equal which does not seem to make sense at all in the CPPC
frame (and, anyway, in this case, the actual minimum and maximum values
we program should have no effect at all). That last case actually also
covers the one exposed in the previous paragraph.
PR: 292615
Reviewed by: aokblast
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55007
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the 'debug.hwpstate_verbose' tunable/sysctl knob is set, dump the
initial content of the CPPC_CAPABILITY_1 and CPPC_REQUEST registers.
If, after enabling CPPC, reading/writing some MSR fails during the attach
sequence, print a diagnostic. However, once CPPC is enabled, we cannot
go back (disabling it is impossible), so we'll attach even if fiddling
with other MSRs failed.
While here, move diagnostic printing on attach out of the callback that
is executed on (potentially) another CPU and with interrupts disabled,
putting it into the attach routine itself.
While here, fix format for printing the CPU ID.
PR: 292615
Reviewed by: aokblast (older version)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55006
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If some of the registers cannot be read, report that but continue trying
reading the others. This also has the side benefit of simplifying code.
While here, use sbuf_new_for_sysctl(), and rename 'res' and 'ret', which
are to contain error values, to 'error'.
While here, remove the test on getting the per-cpu structure, as if it
is not present we would have already crashed on device attach.
While here, fix format for printing the CPU ID.
PR: 292615
Reviewed by: aokblast (older version)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55005
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As the new CPPC and old P-states modes are exclusive, put their
respective data in a union.
Rename the field containing the content of the CPPC_REQUEST register.
It it now to be accessed using 'cppc.request'.
Use an 'unsigned int' instead of 'uint32_t' for 'flags'. This is an
internal field whose width could be changed at will. We only have one
flag at the moment.
No functional change intended.
Reviewed by: aokblast
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55004
|
| |
|
|
|
|
|
|
| |
No functional change intended.
Reviewed by: aokblast, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55003
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'val' is supposed to be the storage for a sysctl knob of an 'unsigned
int', so consistently don't specify its width.
While here, rename variables in the handler. The new names feel
clearer, and the 'ret' => 'error' rename is to be more in line with our
tradition.
No functional change intended.
Reviewed by: aokblast
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55002
|
| |
|
|
|
|
|
| |
No functional change intended.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55001
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While here, rename the callback function and structure to a more
immediately informative name.
While here, remove a superfluous cast and rename the variable containing
the callback data to just 'data' instead of 'req' which can be confusing
(because of CPPC_REQUEST but also the fact that 'req' is a parameter of
sysctl handlers).
No functional change intended.
Reviewed by: aokblast
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55000
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Factor out these printing, so they can be called from other places than
just the register dump handler. This also makes surrounding code
clearer.
Fix inverted printing of minimum and maximum performance.
For better diagnostic, print the full raw content of each register
before printing the value of fields we know about.
As fields are printed in decimal, remove 0-padding, which could give the
impression that the numbers are printed in octal or hexadecimal.
While here, remove superfluous blank lines when printing (we use TABs
for the different registers' fields).
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54999
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reason for doing this right now is to resolve the conflict on
'machdep.hwpstate_pkg_ctrl' between the Intel and AMD drivers, even
though I expect to remove it for hwpstate_amd(4) at some point.
More generally, this is going to be useful for some future code
factorization. Also, the 'debug.hwpstate_verbose' knob was moved there,
as we'll likely want to use it for the Intel driver as well (which is
currently not the case).
Note for MFC: Will be partial, since `hwpstate_amd(4)` does not support
CPPC in stable/15 nor stable/14.
Reviewed by: emaste
Fixes: 3e6e4e4a0d42 ("hwpstate: add CPPC support for pstate driver on AMD")
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D54528
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
To be closer to AMD's official terminology, except for the "Lowest
Non-Linear Performance" field which we label as 'EFFICIENT_PERF' closer
to Intel's ("Most Efficient Performance"), and to clear possible
confusion.
No functional change (intended).
Reviewed by: aokblast
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54998
|
| |
|
|
|
|
|
|
|
| |
While here, rename an argument of BITS_VALUE() to be consistent with the
other macros.
Reviewed by: aokblast
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54997
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Framework 13 runs very hot the maximum frequency is possible. By
disabling CPPC (reverting to Cool`n'Quiet 2.0) we can use powerd to
limit the CPU frequency to 2200, thereby reducing the CPU temperature.
Some systems may run slower with CPPC enabled. See PR/292615 for that
bug.
Those experiencing either of these issues may add the following to
their loader.conf or device.hints to disable CPPC:
machdep.hwpstate_amd_cppc_enable="0"
PR: 292615
Reviewed by: lwhsu, olce
Differential revision: https://reviews.freebsd.org/D54803
|
| |
|
|
|
|
|
| |
Reviewed by: olce
Approved by: markj (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D54505
|
| |
|
|
|
|
|
|
|
| |
Add parentheses between OR and AND operator to pass the compiler check.
Approved by: lwhsu (mentor)
Fixes: 3e6e4e4a0d42 ("hwpstate: add CPPC support for pstate driver on AMD")
MFC aftert: 2 weeks
Differential Revision: https://reviews.freebsd.org/D54465
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement CPPC interface for AMD Pstate Driver.
This feature is only enabled when the CPUID shows it support CPPC.
The CPPC is implemneted by the following steps:
1. Write MSR to enable it.
2. Read capability registert which indicates binary value of levels
about lowest, best energy efficient, guarantee, and max performance.
3. Write request register with epp in energy balanced mode. And let
CPU and firmware to enter autonomous mode.
Also, create a sysctl handler to allow userspace to change epp value.
In intel's hwpstate, The epp value can be in package level and core level.
However, in AMD's one, there is only core level. Thus, to sync with the
intel's code, we implement package level control in software and provide
another sysctl (machdep.hwpstate_pkg_ctrl) to control it.
Reviewed by: olce, khng
Approved by: lwhsu (mentor)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49587
|
| |
|
|
|
|
| |
Reviewed by: imp, jhb
Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D50913
|
| |
|
|
|
|
| |
Reviewed by: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D47985
|
| |
|
|
|
|
|
|
| |
Co-authored-by: Daniel Schaefer <dhs@frame.work>
Reviewed by: markj
MFC after: 2 weeks
Sponsored by: Framework Computer Inc
Differential Revision: https://reviews.freebsd.org/D48461
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.
Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/
Sponsored by: Netflix
|
| |
|
|
| |
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
| |
|
|
| |
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
|
| |
|
|
|
|
| |
Reviewed by: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D40140
|
| |
|
|
|
|
|
|
|
| |
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix
|
| | |
|
| | |
|
| |
|
|
| |
MFC after: 2 weeks
|
| |
|
|
|
|
| |
bus_dmamap_load() call uses BUS_DMA_NOWAIT.
MFC after: 2 weeks
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With various firmware files used by graphics and wireless drivers
we are exceeding the current 32 character module name (file path
in kldxref) length.
In order to overcome this issue bump it to the maximum path length
for the next version.
To be able to MFC provide backward compat support for another version
of the struct as the offsets for the second half change due to the
array size increase.
MAXMODNAME being defined to MAXPATHLEN needs param.h to be
included first. With only 7 modules (or LinuxKPI module.h) not
doing that adjust them rather than including param.h in module.h [1].
Reported by: Greg V (greg unrelenting.technology)
Sponsored by: The FreeBSD Foundation
Suggested by: imp [1]
MFC after: 10 days
Reviewed by: imp (and others to different level)
Differential Revision: https://reviews.freebsd.org/D32383
|
| |
|
|
|
|
| |
Before this device unit number match was coincidental and broke if I
disabled some CPU device(s). Aside of cosmetics, for some drivers
(may be considered broken) it caused talking to wrong CPUs.
|
| |
|
|
|
|
|
|
|
|
|
| |
Actually check the wrmsr_safe() return value when setting autonomous
HWP for package.
PR: 245582
Differential Revision: https://reviews.freebsd.org/D24744
Notes:
svn path=/head/; revision=368140
|
| |
|
|
| |
Notes:
svn path=/head/; revision=365079
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked).
Use it in preparation for a general review of all nodes.
This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.
Mark all obvious cases as MPSAFE. All entries that haven't been marked
as MPSAFE before are by default marked as NEEDGIANT
Approved by: kib (mentor, blanket)
Commented by: kib, gallatin, melifaro
Differential Revision: https://reviews.freebsd.org/D23718
Notes:
svn path=/head/; revision=358333
|
| |
|
|
| |
Notes:
svn path=/head/; revision=357381
|
| |
|
|
|
|
|
| |
X-MFC-With: r357379
Notes:
svn path=/head/; revision=357380
|
| |
|
|
|
|
|
|
|
| |
If package-level control is present, we default to using it. Per-core
software control may be enabled by setting the machdep.hwpstate_pkg_ctrl
tunable to "0" in loader.conf(5).
Notes:
svn path=/head/; revision=357379
|
| |
|
|
|
|
|
|
|
|
| |
Per Intel SDM (Vol 3b Part 2), if HWP indicates EPP (energy-performance
preference) is not supported, the hardware instead uses the ENERGY_PERF_BIAS
MSR. In the epp sysctl handler, fall back to that MSR if HWP does not
support EPP and CPUID indicates the ENERGY_PERF_BIAS MSR is supported.
Notes:
svn path=/head/; revision=357378
|