[flang][OpenMP] Push context for all directives in resolve-directives.cpp (#181736)
The visitors for loop and simple-standalone constructs had switch
statements that explicitly listed all directives in the category, and
pushed the context for them.
The visitor for OmpBlockConstruct listed a selection of block-associated
directives, but they are the only ones for which OmpBlockConstruct is
created directly without a subclass.
asmc(4): Stop building it on i386, as it supports only 64-bit chipsets
Reported by: ngie
Fixes: fde9fe18219f ("i386: Fix kernel compilation after introduction of ASMC_DEBUG option")
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 8342d9f7b5f13d0623861cb8b88caf10a15571f6)
asmc(4): Stop building it on i386, as it supports only 64-bit chipsets
Reported by: ngie
Fixes: fde9fe18219f ("i386: Fix kernel compilation after introduction of ASMC_DEBUG option")
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 8342d9f7b5f13d0623861cb8b88caf10a15571f6)
sysctl(9): Booleans: Accept integers to ease knob conversion
In sysctl_handle_bool(), if the output buffer (for the old value) has
room for exactly 4 bytes (sizeof(int)), then output the current boolean
value as an integer rather than a 'uint8_t'. Conversely, if 4 bytes
exactly remain in the input buffer (for the new value), treat them as an
integer and derive the new boolean value from it.
Doing so allows to convert existing integer syscstl knobs that are
interpreted as a boolean into true boolean ones while staying
backwards-compatible.
That brings no drawback as no code currently uses sysctl_handle_bool()
as part of a series of calls to sysctl_handle_*() functions for
(de)serialization of some compound structure. If that case ever
materializes, it can be easily solved, e.g., by creating
a sysctl_handle_bool_strict() variant.
In the future, we might want to go further and generally be more liberal
[12 lines not shown]
sysctl(9): Booleans: Fix old value length discovery
When calling sysctl(3) with a null 'oldp', i.e., length discovery mode,
'oldix' can be equal to 'oldlen', and we should not fail.
More generally, let SYSCTL_OUT() and SYSCTL_IN() handle corner cases,
simply removing the comparisons between 'oldidx' and 'oldlen' and
'newidx' and 'newlen' done by hand as the test just after is an equality
that does not require to know if 'idx' is smaller than 'len'.
PR: 292917
Reported by: cy
Fixes: 406da392ef8d ("sysctl(9): Booleans: Accept integers to ease knob conversion")
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 895e1c6567d9561c86f8d20b47e924911bce989e)
sysctl(9): Booleans: Accept integers to ease knob conversion
In sysctl_handle_bool(), if the output buffer (for the old value) has
room for exactly 4 bytes (sizeof(int)), then output the current boolean
value as an integer rather than a 'uint8_t'. Conversely, if 4 bytes
exactly remain in the input buffer (for the new value), treat them as an
integer and derive the new boolean value from it.
Doing so allows to convert existing integer syscstl knobs that are
interpreted as a boolean into true boolean ones while staying
backwards-compatible.
That brings no drawback as no code currently uses sysctl_handle_bool()
as part of a series of calls to sysctl_handle_*() functions for
(de)serialization of some compound structure. If that case ever
materializes, it can be easily solved, e.g., by creating
a sysctl_handle_bool_strict() variant.
In the future, we might want to go further and generally be more liberal
[12 lines not shown]
sysctl(9): Booleans: Fix old value length discovery
When calling sysctl(3) with a null 'oldp', i.e., length discovery mode,
'oldix' can be equal to 'oldlen', and we should not fail.
More generally, let SYSCTL_OUT() and SYSCTL_IN() handle corner cases,
simply removing the comparisons between 'oldidx' and 'oldlen' and
'newidx' and 'newlen' done by hand as the test just after is an equality
that does not require to know if 'idx' is smaller than 'len'.
PR: 292917
Reported by: cy
Fixes: 406da392ef8d ("sysctl(9): Booleans: Accept integers to ease knob conversion")
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 895e1c6567d9561c86f8d20b47e924911bce989e)
x86: x86_msr_op(): MSR_OP_LOCAL: Disable interrupts on atomic ops
On MSR_OP_LOCAL and non-naturally-atomic operations (MSR_OP_ANDNOT and
MSR_OP_OR), there is no guarantee that we are not interrupted between
reading and writing the MSR, and that interruption could actually
perform some operation on that MSR, which would be lost.
Prevent that problem by temporarily disabling interrupts around MSR
manipulation.
Reviewed by: kib
Discussed with: markj
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54996
(cherry picked from commit e5f8cbb86d58f25b5ff168506b78d09dca266fb6)
x86: x86_msr_op(): Simplify assertions
Simplify them by moving them into more natural places, i.e., default
cases of 'switch' statements.
No functional change (intended).
Reviewed by: kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54996
(cherry picked from commit a1a8bcdfde2e616cffeb4bf4e1968ba55cf409e9)
amd64: parse_memmap(): Move comment about size at proper place
While here, declare 'size' only in the relevant block.
No functional change (intended).
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 53bb02015fce72c79498842b898faefc2da3b0fb)
x86: x86_msr_op(): MSR_OP_LOCAL: Disable interrupts on atomic ops
On MSR_OP_LOCAL and non-naturally-atomic operations (MSR_OP_ANDNOT and
MSR_OP_OR), there is no guarantee that we are not interrupted between
reading and writing the MSR, and that interruption could actually
perform some operation on that MSR, which would be lost.
Prevent that problem by temporarily disabling interrupts around MSR
manipulation.
Reviewed by: kib
Discussed with: markj
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54996
(cherry picked from commit e5f8cbb86d58f25b5ff168506b78d09dca266fb6)
x86: x86_msr_op(): Simplify assertions
Simplify them by moving them into more natural places, i.e., default
cases of 'switch' statements.
No functional change (intended).
Reviewed by: kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54996
(cherry picked from commit a1a8bcdfde2e616cffeb4bf4e1968ba55cf409e9)
amd64: parse_memmap(): Move comment about size at proper place
While here, declare 'size' only in the relevant block.
No functional change (intended).
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 53bb02015fce72c79498842b898faefc2da3b0fb)
acpi: Use only AcpiGetSleepTypeData() to determine Sx support
Previously, we would first call AcpiEvaluateObject() to execute \_Sx
before calling AcpiGetSleepTypeData(). This was unnecessary, as
AcpiGetSleepTypeData() performs the same call itself. While doing so,
the latter function logs any other error than AE_NOT_FOUND (which
indicates that a particular sleep state is not supported), which most
probably is an added benefit of this change.
Reviewed by: obiwac
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54624
(cherry picked from commit 526c09a489295c96662d6c3d428f69672968ab80)
ahc(4): Fix a warning on i386 compilation
Fixes: cd036e891a35 ("ahc_pci.c: If bus_dma...")
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
(cherry picked from commit a9f7074e858fd7c8e07c164fc365afc0d0077735)
acpi: Use only AcpiGetSleepTypeData() to determine Sx support
Previously, we would first call AcpiEvaluateObject() to execute \_Sx
before calling AcpiGetSleepTypeData(). This was unnecessary, as
AcpiGetSleepTypeData() performs the same call itself. While doing so,
the latter function logs any other error than AE_NOT_FOUND (which
indicates that a particular sleep state is not supported), which most
probably is an added benefit of this change.
Reviewed by: obiwac
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54624
(cherry picked from commit 526c09a489295c96662d6c3d428f69672968ab80)
ps(1): Sort headers
Found these changes by chance in an old patch file. Should have been
committed along with the ps(1) modifications done in March 2025.
No functional change (intended).
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 730b3e20069b7115d16f02525103c6c05fa04759)
ps(1): Sort headers
Found these changes by chance in an old patch file. Should have been
committed along with the ps(1) modifications done in March 2025.
No functional change (intended).
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 730b3e20069b7115d16f02525103c6c05fa04759)
exterrvar.h: style(9): Fix two small nits
- Use tabs before '\'.
- Comment for '#else' must be the negation of the initial '#if''s test.
No functional change.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit d9e734d650844f4465a2e064fc9ee0897ed9aa95)
exterrvar.h: style(9): Fix two small nits
- Use tabs before '\'.
- Comment for '#else' must be the negation of the initial '#if''s test.
No functional change.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit d9e734d650844f4465a2e064fc9ee0897ed9aa95)