Am Tage des Herren Sun, 15 Jun 2025 09:28:38 + (UTC)
"Bjoern A. Zeeb" schrieb:
> On Sun, 15 Jun 2025, A FreeBSD User wrote:
>
> > Am Tage des Herren Sun, 15 Jun 2025 06:09:39 GMT
> > Warner Losh schrieb:
> >
> >> The branch main has been
> + uint32_t dNumSharedWriteBoosterBufferAllocUnits;
> +} __packed;
> +
> +_Static_assert(sizeof(struct ufshci_device_descriptor) == 89,
> +"bad size for ufshci_device_descriptor");
> +
> +/*
> + * UFS Spec 4.1, section 14.1.5.3 "Configuration Descriptor"
> + * ConfigurationDescriptor use big-endian byte ordering.
> + */
> +struct ufshci_unit_descriptor_configurable_parameters {
> + uint8_t bLUEnable;
> + uint8_t bBootLunID;
> + uint8_t bLUWriteProtect;
> + uint8_t bMemoryType;
> + uint32_t dNumAllocUnits;
> + uint8_t bDataReliability;
> + uint8_t bLogicalBlockSize;
> + uint8_t bProvisioningType;
> + uint16_t wContextCapabilities;
> + union {
> + struct {
> + uint8_t Reserved[3];
> + uint8_t ReservedHpb[6];
> + } __packed;
> + uint16_t wZoneBufferAllocUnits;
> + };
> + uint32_t dLUNumWriteBoosterBufferAllocUnits;
> +} __packed;
> +
> +_Static_assert(sizeof(struct ufshci_unit_descriptor_configurable_parameters)
> ==
> + 27,
> +"bad size for ufshci_unit_descriptor_configurable_parameters");
> +
> +#define UFSHCI_CONFIGURATION_DESCEIPTOR_LU_NUM 8
> +
> +struct ufshci_configuration_descriptor {
> + uint8_t bLength;
> + uint8_t bDescriptorIDN;
> + uint8_t bConfDescContinue;
> + uint8_t bBootEnable;
> + uint8_t bDescrAccessEn;
> + uint8_t bInitPowerMode;
> + uint8_t bHighPriorityLUN;
> + uint8_t bSecureRemovalType;
> + uint8_t bInitActiveICCLevel;
> + uint16_t wPeriodicRTCUpdate;
> + uint8_t Reserved;
> + uint8_t bRPMBRegionEnable;
> + uint8_t bRPMBRegion1Size;
> + uint8_t bRPMBRegion2Size;
> + uint8_t bRPMBRegion3Size;
> + uint8_t bWriteBoosterBufferPreserveUserSpaceEn;
> + uint8_t bWriteBoosterBufferType;
> + uint32_t dNumSharedWriteBoosterBufferAllocUnits;
> + /* 0x16 */
> + struct ufshci_unit_descriptor_configurable_parameters
> + unit_config_params[UFSHCI_CONFIGURATION_DESCEIPTOR_LU_NUM];
> +} __packed;
> +
> +_Static_assert(sizeof(struct ufshci_configuration_descriptor) == (22 + 27 *
> 8),
> +"bad size for ufshci_configuration_descriptor");
> +
> +/*
> + * UFS Spec 4.1, section 14.1.5.4 "Geometry Descriptor"
> + * GeometryDescriptor use big-endian byte ordering.
> + */
> +struct ufshci_geometry_descriptor {
> + uint8_t bLength;
> + uint8_t bDescriptorIDN;
> + uint8_t bMediaTechnology;
> + uint8_t Reserved;
> + uint64_t qTotalRawDeviceCapacity;
> + uint8_t bMaxNumberLU;
> + uint32_t dSegmentSize;
> + /* 0x11 */
> + uint8_t bAllocationUnitSize;
> + uint8_t bMinAddrBlockSize;
> + uint8_t bOptimalReadBlockSize;
> + uint8_t bOptimalWriteBlockSize;
> + uint8_t bMaxInBufferSize;
> + uint8_t bMaxOutBufferSize;
> + uint8_t bRPMB_ReadWriteSize;
> + uint8_t bDynamicCapacityResourcePolicy;
> + uint8_t bDataOrdering;
> + uint8_t bMaxContexIDNumber;
> + uint8_t bSysDataTagUnitSize;
> + uint8_t bSysDataTagResSize;
> + uint8_t bSupportedSecRTypes;
> + uint16_t wSupportedMemoryTypes;
> + /* 0x20 */
> + uint32_t dSystemCodeMaxNAllocU;
> + uint16_t wSystemCodeCapAdjFac;
> + uint32_t dNonPersistMaxNAllocU;
> + uint16_t wNonPersistCapAdjFac;
> + uint32_t dEnhanced1MaxNAllocU;
> + /* 0x30 */
> + uint16_t wEnhanced1CapAdjFac;
> *** 4268 LINES SKIPPED ***
>
--
A FreeBSD user
pgpUI9nYTtdtL.pgp
Description: OpenPGP digital signature
; diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c
> index 21cb6beaf1fb..2bb59cb2d92b 100644
> --- a/sys/cam/scsi/scsi_xpt.c
> +++ b/sys/cam/scsi/scsi_xpt.c
> @@ -40,6 +40,7 @@
> #include
> #include
> #include
> +#include
>
> #include
> #include
> @@ -59,7 +60,6 @@
> #include
> #include
> #include
> -#include /* for xpt_print below */
>
> struct scsi_quirk_entry {
> struct scsi_inquiry_pattern inq_pat;
> diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris_string.c
> b/sys/cddl/compat/opensolaris/kern/opensolaris_string.c index
> ec088f216cb3..4c8eb533e930
> 100644 --- a/sys/cddl/compat/opensolaris/kern/opensolaris_string.c
> +++ b/sys/cddl/compat/opensolaris/kern/opensolaris_string.c
> @@ -26,7 +26,7 @@
> #include
> #include
> #include
> -#include
> +#include
>
> #define IS_DIGIT(c) ((c) >= '0' && (c) <= '9')
>
> diff --git a/sys/cddl/compat/opensolaris/sys/cmn_err.h
> b/sys/cddl/compat/opensolaris/sys/cmn_err.h index 2623693ec8b7..b3ebf6414e8b
> 100644
> --- a/sys/cddl/compat/opensolaris/sys/cmn_err.h
> +++ b/sys/cddl/compat/opensolaris/sys/cmn_err.h
> @@ -28,7 +28,7 @@
> #define _OPENSOLARIS_SYS_CMN_ERR_H_
>
> #include
> -#include
> +#include
>
> #ifdef __cplusplus
> extern "C" {
> diff --git a/sys/cddl/compat/opensolaris/sys/varargs.h
> b/sys/cddl/compat/opensolaris/sys/varargs.h index 9684502756cb..bede89fafa18
> 100644
> --- a/sys/cddl/compat/opensolaris/sys/varargs.h
> +++ b/sys/cddl/compat/opensolaris/sys/varargs.h
> @@ -28,7 +28,7 @@
> #define _OPENSOLARIS_SYS_VARARGS_H_
>
> #ifdef _KERNEL
> -#include
> +#include
> #else
> #include
> #endif
> diff --git a/sys/cddl/dev/fbt/fbt.c b/sys/cddl/dev/fbt/fbt.c
> index 99a77ba65eb8..da9c4ee2ab76 100644
> --- a/sys/cddl/dev/fbt/fbt.c
> +++ b/sys/cddl/dev/fbt/fbt.c
> @@ -49,12 +49,12 @@
> #include
> #include
> #include
> +#include
> #include
> #include
> #include
> #include
> #include
> -#include
>
> #include
> #include
> diff --git a/sys/cddl/dev/profile/profile.c b/sys/cddl/dev/profile/profile.c
> index 3e106aab1c85..23a8c9256708 100644
> --- a/sys/cddl/dev/profile/profile.c
> +++ b/sys/cddl/dev/profile/profile.c
> @@ -48,11 +48,11 @@
> #include
> #include
> #include
> +#include
> #include
> #include
> #include
> #include
> -#include
>
> #include
> #include
> diff --git a/sys/cddl/dev/systrace/systrace.c
> b/sys/cddl/dev/systrace/systrace.c
> index c14a663d1995..d8fe1a6430c6 100644
> --- a/sys/cddl/dev/systrace/systrace.c
> +++ b/sys/cddl/dev/systrace/systrace.c
> @@ -47,6 +47,7 @@
> #include
> #include
> #include
> +#include
> #include
> #include
> #include
> @@ -54,8 +55,6 @@
> *** 3126 LINES SKIPPED ***
>
--
A FreeBSD user
pgpTMQyCO98rb.pgp
Description: OpenPGP digital signature
int hwt_config_set(struct thread *td, struct hwt_context *ctx,
> +struct hwt_set_config *sconf);
> +void hwt_config_free(struct hwt_context *ctx);
> +
> +#endif /* !_DEV_HWT_HWT_CONFIG_H_ */
> diff --git a/sys/dev/hwt/hwt_context.c b/sys/dev/hwt/hwt_context.c
> new file mode 100644
> index ..9af76cffc928
> --- /dev/null
> +++ b/sys/dev/hwt/hwt_context.c
> @@ -0,0 +1,201 @@
> +/*-
> + * SPDX-License-Identifier: BSD-2-Clause
> + *
> + * Copyright (c) 2023-2025 Ruslan Bukin
> + *
> + * This work was supported by Innovate UK project 105694, "Digital Security
> + * by Design (DSbD) Technology Platform Prototype".
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + * 1. Redistributions of source code must retain the above copyright
> + *notice, this list of conditions and the following disclaimer.
> + * 2. Redistributions in binary form must reproduce the above copyright
> + *notice, this list of conditions and the following disclaimer in the
> + *documentation and/or other materials provided with the distribution.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
> + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
> + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
> + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
> + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
> + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> + * SUCH DAMAGE.
> + */
> +
> +#include
> +#include
> +#include
> +#include
> +#include
> +#include
> +#include
> +#include
> +#include
> +#include
> +#include
> +
> +#include
> +#include
> +#include
> +#include
> +#include
> +#include
> +#include
> +
> +#define HWT_DEBUG
> +#undef HWT_DEBUG
> +
> +#ifdef HWT_DEBUG
> +#define dprintf(fmt, ...) printf(fmt, ##__VA_ARGS__)
> +#else
> +#define dprintf(fmt, ...)
> +#endif
> +
> +static MALLOC_DEFINE(M_HWT_CTX, "hwt_ctx", "Hardware Trace");
> +
> +static bitstr_t *ident_set;
> +static int ident_set_size;
> +static struct mtx ident_set_mutex;
> +
> +static int
> +hwt_ctx_ident_alloc(int *new_ident)
> +{
> +
> + mtx_lock(&ident_set_mutex);
> + bit_ffc(ident_set, ident_set_size, new_ident);
> + if (*new_ident == -1) {
> + mtx_unlock(&ident_set_mutex);
> + return (ENOMEM);
> + }
> + bit_set(ident_set, *new_ident);
> + mtx_unlock(&ident_set_mutex);
> +
> + return (0);
> mtx)+}
> *** 3705 LINES SKIPPED ***
>
The commit breaks buildkernel:
[...]
/usr/src/sys/dev/hwt/hwt_contexthash.c:82:2: error: call to undeclared function
'spinlock_enter'; ISO C99 and later do not support implicit function
declarations
[-Werror,-Wimplicit-function-declaration] 82 | HWT_CTXHASH_LOCK(); |
^
/usr/src/sys/dev/hwt/hwt_contexthash.h:39:28: note: expanded from macro
'HWT_CTXHASH_LOCK'
39 | #define HWT_CTXHASH_LOCK() mtx_lock_spin(&hwt_contexthash_mtx)
--
A FreeBSD user
pgpkAKkmg2hFo.pgp
Description: OpenPGP digital signature
zfs_status.pico
libzfs_util.pico libzfs_compat.pico libzfs_zmount.pico libshare.pico nfs.pico
os/freebsd/nfs.pico os/freebsd/smb.pico cityhash.pico zfeature_common.pico
zfs_comutil.pico zfs_deleg.pico zfs_fletcher.pico zfs_fletcher_superscalar.pico
zfs_fletcher_superscalar4.pico zfs_namecheck.p