1
0

Compare commits

...

53 Commits

Author SHA1 Message Date
86c5c0ef41 release 6.15.11 2025-08-20 21:48:25 +03:00
720355d977 release 6.15.10 2025-08-15 15:46:56 +03:00
28be96caa2 release 6.15.9 2025-08-01 17:51:51 +03:00
4d05ae4de6 release 6.15.8 2025-07-26 13:24:48 +03:00
48372baf14 release 6.15.7 2025-07-17 22:56:59 +03:00
01b98c3c62 release 6.15.6 2025-07-10 19:51:42 +03:00
492ec3ca82 release 6.15.5 2025-07-07 02:21:22 +03:00
8df072e89b release 6.15.4 2025-06-27 14:17:53 +03:00
4cb7006cd5 release 6.15.3 2025-06-19 18:06:35 +03:00
43dc655d2e release 6.15.2 (preliminary) 2025-06-18 12:24:58 +03:00
4d2691343a release 6.14.11 2025-06-10 15:56:25 +03:00
97cfa52990 release 6.14.10 2025-06-04 16:12:12 +03:00
245a50c3dd release 6.14.9 2025-05-29 17:14:07 +03:00
20c917c71c release 6.14.8 2025-05-22 17:47:17 +03:00
a5a8a2798d release 6.14.7 2025-05-18 12:32:18 +03:00
5c06d65ded release 6.14.6 2025-05-09 12:55:05 +03:00
9d4ee668cc release 6.14.5 2025-05-02 16:53:38 +03:00
23be27fbba release 6.14.4 2025-04-26 01:02:31 +03:00
f2e779751a release 6.14.3 2025-04-21 02:06:41 +03:00
0a221c5ce2 release 6.14.2 2025-04-11 00:38:04 +03:00
12ad6316be release 6.14.1 2025-04-07 13:34:51 +03:00
cb529499fc sync with Debian 2025-04-07 12:53:36 +03:00
5205e81720 release 6.14 (preliminary) 2025-03-27 01:51:30 +03:00
8083f6cf32 refine configs 2025-03-27 01:51:30 +03:00
b65c570ac2 refresh patches 2025-03-27 01:51:30 +03:00
3d597650a9 sync with Debian 2025-03-27 01:51:30 +03:00
06a5da3214 release 6.12.20 2025-03-23 03:20:34 +03:00
42650d9e26 release 6.12.19 2025-03-13 20:55:12 +03:00
541b699fa5 release 6.12.18 2025-03-08 06:46:16 +03:00
9bc795cb7a release 6.12.17 2025-02-27 16:40:53 +03:00
40abc00198 release 6.12.16 2025-02-21 18:45:20 +03:00
92542309fb release 6.12.14 2025-02-17 17:51:15 +03:00
e0baaf49dd release 6.12.13 2025-02-09 19:40:34 +03:00
b8c80400f5 release 6.12.12 2025-02-02 13:14:09 +03:00
d459972144 fixes 2025-01-29 11:02:24 +03:00
dbf57fda83 release 6.12.11 2025-01-28 09:26:32 +03:00
5b35bedab1 release 6.12.10 2025-01-18 01:49:54 +03:00
d372c88caf release 6.12.9 2025-01-09 23:12:45 +03:00
3fb1083e44 release 6.12.8 2025-01-02 21:18:06 +03:00
d0b6dece32 release 6.12.7 2024-12-27 16:31:57 +03:00
ce0cb160c6 drop buggy patch 2024-12-27 01:48:01 +03:00
fb44366f3a update 2024-12-27 01:06:21 +03:00
d1cc1656f5 release 6.12.6 2024-12-19 21:07:33 +03:00
efeeb92dda release 6.12.5 2024-12-16 07:12:49 +03:00
a78998e6a3 cleanup configs a bit more 2024-12-10 11:04:31 +03:00
407e7bac82 release 6.12.4 (preliminary) 2024-12-10 06:44:25 +03:00
9debc8729c release 6.11.11 2024-12-05 18:46:18 +03:00
bf0cfbdd57 release 6.11.10 2024-11-22 20:01:53 +03:00
651f9d897b release 6.11.9 2024-11-18 01:12:45 +03:00
428ce77115 release 6.11.8 2024-11-15 10:44:41 +03:00
02e7703ba0 release 6.11.7 2024-11-08 22:50:42 +03:00
a84cf6e84b release 6.11.6 2024-11-01 15:46:17 +03:00
352b17054d refine scripts 2024-11-01 15:46:17 +03:00
334 changed files with 5423 additions and 33839 deletions

1
debian/.gitignore vendored
View File

@@ -27,6 +27,7 @@
/rules.gen /rules.gen
!/linux-bpf-dev.* !/linux-bpf-dev.*
!/linux-cpupower.* !/linux-cpupower.*
!/linux-misc-tools.*
!/linux-perf.* !/linux-perf.*
# Ignore compiled Python files # Ignore compiled Python files

View File

@@ -221,27 +221,17 @@ class Gencontrol(Base):
do_meta = config.packages.meta do_meta = config.packages.meta
relation_compiler = PackageRelationEntry(cast(str, config.build.compiler)) relation_compiler = PackageRelationEntry(cast(str, config.build.compiler))
relation_compiler_host = PackageRelationEntry(
relation_compiler_header = PackageRelationGroup([relation_compiler])
# Generate compiler build-depends for native:
# gcc-N [arm64] <!cross !pkg.linux.nokernel>
self.bundle.source.build_depends_arch.merge([
PackageRelationEntry(
relation_compiler, relation_compiler,
arches={arch}, name=f'{relation_compiler.name}-for-host',
restrictions='<!cross !pkg.linux.nokernel>',
) )
])
# Generate compiler build-depends for cross: # Generate compiler build-depends:
# gcc-N-aarch64-linux-gnu [arm64] <cross !pkg.linux.nokernel>
self.bundle.source.build_depends_arch.merge([ self.bundle.source.build_depends_arch.merge([
PackageRelationEntry( PackageRelationEntry(
relation_compiler, relation_compiler_host,
name=f'{relation_compiler.name}-{config.defs_debianarch.gnutype_package}',
arches={arch}, arches={arch},
restrictions='<cross !pkg.linux.nokernel>', restrictions='<!pkg.linux.nokernel>',
) )
]) ])
@@ -307,7 +297,7 @@ class Gencontrol(Base):
desc.append(config.description.long[part]) desc.append(config.description.long[part])
desc.append_short(config.description.short[part]) desc.append_short(config.description.short[part])
packages_headers[0].depends.merge(relation_compiler_header) packages_headers[0].depends.merge([relation_compiler_host])
packages_own.extend(packages_image) packages_own.extend(packages_image)
packages_own.extend(packages_headers) packages_own.extend(packages_headers)
@@ -349,7 +339,7 @@ class Gencontrol(Base):
makeflags['KCONFIG_OPTIONS'] = '' makeflags['KCONFIG_OPTIONS'] = ''
# Add "salt" to fix #872263 # Add "salt" to fix #872263
makeflags['KCONFIG_OPTIONS'] += \ makeflags['KCONFIG_OPTIONS'] += \
' -o "BUILD_SALT=\\"%(source_basename)s%(abiname)s%(localversion)s\\""' % vars ' -o "BUILD_SALT=\\"krd-%(source_basename)s-%(abiname)s%(localversion)s\\""' % vars
merged_config = ('debian/build/config.%s_%s_%s' % merged_config = ('debian/build/config.%s_%s_%s' %
(config.name_debianarch, config.name_featureset, config.name_flavour)) (config.name_debianarch, config.name_featureset, config.name_flavour))
@@ -360,13 +350,6 @@ class Gencontrol(Base):
def process_changelog(self) -> None: def process_changelog(self) -> None:
version = self.version = self.changelog[0].version version = self.version = self.changelog[0].version
if self.changelog[0].distribution == 'UNRELEASED':
self.abiname = f'{version.linux_upstream}+unreleased'
elif self.changelog[0].distribution == 'experimental':
self.abiname = f'{version.linux_upstream}'
elif version.linux_revision_backports:
self.abiname = f'{version.linux_upstream_full}+bpo'
else:
self.abiname = f'{version.linux_upstream_full}' self.abiname = f'{version.linux_upstream_full}'
self.vars = { self.vars = {

View File

@@ -5,11 +5,12 @@ export GIT_OPTIONAL_LOCKS=0
w=$(git rev-parse --path-format=absolute --show-toplevel) ; : "${w:?}" ; cd "$w" w=$(git rev-parse --path-format=absolute --show-toplevel) ; : "${w:?}" ; cd "$w"
dst='debian/patches/pf' dst='debian/patches/tmp-pf'
src='../linux-extras' src='../linux-extras'
branches='amd-pstate amd-rapl cpuidle crypto fixes ksm zstd' branches='fixes archlinux cpuidle exfat kbuild nfs smb xfs'
[ -d "${dst}" ] if [ -d "${dst}" ] ; then rm -rf "${dst}" ; fi
mkdir -p "${dst}"
kver= kver=
if [ -n "$1" ] ; then if [ -n "$1" ] ; then
@@ -33,19 +34,17 @@ for b in ${branches} ; do
git switch --detach "${ref}" git switch --detach "${ref}"
git switch -C "$r" git switch -C "$r"
rm -rf "$w/${dst}/$b" ; mkdir -p "$w/${dst}/$b"
if git rebase "${from}" ; then if git rebase "${from}" ; then
[ -d "$w/${dst}/$b/" ] || mkdir -p "$w/${dst}/$b"
set +e
env -C "$w" git ls-files -z | grep -zF "${dst}/$b/" | grep -zFv '/.' | env -C "$w" -u GIT_OPTIONAL_LOCKS xargs -r -0 git rm -f
find "$w/${dst}/$b/" -name '*.patch' -type f -exec rm -f {} +
set -e
git format-patch -N --subject-prefix='' --output-directory "$w/${dst}/$b" "${from}..$r" git format-patch -N --subject-prefix='' --output-directory "$w/${dst}/$b" "${from}..$r"
else else
echo >&2 echo >&2
git rebase --abort git rebase --abort
echo >&2
touch "$w/${dst}/$b/0000-rebase-failed"
base=$(git merge-base "${from}" "${ref}")
git format-patch -N --subject-prefix='' --output-directory "$w/${dst}/$b" "${base}..${ref}"
fi fi
git switch -q --detach "${ref}" git switch -q --detach "${ref}"
@@ -56,6 +55,6 @@ done
cd "$w" ; rm -rf "$t" cd "$w" ; rm -rf "$t"
echo >&2 echo >&2
echo 'put in debian/patches/series' >&2 echo 'output:' >&2
echo >&2 echo >&2
find "${dst}/" -type f -name '*.patch' | sed -E 's#^debian/patches/##' | sort -V find "${dst}/" -type f -name '*.patch' | sed -E 's#^debian/patches/##' | sort -V

60
debian/bin/genpatch-zen vendored Executable file
View File

@@ -0,0 +1,60 @@
#!/bin/sh
set -ef
export GIT_OPTIONAL_LOCKS=0
w=$(git rev-parse --path-format=absolute --show-toplevel) ; : "${w:?}" ; cd "$w"
dst='debian/patches/tmp-zen'
src='../linux-extras'
branches='zen-sauce fixes'
if [ -d "${dst}" ] ; then rm -rf "${dst}" ; fi
mkdir -p "${dst}"
kver=
if [ -n "$1" ] ; then
kver="$1"
else
kver=$(dpkg-parsechangelog --show-field=Version | sed -E 's/^[0-9]+://;s/-[^-]*$//' | cut -d. -f1-2)
fi
from="upstream/linux-${kver}.y"
t=$(mktemp -d) ; : "${t:?}"
cp -ar "${src}" "$t/"
cd "$t/${src##*/}"
git config advice.skippedCherryPicks false
for b in ${branches} ; do
ref="zen/${kver}/$b"
r="tmp-rebase-$b"
git switch --detach "${ref}"
git switch -C "$r"
rm -rf "$w/${dst}/$b" ; mkdir -p "$w/${dst}/$b"
if git rebase "${from}" ; then
git format-patch -N --subject-prefix='' --output-directory "$w/${dst}/$b" "${from}..$r"
else
echo >&2
git rebase --abort
touch "$w/${dst}/$b/0000-rebase-failed"
base=$(git merge-base "${from}" "${ref}")
git format-patch -N --subject-prefix='' --output-directory "$w/${dst}/$b" "${base}..${ref}"
fi
git switch -q --detach "${ref}"
git branch -D "$r"
echo >&2
done
cd "$w" ; rm -rf "$t"
echo >&2
echo 'output:' >&2
echo >&2
find "${dst}/" -type f -name '*.patch' | sed -E 's#^debian/patches/##' | sort -V

View File

@@ -29,7 +29,7 @@ ver_path="v${major}.${minor}"
tarball_new="linux_${v}.orig.tar" tarball_new="linux_${v}.orig.tar"
tarball_new_comp="${tarball_new}.xz" tarball_new_comp="${tarball_new}.xz"
do_compress() { do_idle xz -1vv "$1" ; } do_compress() { do_idle xz -8vv "$1" ; }
while ! [ -s "../${tarball_new_comp}" ] ; do while ! [ -s "../${tarball_new_comp}" ] ; do

100
debian/bin/refine-configs vendored Executable file
View File

@@ -0,0 +1,100 @@
#!/bin/sh
set -ef
export PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1
prj_dir=$(readlink -f "$(dirname "$0")/../..")
cd "${prj_dir}"
[ -s debian/changelog ]
dpkg-parsechangelog --show-field Source | grep -Eq '^linux'
ch_ver=$(dpkg-parsechangelog --show-field Version)
ktarget=$1
[ -n "${ktarget}" ] || ktarget=oldconfig
v=$2
[ -n "$v" ] || v=$(echo "${ch_ver}" | sed -E 's/^\d+://;s/-[^-]+$//')
[ -n "$v" ]
## should be source tree with patches applied
src_dir=$3
[ -n "${src_dir}" ] || src_dir="/tmp/linux-$v"
[ -n "${src_dir}" ]
[ -d "${src_dir}" ]
src_dir=$(readlink -f "${src_dir}")
nproc=$(nproc || printf 2)
case "${nproc}" in
[0-1] ) nproc=2 ;;
[2-8] ) ;;
* ) nproc=8 ;;
esac
rm -rf debian/build/
make -f debian/rules debian/control
[ -f debian/rules.gen ]
configs=$(sed -En '\,debian/build/(config\.[^ :]+):$,{s,,\1,p}' debian/rules.gen | sort -uV | tr -s '[:space:]' ' ')
[ -n "${configs}" ]
## produce configs
make -f debian/rules.gen "-j${nproc}" $(printf ' debian/build/%s' ${configs})
## refresh configs
for c in ${configs} ; do
echo "# refreshing $c" >&2
f="debian/build/$c"
cp -f "$f" "${src_dir}/.config"
env -C "${src_dir}" make "-j${nproc}" "${ktarget}"
cp -f "${src_dir}/.config" "$f"
done
## remove build-generated options
find debian/build/ -name 'config.*' -type f -exec \
sed -i -E \
-e '/CONFIG_BUILD_SALT/d' \
-e '/CONFIG_MODULE_SIG_KEY( |=)/d' \
-e '/CONFIG_(AS|CC|PAHOLE)_((CAN|HAS)_)/d' \
-e '/CONFIG_(AS|BINDGEN|CC|CLANG|GCC|LD|LLD|PAHOLE|RUSTC)_VERSION/d' \
-e '/CONFIG_RUSTC_LLVM_VERSION/d' \
-e '/CONFIG_AS_(AVX512|GFNI|SHA(1|256)_NI|TPAUSE|VAES|VPCLMULQDQ|WRUSS)/d' \
-e '/CONFIG_CC_(IMPLICIT_FALLTHROUGH)/d' \
-e '/CONFIG_(CC|GCC10)_NO_ARRAY_BOUNDS/d' \
-e '/CONFIG_(CC|GCC)_((|NO_)STRINGOP_OVERFLOW)/d' \
{} +
## prepare configs for splitting
find debian/build/ -name 'config.*' -type f -exec sed -i -En '/CONFIG_/p' {} +
(
cd debian/build
mkdir -p split-configs
cd split-configs
"${prj_dir}/../kconfigeditor2/split-common.py" $(printf ' ../%s' ${configs})
find ./ -mindepth 1 -maxdepth 1 -type f -exec sed -i -En '/CONFIG_/p' {} +
cp -f output-common "${prj_dir}/debian/config/config"
i=0
for c in ${configs} ; do
i=$((i+1))
## config.amd64_none_cloud -> amd64/config.cloud
## config.amd64_rt_desktop -> amd64/rt/config.desktop
read -r arch featureset flavour <<-EOF
$(printf '%s' "${c#config.}" | tr '_' ' ')
EOF
[ -n "${arch}" ] || continue
[ -n "${featureset}" ] || continue
[ -n "${flavour}" ] || continue
case "${featureset}" in
none ) o="${arch}/config.${flavour}" ;;
* ) o="${arch}/${featureset}/config.${flavour}" ;;
esac
cp -f "output-part-$i" "${prj_dir}/debian/config/$o"
done
)
"${prj_dir}/../kconfigeditor2/process.py" -s "${src_dir}" .

84
debian/changelog vendored
View File

@@ -1,29 +1,71 @@
linux (6.11.5-1) sid; urgency=medium linux (6.15.11-1) sid; urgency=medium
* New upstream stable update: * New upstream stable update:
https://www.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.11.5 https://www.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.15.11
[ Aurelien Jarno ] -- Konstantin Demin <rockdrilla@gmail.com> Wed, 20 Aug 2025 21:45:46 +0300
* Revert upstream commit causing data corrution (Closes: #1085425)
- Revert "mmc: dw_mmc: Fix IDMAC operation with pages bigger than 4K"
[ Salvatore Bonaccorso ] linux (6.15.10-1) sid; urgency=medium
* netfilter: xtables: fix typo causing some targets not to load on IPv6
(Closes: #1085953)
[ Konstantin Demin ]
* Initial package release.
-- Konstantin Demin <rockdrilla@gmail.com> Tue, 29 Oct 2024 05:14:58 +0300
linux (6.11.4-1) unstable; urgency=medium
* New upstream stable update: * New upstream stable update:
https://www.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.11.3 https://www.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.15.10
https://www.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.11.4
[ Salvatore Bonaccorso ] -- Konstantin Demin <rockdrilla@gmail.com> Fri, 15 Aug 2025 15:43:04 +0300
* d/config: Update with the help of kconfigeditor2
- mm: Enable Z3FOLD_DEPRECATED instead of Z3FOLD
-- Salvatore Bonaccorso <carnil@debian.org> Sun, 20 Oct 2024 20:51:13 +0200 linux (6.15.9-1) sid; urgency=medium
* New upstream stable update:
https://www.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.15.9
-- Konstantin Demin <rockdrilla@gmail.com> Fri, 01 Aug 2025 16:49:13 +0300
linux (6.15.8-1) sid; urgency=medium
* New upstream stable update:
https://www.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.15.8
-- Konstantin Demin <rockdrilla@gmail.com> Sat, 26 Jul 2025 12:31:39 +0300
linux (6.15.7-1) sid; urgency=medium
* New upstream stable update:
https://www.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.15.7
-- Konstantin Demin <rockdrilla@gmail.com> Thu, 17 Jul 2025 22:21:12 +0300
linux (6.15.6-1) sid; urgency=medium
* New upstream stable update:
https://www.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.15.6
-- Konstantin Demin <rockdrilla@gmail.com> Thu, 10 Jul 2025 19:38:23 +0300
linux (6.15.5-1) sid; urgency=medium
* New upstream stable update:
https://www.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.15.5
-- Konstantin Demin <rockdrilla@gmail.com> Mon, 07 Jul 2025 01:40:22 +0300
linux (6.15.4-1) sid; urgency=medium
* New upstream stable update:
https://www.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.15.4
-- Konstantin Demin <rockdrilla@gmail.com> Fri, 27 Jun 2025 14:05:47 +0300
linux (6.15.3-1) sid; urgency=medium
* New upstream stable update:
https://www.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.15.3
-- Konstantin Demin <rockdrilla@gmail.com> Thu, 19 Jun 2025 17:46:46 +0300
linux (6.15.2-1) sid; urgency=medium
* New upstream stable update:
https://www.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.15.1
https://www.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.15.2
* New upstream release: https://kernelnewbies.org/Linux_6.15
-- Konstantin Demin <rockdrilla@gmail.com> Tue, 17 Jun 2025 12:18:45 +0300

View File

@@ -12,24 +12,11 @@
# CONFIG_X86_INTEL_LPSS is not set # CONFIG_X86_INTEL_LPSS is not set
# CONFIG_X86_AMD_PLATFORM_DEVICE is not set # CONFIG_X86_AMD_PLATFORM_DEVICE is not set
CONFIG_IOSF_MBI=m CONFIG_IOSF_MBI=m
CONFIG_HYPERVISOR_GUEST=y
CONFIG_PARAVIRT=y
# CONFIG_PARAVIRT_DEBUG is not set
CONFIG_PARAVIRT_SPINLOCKS=y
CONFIG_KVM_GUEST=y
CONFIG_ARCH_CPUIDLE_HALTPOLL=y
CONFIG_PVH=y
# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
CONFIG_JAILHOUSE_GUEST=y
CONFIG_ACRN_GUEST=y
CONFIG_INTEL_TDX_GUEST=y
# CONFIG_GART_IOMMU is not set # CONFIG_GART_IOMMU is not set
CONFIG_NR_CPUS=512 CONFIG_NR_CPUS=64
# CONFIG_X86_MCE_INJECT is not set # CONFIG_X86_MCE_INJECT is not set
CONFIG_X86_5LEVEL=y
# CONFIG_AMD_NUMA is not set # CONFIG_AMD_NUMA is not set
# CONFIG_NUMA_EMU is not set CONFIG_NODES_SHIFT=6
CONFIG_NODES_SHIFT=10
# CONFIG_X86_PMEM_LEGACY is not set # CONFIG_X86_PMEM_LEGACY is not set
# CONFIG_X86_CHECK_BIOS_CORRUPTION is not set # CONFIG_X86_CHECK_BIOS_CORRUPTION is not set
## choice: TSX enable mode ## choice: TSX enable mode
@@ -65,14 +52,7 @@ CONFIG_IO_DELAY_NONE=y
## ##
## file: arch/x86/xen/Kconfig ## file: arch/x86/xen/Kconfig
## ##
CONFIG_XEN=y
CONFIG_XEN_PV=y
CONFIG_XEN_512GB=y
CONFIG_XEN_PVHVM_GUEST=y
# CONFIG_XEN_DEBUG_FS is not set
CONFIG_XEN_PVH=y
# CONFIG_XEN_DOM0 is not set # CONFIG_XEN_DOM0 is not set
CONFIG_XEN_PV_MSR_SAFE=y
## ##
## file: block/Kconfig ## file: block/Kconfig
@@ -112,9 +92,6 @@ CONFIG_XEN_PV_MSR_SAFE=y
## file: crypto/Kconfig ## file: crypto/Kconfig
## ##
CONFIG_CRYPTO_ECDH=m CONFIG_CRYPTO_ECDH=m
CONFIG_CRYPTO_ECDSA=m
CONFIG_CRYPTO_CTS=m
CONFIG_CRYPTO_XTS=m
CONFIG_CRYPTO_DEFLATE=m CONFIG_CRYPTO_DEFLATE=m
CONFIG_CRYPTO_842=m CONFIG_CRYPTO_842=m
CONFIG_CRYPTO_LZ4=m CONFIG_CRYPTO_LZ4=m
@@ -154,7 +131,8 @@ CONFIG_CRYPTO_ZSTD=m
CONFIG_ATA=m CONFIG_ATA=m
# CONFIG_ATA_ACPI is not set # CONFIG_ATA_ACPI is not set
# CONFIG_SATA_PMP is not set # CONFIG_SATA_PMP is not set
# CONFIG_SATA_AHCI is not set CONFIG_SATA_AHCI=m
CONFIG_SATA_MOBILE_LPM_POLICY=0
# CONFIG_SATA_AHCI_PLATFORM is not set # CONFIG_SATA_AHCI_PLATFORM is not set
# CONFIG_AHCI_DWC is not set # CONFIG_AHCI_DWC is not set
# CONFIG_SATA_ACARD_AHCI is not set # CONFIG_SATA_ACARD_AHCI is not set
@@ -223,8 +201,6 @@ CONFIG_ATA=m
## file: drivers/block/Kconfig ## file: drivers/block/Kconfig
## ##
# CONFIG_ATA_OVER_ETH is not set # CONFIG_ATA_OVER_ETH is not set
CONFIG_XEN_BLKDEV_FRONTEND=m
CONFIG_XEN_BLKDEV_BACKEND=m
## ##
## file: drivers/block/mtip32xx/Kconfig ## file: drivers/block/mtip32xx/Kconfig
@@ -270,7 +246,6 @@ CONFIG_TCG_TIS=m
# CONFIG_TCG_NSC is not set # CONFIG_TCG_NSC is not set
# CONFIG_TCG_ATMEL is not set # CONFIG_TCG_ATMEL is not set
# CONFIG_TCG_INFINEON is not set # CONFIG_TCG_INFINEON is not set
CONFIG_TCG_XEN=m
CONFIG_TCG_CRB=m CONFIG_TCG_CRB=m
## ##
@@ -296,12 +271,6 @@ CONFIG_TCG_CRB=m
CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y
## end choice ## end choice
##
## file: drivers/cpuidle/Kconfig
##
CONFIG_CPU_IDLE_GOV_HALTPOLL=y
CONFIG_HALTPOLL_CPUIDLE=y
## ##
## file: drivers/crypto/Kconfig ## file: drivers/crypto/Kconfig
## ##
@@ -335,6 +304,7 @@ CONFIG_HALTPOLL_CPUIDLE=y
## ##
CONFIG_CXL_BUS=y CONFIG_CXL_BUS=y
# CONFIG_CXL_MEM_RAW_COMMANDS is not set # CONFIG_CXL_MEM_RAW_COMMANDS is not set
# CONFIG_CXL_FEATURES is not set
## ##
## file: drivers/devfreq/Kconfig ## file: drivers/devfreq/Kconfig
@@ -352,6 +322,12 @@ CONFIG_CXL_BUS=y
# CONFIG_XILINX_DMA is not set # CONFIG_XILINX_DMA is not set
# CONFIG_XILINX_XDMA is not set # CONFIG_XILINX_XDMA is not set
##
## file: drivers/dma/amd/Kconfig
##
# CONFIG_AMD_PTDMA is not set
# CONFIG_AMD_QDMA is not set
## ##
## file: drivers/dma/dw/Kconfig ## file: drivers/dma/dw/Kconfig
## ##
@@ -368,11 +344,6 @@ CONFIG_CXL_BUS=y
## ##
# CONFIG_INTEL_LDMA is not set # CONFIG_INTEL_LDMA is not set
##
## file: drivers/dma/ptdma/Kconfig
##
# CONFIG_AMD_PTDMA is not set
## ##
## file: drivers/dma/qcom/Kconfig ## file: drivers/dma/qcom/Kconfig
## ##
@@ -426,6 +397,11 @@ CONFIG_GOOGLE_COREBOOT_TABLE=m
CONFIG_GOOGLE_FRAMEBUFFER_COREBOOT=m CONFIG_GOOGLE_FRAMEBUFFER_COREBOOT=m
CONFIG_GOOGLE_VPD=m CONFIG_GOOGLE_VPD=m
##
## file: drivers/fwctl/Kconfig
##
# CONFIG_FWCTL is not set
## ##
## file: drivers/gnss/Kconfig ## file: drivers/gnss/Kconfig
## ##
@@ -469,10 +445,7 @@ CONFIG_GOOGLE_VPD=m
## ##
## file: drivers/hv/Kconfig ## file: drivers/hv/Kconfig
## ##
CONFIG_HYPERV=m # CONFIG_MSHV_ROOT is not set
# CONFIG_HYPERV_VTL_MODE is not set
CONFIG_HYPERV_UTILS=m
CONFIG_HYPERV_BALLOON=m
## ##
## file: drivers/hwmon/Kconfig ## file: drivers/hwmon/Kconfig
@@ -685,7 +658,6 @@ CONFIG_INFINIBAND_SRPT=m
# CONFIG_SERIO_ALTERA_PS2 is not set # CONFIG_SERIO_ALTERA_PS2 is not set
# CONFIG_SERIO_PS2MULT is not set # CONFIG_SERIO_PS2MULT is not set
# CONFIG_SERIO_ARC_PS2 is not set # CONFIG_SERIO_ARC_PS2 is not set
CONFIG_HYPERV_KEYBOARD=m
# CONFIG_USERIO is not set # CONFIG_USERIO is not set
## ##
@@ -703,22 +675,11 @@ CONFIG_HYPERV_KEYBOARD=m
## ##
# CONFIG_INTERCONNECT is not set # CONFIG_INTERCONNECT is not set
##
## file: drivers/iommu/Kconfig
##
CONFIG_HYPERV_IOMMU=y
CONFIG_VIRTIO_IOMMU=y
## ##
## file: drivers/iommu/iommufd/Kconfig ## file: drivers/iommu/iommufd/Kconfig
## ##
# CONFIG_IOMMUFD is not set # CONFIG_IOMMUFD is not set
##
## file: drivers/irqchip/Kconfig
##
# CONFIG_LAN966X_OIC is not set
## ##
## file: drivers/isdn/Kconfig ## file: drivers/isdn/Kconfig
## ##
@@ -786,6 +747,7 @@ CONFIG_FUSION_FC=m
## ##
## file: drivers/mfd/Kconfig ## file: drivers/mfd/Kconfig
## ##
# CONFIG_MFD_CGBC is not set
# CONFIG_MFD_MADERA is not set # CONFIG_MFD_MADERA is not set
# CONFIG_MFD_INTEL_LPSS_ACPI is not set # CONFIG_MFD_INTEL_LPSS_ACPI is not set
# CONFIG_MFD_INTEL_LPSS_PCI is not set # CONFIG_MFD_INTEL_LPSS_PCI is not set
@@ -798,6 +760,8 @@ CONFIG_FUSION_FC=m
# CONFIG_MFD_TQMX86 is not set # CONFIG_MFD_TQMX86 is not set
# CONFIG_MFD_VX855 is not set # CONFIG_MFD_VX855 is not set
# CONFIG_RAVE_SP_CORE is not set # CONFIG_RAVE_SP_CORE is not set
# CONFIG_MFD_QNAP_MCU is not set
# CONFIG_MFD_UPBOARD_FPGA is not set
# CONFIG_MFD_STEAMDECK is not set # CONFIG_MFD_STEAMDECK is not set
## ##
@@ -808,7 +772,6 @@ CONFIG_FUSION_FC=m
# CONFIG_TIFM_CORE is not set # CONFIG_TIFM_CORE is not set
# CONFIG_ENCLOSURE_SERVICES is not set # CONFIG_ENCLOSURE_SERVICES is not set
# CONFIG_HP_ILO is not set # CONFIG_HP_ILO is not set
CONFIG_VMWARE_BALLOON=m
# CONFIG_SRAM is not set # CONFIG_SRAM is not set
# CONFIG_DW_XDATA_PCIE is not set # CONFIG_DW_XDATA_PCIE is not set
# CONFIG_XILINX_SDFEC is not set # CONFIG_XILINX_SDFEC is not set
@@ -840,11 +803,6 @@ CONFIG_VMWARE_BALLOON=m
## ##
# CONFIG_EEPROM_93CX6 is not set # CONFIG_EEPROM_93CX6 is not set
##
## file: drivers/misc/keba/Kconfig
##
# CONFIG_KEBA_CP500 is not set
## ##
## file: drivers/misc/mei/Kconfig ## file: drivers/misc/mei/Kconfig
## ##
@@ -868,8 +826,6 @@ CONFIG_VMWARE_BALLOON=m
## ##
## file: drivers/net/Kconfig ## file: drivers/net/Kconfig
## ##
CONFIG_XEN_NETDEV_FRONTEND=m
CONFIG_XEN_NETDEV_BACKEND=m
# CONFIG_FUJITSU_ES is not set # CONFIG_FUJITSU_ES is not set
## ##
@@ -1012,6 +968,11 @@ CONFIG_BE2NET_SKYHAWK=y
## ##
# CONFIG_NET_VENDOR_FUNGIBLE is not set # CONFIG_NET_VENDOR_FUNGIBLE is not set
##
## file: drivers/net/ethernet/hisilicon/Kconfig
##
# CONFIG_NET_VENDOR_HISILICON is not set
## ##
## file: drivers/net/ethernet/huawei/Kconfig ## file: drivers/net/ethernet/huawei/Kconfig
## ##
@@ -1082,11 +1043,6 @@ CONFIG_FBNIC=m
## ##
# CONFIG_NET_VENDOR_MICROCHIP is not set # CONFIG_NET_VENDOR_MICROCHIP is not set
##
## file: drivers/net/ethernet/microsoft/Kconfig
##
CONFIG_MICROSOFT_MANA=m
## ##
## file: drivers/net/ethernet/mscc/Kconfig ## file: drivers/net/ethernet/mscc/Kconfig
## ##
@@ -1252,11 +1208,6 @@ CONFIG_MICROSOFT_MANA=m
## ##
# CONFIG_NET_VENDOR_XILINX is not set # CONFIG_NET_VENDOR_XILINX is not set
##
## file: drivers/net/hyperv/Kconfig
##
CONFIG_HYPERV_NET=m
## ##
## file: drivers/net/mdio/Kconfig ## file: drivers/net/mdio/Kconfig
## ##
@@ -1294,7 +1245,6 @@ CONFIG_HYPERV_NET=m
# CONFIG_MARVELL_88Q2XXX_PHY is not set # CONFIG_MARVELL_88Q2XXX_PHY is not set
# CONFIG_MARVELL_88X2222_PHY is not set # CONFIG_MARVELL_88X2222_PHY is not set
# CONFIG_MAXLINEAR_GPHY is not set # CONFIG_MAXLINEAR_GPHY is not set
# CONFIG_MEDIATEK_GE_PHY is not set
# CONFIG_MICREL_PHY is not set # CONFIG_MICREL_PHY is not set
# CONFIG_MICROCHIP_T1S_PHY is not set # CONFIG_MICROCHIP_T1S_PHY is not set
# CONFIG_MICROCHIP_PHY is not set # CONFIG_MICROCHIP_PHY is not set
@@ -1307,7 +1257,6 @@ CONFIG_HYPERV_NET=m
# CONFIG_NXP_TJA11XX_PHY is not set # CONFIG_NXP_TJA11XX_PHY is not set
# CONFIG_NCN26000_PHY is not set # CONFIG_NCN26000_PHY is not set
# CONFIG_QSEMI_PHY is not set # CONFIG_QSEMI_PHY is not set
# CONFIG_REALTEK_PHY is not set
# CONFIG_RENESAS_PHY is not set # CONFIG_RENESAS_PHY is not set
# CONFIG_ROCKCHIP_PHY is not set # CONFIG_ROCKCHIP_PHY is not set
# CONFIG_SMSC_PHY is not set # CONFIG_SMSC_PHY is not set
@@ -1328,12 +1277,22 @@ CONFIG_HYPERV_NET=m
## ##
# CONFIG_AQUANTIA_PHY is not set # CONFIG_AQUANTIA_PHY is not set
##
## file: drivers/net/phy/mediatek/Kconfig
##
# CONFIG_MEDIATEK_GE_PHY is not set
## ##
## file: drivers/net/phy/qcom/Kconfig ## file: drivers/net/phy/qcom/Kconfig
## ##
# CONFIG_QCA83XX_PHY is not set # CONFIG_QCA83XX_PHY is not set
# CONFIG_QCA808X_PHY is not set # CONFIG_QCA808X_PHY is not set
##
## file: drivers/net/phy/realtek/Kconfig
##
# CONFIG_REALTEK_PHY is not set
## ##
## file: drivers/net/ppp/Kconfig ## file: drivers/net/ppp/Kconfig
## ##
@@ -1376,9 +1335,6 @@ CONFIG_BLK_DEV_PMEM=m
# CONFIG_NVME_HWMON is not set # CONFIG_NVME_HWMON is not set
# CONFIG_NVME_RDMA is not set # CONFIG_NVME_RDMA is not set
CONFIG_NVME_FC=m CONFIG_NVME_FC=m
CONFIG_NVME_TCP=m
# CONFIG_NVME_TCP_TLS is not set
# CONFIG_NVME_HOST_AUTH is not set
## ##
## file: drivers/nvme/target/Kconfig ## file: drivers/nvme/target/Kconfig
@@ -1386,8 +1342,6 @@ CONFIG_NVME_TCP=m
CONFIG_NVME_TARGET_RDMA=m CONFIG_NVME_TARGET_RDMA=m
CONFIG_NVME_TARGET_FC=m CONFIG_NVME_TARGET_FC=m
# CONFIG_NVME_TARGET_FCLOOP is not set # CONFIG_NVME_TARGET_FCLOOP is not set
CONFIG_NVME_TARGET_TCP=m
# CONFIG_NVME_TARGET_TCP_TLS is not set
## ##
## file: drivers/of/Kconfig ## file: drivers/of/Kconfig
@@ -1402,14 +1356,12 @@ CONFIG_NVME_TARGET_TCP=m
## ##
## file: drivers/pci/Kconfig ## file: drivers/pci/Kconfig
## ##
CONFIG_XEN_PCIDEV_FRONTEND=m # CONFIG_PCIE_TPH is not set
CONFIG_PCI_HYPERV=m
## ##
## file: drivers/pci/controller/Kconfig ## file: drivers/pci/controller/Kconfig
## ##
# CONFIG_VMD is not set # CONFIG_VMD is not set
CONFIG_PCI_HYPERV_INTERFACE=m
## ##
## file: drivers/pci/controller/dwc/Kconfig ## file: drivers/pci/controller/dwc/Kconfig
@@ -1422,6 +1374,7 @@ CONFIG_PCI_HYPERV_INTERFACE=m
## ##
# CONFIG_HOTPLUG_PCI_ACPI_IBM is not set # CONFIG_HOTPLUG_PCI_ACPI_IBM is not set
# CONFIG_HOTPLUG_PCI_CPCI is not set # CONFIG_HOTPLUG_PCI_CPCI is not set
# CONFIG_HOTPLUG_PCI_OCTEONEP is not set
# CONFIG_HOTPLUG_PCI_SHPC is not set # CONFIG_HOTPLUG_PCI_SHPC is not set
## ##
@@ -1433,6 +1386,11 @@ CONFIG_PCIEASPM_DEFAULT=y
# CONFIG_PCIEASPM_POWERSAVE is not set # CONFIG_PCIEASPM_POWERSAVE is not set
## end choice ## end choice
##
## file: drivers/pci/pwrctrl/Kconfig
##
# CONFIG_PCI_PWRCTL_SLOT is not set
## ##
## file: drivers/pci/switch/Kconfig ## file: drivers/pci/switch/Kconfig
## ##
@@ -1522,13 +1480,16 @@ CONFIG_PCIEASPM_DEFAULT=y
## ##
CONFIG_PPS=m CONFIG_PPS=m
##
## file: drivers/pps/generators/Kconfig
##
# CONFIG_PPS_GENERATOR_TIO is not set
## ##
## file: drivers/ptp/Kconfig ## file: drivers/ptp/Kconfig
## ##
# CONFIG_DP83640_PHY is not set # CONFIG_DP83640_PHY is not set
# CONFIG_PTP_1588_CLOCK_INES is not set # CONFIG_PTP_1588_CLOCK_INES is not set
CONFIG_PTP_1588_CLOCK_KVM=m
CONFIG_PTP_1588_CLOCK_VMW=m
## ##
## file: drivers/pwm/Kconfig ## file: drivers/pwm/Kconfig
@@ -1588,8 +1549,6 @@ CONFIG_SCSI_FC_ATTRS=m
CONFIG_SCSI_SRP_ATTRS=m CONFIG_SCSI_SRP_ATTRS=m
CONFIG_SCSI_BUSLOGIC=m CONFIG_SCSI_BUSLOGIC=m
# CONFIG_SCSI_FLASHPOINT is not set # CONFIG_SCSI_FLASHPOINT is not set
CONFIG_XEN_SCSI_FRONTEND=m
CONFIG_HYPERV_STORAGE=m
# CONFIG_LIBFC is not set # CONFIG_LIBFC is not set
CONFIG_SCSI_IPR=m CONFIG_SCSI_IPR=m
# CONFIG_SCSI_IPR_TRACE is not set # CONFIG_SCSI_IPR_TRACE is not set
@@ -1642,11 +1601,6 @@ CONFIG_SCSI_MPI3MR=m
## ##
# CONFIG_SOC_TI is not set # CONFIG_SOC_TI is not set
##
## file: drivers/soundwire/Kconfig
##
# CONFIG_SOUNDWIRE is not set
## ##
## file: drivers/spi/Kconfig ## file: drivers/spi/Kconfig
## ##
@@ -1682,7 +1636,9 @@ CONFIG_SCSI_MPI3MR=m
## ##
# CONFIG_THERMAL_STATISTICS is not set # CONFIG_THERMAL_STATISTICS is not set
# CONFIG_THERMAL_DEBUGFS is not set # CONFIG_THERMAL_DEBUGFS is not set
# CONFIG_THERMAL_CORE_TESTING is not set
# CONFIG_THERMAL_GOV_BANG_BANG is not set # CONFIG_THERMAL_GOV_BANG_BANG is not set
# CONFIG_PCIE_THERMAL is not set
## ##
## file: drivers/thunderbolt/Kconfig ## file: drivers/thunderbolt/Kconfig
@@ -1696,12 +1652,6 @@ CONFIG_SCSI_MPI3MR=m
# CONFIG_N_GSM is not set # CONFIG_N_GSM is not set
# CONFIG_NOZOMI is not set # CONFIG_NOZOMI is not set
##
## file: drivers/tty/hvc/Kconfig
##
CONFIG_HVC_XEN=y
CONFIG_HVC_XEN_FRONTEND=y
## ##
## file: drivers/tty/serial/Kconfig ## file: drivers/tty/serial/Kconfig
## ##
@@ -1725,6 +1675,7 @@ CONFIG_HVC_XEN_FRONTEND=y
# CONFIG_SERIAL_8250_RSA is not set # CONFIG_SERIAL_8250_RSA is not set
# CONFIG_SERIAL_8250_RT288X is not set # CONFIG_SERIAL_8250_RT288X is not set
# CONFIG_SERIAL_8250_MID is not set # CONFIG_SERIAL_8250_MID is not set
# CONFIG_SERIAL_8250_NI is not set
## ##
## file: drivers/ufs/Kconfig ## file: drivers/ufs/Kconfig
@@ -1739,7 +1690,6 @@ CONFIG_HVC_XEN_FRONTEND=y
# CONFIG_UIO_SERCOS3 is not set # CONFIG_UIO_SERCOS3 is not set
# CONFIG_UIO_NETX is not set # CONFIG_UIO_NETX is not set
# CONFIG_UIO_MF624 is not set # CONFIG_UIO_MF624 is not set
CONFIG_UIO_HV_GENERIC=m
## ##
## file: drivers/usb/Kconfig ## file: drivers/usb/Kconfig
@@ -1768,34 +1718,17 @@ CONFIG_UIO_HV_GENERIC=m
## ##
CONFIG_FB_CIRRUS=m CONFIG_FB_CIRRUS=m
CONFIG_FB_UVESA=m CONFIG_FB_UVESA=m
CONFIG_XEN_FBDEV_FRONTEND=y
CONFIG_FB_HYPERV=m
## ##
## file: drivers/video/fbdev/core/Kconfig ## file: drivers/video/fbdev/core/Kconfig
## ##
# CONFIG_FB_DEVICE is not set # CONFIG_FB_DEVICE is not set
##
## file: drivers/virt/acrn/Kconfig
##
CONFIG_ACRN_HSM=m
##
## file: drivers/virt/coco/tdx-guest/Kconfig
##
CONFIG_TDX_GUEST_DRIVER=m
## ##
## file: drivers/virt/vboxguest/Kconfig ## file: drivers/virt/vboxguest/Kconfig
## ##
# CONFIG_VBOXGUEST is not set # CONFIG_VBOXGUEST is not set
##
## file: drivers/virtio/Kconfig
##
CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
## ##
## file: drivers/w1/Kconfig ## file: drivers/w1/Kconfig
## ##
@@ -1809,6 +1742,7 @@ CONFIG_WATCHDOG_PRETIMEOUT_GOV_NOOP=m
CONFIG_WATCHDOG_PRETIMEOUT_GOV_PANIC=m CONFIG_WATCHDOG_PRETIMEOUT_GOV_PANIC=m
CONFIG_SOFT_WATCHDOG_PRETIMEOUT=y CONFIG_SOFT_WATCHDOG_PRETIMEOUT=y
# CONFIG_LENOVO_SE10_WDT is not set # CONFIG_LENOVO_SE10_WDT is not set
# CONFIG_LENOVO_SE30_WDT is not set
# CONFIG_XILINX_WATCHDOG is not set # CONFIG_XILINX_WATCHDOG is not set
# CONFIG_CADENCE_WATCHDOG is not set # CONFIG_CADENCE_WATCHDOG is not set
# CONFIG_DW_WATCHDOG is not set # CONFIG_DW_WATCHDOG is not set
@@ -1835,7 +1769,6 @@ CONFIG_SOFT_WATCHDOG_PRETIMEOUT=y
# CONFIG_PC87413_WDT is not set # CONFIG_PC87413_WDT is not set
# CONFIG_NV_TCO is not set # CONFIG_NV_TCO is not set
# CONFIG_60XX_WDT is not set # CONFIG_60XX_WDT is not set
# CONFIG_CPU5_WDT is not set
# CONFIG_SMSC_SCH311X_WDT is not set # CONFIG_SMSC_SCH311X_WDT is not set
# CONFIG_SMSC37B787_WDT is not set # CONFIG_SMSC37B787_WDT is not set
# CONFIG_TQMX86_WDT is not set # CONFIG_TQMX86_WDT is not set
@@ -1847,35 +1780,8 @@ CONFIG_SOFT_WATCHDOG_PRETIMEOUT=y
# CONFIG_SBC_EPX_C3_WATCHDOG is not set # CONFIG_SBC_EPX_C3_WATCHDOG is not set
# CONFIG_NI903X_WDT is not set # CONFIG_NI903X_WDT is not set
# CONFIG_NIC7018_WDT is not set # CONFIG_NIC7018_WDT is not set
CONFIG_XEN_WDT=m
# CONFIG_PCIPCWATCHDOG is not set # CONFIG_PCIPCWATCHDOG is not set
##
## file: drivers/xen/Kconfig
##
CONFIG_XEN_BALLOON=y
CONFIG_XEN_BALLOON_MEMORY_HOTPLUG=y
CONFIG_XEN_MEMORY_HOTPLUG_LIMIT=512
CONFIG_XEN_SCRUB_PAGES_DEFAULT=y
CONFIG_XEN_DEV_EVTCHN=m
CONFIG_XEN_BACKEND=y
CONFIG_XENFS=m
CONFIG_XEN_COMPAT_XENFS=y
CONFIG_XEN_SYS_HYPERVISOR=y
CONFIG_XEN_GNTDEV=m
CONFIG_XEN_GNTDEV_DMABUF=y
CONFIG_XEN_GRANT_DEV_ALLOC=m
CONFIG_XEN_GRANT_DMA_ALLOC=y
CONFIG_XEN_PCIDEV_BACKEND=m
# CONFIG_XEN_PVCALLS_FRONTEND is not set
# CONFIG_XEN_PVCALLS_BACKEND is not set
CONFIG_XEN_SCSI_BACKEND=m
CONFIG_XEN_PRIVCMD=m
CONFIG_XEN_PRIVCMD_EVENTFD=y
CONFIG_XEN_UNPOPULATED_ALLOC=y
CONFIG_XEN_VIRTIO=y
# CONFIG_XEN_VIRTIO_FORCE_GRANT is not set
## ##
## file: fs/Kconfig ## file: fs/Kconfig
## ##
@@ -1901,11 +1807,6 @@ CONFIG_XEN_VIRTIO=y
## ##
# CONFIG_BFS_FS is not set # CONFIG_BFS_FS is not set
##
## file: fs/btrfs/Kconfig
##
# CONFIG_BTRFS_FS is not set
## ##
## file: fs/coda/Kconfig ## file: fs/coda/Kconfig
## ##
@@ -1941,12 +1842,6 @@ CONFIG_XEN_VIRTIO=y
## ##
# CONFIG_VXFS_FS is not set # CONFIG_VXFS_FS is not set
##
## file: fs/fuse/Kconfig
##
CONFIG_FUSE_FS=m
CONFIG_VIRTIO_FS=m
## ##
## file: fs/gfs2/Kconfig ## file: fs/gfs2/Kconfig
## ##
@@ -2062,11 +1957,6 @@ CONFIG_PROC_VMCORE=y
## ##
# CONFIG_QNX6FS_FS is not set # CONFIG_QNX6FS_FS is not set
##
## file: fs/reiserfs/Kconfig
##
# CONFIG_REISERFS_FS is not set
## ##
## file: fs/romfs/Kconfig ## file: fs/romfs/Kconfig
## ##
@@ -2077,11 +1967,6 @@ CONFIG_PROC_VMCORE=y
## ##
# CONFIG_CIFS is not set # CONFIG_CIFS is not set
##
## file: fs/sysv/Kconfig
##
# CONFIG_SYSV_FS is not set
## ##
## file: fs/ufs/Kconfig ## file: fs/ufs/Kconfig
## ##
@@ -2095,24 +1980,12 @@ CONFIG_PROC_VMCORE=y
## ##
## file: init/Kconfig ## file: init/Kconfig
## ##
## choice: Kernel compression mode
# CONFIG_KERNEL_XZ is not set
CONFIG_KERNEL_LZ4=y
## end choice
CONFIG_DEFAULT_HOSTNAME="debian-cloud" CONFIG_DEFAULT_HOSTNAME="debian-cloud"
CONFIG_LOG_BUF_SHIFT=17 CONFIG_LOG_BUF_SHIFT=17
CONFIG_LOG_CPU_MAX_BUF_SHIFT=12 CONFIG_LOG_CPU_MAX_BUF_SHIFT=12
# CONFIG_UCLAMP_TASK is not set # CONFIG_UCLAMP_TASK is not set
# CONFIG_RT_GROUP_SCHED is not set # CONFIG_RT_GROUP_SCHED is not set
##
## file: kernel/Kconfig.hz
##
## choice: Timer frequency
CONFIG_HZ_100=y
# CONFIG_HZ_500 is not set
## end choice
## ##
## file: kernel/Kconfig.kexec ## file: kernel/Kconfig.kexec
## ##
@@ -2131,7 +2004,7 @@ CONFIG_CRASH_MAX_MEMORY_RANGES=8192
## ##
## choice: Preemption Model ## choice: Preemption Model
CONFIG_PREEMPT_NONE=y CONFIG_PREEMPT_NONE=y
# CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT_LAZY is not set
## end choice ## end choice
# CONFIG_SCHED_CORE is not set # CONFIG_SCHED_CORE is not set
@@ -2140,19 +2013,10 @@ CONFIG_PREEMPT_NONE=y
## ##
# CONFIG_SWIOTLB_DYNAMIC is not set # CONFIG_SWIOTLB_DYNAMIC is not set
##
## file: kernel/module/Kconfig
##
## choice: Module compression mode
CONFIG_MODULE_COMPRESS_NONE=y
# CONFIG_MODULE_COMPRESS_XZ is not set
## end choice
## ##
## file: kernel/power/Kconfig ## file: kernel/power/Kconfig
## ##
# CONFIG_PM_DEBUG is not set # CONFIG_PM_DEBUG is not set
# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
## ##
## file: kernel/rcu/Kconfig ## file: kernel/rcu/Kconfig
@@ -2192,7 +2056,6 @@ CONFIG_PANIC_TIMEOUT=5
# CONFIG_FUNCTION_ERROR_INJECTION is not set # CONFIG_FUNCTION_ERROR_INJECTION is not set
# CONFIG_RUNTIME_TESTING_MENU is not set # CONFIG_RUNTIME_TESTING_MENU is not set
# CONFIG_MEMTEST is not set # CONFIG_MEMTEST is not set
# CONFIG_HYPERV_TESTING is not set
## ##
## file: lib/Kconfig.kfence ## file: lib/Kconfig.kfence
@@ -2203,8 +2066,9 @@ CONFIG_PANIC_TIMEOUT=5
## file: mm/Kconfig ## file: mm/Kconfig
## ##
# CONFIG_ZSWAP is not set # CONFIG_ZSWAP is not set
CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE=y CONFIG_ZSMALLOC=m
# CONFIG_HWPOISON_INJECT is not set # CONFIG_HWPOISON_INJECT is not set
# CONFIG_NUMA_EMU is not set
## ##
## file: mm/Kconfig.debug ## file: mm/Kconfig.debug
@@ -2271,17 +2135,6 @@ CONFIG_MAX_SKB_FRAGS=19
## ##
# CONFIG_CAN is not set # CONFIG_CAN is not set
##
## file: net/dccp/Kconfig
##
# CONFIG_IP_DCCP_DEBUG is not set
##
## file: net/dccp/ccids/Kconfig
##
# CONFIG_IP_DCCP_CCID2_DEBUG is not set
# CONFIG_IP_DCCP_CCID3_DEBUG is not set
## ##
## file: net/ieee802154/Kconfig ## file: net/ieee802154/Kconfig
## ##
@@ -2439,11 +2292,6 @@ CONFIG_SUNRPC_XPRT_RDMA=m
## ##
CONFIG_TIPC_MEDIA_IB=y CONFIG_TIPC_MEDIA_IB=y
##
## file: net/vmw_vsock/Kconfig
##
CONFIG_HYPERV_VSOCKETS=m
## ##
## file: net/x25/Kconfig ## file: net/x25/Kconfig
## ##
@@ -2460,10 +2308,16 @@ CONFIG_HYPERV_VSOCKETS=m
# CONFIG_LIST_HARDENED is not set # CONFIG_LIST_HARDENED is not set
# CONFIG_BUG_ON_DATA_CORRUPTION is not set # CONFIG_BUG_ON_DATA_CORRUPTION is not set
##
## file: security/ipe/Kconfig
##
CONFIG_IPE_PROP_DM_VERITY_SIGNATURE=y
## ##
## file: security/keys/Kconfig ## file: security/keys/Kconfig
## ##
# CONFIG_KEYS_REQUEST_CACHE is not set # CONFIG_KEYS_REQUEST_CACHE is not set
# CONFIG_BIG_KEYS is not set
# CONFIG_TRUSTED_KEYS is not set # CONFIG_TRUSTED_KEYS is not set
# CONFIG_USER_DECRYPTED_DATA is not set # CONFIG_USER_DECRYPTED_DATA is not set
@@ -2481,51 +2335,39 @@ CONFIG_ARCH_HAS_GENERIC_CRASHKERNEL_RESERVATION=y
CONFIG_ARCH_SELECTS_KEXEC_FILE=y CONFIG_ARCH_SELECTS_KEXEC_FILE=y
CONFIG_BLK_DEV_RNBD=y CONFIG_BLK_DEV_RNBD=y
CONFIG_CRASH_RESERVE=y CONFIG_CRASH_RESERVE=y
CONFIG_CRYPTO_ECC=m CONFIG_CRYPTO_CHACHA20_X86_64=m
CONFIG_CRYPTO_LIB_AESCFB=m CONFIG_CRYPTO_LIB_AESCFB=m
CONFIG_CRYPTO_LIB_CHACHA=m
CONFIG_CRYPTO_LIB_CHACHA20POLY1305=m
CONFIG_CRYPTO_LIB_CHACHA_GENERIC=m
CONFIG_CRYPTO_LIB_CHACHA_INTERNAL=m
CONFIG_CRYPTO_LIB_POLY1305=m
CONFIG_CRYPTO_LIB_POLY1305_GENERIC=m
CONFIG_CRYPTO_LIB_POLY1305_INTERNAL=m
CONFIG_CRYPTO_POLY1305_X86_64=m
CONFIG_CXL_PORT=y CONFIG_CXL_PORT=y
CONFIG_FB_IOMEM_HELPERS_DEFERRED=y
CONFIG_HVC_IRQ=y
CONFIG_HYPERV_TIMER=y
CONFIG_HZ=100
CONFIG_INFINIBAND_ADDR_TRANS_CONFIGFS=y CONFIG_INFINIBAND_ADDR_TRANS_CONFIGFS=y
CONFIG_INFINIBAND_RTRS=m CONFIG_INFINIBAND_RTRS=m
CONFIG_INFINIBAND_USER_MEM=y CONFIG_INFINIBAND_USER_MEM=y
CONFIG_INFINIBAND_VIRT_DMA=y CONFIG_INFINIBAND_VIRT_DMA=y
CONFIG_INLINE_READ_UNLOCK=y
CONFIG_INLINE_READ_UNLOCK_IRQ=y
CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
CONFIG_INLINE_WRITE_UNLOCK=y
CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
CONFIG_IP_VS_PROTO_AH_ESP=y CONFIG_IP_VS_PROTO_AH_ESP=y
CONFIG_KEXEC_CORE=y CONFIG_KEXEC_CORE=y
CONFIG_LZ4HC_COMPRESS=m CONFIG_LZ4HC_COMPRESS=m
CONFIG_LZ4_COMPRESS=m CONFIG_LZ4_COMPRESS=m
CONFIG_MFD_CORE=m CONFIG_MFD_CORE=m
CONFIG_MMU_GATHER_RCU_TABLE_FREE=y
CONFIG_MMU_GATHER_TABLE_FREE=y
CONFIG_ND_BTT=m CONFIG_ND_BTT=m
CONFIG_ND_PFN=m CONFIG_ND_PFN=m
CONFIG_NETFS_SUPPORT=m CONFIG_NETFS_SUPPORT=m
# CONFIG_NVMEM_LAYOUTS is not set # CONFIG_NVMEM_LAYOUTS is not set
CONFIG_PARAVIRT_CLOCK=y
CONFIG_PARAVIRT_XXL=y
CONFIG_PCI_XEN=y
CONFIG_PGTABLE_LEVELS=5
CONFIG_PREEMPT_NONE_BUILD=y CONFIG_PREEMPT_NONE_BUILD=y
CONFIG_RATIONAL=m CONFIG_RATIONAL=m
CONFIG_SCSI_COMMON=m CONFIG_SCSI_COMMON=m
CONFIG_SCSI_MOD=m CONFIG_SCSI_MOD=m
CONFIG_SCSI_NETLINK=y CONFIG_SCSI_NETLINK=y
CONFIG_SWIOTLB_XEN=y
CONFIG_SYS_HYPERVISOR=y
CONFIG_TCG_TIS_CORE=m CONFIG_TCG_TIS_CORE=m
CONFIG_X86_HV_CALLBACK_VECTOR=y
CONFIG_XEN_ACPI=y
CONFIG_XEN_AUTO_XLATE=y
CONFIG_XEN_EFI=y
CONFIG_XEN_GRANT_DMA_OPS=y
CONFIG_XEN_HAVE_PVMMU=y
CONFIG_XEN_HAVE_VPMU=y
CONFIG_XEN_PCI_STUB=y
CONFIG_XEN_PVHVM=y
CONFIG_XEN_PVHVM_SMP=y
CONFIG_XEN_PV_SMP=y
CONFIG_XEN_SAVE_RESTORE=y
CONFIG_XEN_XENBUS_FRONTEND=y
CONFIG_ZSTD_COMPRESS=m CONFIG_ZSTD_COMPRESS=m

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

542
debian/config/config vendored

File diff suppressed because it is too large Load Diff

116
debian/copyright vendored
View File

@@ -25,43 +25,43 @@ Copyright: 1996-2006 Manoj Srivastava
License: GPL-2 License: GPL-2
Files: Files:
arch/arm/boot/dts/armada-370.dtsi arch/arm/boot/dts/allwinner/axp*.dts*
arch/arm/boot/dts/armada-370-d*.dts* arch/arm/boot/dts/allwinner/sun*.dts*
arch/arm/boot/dts/armada-370-mirabox.dts arch/arm/boot/dts/amlogic/meson*.dts*
arch/arm/boot/dts/armada-370-netgear*.dts* arch/arm/boot/dts/arm/mps2*.dts*
arch/arm/boot/dts/armada-370-rd.dts arch/arm/boot/dts/axis/artpec6.dtsi
arch/arm/boot/dts/armada-370-synology-ds213j.dts arch/arm/boot/dts/cnxt/cx92755*.dts*
arch/arm/boot/dts/armada-375*.dts*
arch/arm/boot/dts/armada-38*.dts*
arch/arm/boot/dts/armada-39*.dts*
arch/arm/boot/dts/armada-xp*.dts*
arch/arm/boot/dts/artpec6.dtsi
arch/arm/boot/dts/at91sam9260ek.dts
arch/arm/boot/dts/at91sam9xe.dtsi
arch/arm/boot/dts/axp*.dts*
arch/arm/boot/dts/berlin2*.dts*
arch/arm/boot/dts/cros-ec-sbs.dtsi arch/arm/boot/dts/cros-ec-sbs.dtsi
arch/arm/boot/dts/cx92755*.dts* arch/arm/boot/dts/intel/socfpga/socfpga_cyclone5_vining_fpga.dts
arch/arm/boot/dts/imx7*.dts* arch/arm/boot/dts/marvell/armada-370-d*.dts*
arch/arm/boot/dts/kirkwood-linkstation*.dts* arch/arm/boot/dts/marvell/armada-370-mirabox.dts
arch/arm/boot/dts/ls*.dts* arch/arm/boot/dts/marvell/armada-370-netgear*.dts*
arch/arm/boot/dts/meson*.dts* arch/arm/boot/dts/marvell/armada-370-rd.dts
arch/arm/boot/dts/mps2*.dts* arch/arm/boot/dts/marvell/armada-370-synology-ds213j.dts
arch/arm/boot/dts/mvebu-linkstation-*.dts* arch/arm/boot/dts/marvell/armada-370.dtsi
arch/arm/boot/dts/orion5x-kuroboxpro.dts arch/arm/boot/dts/marvell/armada-375*.dts*
arch/arm/boot/dts/orion5x-linkstation*.dts* arch/arm/boot/dts/marvell/armada-38*.dts*
arch/arm/boot/dts/orion5x-ls*.dts* arch/arm/boot/dts/marvell/armada-39*.dts*
arch/arm/boot/dts/qcom-mdm9615*.dts* arch/arm/boot/dts/marvell/armada-xp*.dts*
arch/arm/boot/dts/rk*.dts arch/arm/boot/dts/marvell/kirkwood-linkstation*.dts*
arch/arm/boot/dts/sama5d2.dtsi arch/arm/boot/dts/marvell/mvebu-linkstation-*.dts*
arch/arm/boot/dts/sama5d4.dtsi arch/arm/boot/dts/marvell/orion5x-kuroboxpro.dts
arch/arm/boot/dts/socfpga_cyclone5_vining_fpga.dts arch/arm/boot/dts/marvell/orion5x-linkstation*.dts*
arch/arm/boot/dts/stm*.dts* arch/arm/boot/dts/marvell/orion5x-ls*.dts*
arch/arm/boot/dts/sun*.dts* arch/arm/boot/dts/microchip/at91sam9260ek.dts
arch/arm/boot/dts/tegra124-apalis*.dts* arch/arm/boot/dts/microchip/at91sam9xe.dtsi
arch/arm/boot/dts/uniphier-*.dts* arch/arm/boot/dts/microchip/sama5d2.dtsi
arch/arm/boot/dts/vf610-colibri*.dts* arch/arm/boot/dts/microchip/sama5d4.dtsi
arch/arm/boot/dts/vf610m*.dts* arch/arm/boot/dts/nvidia/tegra124-apalis*.dts*
arch/arm/boot/dts/nxp/imx/imx7*.dts*
arch/arm/boot/dts/nxp/ls/ls*.dts*
arch/arm/boot/dts/nxp/vf/vf610-colibri*.dts*
arch/arm/boot/dts/nxp/vf/vf610m*.dts*
arch/arm/boot/dts/qcom/qcom-mdm9615*.dts*
arch/arm/boot/dts/rockchip/rk*.dts
arch/arm/boot/dts/socionext/uniphier-*.dts*
arch/arm/boot/dts/st/stm*.dts*
arch/arm/boot/dts/synaptics/berlin2*.dts*
arch/arm64/boot/dts/allwinner/*.dts* arch/arm64/boot/dts/allwinner/*.dts*
arch/arm64/boot/dts/amlogic/*.dts* arch/arm64/boot/dts/amlogic/*.dts*
arch/arm64/boot/dts/cavium/thunder-*.dts* arch/arm64/boot/dts/cavium/thunder-*.dts*
@@ -78,48 +78,11 @@ Files:
Copyright: 2012-2018 Linus Torvalds and many others Copyright: 2012-2018 Linus Torvalds and many others
License: GPL-2+-or-X11 License: GPL-2+-or-X11
Files: drivers/crypto/vmx/*.pl
Copyright: 2006,2014 Andy Polyakov <appro@openssl.org>
License: CRYPTOGAMS
All rights reserved.
.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
.
* Redistributions of source code must retain copyright notices, this
list of conditions and the following disclaimer.
* 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.
* Neither the name of the CRYPTOGAMS nor the names of its copyright
holder and contributors may be used to endorse or promote products
derived from this software without specific prior written
permission.
.
ALTERNATIVELY, provided that this notice is retained in full, this
product may be distributed under the terms of the GNU General Public
License (GPL), in which case the provisions of the GPL apply INSTEAD
OF those given above.
.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER 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 COPYRIGHT
OWNER 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.
Files: fs/nls/mac-* Files: fs/nls/mac-*
Copyright: 1991-2012 Unicode, Inc. Copyright: 1991-2012 Unicode, Inc.
License: Unicode-data License: Unicode-data
All rights reserved. Distributed under the Terms of Use in All rights reserved. Distributed under the Terms of Use in
http://www.unicode.org/copyright.html. https://www.unicode.org/copyright.html.
. .
Permission is hereby granted, free of charge, to any person obtaining a Permission is hereby granted, free of charge, to any person obtaining a
copy of the Unicode data files and any associated documentation (the "Data copy of the Unicode data files and any associated documentation (the "Data
@@ -228,8 +191,7 @@ License: GPL-2
GNU General Public License for more details. GNU General Public License for more details.
. .
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this package; if not, write to the Free Software along with this program. If not, see <https://www.gnu.org/licenses/>.
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
. .
On Debian systems, the complete text of the GNU General Public License version On Debian systems, the complete text of the GNU General Public License version
2 can be found in `/usr/share/common-licenses/GPL-2'. 2 can be found in `/usr/share/common-licenses/GPL-2'.
@@ -246,7 +208,7 @@ License: LGPL-2.1
Lesser General Public License for more details. Lesser General Public License for more details.
. .
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program; If not, see <http://www.gnu.org/licenses/>. along with this program; If not, see <https://www.gnu.org/licenses/>.
. .
On Debian systems, the complete text of the GNU Lesser General Public On Debian systems, the complete text of the GNU Lesser General Public
License version 2.1 can be found in `/usr/share/common-licenses/LGPL-2.1'. License version 2.1 can be found in `/usr/share/common-licenses/LGPL-2.1'.

View File

@@ -9,7 +9,7 @@ configure )
if [ ${have_systemd} = 1 ] ; then if [ ${have_systemd} = 1 ] ; then
if [ -z "$2" ] ; then if [ -z "$2" ] ; then
# On initial install make sure udev notifies systemd # On initial install make sure udev notifies systemd
udevadm trigger || true udevadm trigger || :
else else
# On upgrade make sure running daemons are restarted # On upgrade make sure running daemons are restarted
systemctl try-restart hv-kvp-daemon.service hv-vss-daemon.service systemctl try-restart hv-kvp-daemon.service hv-vss-daemon.service

View File

@@ -14,11 +14,11 @@ upgrade )
init_service="hyperv-daemons.hv-$i-daemon" init_service="hyperv-daemons.hv-$i-daemon"
systemd_unit="${init_service}.service" systemd_unit="${init_service}.service"
if [ ${have_systemd} = 1 ] ; then if [ ${have_systemd} = 1 ] ; then
systemctl stop "${systemd_unit}" 2>/dev/null || true systemctl stop "${systemd_unit}" 2>/dev/null || :
fi fi
deb-systemd-helper purge "${systemd_unit}" || true deb-systemd-helper purge "${systemd_unit}" || :
invoke-rc.d --skip-systemd-native "${init_service}" stop || true invoke-rc.d --skip-systemd-native "${init_service}" stop || :
update-rc.d "${init_service}" remove || true update-rc.d "${init_service}" remove || :
done ; unset services i init_service systemd_unit done ; unset services i init_service systemd_unit
;; ;;
esac esac

View File

@@ -11,7 +11,6 @@ from pathlib import Path
from typing import ( from typing import (
Optional, Optional,
Self, Self,
TypeVar,
) )
import dacite import dacite
@@ -157,9 +156,6 @@ class ConfigBase:
return config return config
ConfigT = TypeVar('ConfigT', bound=ConfigBase)
@dataclasses.dataclass @dataclasses.dataclass
class Config(ConfigBase): class Config(ConfigBase):
# Disable basic fields # Disable basic fields
@@ -227,9 +223,9 @@ class Config(ConfigBase):
return config return config
@classmethod @classmethod
def _read_hierarchy( def _read_hierarchy[T: ConfigBase](
cls, bases: Iterable[Path], orig: Iterable[ConfigT], cls, bases: Iterable[Path], orig: Iterable[T],
) -> Iterable[ConfigT]: ) -> Iterable[T]:
for i in orig: for i in orig:
try: try:
assert i.path is not None assert i.path is not None

View File

@@ -5,22 +5,16 @@ import re
from typing import ( from typing import (
Any, Any,
Callable, Callable,
Generic,
IO, IO,
Iterable, Iterable,
Optional, Optional,
overload, overload,
TypeVar,
TYPE_CHECKING, TYPE_CHECKING,
) )
_T = TypeVar('_T')
if TYPE_CHECKING: if TYPE_CHECKING:
from dataclasses import _DataclassT from _typeshed import DataclassInstance as _DataclassInstance
else:
# We can only get to _DataclassT during type checking, use a generic type during runtime
_DataclassT = _T
__all__ = [ __all__ = [
'field_deb822', 'field_deb822',
@@ -30,61 +24,61 @@ __all__ = [
] ]
class Deb822Field(Generic[_T]): class Deb822Field[T]:
key: str key: str
load: Optional[Callable[[str], _T]] load: Optional[Callable[[str], T]]
dump: Optional[Callable[[_T], str]] dump: Optional[Callable[[T], str]]
def __init__( def __init__(
self, *, self, *,
key: str, key: str,
load: Optional[Callable[[str], _T]], load: Optional[Callable[[str], T]],
dump: Optional[Callable[[_T], str]], dump: Optional[Callable[[T], str]],
) -> None: ) -> None:
self.key = key self.key = key
self.load = load self.load = load
self.dump = dump self.dump = dump
# The return type _T is technically wrong, but it allows checking if during # The return type T is technically wrong, but it allows checking if during
# runtime we get the correct type. # runtime we get the correct type.
@overload @overload
def field_deb822( def field_deb822[T](
deb822_key: str, deb822_key: str,
/, *, /, *,
deb822_load: Optional[Callable[[str], _T]] = None, deb822_load: Optional[Callable[[str], T]] = None,
deb822_dump: Optional[Callable[[_T], str]] = str, deb822_dump: Optional[Callable[[T], str]] = str,
default: _T, default: T,
) -> _T: ) -> T:
... ...
@overload @overload
def field_deb822( def field_deb822[T](
deb822_key: str, deb822_key: str,
/, *, /, *,
deb822_load: Optional[Callable[[str], _T]] = None, deb822_load: Optional[Callable[[str], T]] = None,
deb822_dump: Optional[Callable[[_T], str]] = str, deb822_dump: Optional[Callable[[T], str]] = str,
default_factory: Callable[[], _T], default_factory: Callable[[], T],
) -> _T: ) -> T:
... ...
@overload @overload
def field_deb822( def field_deb822[T](
deb822_key: str, deb822_key: str,
/, *, /, *,
deb822_load: Optional[Callable[[str], _T]] = None, deb822_load: Optional[Callable[[str], T]] = None,
deb822_dump: Optional[Callable[[_T], str]] = str, deb822_dump: Optional[Callable[[T], str]] = str,
) -> _T: ) -> T:
... ...
def field_deb822( def field_deb822[T](
deb822_key: str, deb822_key: str,
/, *, /, *,
deb822_load: Optional[Callable[[str], _T]] = None, deb822_load: Optional[Callable[[str], T]] = None,
deb822_dump: Optional[Callable[[_T], str]] = str, deb822_dump: Optional[Callable[[T], str]] = str,
default: Any = dataclasses.MISSING, default: Any = dataclasses.MISSING,
default_factory: Any = dataclasses.MISSING, default_factory: Any = dataclasses.MISSING,
) -> Any: ) -> Any:
@@ -112,8 +106,8 @@ class Deb822DecodeError(ValueError):
pass pass
class Deb822DecodeState(Generic[_DataclassT]): class Deb822DecodeState[T: _DataclassInstance]:
cls: type[_DataclassT] cls: type[T]
fields: dict[str, dataclasses.Field] fields: dict[str, dataclasses.Field]
ignore_unknown: bool ignore_unknown: bool
@@ -132,7 +126,7 @@ class Deb822DecodeState(Generic[_DataclassT]):
def __init__( def __init__(
self, self,
cls: type[_DataclassT], cls: type[T],
ignore_unknown: bool, ignore_unknown: bool,
) -> None: ) -> None:
self.reset() self.reset()
@@ -167,7 +161,7 @@ class Deb822DecodeState(Generic[_DataclassT]):
else: else:
raise NotImplementedError raise NotImplementedError
def generate(self) -> _DataclassT | None: def generate(self) -> T | None:
if not self.data: if not self.data:
return None return None
@@ -192,12 +186,12 @@ class Deb822DecodeState(Generic[_DataclassT]):
return self.cls(**r) return self.cls(**r)
def read_deb822( def read_deb822[T: _DataclassInstance](
cls: type[_DataclassT], cls: type[T],
file: IO[str], file: IO[str],
/, /,
ignore_unknown: bool = False, ignore_unknown: bool = False,
) -> Iterable[_DataclassT]: ) -> Iterable[T]:
state = Deb822DecodeState(cls, ignore_unknown) state = Deb822DecodeState(cls, ignore_unknown)
for linenr, line in enumerate(file): for linenr, line in enumerate(file):
@@ -217,8 +211,8 @@ def read_deb822(
yield obj yield obj
def write_deb822( def write_deb822[T: _DataclassInstance](
objs: Iterable[_DataclassT], objs: Iterable[T],
file: IO[str], file: IO[str],
/, /,
) -> None: ) -> None:

View File

@@ -7,7 +7,6 @@ from dataclasses import (
) )
from typing import ( from typing import (
Protocol, Protocol,
TypeVar,
TYPE_CHECKING, TYPE_CHECKING,
) )
@@ -17,14 +16,11 @@ if TYPE_CHECKING:
class _HasName(Protocol, _DataclassInstance): class _HasName(Protocol, _DataclassInstance):
name: str name: str
_DataclassT = TypeVar('_DataclassT', bound=_DataclassInstance)
_HasNameT = TypeVar('_HasNameT', bound=_HasName)
def default[T: _DataclassInstance](
def default( cls: type[T],
cls: type[_DataclassT],
/, /,
) -> _DataclassT: ) -> T:
f = {} f = {}
for field in fields(cls): for field in fields(cls):
@@ -34,10 +30,10 @@ def default(
return cls(**f) return cls(**f)
def merge( def merge[T: _DataclassInstance](
self: _DataclassT, self: T,
other: _DataclassT | None, /, other: T | None, /,
) -> _DataclassT: ) -> T:
if other is None: if other is None:
return self return self
@@ -75,22 +71,22 @@ def merge(
return replace(self, **f) return replace(self, **f)
def merge_default( def merge_default[T: _DataclassInstance](
cls: type[_DataclassT], cls: type[T],
/, /,
*others: _DataclassT, *others: T,
) -> _DataclassT: ) -> T:
ret: _DataclassT = default(cls) ret: T = default(cls)
for o in others: for o in others:
ret = merge(ret, o) ret = merge(ret, o)
return ret return ret
def _merge_assoclist( def _merge_assoclist[T: _HasName](
self_list: list[_HasNameT], self_list: list[T],
other_list: list[_HasNameT], other_list: list[T],
/, /,
) -> list[_HasNameT]: ) -> list[T]:
''' '''
Merge lists where each item got a "name" attribute Merge lists where each item got a "name" attribute
''' '''
@@ -99,7 +95,7 @@ def _merge_assoclist(
if not other_list: if not other_list:
return self_list return self_list
ret: list[_HasNameT] = [] ret: list[T] = []
other_dict = { other_dict = {
i.name: i i.name: i
for i in other_list for i in other_list

View File

@@ -181,28 +181,6 @@ class VersionLinux(Version):
\d+ \d+
) )
)? )?
$
""", re.X)
_revision_re = re.compile(r"""
\d+
(\.\d+)?
(?:
(?P<revision_experimental>
~exp\d+
)
|
(?P<revision_security>
(?:[~+]deb\d+u\d+)+
)?
(?P<revision_backports>
~bpo\d+\+\d+
)?
|
(?P<revision_other>
.+?
)
)
(?:\+b\d+)?
$ $
""", re.X) """, re.X)
@@ -223,11 +201,6 @@ $
self.linux_upstream = d['version'] self.linux_upstream = d['version']
self.linux_upstream_full = self.linux_upstream + d['update'] self.linux_upstream_full = self.linux_upstream + d['update']
self.linux_dfsg = d['dfsg'] self.linux_dfsg = d['dfsg']
d = rev_match.groupdict()
self.linux_revision_experimental = d['revision_experimental'] and True
self.linux_revision_security = d['revision_security'] and True
self.linux_revision_backports = d['revision_backports'] and True
self.linux_revision_other = d['revision_other'] and True
class PackageArchitecture(set[str]): class PackageArchitecture(set[str]):
@@ -370,9 +343,8 @@ class PackageRelationEntry:
ret.append(f'({self.operator} {self.version})') ret.append(f'({self.operator} {self.version})')
if self.arches: if self.arches:
ret.append(f'[{self.arches}]') ret.append(f'[{self.arches}]')
if self.restrictions:
ret.append(str(self.restrictions)) ret.append(str(self.restrictions))
return ' '.join(ret) return ' '.join(i for i in ret if i)
class PackageRelationGroup(list[PackageRelationEntry]): class PackageRelationGroup(list[PackageRelationEntry]):
@@ -443,8 +415,6 @@ class PackageBuildprofileEntry:
pos: set[str] = dataclasses.field(default_factory=set) pos: set[str] = dataclasses.field(default_factory=set)
neg: set[str] = dataclasses.field(default_factory=set) neg: set[str] = dataclasses.field(default_factory=set)
__re = re.compile(r'^<(?P<profiles>[a-z0-9. !-]+)>$')
def copy(self) -> Self: def copy(self) -> Self:
return self.__class__( return self.__class__(
pos=set(self.pos), pos=set(self.pos),
@@ -453,17 +423,15 @@ class PackageBuildprofileEntry:
@classmethod @classmethod
def parse(cls, v: str, /) -> Self: def parse(cls, v: str, /) -> Self:
match = cls.__re.match(v)
if not match:
raise RuntimeError('Unable to parse build profile "%s"' % v)
ret = cls() ret = cls()
for i in re.split(r' ', match.group('profiles')): for i in re.split(r' ', v):
if i: if i:
if i[0] == '!': if i[0] == '!':
ret.neg.add(i[1:]) ret.neg.add(i[1:])
else: else:
ret.pos.add(i) ret.pos.add(i)
if ret.pos & ret.neg:
raise ValueError
return ret return ret
def __eq__(self, other: object, /) -> bool: def __eq__(self, other: object, /) -> bool:
@@ -494,7 +462,7 @@ class PackageBuildprofileEntry:
return self.pos <= other.pos and self.neg >= other.neg return self.pos <= other.pos and self.neg >= other.neg
__ge__ = issuperset __ge__ = issuperset
def update(self, other: Self, /) -> None: def update(self, other: Self, /) -> Self:
''' '''
Update the build profiles, adding entries from other, merging if possible. Update the build profiles, adding entries from other, merging if possible.
@@ -502,20 +470,41 @@ class PackageBuildprofileEntry:
All others remain if they are used on both sides. All others remain if they are used on both sides.
''' '''
diff = (self.pos & other.neg) | (self.neg & other.pos) diff = (self.pos & other.neg) | (self.neg & other.pos)
self.pos &= other.pos - diff self.pos &= other.pos
self.neg &= other.neg - diff self.neg &= other.neg
self.pos -= diff
self.neg -= diff
return self
__ior__ = update __ior__ = update
def intersection_update(self, other: Self, /) -> Self:
'''
Update the build profiles, creating an intersection of both.
Negating entries (profile vs !profile) are completely removed.
All others remain.
'''
diff = (self.pos & other.neg) | (self.neg & other.pos)
self.pos |= other.pos
self.neg |= other.neg
self.pos -= diff
self.neg -= diff
return self
__iand__ = intersection_update
def __len__(self) -> int:
return len(self.pos) + len(self.neg)
def __str__(self) -> str: def __str__(self) -> str:
s = ' '.join(itertools.chain( return ' '.join(itertools.chain(
sorted(self.pos), sorted(self.pos),
(f'!{i}' for i in sorted(self.neg)), (f'!{i}' for i in sorted(self.neg)),
)) ))
return f'<{s}>'
class PackageBuildprofile(list[PackageBuildprofileEntry]): class PackageBuildprofile(list[PackageBuildprofileEntry]):
__re = re.compile(r' *(<[^>]+>)(?: +|$)') __re = re.compile(r' *<(?P<entry>[a-z0-9. !-]+)>(?: +|$)')
def copy(self) -> Self: def copy(self) -> Self:
return self.__class__(i.copy() for i in self) return self.__class__(i.copy() for i in self)
@@ -524,10 +513,10 @@ class PackageBuildprofile(list[PackageBuildprofileEntry]):
def parse(cls, v: str, /) -> Self: def parse(cls, v: str, /) -> Self:
ret = cls() ret = cls()
for match in cls.__re.finditer(v): for match in cls.__re.finditer(v):
ret.append(PackageBuildprofileEntry.parse(match.group(1))) ret.append(PackageBuildprofileEntry.parse(match.group('entry')))
return ret return ret
def update(self, v: Self, /) -> None: def update(self, v: Self, /) -> Self:
for i in v: for i in v:
for j in self: for j in self:
if not j.isdisjoint(i): if not j.isdisjoint(i):
@@ -535,10 +524,23 @@ class PackageBuildprofile(list[PackageBuildprofileEntry]):
break break
else: else:
self.append(i) self.append(i)
return self
__ior__ = update __ior__ = update
def intersection_update(self, v: Self, /) -> Self:
if len(v) > 1:
raise ValueError
for i in v:
if self:
for j in self:
j.intersection_update(i)
else:
self.append(i)
return self
__iand__ = intersection_update
def __str__(self) -> str: def __str__(self) -> str:
return ' '.join(str(i) for i in self) return ' '.join(f'<{str(i)}>' for i in self if i)
@dataclasses.dataclass @dataclasses.dataclass

View File

@@ -189,6 +189,7 @@ class PackagesBundle:
package.meta_rules_check_packages = check_packages package.meta_rules_check_packages = check_packages
for name in ( for name in (
'NEWS',
'lintian-overrides', 'lintian-overrides',
'maintscript', 'maintscript',
'postinst', 'postinst',
@@ -202,7 +203,11 @@ class PackagesBundle:
except KeyError: except KeyError:
pass pass
else: else:
with self.open(f'{package_name}.{name}') as f: if arch:
out = f'{package_name}.{name}.{arch}'
else:
out = f'{package_name}.{name}'
with self.open(out) as f:
f.write(template) f.write(template)
return ret return ret
@@ -341,8 +346,7 @@ class PackagesBundle:
for item in group: for item in group:
if package.architecture != arch_all and not item.arches: if package.architecture != arch_all and not item.arches:
item.arches = package.architecture item.arches = package.architecture
if package.build_profiles and not item.restrictions: item.restrictions &= package.build_profiles
item.restrictions = package.build_profiles
build_dep.merge(group) build_dep.merge(group)
def write(self) -> None: def write(self) -> None:

View File

@@ -1,424 +0,0 @@
import pytest
from .debian import (
Version,
VersionLinux,
PackageArchitecture,
PackageDescription,
PackageRelationEntry,
PackageRelationGroup,
PackageRelation,
PackageBuildprofileEntry,
PackageBuildprofile,
)
class TestVersion:
def test_native(self) -> None:
v = Version('1.2+c~4')
assert v.epoch is None
assert v.upstream == '1.2+c~4'
assert v.revision is None
assert v.complete == '1.2+c~4'
assert v.complete_noepoch == '1.2+c~4'
def test_nonnative(self) -> None:
v = Version('1-2+d~3')
assert v.epoch is None
assert v.upstream == '1'
assert v.revision == '2+d~3'
assert v.complete == '1-2+d~3'
assert v.complete_noepoch == '1-2+d~3'
def test_native_epoch(self) -> None:
v = Version('5:1.2.3')
assert v.epoch == 5
assert v.upstream == '1.2.3'
assert v.revision is None
assert v.complete == '5:1.2.3'
assert v.complete_noepoch == '1.2.3'
def test_nonnative_epoch(self) -> None:
v = Version('5:1.2.3-4')
assert v.epoch == 5
assert v.upstream == '1.2.3'
assert v.revision == '4'
assert v.complete == '5:1.2.3-4'
assert v.complete_noepoch == '1.2.3-4'
def test_multi_hyphen(self) -> None:
v = Version('1-2-3')
assert v.epoch is None
assert v.upstream == '1-2'
assert v.revision == '3'
assert v.complete == '1-2-3'
def test_multi_colon(self) -> None:
v = Version('1:2:3')
assert v.epoch == 1
assert v.upstream == '2:3'
assert v.revision is None
def test_invalid_epoch(self) -> None:
with pytest.raises(RuntimeError):
Version('a:1')
with pytest.raises(RuntimeError):
Version('-1:1')
with pytest.raises(RuntimeError):
Version('1a:1')
def test_invalid_upstream(self) -> None:
with pytest.raises(RuntimeError):
Version('1_2')
with pytest.raises(RuntimeError):
Version('1/2')
with pytest.raises(RuntimeError):
Version('a1')
with pytest.raises(RuntimeError):
Version('1 2')
def test_invalid_revision(self) -> None:
with pytest.raises(RuntimeError):
Version('1-2_3')
with pytest.raises(RuntimeError):
Version('1-2/3')
with pytest.raises(RuntimeError):
Version('1-2:3')
class TestVersionLinux:
def test_stable(self) -> None:
v = VersionLinux('1.2.3-4')
assert v.linux_version == '1.2'
assert v.linux_upstream == '1.2'
assert v.linux_upstream_full == '1.2.3'
assert v.linux_modifier is None
assert v.linux_dfsg is None
assert not v.linux_revision_experimental
assert not v.linux_revision_security
assert not v.linux_revision_backports
assert not v.linux_revision_other
def test_rc(self) -> None:
v = VersionLinux('1.2~rc3-4')
assert v.linux_version == '1.2'
assert v.linux_upstream == '1.2-rc3'
assert v.linux_upstream_full == '1.2-rc3'
assert v.linux_modifier == 'rc3'
assert v.linux_dfsg is None
assert not v.linux_revision_experimental
assert not v.linux_revision_security
assert not v.linux_revision_backports
assert not v.linux_revision_other
def test_dfsg(self) -> None:
v = VersionLinux('1.2~rc3.dfsg.1-4')
assert v.linux_version == '1.2'
assert v.linux_upstream == '1.2-rc3'
assert v.linux_upstream_full == '1.2-rc3'
assert v.linux_modifier == 'rc3'
assert v.linux_dfsg == '1'
assert not v.linux_revision_experimental
assert not v.linux_revision_security
assert not v.linux_revision_backports
assert not v.linux_revision_other
def test_experimental(self) -> None:
v = VersionLinux('1.2~rc3-4~exp5')
assert v.linux_upstream_full == '1.2-rc3'
assert v.linux_revision_experimental
assert not v.linux_revision_security
assert not v.linux_revision_backports
assert not v.linux_revision_other
def test_security(self) -> None:
v = VersionLinux('1.2.3-4+deb10u1')
assert v.linux_upstream_full == '1.2.3'
assert not v.linux_revision_experimental
assert v.linux_revision_security
assert not v.linux_revision_backports
assert not v.linux_revision_other
def test_backports(self) -> None:
v = VersionLinux('1.2.3-4~bpo9+10')
assert v.linux_upstream_full == '1.2.3'
assert not v.linux_revision_experimental
assert not v.linux_revision_security
assert v.linux_revision_backports
assert not v.linux_revision_other
def test_security_backports(self) -> None:
v = VersionLinux('1.2.3-4+deb10u1~bpo9+10')
assert v.linux_upstream_full == '1.2.3'
assert not v.linux_revision_experimental
assert v.linux_revision_security
assert v.linux_revision_backports
assert not v.linux_revision_other
def test_lts_backports(self) -> None:
# Backport during LTS, as an extra package in the -security
# suite. Since this is not part of a -backports suite it
# shouldn't get the linux_revision_backports flag.
v = VersionLinux('1.2.3-4~deb9u10')
assert v.linux_upstream_full == '1.2.3'
assert not v.linux_revision_experimental
assert v.linux_revision_security
assert not v.linux_revision_backports
assert not v.linux_revision_other
def test_lts_backports_2(self) -> None:
# Same but with two security extensions in the revision.
v = VersionLinux('1.2.3-4+deb10u1~deb9u10')
assert v.linux_upstream_full == '1.2.3'
assert not v.linux_revision_experimental
assert v.linux_revision_security
assert not v.linux_revision_backports
assert not v.linux_revision_other
def test_binnmu(self) -> None:
v = VersionLinux('1.2.3-4+b1')
assert not v.linux_revision_experimental
assert not v.linux_revision_security
assert not v.linux_revision_backports
assert not v.linux_revision_other
def test_other_revision(self) -> None:
v = VersionLinux('4.16.5-1+revert+crng+ready') # from #898087
assert not v.linux_revision_experimental
assert not v.linux_revision_security
assert not v.linux_revision_backports
assert v.linux_revision_other
def test_other_revision_binnmu(self) -> None:
v = VersionLinux('4.16.5-1+revert+crng+ready+b1')
assert not v.linux_revision_experimental
assert not v.linux_revision_security
assert not v.linux_revision_backports
assert v.linux_revision_other
class TestPackageArchitecture:
def test_init(self) -> None:
a = PackageArchitecture()
assert a == set()
def test_init_str(self) -> None:
a = PackageArchitecture(' foo bar\tbaz ')
assert a == {'foo', 'bar', 'baz'}
def test_init_iter(self) -> None:
a = PackageArchitecture(('foo', 'bar'))
assert a == {'foo', 'bar'}
def test_init_self(self) -> None:
a = PackageArchitecture(PackageArchitecture(('foo', 'bar')))
assert a == {'foo', 'bar'}
def test_str(self) -> None:
a = PackageArchitecture(('foo', 'bar'))
assert str(a) == 'bar foo'
class TestPackageDescription:
def test_init(self) -> None:
a = PackageDescription()
assert a.short == []
assert a.long == []
def test_init_str(self) -> None:
a = PackageDescription('Short\nLong1\n.\nLong2')
assert a.short == ['Short']
assert a.long == ['Long1', 'Long2']
def test_init_self(self) -> None:
a = PackageDescription(PackageDescription('Short\nLong1\n.\nLong2'))
assert a.short == ['Short']
assert a.long == ['Long1', 'Long2']
def test_str(self) -> None:
a = PackageDescription('Short\nLong1\n.\nLong2')
assert str(a) == 'Short\nLong1\n.\nLong2'
class TestPackageRelationEntry:
def test_init_str(self) -> None:
a = PackageRelationEntry('package (>=version) [arch2 arch1] <profile1 >')
assert a.name == 'package'
assert a.version == 'version'
assert a.arches == {'arch1', 'arch2'}
# TODO: assert a.profiles
assert str(a) == 'package (>= version) [arch1 arch2] <profile1>'
def test_init_self(self) -> None:
a = PackageRelationEntry(PackageRelationEntry('package [arch2 arch1]'))
assert a.name == 'package'
assert a.arches == {'arch1', 'arch2'}
assert str(a) == 'package [arch1 arch2]'
class TestPackageRelationGroup:
def test_init(self) -> None:
a = PackageRelationGroup()
assert a == []
def test_init_str(self) -> None:
a = PackageRelationGroup('foo | bar')
assert len(a) == 2
assert a[0].name == 'foo'
assert a[1].name == 'bar'
def test_init_iter_entry(self) -> None:
a = PackageRelationGroup((PackageRelationEntry('foo'), PackageRelationEntry('bar')))
assert len(a) == 2
assert a[0].name == 'foo'
assert a[1].name == 'bar'
def test_init_iter_str(self) -> None:
a = PackageRelationGroup(('foo', 'bar'))
assert len(a) == 2
assert a[0].name == 'foo'
assert a[1].name == 'bar'
def test_init_self(self) -> None:
a = PackageRelationGroup(PackageRelationGroup(['foo', 'bar']))
assert len(a) == 2
assert a[0].name == 'foo'
assert a[1].name == 'bar'
def test_str(self) -> None:
a = PackageRelationGroup('foo| bar')
assert str(a) == 'foo | bar'
class TestPackageRelation:
def test_init(self) -> None:
a = PackageRelation()
assert a == []
def test_init_str(self) -> None:
a = PackageRelation('foo1 | foo2, bar')
assert len(a) == 2
assert len(a[0]) == 2
assert a[0][0].name == 'foo1'
assert a[0][1].name == 'foo2'
assert len(a[1]) == 1
assert a[1][0].name == 'bar'
def test_init_iter_entry(self) -> None:
a = PackageRelation([[PackageRelationEntry('foo')], [PackageRelationEntry('bar')]])
assert len(a) == 2
assert len(a[0]) == 1
assert a[0][0].name == 'foo'
assert len(a[1]) == 1
assert a[1][0].name == 'bar'
def test_init_iter_str(self) -> None:
a = PackageRelation(('foo', 'bar'))
assert len(a) == 2
assert len(a[0]) == 1
assert a[0][0].name == 'foo'
assert len(a[1]) == 1
assert a[1][0].name == 'bar'
def test_init_self(self) -> None:
a = PackageRelation(PackageRelation(('foo', 'bar')))
assert len(a) == 2
assert len(a[0]) == 1
assert a[0][0].name == 'foo'
assert len(a[1]) == 1
assert a[1][0].name == 'bar'
def test_str(self) -> None:
a = PackageRelation('foo ,bar')
assert str(a) == 'foo, bar'
class TestPackageBuildprofileEntry:
def test_parse(self) -> None:
a = PackageBuildprofileEntry.parse('<profile1 !profile2 profile3 !profile4>')
assert a.pos == {'profile1', 'profile3'}
assert a.neg == {'profile2', 'profile4'}
assert str(a) == '<profile1 profile3 !profile2 !profile4>'
def test_eq(self) -> None:
a = PackageBuildprofileEntry.parse('<profile1 !profile2>')
b = PackageBuildprofileEntry(pos={'profile1'}, neg={'profile2'})
assert a == b
def test_isdisjoint(self) -> None:
a = PackageBuildprofileEntry.parse('<profile1 profile2>')
b = PackageBuildprofileEntry.parse('<profile1 profile3>')
assert a.isdisjoint(b)
def test_issubset_empty(self) -> None:
a = PackageBuildprofileEntry.parse('<profile1 profile2>')
b = PackageBuildprofileEntry()
assert a.issubset(b)
def test_issubset_pos(self) -> None:
a = PackageBuildprofileEntry.parse('<profile1 profile2>')
b = PackageBuildprofileEntry.parse('<profile1>')
assert a.issubset(b)
def test_issubset_neg(self) -> None:
a = PackageBuildprofileEntry.parse('<!profile1>')
b = PackageBuildprofileEntry.parse('<!profile1 !profile2>')
assert a.issubset(b)
def test_issubset_both(self) -> None:
a = PackageBuildprofileEntry.parse('<!profile1 !profile2 profile3>')
b = PackageBuildprofileEntry.parse('<!profile1 !profile2 !profile3>')
assert a.issubset(b)
def test_issuperset_empty(self) -> None:
a = PackageBuildprofileEntry.parse('<profile1 profile2>')
b = PackageBuildprofileEntry()
assert b.issuperset(a)
def test_issuperset_pos(self) -> None:
a = PackageBuildprofileEntry.parse('<profile1 profile2>')
b = PackageBuildprofileEntry.parse('<profile1>')
assert b.issuperset(a)
def test_issuperset_neg(self) -> None:
a = PackageBuildprofileEntry.parse('<!profile1>')
b = PackageBuildprofileEntry.parse('<!profile1 !profile2>')
assert b.issuperset(a)
def test_issuperset_both(self) -> None:
a = PackageBuildprofileEntry.parse('<!profile1 !profile2 profile3>')
b = PackageBuildprofileEntry.parse('<!profile1 !profile2 !profile3>')
assert b.issuperset(a)
def test_update_pos(self) -> None:
a = PackageBuildprofileEntry.parse('<profile1 profile2>')
b = PackageBuildprofileEntry.parse('<profile1>')
a.update(b)
assert a.pos == {'profile1'}
assert a.neg == set()
def test_update_neg(self) -> None:
a = PackageBuildprofileEntry.parse('<!profile1 !profile2>')
b = PackageBuildprofileEntry.parse('<!profile1>')
a.update(b)
assert a.pos == set()
assert a.neg == {'profile1'}
def test_update_both(self) -> None:
a = PackageBuildprofileEntry.parse('<profile1 !profile2 profile3>')
b = PackageBuildprofileEntry.parse('<profile1 !profile2 !profile3>')
a.update(b)
assert a.pos == {'profile1'}
assert a.neg == {'profile2'}
class TestPackageBuildprofile:
def test_parse(self) -> None:
a = PackageBuildprofile.parse('<profile1> <!profile2> <profile3> <!profile4>')
assert str(a) == '<profile1> <!profile2> <profile3> <!profile4>'
def test_update(self) -> None:
a = PackageBuildprofile.parse('<profile1 profile2> <profile2>')
b = PackageBuildprofile.parse('<profile1> <profile2 !profile3> <profile3>')
a.update(b)
assert str(a) == '<profile1> <profile2> <profile3>'

View File

@@ -6,6 +6,7 @@ libcpupower.so.1 libcpupower1 #MINVER#
cpufreq_get_available_governors@Base 4.7~rc2-1~exp1 cpufreq_get_available_governors@Base 4.7~rc2-1~exp1
cpufreq_get_boost_frequencies@Base 5.5.8-1~exp1 cpufreq_get_boost_frequencies@Base 5.5.8-1~exp1
cpufreq_get_driver@Base 4.7~rc2-1~exp1 cpufreq_get_driver@Base 4.7~rc2-1~exp1
cpufreq_get_energy_performance_preference@Base 6.14~
cpufreq_get_freq_hardware@Base 4.7~rc2-1~exp1 cpufreq_get_freq_hardware@Base 4.7~rc2-1~exp1
cpufreq_get_freq_kernel@Base 4.7~rc2-1~exp1 cpufreq_get_freq_kernel@Base 4.7~rc2-1~exp1
cpufreq_get_hardware_limits@Base 4.7~rc2-1~exp1 cpufreq_get_hardware_limits@Base 4.7~rc2-1~exp1
@@ -23,6 +24,7 @@ libcpupower.so.1 libcpupower1 #MINVER#
cpufreq_put_available_governors@Base 4.7~rc2-1~exp1 cpufreq_put_available_governors@Base 4.7~rc2-1~exp1
cpufreq_put_boost_frequencies@Base 5.5.8-1~exp1 cpufreq_put_boost_frequencies@Base 5.5.8-1~exp1
cpufreq_put_driver@Base 4.7~rc2-1~exp1 cpufreq_put_driver@Base 4.7~rc2-1~exp1
cpufreq_put_energy_performance_preference@Base 6.14~
cpufreq_put_policy@Base 4.7~rc2-1~exp1 cpufreq_put_policy@Base 4.7~rc2-1~exp1
cpufreq_put_related_cpus@Base 4.7~rc2-1~exp1 cpufreq_put_related_cpus@Base 4.7~rc2-1~exp1
cpufreq_put_stats@Base 4.7~rc2-1~exp1 cpufreq_put_stats@Base 4.7~rc2-1~exp1
@@ -36,6 +38,7 @@ libcpupower.so.1 libcpupower1 #MINVER#
cpuidle_state_disable@Base 4.7~rc2-1~exp1 cpuidle_state_disable@Base 4.7~rc2-1~exp1
cpuidle_state_latency@Base 4.7~rc2-1~exp1 cpuidle_state_latency@Base 4.7~rc2-1~exp1
cpuidle_state_name@Base 4.7~rc2-1~exp1 cpuidle_state_name@Base 4.7~rc2-1~exp1
cpuidle_state_residency@Base 6.12~rc2-1~exp1
cpuidle_state_time@Base 4.7~rc2-1~exp1 cpuidle_state_time@Base 4.7~rc2-1~exp1
cpuidle_state_usage@Base 4.7~rc2-1~exp1 cpuidle_state_usage@Base 4.7~rc2-1~exp1
cpupower_is_cpu_online@Base 4.7~rc2-1~exp1 cpupower_is_cpu_online@Base 4.7~rc2-1~exp1

2
debian/linux-misc-tools.manpages vendored Normal file
View File

@@ -0,0 +1,2 @@
tools/thermal/thermometer/thermometer.8
tools/thermal/tmon/tmon.8

View File

@@ -1,4 +1,5 @@
# These executables are needed to handle processes running in compat mode # These executables are needed to handle processes running in compat mode
linux-perf: binary-from-other-architecture *usr/lib/perf-core/perf-read-vdso32*
linux-perf: binary-from-other-architecture *usr/lib/perf-core/perf-read-vdsox32* linux-perf: binary-from-other-architecture *usr/lib/perf-core/perf-read-vdsox32*
# Some of these plugins only need symbols from libtraceevent, which # Some of these plugins only need symbols from libtraceevent, which

View File

@@ -0,0 +1,10 @@
# This is a test program that does not link any libraries, either
# statically or dynamically
linux-perf: statically-linked-binary [usr/lib/perf-core/tests/shell/coresight/asm_pure_loop/asm_pure_loop]
# Some of these plugins only need symbols from libtraceevent, which
# loads them and should not have a NEEDED entry
linux-perf: shared-library-lacks-prerequisites *usr/lib/traceevent/plugins/plugin_*.so*
# This transition was too complex for dh_installdeb to handle
linux-perf: maintainer-script-should-not-use-dpkg-maintscript-helper "dpkg-maintscript-helper" *

View File

@@ -9,8 +9,7 @@ if [ -n "${old_version_suffix}" ] ; then
fi fi
unset old_version_suffix unset old_version_suffix
case "$1" in if [ "$1" = remove ] ; then
remove )
for wrapper in \ for wrapper in \
/usr/bin/perf \ /usr/bin/perf \
/usr/share/bash-completion/completions/perf \ /usr/share/bash-completion/completions/perf \
@@ -19,7 +18,6 @@ remove )
diversion="${wrapper%/perf*}/perf.wrapper${wrapper#*/perf}" diversion="${wrapper%/perf*}/perf.wrapper${wrapper#*/perf}"
dpkg-divert --package linux-perf --divert "${diversion}" --rename --remove "${wrapper}" dpkg-divert --package linux-perf --divert "${diversion}" --rename --remove "${wrapper}"
done ; unset wrapper diversion done ; unset wrapper diversion
;; fi
esac
#DEBHELPER# #DEBHELPER#

View File

@@ -1,24 +0,0 @@
From ae6a452692f8b02115019b0b62ac82ae2c432f59 Mon Sep 17 00:00:00 2001
From: Aurelien Jarno <aurelien@aurel32.net>
Date: Wed, 23 Oct 2024 21:28:33 +0200
Subject: [PATCH] Revert "mmc: dw_mmc: Fix IDMAC operation with pages bigger
than 4K"
This reverts commit 8396c793ffdf28bb8aee7cfe0891080f8cab7890.
---
drivers/mmc/host/dw_mmc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -2957,8 +2957,8 @@ static int dw_mci_init_slot(struct dw_mc
if (host->use_dma == TRANS_MODE_IDMAC) {
mmc->max_segs = host->ring_size;
mmc->max_blk_size = 65535;
- mmc->max_req_size = DW_MCI_DESC_DATA_LENGTH * host->ring_size;
- mmc->max_seg_size = mmc->max_req_size;
+ mmc->max_seg_size = 0x1000;
+ mmc->max_req_size = mmc->max_seg_size * host->ring_size;
mmc->max_blk_count = mmc->max_req_size / 512;
} else if (host->use_dma == TRANS_MODE_EDMAC) {
mmc->max_segs = 64;

View File

@@ -16,7 +16,7 @@ correctness.
--- a/drivers/net/phy/marvell.c --- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c
@@ -1366,6 +1366,7 @@ static int m88e1118_config_init(struct p @@ -1409,6 +1409,7 @@ static int m88e1118_config_init(struct p
return genphy_soft_reset(phydev); return genphy_soft_reset(phydev);
} }
@@ -24,7 +24,7 @@ correctness.
static int m88e1149_config_init(struct phy_device *phydev) static int m88e1149_config_init(struct phy_device *phydev)
{ {
int err; int err;
@@ -1391,7 +1392,9 @@ static int m88e1149_config_init(struct p @@ -1434,7 +1435,9 @@ static int m88e1149_config_init(struct p
return genphy_soft_reset(phydev); return genphy_soft_reset(phydev);
} }
@@ -34,7 +34,7 @@ correctness.
static int m88e1145_config_init_rgmii(struct phy_device *phydev) static int m88e1145_config_init_rgmii(struct phy_device *phydev)
{ {
int err; int err;
@@ -1469,6 +1472,7 @@ static int m88e1145_config_init(struct p @@ -1512,6 +1515,7 @@ static int m88e1145_config_init(struct p
return 0; return 0;
} }
@@ -42,7 +42,7 @@ correctness.
static int m88e1540_get_fld(struct phy_device *phydev, u8 *msecs) static int m88e1540_get_fld(struct phy_device *phydev, u8 *msecs)
{ {
@@ -3790,6 +3794,7 @@ static struct phy_driver marvell_drivers @@ -3828,6 +3832,7 @@ static struct phy_driver marvell_drivers
.led_hw_control_set = m88e1318_led_hw_control_set, .led_hw_control_set = m88e1318_led_hw_control_set,
.led_hw_control_get = m88e1318_led_hw_control_get, .led_hw_control_get = m88e1318_led_hw_control_get,
}, },
@@ -50,7 +50,7 @@ correctness.
{ {
.phy_id = MARVELL_PHY_ID_88E1145, .phy_id = MARVELL_PHY_ID_88E1145,
.phy_id_mask = MARVELL_PHY_ID_MASK, .phy_id_mask = MARVELL_PHY_ID_MASK,
@@ -3813,6 +3818,8 @@ static struct phy_driver marvell_drivers @@ -3851,6 +3856,8 @@ static struct phy_driver marvell_drivers
.cable_test_start = m88e1111_vct_cable_test_start, .cable_test_start = m88e1111_vct_cable_test_start,
.cable_test_get_status = m88e1111_vct_cable_test_get_status, .cable_test_get_status = m88e1111_vct_cable_test_get_status,
}, },
@@ -59,7 +59,7 @@ correctness.
{ {
.phy_id = MARVELL_PHY_ID_88E1149R, .phy_id = MARVELL_PHY_ID_88E1149R,
.phy_id_mask = MARVELL_PHY_ID_MASK, .phy_id_mask = MARVELL_PHY_ID_MASK,
@@ -3831,6 +3838,8 @@ static struct phy_driver marvell_drivers @@ -3869,6 +3876,8 @@ static struct phy_driver marvell_drivers
.get_strings = marvell_get_strings, .get_strings = marvell_get_strings,
.get_stats = marvell_get_stats, .get_stats = marvell_get_stats,
}, },
@@ -68,7 +68,7 @@ correctness.
{ {
.phy_id = MARVELL_PHY_ID_88E1240, .phy_id = MARVELL_PHY_ID_88E1240,
.phy_id_mask = MARVELL_PHY_ID_MASK, .phy_id_mask = MARVELL_PHY_ID_MASK,
@@ -3851,6 +3860,7 @@ static struct phy_driver marvell_drivers @@ -3889,6 +3898,7 @@ static struct phy_driver marvell_drivers
.get_tunable = m88e1011_get_tunable, .get_tunable = m88e1011_get_tunable,
.set_tunable = m88e1011_set_tunable, .set_tunable = m88e1011_set_tunable,
}, },
@@ -76,7 +76,7 @@ correctness.
{ {
.phy_id = MARVELL_PHY_ID_88E1116R, .phy_id = MARVELL_PHY_ID_88E1116R,
.phy_id_mask = MARVELL_PHY_ID_MASK, .phy_id_mask = MARVELL_PHY_ID_MASK,
@@ -4139,9 +4149,9 @@ static struct mdio_device_id __maybe_unu @@ -4177,9 +4187,9 @@ static const struct mdio_device_id __may
{ MARVELL_PHY_ID_88E1111_FINISAR, MARVELL_PHY_ID_MASK }, { MARVELL_PHY_ID_88E1111_FINISAR, MARVELL_PHY_ID_MASK },
{ MARVELL_PHY_ID_88E1118, MARVELL_PHY_ID_MASK }, { MARVELL_PHY_ID_88E1118, MARVELL_PHY_ID_MASK },
{ MARVELL_PHY_ID_88E1121R, MARVELL_PHY_ID_MASK }, { MARVELL_PHY_ID_88E1121R, MARVELL_PHY_ID_MASK },

View File

@@ -1,32 +0,0 @@
From: Ben Hutchings <benh@debian.org>
Date: Mon, 16 Sep 2024 00:07:04 +0200
Subject: Documentation: Use relative source filenames in ABI documentation
Currently the ABI documentation files contain absolute source
filenames, which makes them unreproducible if the build directory can
vary.
Remove the source base directory ($srctree) from the source filenames
shown in the documentation.
Signed-off-by: Ben Hutchings <benh@debian.org>
---
--- a/Documentation/sphinx/kernel_abi.py
+++ b/Documentation/sphinx/kernel_abi.py
@@ -103,6 +103,7 @@ class KernelCmd(Directive):
lines = code_block + "\n\n"
line_regex = re.compile(r"^\.\. LINENO (\S+)\#([0-9]+)$")
+ srctree = os.path.abspath(os.environ["srctree"])
ln = 0
n = 0
f = fname
@@ -127,7 +128,7 @@ class KernelCmd(Directive):
# sphinx counts lines from 0
ln = int(match.group(2)) - 1
else:
- content.append(line, f, ln)
+ content.append(line, os.path.relpath(f, srctree), ln)
kernellog.info(self.state.document.settings.env.app, "%s: parsed %i lines" % (fname, n))

View File

@@ -18,7 +18,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
--- a/fs/btrfs/super.c --- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c +++ b/fs/btrfs/super.c
@@ -2638,7 +2638,7 @@ module_exit(exit_btrfs_fs) @@ -2630,7 +2630,7 @@ module_exit(exit_btrfs_fs)
MODULE_DESCRIPTION("B-Tree File System (BTRFS)"); MODULE_DESCRIPTION("B-Tree File System (BTRFS)");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
@@ -27,19 +27,9 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
MODULE_SOFTDEP("pre: xxhash64"); MODULE_SOFTDEP("pre: xxhash64");
MODULE_SOFTDEP("pre: sha256"); MODULE_SOFTDEP("pre: sha256");
MODULE_SOFTDEP("pre: blake2b-256"); MODULE_SOFTDEP("pre: blake2b-256");
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -7435,6 +7435,6 @@ static void __exit ext4_exit_fs(void)
MODULE_AUTHOR("Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others");
MODULE_DESCRIPTION("Fourth Extended Filesystem");
MODULE_LICENSE("GPL");
-MODULE_SOFTDEP("pre: crc32c");
+MODULE_SOFTDEP("pre: crypto-crc32c");
module_init(ext4_init_fs)
module_exit(ext4_exit_fs)
--- a/fs/jbd2/journal.c --- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c
@@ -3194,6 +3194,7 @@ static void __exit journal_exit(void) @@ -3158,6 +3158,7 @@ static void __exit journal_exit(void)
MODULE_DESCRIPTION("Generic filesystem journal-writing module"); MODULE_DESCRIPTION("Generic filesystem journal-writing module");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
@@ -49,7 +39,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
--- a/fs/nfsd/nfsctl.c --- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c
@@ -2352,5 +2352,8 @@ static void __exit exit_nfsd(void) @@ -2349,5 +2349,8 @@ static void __exit exit_nfsd(void)
MODULE_AUTHOR("Olaf Kirch <okir@monad.swb.de>"); MODULE_AUTHOR("Olaf Kirch <okir@monad.swb.de>");
MODULE_DESCRIPTION("In-kernel NFS server"); MODULE_DESCRIPTION("In-kernel NFS server");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");

View File

@@ -15,16 +15,16 @@ Signed-off-by: Ben Hutchings <benh@debian.org>
--- ---
--- a/scripts/Makefile.btf --- a/scripts/Makefile.btf
+++ b/scripts/Makefile.btf +++ b/scripts/Makefile.btf
@@ -12,8 +12,6 @@ endif @@ -14,8 +14,6 @@ endif
pahole-flags-$(call test-ge, $(pahole-ver), 121) += --btf_gen_floats pahole-flags-$(call test-ge, $(pahole-ver), 121) += --btf_gen_floats
-pahole-flags-$(call test-ge, $(pahole-ver), 122) += -j -pahole-flags-$(call test-ge, $(pahole-ver), 122) += -j$(JOBS)
- -
pahole-flags-$(call test-ge, $(pahole-ver), 125) += --skip_encoding_btf_inconsistent_proto --btf_gen_optimized pahole-flags-$(call test-ge, $(pahole-ver), 125) += --skip_encoding_btf_inconsistent_proto --btf_gen_optimized
else else
@@ -27,6 +25,18 @@ endif @@ -29,6 +27,18 @@ endif
endif endif
@@ -35,9 +35,9 @@ Signed-off-by: Ben Hutchings <benh@debian.org>
+# Assume that if KBUILD_BUILD_TIMESTAMP is set then a reproducible +# Assume that if KBUILD_BUILD_TIMESTAMP is set then a reproducible
+# build is required and we must not use -j alone. +# build is required and we must not use -j alone.
+ifeq ($(KBUILD_BUILD_TIMESTAMP),) +ifeq ($(KBUILD_BUILD_TIMESTAMP),)
+pahole-flags-$(call test-ge, $(pahole-ver), 122) += -j +pahole-flags-$(call test-ge, $(pahole-ver), 122) += -j$(JOBS)
+else +else
+pahole-flags-$(call test-ge, $(pahole-ver), 127) += -j --btf_features=+reproducible_build +pahole-flags-$(call test-ge, $(pahole-ver), 127) += -j$(JOBS) --btf_features=+reproducible_build
+endif +endif
+ +
pahole-flags-$(CONFIG_PAHOLE_HAS_LANG_EXCLUDE) += --lang_exclude=rust pahole-flags-$(CONFIG_PAHOLE_HAS_LANG_EXCLUDE) += --lang_exclude=rust

View File

@@ -9,7 +9,7 @@ sources.
--- a/scripts/Makefile.build --- a/scripts/Makefile.build
+++ b/scripts/Makefile.build +++ b/scripts/Makefile.build
@@ -210,6 +210,11 @@ cmd_record_mcount = $(if $(findstring $( @@ -184,6 +184,11 @@ cmd_record_mcount = $(if $(findstring $(
$(sub_cmd_record_mcount)) $(sub_cmd_record_mcount))
endif # CONFIG_FTRACE_MCOUNT_USE_RECORDMCOUNT endif # CONFIG_FTRACE_MCOUNT_USE_RECORDMCOUNT

View File

@@ -7,7 +7,7 @@ Signed-off-by: Ben Hutchings <benh@debian.org>
--- ---
--- a/tools/lib/api/Makefile --- a/tools/lib/api/Makefile
+++ b/tools/lib/api/Makefile +++ b/tools/lib/api/Makefile
@@ -39,7 +39,7 @@ endif @@ -35,7 +35,7 @@ ifeq ($(DEBUG),0)
endif endif
ifeq ($(DEBUG),0) ifeq ($(DEBUG),0)

View File

@@ -0,0 +1,41 @@
From: Ben Hutchings <benh@debian.org>
Date: Sun, 20 Apr 2025 18:50:44 +0200
Subject: libbpf: Use the standard fixdep build rule
libbpf's all target depends on the fixdep target defined in
tools/scripts/Makefile.include. However the $(BPF_IN_SHARED) and
$(BPF_IN_STATIC) targets don't use it, but instead rebuild fixdep in
the staticobjs or sharedobjs subdirectory using a different command.
Change the $(BPF_IN_SHARED) and $(BPF_IN_STATIC) targets to depend on
fixdep and to symlink the executable into the respective output
subdirectory.
Signed-off-by: Ben Hutchings <benh@debian.org>
---
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -134,7 +134,7 @@ all_cmd: $(CMD_TARGETS) check
$(SHARED_OBJDIR) $(STATIC_OBJDIR):
$(Q)mkdir -p $@
-$(BPF_IN_SHARED): force $(BPF_GENERATED) | $(SHARED_OBJDIR)
+$(BPF_IN_SHARED): fixdep force $(BPF_GENERATED) | $(SHARED_OBJDIR)
@(test -f ../../include/uapi/linux/bpf.h -a -f ../../../include/uapi/linux/bpf.h && ( \
(diff -B ../../include/uapi/linux/bpf.h ../../../include/uapi/linux/bpf.h >/dev/null) || \
echo "Warning: Kernel ABI header at 'tools/include/uapi/linux/bpf.h' differs from latest version at 'include/uapi/linux/bpf.h'" >&2 )) || true
@@ -144,11 +144,11 @@ $(BPF_IN_SHARED): force $(BPF_GENERATED)
@(test -f ../../include/uapi/linux/if_xdp.h -a -f ../../../include/uapi/linux/if_xdp.h && ( \
(diff -B ../../include/uapi/linux/if_xdp.h ../../../include/uapi/linux/if_xdp.h >/dev/null) || \
echo "Warning: Kernel ABI header at 'tools/include/uapi/linux/if_xdp.h' differs from latest version at 'include/uapi/linux/if_xdp.h'" >&2 )) || true
- $(SILENT_MAKE) -C $(srctree)/tools/build CFLAGS= LDFLAGS= OUTPUT=$(SHARED_OBJDIR) $(SHARED_OBJDIR)fixdep
+ ln -sf ../fixdep $(SHARED_OBJDIR)/
$(Q)$(MAKE) $(build)=libbpf OUTPUT=$(SHARED_OBJDIR) CFLAGS="$(CFLAGS) $(SHLIB_FLAGS)"
-$(BPF_IN_STATIC): force $(BPF_GENERATED) | $(STATIC_OBJDIR)
- $(SILENT_MAKE) -C $(srctree)/tools/build CFLAGS= LDFLAGS= OUTPUT=$(STATIC_OBJDIR) $(STATIC_OBJDIR)fixdep
+$(BPF_IN_STATIC): fixdep force $(BPF_GENERATED) | $(STATIC_OBJDIR)
+ ln -sf ../fixdep $(STATIC_OBJDIR)/
$(Q)$(MAKE) $(build)=libbpf OUTPUT=$(STATIC_OBJDIR)
$(BPF_HELPER_DEFS): $(srctree)/tools/include/uapi/linux/bpf.h

View File

@@ -9,7 +9,7 @@ alternative may allow subverting module signing.
--- ---
--- a/kernel/module/version.c --- a/kernel/module/version.c
+++ b/kernel/module/version.c +++ b/kernel/module/version.c
@@ -46,9 +46,8 @@ int check_version(const struct load_info @@ -63,9 +63,8 @@ int check_version(const struct load_info
goto bad_version; goto bad_version;
} }

View File

@@ -1,61 +0,0 @@
From: Pablo Neira Ayuso <pablo@netfilter.org>
Date: Sun, 20 Oct 2024 14:49:51 +0200
Subject: netfilter: xtables: fix typo causing some targets not to load on IPv6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Origin: https://git.kernel.org/linus/306ed1728e8438caed30332e1ab46b28c25fe3d8
Bug-Debian: https://bugs.debian.org/1085953
- There is no NFPROTO_IPV6 family for mark and NFLOG.
- TRACE is also missing module autoload with NFPROTO_IPV6.
This results in ip6tables failing to restore a ruleset. This issue has been
reported by several users providing incomplete patches.
Very similar to Ilya Katsnelson's patch including a missing chunk in the
TRACE extension.
Fixes: 0bfcb7b71e73 ("netfilter: xtables: avoid NFPROTO_UNSPEC where needed")
Reported-by: Ignat Korchagin <ignat@cloudflare.com>
Reported-by: Ilya Katsnelson <me@0upti.me>
Reported-by: Krzysztof Olędzki <ole@ans.pl>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
net/netfilter/xt_NFLOG.c | 2 +-
net/netfilter/xt_TRACE.c | 1 +
net/netfilter/xt_mark.c | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
--- a/net/netfilter/xt_NFLOG.c
+++ b/net/netfilter/xt_NFLOG.c
@@ -79,7 +79,7 @@ static struct xt_target nflog_tg_reg[] _
{
.name = "NFLOG",
.revision = 0,
- .family = NFPROTO_IPV4,
+ .family = NFPROTO_IPV6,
.checkentry = nflog_tg_check,
.destroy = nflog_tg_destroy,
.target = nflog_tg,
--- a/net/netfilter/xt_TRACE.c
+++ b/net/netfilter/xt_TRACE.c
@@ -49,6 +49,7 @@ static struct xt_target trace_tg_reg[] _
.target = trace_tg,
.checkentry = trace_tg_check,
.destroy = trace_tg_destroy,
+ .me = THIS_MODULE,
},
#endif
};
--- a/net/netfilter/xt_mark.c
+++ b/net/netfilter/xt_mark.c
@@ -62,7 +62,7 @@ static struct xt_target mark_tg_reg[] __
{
.name = "MARK",
.revision = 2,
- .family = NFPROTO_IPV4,
+ .family = NFPROTO_IPV6,
.target = mark_tg,
.targetsize = sizeof(struct xt_mark_tginfo2),
.me = THIS_MODULE,

View File

@@ -0,0 +1,31 @@
From: Ben Hutchings <benh@debian.org>
Date: Sun, 23 Mar 2025 21:04:02 +0100
Subject: [PATCH] perf docs: Fix perf-check manual page built with asciidoctor
Forwarded: https://lore.kernel.org/linux-perf-users/Z-BxCE8WrcRmR_5f@decadent.org.uk/
asciidoctor is more picky than asciidoc about the length of heading
underlines, and currently mis-parses perf-check.txt:
ASCIIDOC perf-check.1
asciidoctor: ERROR: perf-check.txt: line 1: non-conforming manpage title
asciidoctor: ERROR: perf-check.txt: line 1: name section expected
asciidoctor: WARNING: perf-check.txt: line 2: unterminated example block
asciidoctor: WARNING: perf-check.txt: line 5: unterminated listing block
Fix the length of the title underline so it works properly.
Fixes: 98ad0b77323c ("perf check: Introduce 'check' subcommand")
Signed-off-by: Ben Hutchings <benh@debian.org>
---
tools/perf/Documentation/perf-check.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/tools/perf/Documentation/perf-check.txt
+++ b/tools/perf/Documentation/perf-check.txt
@@ -1,5 +1,5 @@
perf-check(1)
-===============
+=============
NAME
----

View File

@@ -16,7 +16,7 @@ Signed-off-by: Ben Hutchings <benh@debian.org>
--- ---
--- a/tools/perf/Makefile.perf --- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf
@@ -951,7 +951,7 @@ $(LIBAPI)-clean: @@ -963,7 +963,7 @@ $(LIBAPI)-clean:
$(LIBBPF): FORCE | $(LIBBPF_OUTPUT) $(LIBBPF): FORCE | $(LIBBPF_OUTPUT)
$(Q)$(MAKE) -C $(LIBBPF_DIR) FEATURES_DUMP=$(FEATURE_DUMP_EXPORT) \ $(Q)$(MAKE) -C $(LIBBPF_DIR) FEATURES_DUMP=$(FEATURE_DUMP_EXPORT) \
O= OUTPUT=$(LIBBPF_OUTPUT)/ DESTDIR=$(LIBBPF_DESTDIR) prefix= subdir= \ O= OUTPUT=$(LIBBPF_OUTPUT)/ DESTDIR=$(LIBBPF_DESTDIR) prefix= subdir= \

View File

@@ -36,7 +36,7 @@ of the patch
--- a/drivers/gpu/drm/radeon/radeon_drv.c --- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -32,6 +32,8 @@ @@ -32,6 +32,8 @@
#include <linux/aperture.h>
#include <linux/compat.h> #include <linux/compat.h>
#include <linux/module.h> #include <linux/module.h>
+#include <linux/namei.h> +#include <linux/namei.h>
@@ -73,7 +73,7 @@ of the patch
static int radeon_pci_probe(struct pci_dev *pdev, static int radeon_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *ent) const struct pci_device_id *ent)
{ {
@@ -295,6 +319,12 @@ static int radeon_pci_probe(struct pci_d @@ -297,6 +321,12 @@ static int radeon_pci_probe(struct pci_d
if (vga_switcheroo_client_probe_defer(pdev)) if (vga_switcheroo_client_probe_defer(pdev))
return -EPROBE_DEFER; return -EPROBE_DEFER;
@@ -84,5 +84,5 @@ of the patch
+ } + }
+ +
/* Get rid of things like offb */ /* Get rid of things like offb */
ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev, &kms_driver); ret = aperture_remove_conflicting_pci_devices(pdev, kms_driver.name);
if (ret) if (ret)

View File

@@ -10,12 +10,12 @@ Signed-off-by: Ben Hutchings <benh@debian.org>
--- ---
--- a/tools/build/Makefile.include --- a/tools/build/Makefile.include
+++ b/tools/build/Makefile.include +++ b/tools/build/Makefile.include
@@ -2,7 +2,7 @@ @@ -12,7 +12,7 @@ else
build := -f $(srctree)/tools/build/Makefile.build dir=. obj endif
fixdep: fixdep:
- $(Q)$(MAKE) -C $(srctree)/tools/build CFLAGS= LDFLAGS= $(OUTPUT)fixdep - $(SILENT_MAKE) -C $(srctree)/tools/build CFLAGS= LDFLAGS= $(OUTPUT)fixdep
+ $(Q)$(MAKE) -C $(srctree)/tools/build $(OUTPUT)fixdep + $(SILENT_MAKE) -C $(srctree)/tools/build $(OUTPUT)fixdep
fixdep-clean: fixdep-clean:
$(Q)$(MAKE) -C $(srctree)/tools/build clean $(Q)$(MAKE) -C $(srctree)/tools/build clean

View File

@@ -21,7 +21,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+ * much older kernel. Do "use" the attr structure here to avoid + * much older kernel. Do "use" the attr structure here to avoid
+ * a "set but not used" warning. + * a "set but not used" warning.
*/ */
- return syscall(__NR_bpf, BPF_PROG_LOAD, &attr, sizeof(attr)); - return syscall(__NR_bpf, BPF_PROG_LOAD, &attr, sizeof(attr)) == 0;
+ (void)&attr; + (void)&attr;
+ return 0; + return 0;
} }

View File

@@ -6,7 +6,7 @@ Signed-off-by: Ben Hutchings <benh@debian.org>
--- ---
--- a/tools/perf/Makefile.perf --- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf
@@ -925,7 +925,7 @@ $(OUTPUT)dlfilters/%.o: dlfilters/%.c in @@ -937,7 +937,7 @@ $(OUTPUT)dlfilters/%.o: dlfilters/%.c in
.SECONDARY: $(DLFILTERS:.so=.o) .SECONDARY: $(DLFILTERS:.so=.o)
$(OUTPUT)dlfilters/%.so: $(OUTPUT)dlfilters/%.o $(OUTPUT)dlfilters/%.so: $(OUTPUT)dlfilters/%.o

View File

@@ -16,7 +16,7 @@ Acked-by: Ian Rogers <irogers@google.com>
--- a/tools/lib/symbol/Makefile --- a/tools/lib/symbol/Makefile
+++ b/tools/lib/symbol/Makefile +++ b/tools/lib/symbol/Makefile
@@ -39,7 +39,7 @@ endif @@ -35,7 +35,7 @@ ifeq ($(DEBUG),0)
endif endif
ifeq ($(DEBUG),0) ifeq ($(DEBUG),0)

View File

@@ -69,7 +69,7 @@ Signed-off-by: Geoff Levand <geoff@infradead.org>
* acpi_boot_table_init() called from setup_arch(), always. * acpi_boot_table_init() called from setup_arch(), always.
* 1. find RSDP and get its address, and then find XSDT * 1. find RSDP and get its address, and then find XSDT
* 2. extract all tables and checksums them all * 2. extract all tables and checksums them all
@@ -257,6 +286,8 @@ done: @@ -261,6 +290,8 @@ done:
if (IS_ENABLED(CONFIG_ACPI_BGRT)) if (IS_ENABLED(CONFIG_ACPI_BGRT))
acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt); acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt);

View File

@@ -1,89 +0,0 @@
From: Ben Hutchings <ben@decadent.org.uk>
Date: Mon, 07 Feb 2022 00:00:26 +0100
Subject: sh: Do not use hyphen in exported variable names
arch/sh/Makefile defines and exports ld-bfd to be used by
arch/sh/boot/Makefile and arch/sh/boot/compressed/Makefile. However
some shells, including dash, will not pass through environment
variables whose name includes a hyphen. Usually GNU make does not use
a shell to recurse, but if e.g. $(srctree) contains '~' it will use a
shell here.
Rename the variable to ld_bfd.
(Another instance of this problem was fixed upstream by commit
82977af93a0d "sh: rename suffix-y to suffix_y".)
References: https://buildd.debian.org/status/fetch.php?pkg=linux&arch=sh4&ver=4.13%7Erc5-1%7Eexp1&stamp=1502943967&raw=0
Fixes: ef9b542fce00 ("sh: bzip2/lzma uImage support.")
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
arch/sh/Makefile | 10 +++++-----
arch/sh/boot/compressed/Makefile | 4 ++--
arch/sh/boot/romimage/Makefile | 4 ++--
3 files changed, 9 insertions(+), 9 deletions(-)
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -102,16 +102,16 @@ UTS_MACHINE := sh
LDFLAGS_vmlinux += -e _stext
ifdef CONFIG_CPU_LITTLE_ENDIAN
-ld-bfd := elf32-sh-linux
-LDFLAGS_vmlinux += --defsym jiffies=jiffies_64 --oformat $(ld-bfd)
+ld_bfd := elf32-sh-linux
+LDFLAGS_vmlinux += --defsym jiffies=jiffies_64 --oformat $(ld_bfd)
KBUILD_LDFLAGS += -EL
else
-ld-bfd := elf32-shbig-linux
-LDFLAGS_vmlinux += --defsym jiffies=jiffies_64+4 --oformat $(ld-bfd)
+ld_bfd := elf32-shbig-linux
+LDFLAGS_vmlinux += --defsym jiffies=jiffies_64+4 --oformat $(ld_bfd)
KBUILD_LDFLAGS += -EB
endif
-export ld-bfd
+export ld_bfd
# Mach groups
machdir-$(CONFIG_SOLUTION_ENGINE) += mach-se
--- a/arch/sh/boot/compressed/Makefile
+++ b/arch/sh/boot/compressed/Makefile
@@ -27,7 +27,7 @@ endif
ccflags-remove-$(CONFIG_MCOUNT) += -pg
-LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext $(IMAGE_OFFSET) -e startup \
+LDFLAGS_vmlinux := --oformat $(ld_bfd) -Ttext $(IMAGE_OFFSET) -e startup \
-T $(obj)/../../kernel/vmlinux.lds
KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
@@ -51,7 +51,7 @@ $(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.b
OBJCOPYFLAGS += -R .empty_zero_page
-LDFLAGS_piggy.o := -r --format binary --oformat $(ld-bfd) -T
+LDFLAGS_piggy.o := -r --format binary --oformat $(ld_bfd) -T
$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix_y) FORCE
$(call if_changed,ld)
--- a/arch/sh/boot/romimage/Makefile
+++ b/arch/sh/boot/romimage/Makefile
@@ -13,7 +13,7 @@ mmcif-obj-$(CONFIG_CPU_SUBTYPE_SH7724) :
load-$(CONFIG_ROMIMAGE_MMCIF) := $(mmcif-load-y)
obj-$(CONFIG_ROMIMAGE_MMCIF) := $(mmcif-obj-y)
-LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext $(load-y) -e romstart \
+LDFLAGS_vmlinux := --oformat $(ld_bfd) -Ttext $(load-y) -e romstart \
-T $(obj)/../../kernel/vmlinux.lds
$(obj)/vmlinux: $(obj)/head.o $(obj-y) $(obj)/piggy.o FORCE
@@ -24,7 +24,7 @@ OBJCOPYFLAGS += -j .empty_zero_page
$(obj)/zeropage.bin: vmlinux FORCE
$(call if_changed,objcopy)
-LDFLAGS_piggy.o := -r --format binary --oformat $(ld-bfd) -T
+LDFLAGS_piggy.o := -r --format binary --oformat $(ld_bfd) -T
$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/zeropage.bin arch/sh/boot/zImage FORCE
$(call if_changed,ld)

View File

@@ -1,22 +0,0 @@
From: Ben Hutchings <ben@decadent.org.uk>
Date: Fri, 25 Sep 2015 22:50:50 +0100
Subject: Revert "perf build: Fix libunwind feature detection on 32-bit x86"
Forwarded: no
This reverts commit 05b41775e2edd69a83f592e3534930c934d4038e.
It broke feature detection that was working just fine for us.
---
tools/perf/Makefile.config | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -61,7 +61,7 @@ ifeq ($(SRCARCH),x86)
LIBUNWIND_LIBS = -lunwind-x86_64 -lunwind -llzma
$(call detected,CONFIG_X86_64)
else
- LIBUNWIND_LIBS = -lunwind-x86 -llzma -lunwind
+ LIBUNWIND_LIBS = -lunwind -lunwind-x86
endif
endif

View File

@@ -21,7 +21,7 @@ Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
--- a/kernel/fork.c --- a/kernel/fork.c
+++ b/kernel/fork.c +++ b/kernel/fork.c
@@ -118,6 +118,12 @@ @@ -119,6 +119,12 @@
#include <kunit/visibility.h> #include <kunit/visibility.h>
@@ -34,7 +34,7 @@ Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
/* /*
* Minimum number of threads to boot the kernel * Minimum number of threads to boot the kernel
*/ */
@@ -2135,6 +2141,10 @@ __latent_entropy struct task_struct *cop @@ -2194,6 +2200,10 @@ __latent_entropy struct task_struct *cop
if ((clone_flags & (CLONE_NEWUSER|CLONE_FS)) == (CLONE_NEWUSER|CLONE_FS)) if ((clone_flags & (CLONE_NEWUSER|CLONE_FS)) == (CLONE_NEWUSER|CLONE_FS))
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
@@ -45,7 +45,7 @@ Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
/* /*
* Thread groups must share signals as well, and detached threads * Thread groups must share signals as well, and detached threads
* can only be started up within the thread group. * can only be started up within the thread group.
@@ -3283,6 +3293,12 @@ int ksys_unshare(unsigned long unshare_f @@ -3354,6 +3364,12 @@ int ksys_unshare(unsigned long unshare_f
if (unshare_flags & CLONE_NEWNS) if (unshare_flags & CLONE_NEWNS)
unshare_flags |= CLONE_FS; unshare_flags |= CLONE_FS;
@@ -60,18 +60,18 @@ Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
goto bad_unshare_out; goto bad_unshare_out;
--- a/kernel/sysctl.c --- a/kernel/sysctl.c
+++ b/kernel/sysctl.c +++ b/kernel/sysctl.c
@@ -135,6 +135,10 @@ static enum sysctl_writes_mode sysctl_wr @@ -84,6 +84,10 @@ EXPORT_SYMBOL_GPL(sysctl_long_vals);
int sysctl_legacy_va_layout; static const int ngroups_max = NGROUPS_MAX;
#endif static const int cap_last_cap = CAP_LAST_CAP;
+#ifdef CONFIG_USER_NS +#ifdef CONFIG_USER_NS
+extern int unprivileged_userns_clone; +extern int unprivileged_userns_clone;
+#endif +#endif
+ +
#endif /* CONFIG_SYSCTL */ #ifdef CONFIG_PROC_SYSCTL
/* /**
@@ -1618,6 +1622,15 @@ static struct ctl_table kern_table[] = { @@ -1595,6 +1599,15 @@ static const struct ctl_table kern_table
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec, .proc_handler = proc_dointvec,
}, },

View File

@@ -21,7 +21,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
--- a/net/ieee802154/socket.c --- a/net/ieee802154/socket.c
+++ b/net/ieee802154/socket.c +++ b/net/ieee802154/socket.c
@@ -1138,4 +1138,4 @@ module_exit(af_ieee802154_remove); @@ -1140,4 +1140,4 @@ module_exit(af_ieee802154_remove);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("IEEE 802.15.4 socket interface"); MODULE_DESCRIPTION("IEEE 802.15.4 socket interface");

View File

@@ -1,24 +1,15 @@
From: Ben Hutchings <ben@decadent.org.uk> From: Ben Hutchings <ben@decadent.org.uk>
Date: Fri, 22 Jun 2018 17:27:00 +0100 Date: Tue, 08 Jul 2025 13:30:55 +0200
Subject: android: Enable building ashmem and binder as modules Subject: android: Enable building binder as module
Bug-Debian: https://bugs.debian.org/901492 Bug-Debian: https://bugs.debian.org/901492
We want to enable use of the Android ashmem and binder drivers to We want to enable use of the Android binder driver to support
support Anbox, but they should not be built-in as that would waste Waydroid, but it should not be built-in as that would waste resources
resources and increase security attack surface on systems that don't and increase security attack surface on systems that don't need it.
need them.
- Add a MODULE_LICENSE declaration to ashmem - Change the Makefiles to build the driver as an object with the
- Change the Makefiles to build each driver as an object with the "_linux" suffix (which is what Waydroid expects)
"_linux" suffix (which is what Anbox expects)
- Change config symbol types to tristate - Change config symbol types to tristate
Update:
In upstream commit 721412ed3d titled "staging: remove ashmem" the ashmem
driver was removed entirely. Secondary commit message:
"The mainline replacement for ashmem is memfd, so remove the legacy
code from drivers/staging/"
Consequently, the ashmem part of this patch has been removed.
--- ---
drivers/android/Kconfig | 2 +- drivers/android/Kconfig | 2 +-
drivers/android/Makefile | 7 ++++--- drivers/android/Makefile | 7 ++++---

View File

@@ -22,7 +22,7 @@ implementation went from disk-io.c to super.c; forwarded the issue]
--- a/fs/btrfs/super.c --- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c +++ b/fs/btrfs/super.c
@@ -757,6 +757,18 @@ static void set_device_specific_options( @@ -769,6 +769,18 @@ static void set_device_specific_options(
btrfs_set_opt(fs_info->mount_opt, SSD); btrfs_set_opt(fs_info->mount_opt, SSD);
/* /*

View File

@@ -1,27 +0,0 @@
From: Ben Hutchings <ben@decadent.org.uk>
Subject: cdc_ncm,cdc_mbim: Use NCM by default
Date: Sun, 31 Mar 2013 03:58:04 +0100
Forwarded: not-needed
Devices that support both NCM and MBIM modes should be kept in NCM
mode unless there is userland support for MBIM.
Set the default value of cdc_ncm.prefer_mbim to false and leave it to
userland (modem-manager) to override this with a modprobe.conf file
once it's ready to speak MBIM.
---
--- a/drivers/net/usb/cdc_ncm.c
+++ b/drivers/net/usb/cdc_ncm.c
@@ -54,11 +54,7 @@
#include <linux/usb/cdc.h>
#include <linux/usb/cdc_ncm.h>
-#if IS_ENABLED(CONFIG_USB_NET_CDC_MBIM)
-static bool prefer_mbim = true;
-#else
static bool prefer_mbim;
-#endif
module_param(prefer_mbim, bool, 0644);
MODULE_PARM_DESC(prefer_mbim, "Prefer MBIM setting on dual NCM/MBIM functions");

View File

@@ -1,41 +0,0 @@
From: Ben Hutchings <ben@decadent.org.uk>
Date: Thu, 16 Feb 2017 19:09:17 +0000
Subject: dccp: Disable auto-loading as mitigation against local exploits
Forwarded: not-needed
We can mitigate the effect of vulnerabilities in obscure protocols by
preventing unprivileged users from loading the modules, so that they
are only exploitable on systems where the administrator has chosen to
load the protocol.
The 'dccp' protocol is not actively maintained or widely used.
Therefore disable auto-loading.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -1098,8 +1098,8 @@ module_exit(dccp_v4_exit);
* values directly, Also cover the case where the protocol is not specified,
* i.e. net-pf-PF_INET-proto-0-type-SOCK_DCCP
*/
-MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, 33, 6);
-MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, 0, 6);
+/* MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, 33, 6); */
+/* MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, 0, 6); */
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Arnaldo Carvalho de Melo <acme@mandriva.com>");
MODULE_DESCRIPTION("DCCP - Datagram Congestion Controlled Protocol");
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -1174,8 +1174,8 @@ module_exit(dccp_v6_exit);
* values directly, Also cover the case where the protocol is not specified,
* i.e. net-pf-PF_INET6-proto-0-type-SOCK_DCCP
*/
-MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 33, 6);
-MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 0, 6);
+/* MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 33, 6); */
+/* MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 0, 6); */
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Arnaldo Carvalho de Melo <acme@mandriva.com>");
MODULE_DESCRIPTION("DCCPv6 - Datagram Congestion Controlled Protocol");

View File

@@ -15,14 +15,13 @@ probably discontinued 10 years ago.
--- ---
--- a/drivers/video/fbdev/Kconfig --- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig +++ b/drivers/video/fbdev/Kconfig
@@ -657,100 +657,6 @@ config FB_ATMEL @@ -658,102 +658,6 @@ config FB_ATMEL
help help
This enables support for the AT91 LCD Controller. This enables support for the AT91 LCD Controller.
-config FB_NVIDIA -config FB_NVIDIA
- tristate "nVidia Framebuffer Support" - tristate "nVidia Framebuffer Support"
- depends on FB && PCI - depends on FB && PCI && HAS_IOPORT
- select FB_BACKLIGHT if FB_NVIDIA_BACKLIGHT
- select FB_CFB_FILLRECT - select FB_CFB_FILLRECT
- select FB_CFB_COPYAREA - select FB_CFB_COPYAREA
- select FB_CFB_IMAGEBLIT - select FB_CFB_IMAGEBLIT
@@ -62,6 +61,8 @@ probably discontinued 10 years ago.
-config FB_NVIDIA_BACKLIGHT -config FB_NVIDIA_BACKLIGHT
- bool "Support for backlight control" - bool "Support for backlight control"
- depends on FB_NVIDIA - depends on FB_NVIDIA
- depends on BACKLIGHT_CLASS_DEVICE=y || BACKLIGHT_CLASS_DEVICE=FB_NVIDIA
- select FB_BACKLIGHT
- default y - default y
- help - help
- Say Y here if you want to control the backlight of your display. - Say Y here if you want to control the backlight of your display.
@@ -69,7 +70,6 @@ probably discontinued 10 years ago.
-config FB_RIVA -config FB_RIVA
- tristate "nVidia Riva support" - tristate "nVidia Riva support"
- depends on FB && PCI - depends on FB && PCI
- select FB_BACKLIGHT if FB_RIVA_BACKLIGHT
- select FB_CFB_FILLRECT - select FB_CFB_FILLRECT
- select FB_CFB_COPYAREA - select FB_CFB_COPYAREA
- select FB_CFB_IMAGEBLIT - select FB_CFB_IMAGEBLIT
@@ -109,6 +109,8 @@ probably discontinued 10 years ago.
-config FB_RIVA_BACKLIGHT -config FB_RIVA_BACKLIGHT
- bool "Support for backlight control" - bool "Support for backlight control"
- depends on FB_RIVA - depends on FB_RIVA
- depends on BACKLIGHT_CLASS_DEVICE=y || BACKLIGHT_CLASS_DEVICE=FB_RIVA
- select FB_BACKLIGHT
- default y - default y
- help - help
- Say Y here if you want to control the backlight of your display. - Say Y here if you want to control the backlight of your display.

View File

@@ -1,5 +1,5 @@
From: Ben Hutchings <ben@decadent.org.uk> From: Ben Hutchings <ben@decadent.org.uk>
Date: Mon, 05 Aug 2024 03:26:48 +0200 Date: Tue, 08 Jul 2025 13:32:21 +0200
Subject: Export symbols needed by binder Subject: Export symbols needed by binder
Bug-Debian: https://bugs.debian.org/901492 Bug-Debian: https://bugs.debian.org/901492
@@ -16,13 +16,14 @@ Export the currently un-exported symbols it depends on.
kernel/sched/syscalls.c | 1 + kernel/sched/syscalls.c | 1 +
kernel/sched/wait.c | 1 + kernel/sched/wait.c | 1 +
kernel/task_work.c | 1 + kernel/task_work.c | 1 +
mm/memory.c | 1 + mm/list_lru.c | 2 ++
mm/memory.c | 2 ++
security/security.c | 4 ++++ security/security.c | 4 ++++
8 files changed, 11 insertions(+) 9 files changed, 14 insertions(+)
--- a/fs/file.c --- a/fs/file.c
+++ b/fs/file.c +++ b/fs/file.c
@@ -792,6 +792,7 @@ struct file *file_close_fd(unsigned int @@ -858,6 +858,7 @@ struct file *file_close_fd(unsigned int
return file; return file;
} }
@@ -42,7 +43,7 @@ Export the currently un-exported symbols it depends on.
struct msg_msgseg *next; struct msg_msgseg *next;
--- a/ipc/namespace.c --- a/ipc/namespace.c
+++ b/ipc/namespace.c +++ b/ipc/namespace.c
@@ -205,6 +205,7 @@ void put_ipc_ns(struct ipc_namespace *ns @@ -207,6 +207,7 @@ void put_ipc_ns(struct ipc_namespace *ns
schedule_work(&free_ipc_work); schedule_work(&free_ipc_work);
} }
} }
@@ -72,7 +73,7 @@ Export the currently un-exported symbols it depends on.
* Note: we use "set_current_state()" _after_ the wait-queue add, * Note: we use "set_current_state()" _after_ the wait-queue add,
--- a/kernel/task_work.c --- a/kernel/task_work.c
+++ b/kernel/task_work.c +++ b/kernel/task_work.c
@@ -97,6 +97,7 @@ int task_work_add(struct task_struct *ta @@ -96,6 +96,7 @@ int task_work_add(struct task_struct *ta
return 0; return 0;
} }
@@ -80,9 +81,27 @@ Export the currently un-exported symbols it depends on.
/** /**
* task_work_cancel_match - cancel a pending work added by task_work_add() * task_work_cancel_match - cancel a pending work added by task_work_add()
--- a/mm/list_lru.c
+++ b/mm/list_lru.c
@@ -175,6 +175,7 @@ bool list_lru_add(struct list_lru *lru,
unlock_list_lru(l, false);
return false;
}
+EXPORT_SYMBOL_GPL(list_lru_add);
bool list_lru_add_obj(struct list_lru *lru, struct list_head *item)
{
@@ -212,6 +213,7 @@ bool list_lru_del(struct list_lru *lru,
unlock_list_lru(l, false);
return false;
}
+EXPORT_SYMBOL_GPL(list_lru_del);
bool list_lru_del_obj(struct list_lru *lru, struct list_head *item)
{
--- a/mm/memory.c --- a/mm/memory.c
+++ b/mm/memory.c +++ b/mm/memory.c
@@ -1934,6 +1934,7 @@ void zap_page_range_single(struct vm_are @@ -2020,6 +2020,7 @@ void zap_page_range_single(struct vm_are
tlb_finish_mmu(&tlb); tlb_finish_mmu(&tlb);
hugetlb_zap_end(vma, details); hugetlb_zap_end(vma, details);
} }
@@ -90,9 +109,17 @@ Export the currently un-exported symbols it depends on.
/** /**
* zap_vma_ptes - remove ptes mapping the vma * zap_vma_ptes - remove ptes mapping the vma
@@ -6567,6 +6568,7 @@ inval:
count_vm_vma_lock_event(VMA_LOCK_ABORT);
return NULL;
}
+EXPORT_SYMBOL_GPL(lock_vma_under_rcu);
#endif /* CONFIG_PER_VMA_LOCK */
#ifndef __PAGETABLE_P4D_FOLDED
--- a/security/security.c --- a/security/security.c
+++ b/security/security.c +++ b/security/security.c
@@ -893,6 +893,7 @@ int security_binder_set_context_mgr(cons @@ -996,6 +996,7 @@ int security_binder_set_context_mgr(cons
{ {
return call_int_hook(binder_set_context_mgr, mgr); return call_int_hook(binder_set_context_mgr, mgr);
} }
@@ -100,7 +127,7 @@ Export the currently un-exported symbols it depends on.
/** /**
* security_binder_transaction() - Check if a binder transaction is allowed * security_binder_transaction() - Check if a binder transaction is allowed
@@ -908,6 +909,7 @@ int security_binder_transaction(const st @@ -1011,6 +1012,7 @@ int security_binder_transaction(const st
{ {
return call_int_hook(binder_transaction, from, to); return call_int_hook(binder_transaction, from, to);
} }
@@ -108,7 +135,7 @@ Export the currently un-exported symbols it depends on.
/** /**
* security_binder_transfer_binder() - Check if a binder transfer is allowed * security_binder_transfer_binder() - Check if a binder transfer is allowed
@@ -923,6 +925,7 @@ int security_binder_transfer_binder(cons @@ -1026,6 +1028,7 @@ int security_binder_transfer_binder(cons
{ {
return call_int_hook(binder_transfer_binder, from, to); return call_int_hook(binder_transfer_binder, from, to);
} }
@@ -116,7 +143,7 @@ Export the currently un-exported symbols it depends on.
/** /**
* security_binder_transfer_file() - Check if a binder file xfer is allowed * security_binder_transfer_file() - Check if a binder file xfer is allowed
@@ -939,6 +942,7 @@ int security_binder_transfer_file(const @@ -1042,6 +1045,7 @@ int security_binder_transfer_file(const
{ {
return call_int_hook(binder_transfer_file, from, to, file); return call_int_hook(binder_transfer_file, from, to, file);
} }

View File

@@ -12,7 +12,7 @@ actually used.
--- ---
--- a/fs/notify/fanotify/fanotify_user.c --- a/fs/notify/fanotify/fanotify_user.c
+++ b/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c
@@ -1752,6 +1752,14 @@ static int do_fanotify_mark(int fanotify @@ -1881,6 +1881,14 @@ static int do_fanotify_mark(int fanotify
umask = FANOTIFY_EVENT_FLAGS; umask = FANOTIFY_EVENT_FLAGS;
} }
@@ -24,6 +24,6 @@ actually used.
+ } + }
+#endif +#endif
+ +
f = fdget(fanotify_fd); CLASS(fd, f)(fanotify_fd);
if (unlikely(!f.file)) if (fd_empty(f))
return -EBADF; return -EBADF;

View File

@@ -0,0 +1,37 @@
From: Ben Hutchings <benh@debian.org>
Subject: firmware_loader: Log direct loading failures as info for d-i
Date: Thu, 30 May 2024 13:14:32 +0100
Forwarded: not-needed
On an installed Debian system, firmware packages will normally be
installed automatically based on a mapping of device IDs to firmware.
Within the Debian installer this has not yet happened and we need a
way to detect missing firmware.
Although many/most drivers log firmware loading failures, they do so
using many different formats. This adds a single log message to the
firmware loader, which the installer's hw-detect package will look
for. The log level is set to "info" because some failures are
expected and we do not want to confuse users with bogus error messages
(like in bug #966218).
NOTE: The log message format must not be changed without coordinating
this with the check-missing-firmware.sh in hw-detect.
---
drivers/base/firmware_loader/fallback.c | 2 +-
drivers/base/firmware_loader/main.c | 17 ++++++++---------
2 files changed, 9 insertions(+), 10 deletions(-)
--- a/drivers/base/firmware_loader/main.c
+++ b/drivers/base/firmware_loader/main.c
@@ -590,6 +590,10 @@ fw_get_filesystem_firmware(struct device
}
__putname(path);
+ if (rc)
+ dev_info(device, "firmware: failed to load %s (%d)\n",
+ fw_priv->fw_name, rc);
+
return rc;
}

View File

@@ -12,13 +12,13 @@ override HOSTCC and HOSTLD for fixdep only.
--- ---
--- a/tools/build/Makefile.include --- a/tools/build/Makefile.include
+++ b/tools/build/Makefile.include +++ b/tools/build/Makefile.include
@@ -2,7 +2,10 @@ @@ -12,7 +12,10 @@ else
build := -f $(srctree)/tools/build/Makefile.build dir=. obj endif
fixdep: fixdep:
- $(Q)$(MAKE) -C $(srctree)/tools/build $(OUTPUT)fixdep - $(SILENT_MAKE) -C $(srctree)/tools/build $(OUTPUT)fixdep
+ $(Q)$(MAKE) -C $(srctree)/tools/build \ + $(SILENT_MAKE) -C $(srctree)/tools/build \
+ $(if $(REALHOSTCC),HOSTCC=$(REALHOSTCC) HOSTCFLAGS=) \ + $(if $(REALHOSTCC),HOSTCC=$(REALHOSTCC) KBUILD_HOSTCFLAGS=) \
+ $(if $(REALHOSTLD),HOSTLD=$(REALHOSTLD) KBUILD_HOSTLDFLAGS=) \ + $(if $(REALHOSTLD),HOSTLD=$(REALHOSTLD) KBUILD_HOSTLDFLAGS=) \
+ $(OUTPUT)fixdep + $(OUTPUT)fixdep

View File

@@ -9,7 +9,7 @@ This reverts commit 561ec64ae67ef25cac8d72bb9c4bfc955edfd415
--- a/fs/namei.c --- a/fs/namei.c
+++ b/fs/namei.c +++ b/fs/namei.c
@@ -1034,8 +1034,8 @@ static inline void put_link(struct namei @@ -1095,8 +1095,8 @@ static inline void put_link(struct namei
path_put(&last->link); path_put(&last->link);
} }

View File

@@ -1,55 +0,0 @@
From: Ian Campbell <ijc@hellion.org.uk>
Date: Thu, 17 Jan 2013 08:55:21 +0000
Subject: Tweak gitignore for Debian pkg-kernel using git
Forwarded: not-needed
[bwh: Tweak further for pure git]
---
.gitignore | 25 +++++++------------------
1 file changed, 7 insertions(+), 18 deletions(-)
--- a/.gitignore
+++ b/.gitignore
@@ -78,11 +78,6 @@ modules.order
/rpmbuild/
#
-# Debian directory (make deb-pkg)
-#
-/debian/
-
-#
# Snap directory (make snap-pkg)
#
/snap/
@@ -99,19 +94,6 @@ modules.order
/pacman/
#
-# We don't want to ignore the following even if they are dot-files
-#
-!.clang-format
-!.cocciconfig
-!.editorconfig
-!.get_maintainer.ignore
-!.gitattributes
-!.gitignore
-!.kunitconfig
-!.mailmap
-!.rustfmt.toml
-
-#
# Generated include files
#
/include/config/
@@ -176,3 +158,10 @@ sphinx_*/
# Rust analyzer configuration
/rust-project.json
+
+#
+# Debian packaging: ignore everything at the top level, since it isn't
+# included in our repository
+#
+/*
+!/debian/

View File

@@ -15,7 +15,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
--- ---
--- a/net/ax25/af_ax25.c --- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c
@@ -2066,7 +2066,7 @@ module_init(ax25_init); @@ -2067,7 +2067,7 @@ module_init(ax25_init);
MODULE_AUTHOR("Jonathan Naylor G4KLX <g4klx@g4klx.demon.co.uk>"); MODULE_AUTHOR("Jonathan Naylor G4KLX <g4klx@g4klx.demon.co.uk>");
MODULE_DESCRIPTION("The amateur radio AX.25 link layer protocol"); MODULE_DESCRIPTION("The amateur radio AX.25 link layer protocol");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
@@ -37,7 +37,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
{ {
--- a/net/rose/af_rose.c --- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c +++ b/net/rose/af_rose.c
@@ -1630,7 +1630,7 @@ MODULE_PARM_DESC(rose_ndevs, "number of @@ -1638,7 +1638,7 @@ MODULE_PARM_DESC(rose_ndevs, "number of
MODULE_AUTHOR("Jonathan Naylor G4KLX <g4klx@g4klx.demon.co.uk>"); MODULE_AUTHOR("Jonathan Naylor G4KLX <g4klx@g4klx.demon.co.uk>");
MODULE_DESCRIPTION("The amateur radio ROSE network layer protocol"); MODULE_DESCRIPTION("The amateur radio ROSE network layer protocol");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");

View File

@@ -16,8 +16,8 @@ The error message is based on that used in commit 0126be38d988
--- ---
--- a/Makefile --- a/Makefile
+++ b/Makefile +++ b/Makefile
@@ -134,6 +134,18 @@ ifeq ("$(origin M)", "command line") @@ -138,6 +138,18 @@ ifeq ("$(origin MO)", "command line")
KBUILD_EXTMOD := $(M) KBUILD_EXTMOD_OUTPUT := $(MO)
endif endif
+# Old syntax make ... SUBDIRS=$PWD should be rejected to avoid mishaps +# Old syntax make ... SUBDIRS=$PWD should be rejected to avoid mishaps

View File

@@ -27,27 +27,27 @@ rules.real and change Makefile.modfinal to look for it in both places.
--- a/scripts/Makefile.modfinal --- a/scripts/Makefile.modfinal
+++ b/scripts/Makefile.modfinal +++ b/scripts/Makefile.modfinal
@@ -30,11 +30,13 @@ quiet_cmd_cc_o_c = CC [M] $@ @@ -28,11 +28,13 @@ ccflags-remove-y := $(CC_FLAGS_CFI)
%.mod.o: %.mod.c FORCE .module-common.o: $(srctree)/scripts/module-common.c FORCE
$(call if_changed_dep,cc_o_c) $(call if_changed_rule,cc_o_c)
+ARCH_MODULE_LDS := $(word 1,$(wildcard scripts/module.lds arch/$(SRCARCH)/module.lds)) +ARCH_MODULE_LDS := $(word 1,$(wildcard $(objtree)/scripts/module.lds $(objtree)/arch/$(SRCARCH)/module.lds))
+ +
quiet_cmd_ld_ko_o = LD [M] $@ quiet_cmd_ld_ko_o = LD [M] $@
cmd_ld_ko_o += \ cmd_ld_ko_o = \
$(LD) -r $(KBUILD_LDFLAGS) \ $(LD) -r $(KBUILD_LDFLAGS) \
$(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \ $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \
- -T scripts/module.lds -o $@ $(filter %.o, $^) - -T $(objtree)/scripts/module.lds -o $@ $(filter %.o, $^)
+ -T $(ARCH_MODULE_LDS) -o $@ $(filter %.o, $^) + -T $(ARCH_MODULE_LDS) -o $@ $(filter %.o, $^)
quiet_cmd_btf_ko = BTF [M] $@ quiet_cmd_btf_ko = BTF [M] $@
cmd_btf_ko = \ cmd_btf_ko = \
@@ -54,7 +56,7 @@ if_changed_except = $(if $(call newer_pr @@ -52,7 +54,7 @@ if_changed_except = $(if $(call newer_pr
printf '%s\n' 'savedcmd_$@ := $(make-cmd)' > $(dot-target).cmd, @:) printf '%s\n' 'savedcmd_$@ := $(make-cmd)' > $(dot-target).cmd, @:)
# Re-generate module BTFs if either module's .ko or vmlinux changed # Re-generate module BTFs if either module's .ko or vmlinux changed
-%.ko: %.o %.mod.o scripts/module.lds $(and $(CONFIG_DEBUG_INFO_BTF_MODULES),$(KBUILD_BUILTIN),vmlinux) FORCE -%.ko: %.o %.mod.o .module-common.o $(objtree)/scripts/module.lds $(and $(CONFIG_DEBUG_INFO_BTF_MODULES),$(KBUILD_BUILTIN),$(objtree)/vmlinux) FORCE
+%.ko: %.o %.mod.o $(ARCH_MODULE_LDS) $(and $(CONFIG_DEBUG_INFO_BTF_MODULES),$(KBUILD_BUILTIN),vmlinux) FORCE +%.ko: %.o %.mod.o .module-common.o $(ARCH_MODULE_LDS) $(and $(CONFIG_DEBUG_INFO_BTF_MODULES),$(KBUILD_BUILTIN),$(objtree)/vmlinux) FORCE
+$(call if_changed_except,ld_ko_o,vmlinux) +$(call if_changed_except,ld_ko_o,$(objtree)/vmlinux)
ifdef CONFIG_DEBUG_INFO_BTF_MODULES ifdef CONFIG_DEBUG_INFO_BTF_MODULES
+$(if $(newer-prereqs),$(call cmd,btf_ko)) +$(if $(newer-prereqs),$(call cmd,btf_ko))

View File

@@ -14,10 +14,12 @@ use of $(ARCH) needs to be moved after this.
[bwh: Updated for 5.3: include .kernelvariables from current directory [bwh: Updated for 5.3: include .kernelvariables from current directory
rather than using undefined $(obj).] rather than using undefined $(obj).]
[carnil: Update for 6.13: Include .kernelvariables from $(objtree).]
--- ---
--- a/Makefile --- a/Makefile
+++ b/Makefile +++ b/Makefile
@@ -380,36 +380,6 @@ include $(srctree)/scripts/subarch.inclu @@ -402,36 +402,6 @@ include $(srctree)/scripts/subarch.inclu
# Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
ARCH ?= $(SUBARCH) ARCH ?= $(SUBARCH)
@@ -54,11 +56,11 @@ use of $(ARCH) needs to be moved after this.
KCONFIG_CONFIG ?= .config KCONFIG_CONFIG ?= .config
export KCONFIG_CONFIG export KCONFIG_CONFIG
@@ -524,6 +494,35 @@ RUSTFLAGS_KERNEL = @@ -551,6 +521,35 @@ RUSTFLAGS_KERNEL =
AFLAGS_KERNEL = AFLAGS_KERNEL =
LDFLAGS_vmlinux = LDFLAGS_vmlinux =
+-include .kernelvariables +-include $(objtree)/.kernelvariables
+ +
+# Architecture as present in compile.h +# Architecture as present in compile.h
+UTS_MACHINE := $(ARCH) +UTS_MACHINE := $(ARCH)

View File

@@ -15,7 +15,7 @@ to the installed location.
--- ---
--- a/tools/perf/builtin-report.c --- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c
@@ -655,10 +655,12 @@ static int report__browse_hists(struct r @@ -666,10 +666,12 @@ static int report__browse_hists(struct r
path = system_path(TIPDIR); path = system_path(TIPDIR);
if (perf_tip(&help, path) || help == NULL) { if (perf_tip(&help, path) || help == NULL) {
@@ -30,10 +30,10 @@ to the installed location.
free(path); free(path);
--- a/tools/perf/tests/Build --- a/tools/perf/tests/Build
+++ b/tools/perf/tests/Build +++ b/tools/perf/tests/Build
@@ -73,7 +73,7 @@ perf-test-$(CONFIG_DWARF_UNWIND) += dwar @@ -73,7 +73,7 @@ ifeq ($(SRCARCH),$(filter $(SRCARCH),x86
perf-test-$(CONFIG_DWARF_UNWIND) += dwarf-unwind.o
endif endif
CFLAGS_attr.o += -DBINDIR="BUILD_STR($(bindir_SQ))" -DPYTHON="BUILD_STR($(PYTHON_WORD))"
-CFLAGS_python-use.o += -DPYTHONPATH="BUILD_STR($(OUTPUT)python)" -DPYTHON="BUILD_STR($(PYTHON_WORD))" -CFLAGS_python-use.o += -DPYTHONPATH="BUILD_STR($(OUTPUT)python)" -DPYTHON="BUILD_STR($(PYTHON_WORD))"
+CFLAGS_python-use.o += -DPYTHONPATH="BUILD_STR($(perfexec_instdir_SQ)/scripts/python)" -DPYTHON="BUILD_STR($(PYTHON_WORD))" +CFLAGS_python-use.o += -DPYTHONPATH="BUILD_STR($(perfexec_instdir_SQ)/scripts/python)" -DPYTHON="BUILD_STR($(PYTHON_WORD))"
CFLAGS_dwarf-unwind.o += -fno-optimize-sibling-calls CFLAGS_dwarf-unwind.o += -fno-optimize-sibling-calls
@@ -41,7 +41,7 @@ to the installed location.
perf-test-y += workloads/ perf-test-y += workloads/
--- a/tools/perf/Build --- a/tools/perf/Build
+++ b/tools/perf/Build +++ b/tools/perf/Build
@@ -51,7 +51,7 @@ CFLAGS_perf.o += -DPERF_HTM @@ -52,7 +52,7 @@ CFLAGS_perf.o += -DPERF_HTM
-DPREFIX="BUILD_STR($(prefix_SQ))" -DPREFIX="BUILD_STR($(prefix_SQ))"
CFLAGS_builtin-trace.o += -DSTRACE_GROUPS_DIR="BUILD_STR($(STRACE_GROUPS_DIR_SQ))" CFLAGS_builtin-trace.o += -DSTRACE_GROUPS_DIR="BUILD_STR($(STRACE_GROUPS_DIR_SQ))"
CFLAGS_builtin-report.o += -DTIPDIR="BUILD_STR($(tipdir_SQ))" CFLAGS_builtin-report.o += -DTIPDIR="BUILD_STR($(tipdir_SQ))"

View File

@@ -20,7 +20,7 @@ is non-empty.
--- ---
--- a/Makefile --- a/Makefile
+++ b/Makefile +++ b/Makefile
@@ -1807,7 +1807,7 @@ PHONY += prepare @@ -1882,7 +1882,7 @@ PHONY += prepare
# now expand this into a simple variable to reduce the cost of shell evaluations # now expand this into a simple variable to reduce the cost of shell evaluations
prepare: CC_VERSION_TEXT := $(CC_VERSION_TEXT) prepare: CC_VERSION_TEXT := $(CC_VERSION_TEXT)
prepare: prepare:

View File

@@ -10,7 +10,7 @@ Forwarded: not-needed
--- a/tools/perf/Makefile.perf --- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf
@@ -1149,7 +1149,7 @@ install-bin: install-tools install-tests @@ -1158,7 +1158,7 @@ install-bin: install-tools install-tests
install: install-bin try-install-man install: install-bin try-install-man
install-python_ext: install-python_ext:

View File

@@ -4,7 +4,7 @@ Subject: linux-tools: Install perf-read-vdso{,x}32 in directory under /usr/lib
--- a/tools/perf/Makefile.perf --- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf
@@ -1073,21 +1073,21 @@ install-tools: all install-gtk @@ -1085,21 +1085,21 @@ install-tools: all install-gtk
$(LN) '$(DESTDIR_SQ)$(bindir_SQ)/perf' '$(DESTDIR_SQ)$(bindir_SQ)/trace'; \ $(LN) '$(DESTDIR_SQ)$(bindir_SQ)/perf' '$(DESTDIR_SQ)$(bindir_SQ)/trace'; \
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(includedir_SQ)/perf'; \ $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(includedir_SQ)/perf'; \
$(INSTALL) -m 644 include/perf/perf_dlfilter.h -t '$(DESTDIR_SQ)$(includedir_SQ)/perf' $(INSTALL) -m 644 include/perf/perf_dlfilter.h -t '$(DESTDIR_SQ)$(includedir_SQ)/perf'

View File

@@ -13,7 +13,7 @@ $KBUILD_BUILD_TIMESTAMP.
--- a/init/Makefile --- a/init/Makefile
+++ b/init/Makefile +++ b/init/Makefile
@@ -29,7 +29,7 @@ preempt-flag-$(CONFIG_PREEMPT_DYNAMIC) : @@ -30,7 +30,7 @@ preempt-flag-$(CONFIG_PREEMPT_DYNAMIC) :
preempt-flag-$(CONFIG_PREEMPT_RT) := PREEMPT_RT preempt-flag-$(CONFIG_PREEMPT_RT) := PREEMPT_RT
build-version = $(or $(KBUILD_BUILD_VERSION), $(build-version-auto)) build-version = $(or $(KBUILD_BUILD_VERSION), $(build-version-auto))

View File

@@ -19,7 +19,7 @@ Forwarded: not-needed
/* describe a ptrace relationship for potential exception */ /* describe a ptrace relationship for potential exception */
struct ptrace_relation { struct ptrace_relation {
@@ -476,7 +476,7 @@ static inline void yama_init_sysctl(void @@ -469,7 +469,7 @@ static inline void yama_init_sysctl(void
static int __init yama_init(void) static int __init yama_init(void)
{ {

View File

@@ -141,10 +141,10 @@ arm-init to efi-init common for all arch") renamed arm-init.c to efi-init.c]
--- a/include/linux/efi.h --- a/include/linux/efi.h
+++ b/include/linux/efi.h +++ b/include/linux/efi.h
@@ -766,7 +766,8 @@ extern void efi_mem_reserve(phys_addr_t @@ -753,7 +753,8 @@ extern int efi_mem_desc_lookup(u64 phys_
extern int __efi_mem_desc_lookup(u64 phys_addr, efi_memory_desc_t *out_md);
extern void efi_mem_reserve(phys_addr_t addr, u64 size);
extern int efi_mem_reserve_persistent(phys_addr_t addr, u64 size); extern int efi_mem_reserve_persistent(phys_addr_t addr, u64 size);
extern void efi_initialize_iomem_resources(struct resource *code_resource,
struct resource *data_resource, struct resource *bss_resource);
-extern u64 efi_get_fdt_params(struct efi_memory_map_data *data); -extern u64 efi_get_fdt_params(struct efi_memory_map_data *data);
+extern u64 efi_get_fdt_params(struct efi_memory_map_data *data, +extern u64 efi_get_fdt_params(struct efi_memory_map_data *data,
+ u32 *secure_boot); + u32 *secure_boot);

View File

@@ -31,7 +31,7 @@ cc: linux-efi@vger.kernel.org
--- a/arch/x86/kernel/setup.c --- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c
@@ -1065,19 +1065,7 @@ void __init setup_arch(char **cmdline_p) @@ -1127,19 +1127,7 @@ void __init setup_arch(char **cmdline_p)
/* Allocate bigger log buffer */ /* Allocate bigger log buffer */
setup_log_buf(1); setup_log_buf(1);
@@ -106,11 +106,11 @@ cc: linux-efi@vger.kernel.org
+} +}
--- a/include/linux/efi.h --- a/include/linux/efi.h
+++ b/include/linux/efi.h +++ b/include/linux/efi.h
@@ -877,6 +877,14 @@ static inline int efi_range_is_wc(unsign @@ -863,6 +863,14 @@ static inline int efi_range_is_wc(unsign
#define EFI_MEM_ATTR 10 /* Did firmware publish an EFI_MEMORY_ATTRIBUTES table? */ #define EFI_MEM_ATTR 9 /* Did firmware publish an EFI_MEMORY_ATTRIBUTES table? */
#define EFI_MEM_NO_SOFT_RESERVE 11 /* Is the kernel configured to ignore soft reservations? */ #define EFI_MEM_NO_SOFT_RESERVE 10 /* Is the kernel configured to ignore soft reservations? */
#define EFI_PRESERVE_BS_REGIONS 12 /* Are EFI boot-services memory segments available? */ #define EFI_PRESERVE_BS_REGIONS 11 /* Are EFI boot-services memory segments available? */
+#define EFI_SECURE_BOOT 13 /* Are we in Secure Boot mode? */ +#define EFI_SECURE_BOOT 12 /* Are we in Secure Boot mode? */
+ +
+enum efi_secureboot_mode { +enum efi_secureboot_mode {
+ efi_secureboot_mode_unset, + efi_secureboot_mode_unset,
@@ -121,7 +121,7 @@ cc: linux-efi@vger.kernel.org
#ifdef CONFIG_EFI #ifdef CONFIG_EFI
/* /*
@@ -901,6 +909,7 @@ static inline bool efi_rt_services_suppo @@ -887,6 +895,7 @@ static inline bool efi_rt_services_suppo
return (efi.runtime_supported_mask & mask) == mask; return (efi.runtime_supported_mask & mask) == mask;
} }
extern void efi_find_mirror(void); extern void efi_find_mirror(void);
@@ -129,7 +129,7 @@ cc: linux-efi@vger.kernel.org
#else #else
static inline bool efi_enabled(int feature) static inline bool efi_enabled(int feature)
{ {
@@ -920,6 +929,7 @@ static inline bool efi_rt_services_suppo @@ -906,6 +915,7 @@ static inline bool efi_rt_services_suppo
} }
static inline void efi_find_mirror(void) {} static inline void efi_find_mirror(void) {}
@@ -137,7 +137,7 @@ cc: linux-efi@vger.kernel.org
#endif #endif
extern int efi_status_to_err(efi_status_t status); extern int efi_status_to_err(efi_status_t status);
@@ -1138,13 +1148,6 @@ static inline bool efi_runtime_disabled( @@ -1124,13 +1134,6 @@ static inline bool efi_runtime_disabled(
extern void efi_call_virt_check_flags(unsigned long flags, const void *caller); extern void efi_call_virt_check_flags(unsigned long flags, const void *caller);
extern unsigned long efi_call_virt_save_flags(void); extern unsigned long efi_call_virt_save_flags(void);

View File

@@ -26,7 +26,7 @@ Signed-off-by: Salvatore Bonaccorso <carnil@debian.org>
--- a/arch/x86/kernel/setup.c --- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c
@@ -904,6 +904,8 @@ void __init setup_arch(char **cmdline_p) @@ -964,6 +964,8 @@ void __init setup_arch(char **cmdline_p)
if (efi_enabled(EFI_BOOT)) if (efi_enabled(EFI_BOOT))
efi_init(); efi_init();
@@ -35,7 +35,7 @@ Signed-off-by: Salvatore Bonaccorso <carnil@debian.org>
reserve_ibft_region(); reserve_ibft_region();
x86_init.resources.dmi_setup(); x86_init.resources.dmi_setup();
@@ -1065,8 +1067,6 @@ void __init setup_arch(char **cmdline_p) @@ -1127,8 +1129,6 @@ void __init setup_arch(char **cmdline_p)
/* Allocate bigger log buffer */ /* Allocate bigger log buffer */
setup_log_buf(1); setup_log_buf(1);
@@ -67,26 +67,26 @@ Signed-off-by: Salvatore Bonaccorso <carnil@debian.org>
default: default:
--- a/include/linux/security.h --- a/include/linux/security.h
+++ b/include/linux/security.h +++ b/include/linux/security.h
@@ -509,6 +509,7 @@ int security_inode_getsecctx(struct inod @@ -574,6 +574,7 @@ int security_inode_notifysecctx(struct i
int security_inode_setsecctx(struct dentry *dentry, void *ctx, u32 ctxlen);
int security_inode_getsecctx(struct inode *inode, struct lsm_context *cp);
int security_locked_down(enum lockdown_reason what); int security_locked_down(enum lockdown_reason what);
+int lock_kernel_down(const char *where, enum lockdown_reason level);
int lsm_fill_user_ctx(struct lsm_ctx __user *uctx, u32 *uctx_len, int lsm_fill_user_ctx(struct lsm_ctx __user *uctx, u32 *uctx_len,
void *val, size_t val_len, u64 id, u64 flags); void *val, size_t val_len, u64 id, u64 flags);
+int lock_kernel_down(const char *where, enum lockdown_reason level); int security_bdev_alloc(struct block_device *bdev);
#else /* CONFIG_SECURITY */ @@ -1580,6 +1581,11 @@ static inline int security_locked_down(e
static inline int call_blocking_lsm_notifier(enum lsm_event event, void *data)
@@ -1483,6 +1484,11 @@ static inline int lsm_fill_user_ctx(stru
{ {
return -EOPNOTSUPP; return 0;
} }
+static inline int +static inline int
+lock_kernel_down(const char *where, enum lockdown_reason level) +lock_kernel_down(const char *where, enum lockdown_reason level)
+{ +{
+ return -EOPNOTSUPP; + return -EOPNOTSUPP;
+} +}
#endif /* CONFIG_SECURITY */ static inline int lsm_fill_user_ctx(struct lsm_ctx __user *uctx,
u32 *uctx_len, void *val, size_t val_len,
#if defined(CONFIG_SECURITY) && defined(CONFIG_WATCH_QUEUE) u64 id, u64 flags)
--- a/security/lockdown/Kconfig --- a/security/lockdown/Kconfig
+++ b/security/lockdown/Kconfig +++ b/security/lockdown/Kconfig
@@ -45,3 +45,18 @@ config LOCK_DOWN_KERNEL_FORCE_CONFIDENTI @@ -45,3 +45,18 @@ config LOCK_DOWN_KERNEL_FORCE_CONFIDENTI

View File

@@ -23,7 +23,7 @@ Cc: linux-mtd@lists.infradead.org
--- a/drivers/mtd/devices/phram.c --- a/drivers/mtd/devices/phram.c
+++ b/drivers/mtd/devices/phram.c +++ b/drivers/mtd/devices/phram.c
@@ -364,7 +364,11 @@ static int phram_param_call(const char * @@ -365,7 +365,11 @@ static int phram_param_call(const char *
#endif #endif
} }

View File

@@ -22,9 +22,9 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
--- a/include/linux/perf_event.h --- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h +++ b/include/linux/perf_event.h
@@ -1589,6 +1589,11 @@ int perf_cpu_time_max_percent_handler(co @@ -1684,6 +1684,11 @@ extern int sysctl_perf_event_sample_rate
int perf_event_max_stack_handler(const struct ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos); extern void perf_sample_event_took(u64 sample_len_ns);
+static inline bool perf_paranoid_any(void) +static inline bool perf_paranoid_any(void)
+{ +{
@@ -36,7 +36,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
--- a/kernel/events/core.c --- a/kernel/events/core.c
+++ b/kernel/events/core.c +++ b/kernel/events/core.c
@@ -419,8 +419,13 @@ static struct kmem_cache *perf_event_cac @@ -463,8 +463,13 @@ static struct kmem_cache *perf_event_cac
* 0 - disallow raw tracepoint access for unpriv * 0 - disallow raw tracepoint access for unpriv
* 1 - disallow cpu events for unpriv * 1 - disallow cpu events for unpriv
* 2 - disallow kernel profiling for unpriv * 2 - disallow kernel profiling for unpriv
@@ -48,9 +48,9 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
int sysctl_perf_event_paranoid __read_mostly = 2; int sysctl_perf_event_paranoid __read_mostly = 2;
+#endif +#endif
/* Minimum for 512 kiB + 1 user control page */ /* Minimum for 512 kiB + 1 user control page. 'free' kiB per user. */
int sysctl_perf_event_mlock __read_mostly = 512 + (PAGE_SIZE / 1024); /* 'free' kiB per user */ static int sysctl_perf_event_mlock __read_mostly = 512 + (PAGE_SIZE / 1024);
@@ -12506,6 +12511,9 @@ SYSCALL_DEFINE5(perf_event_open, @@ -13164,6 +13169,9 @@ SYSCALL_DEFINE5(perf_event_open,
if (err) if (err)
return err; return err;
@@ -58,13 +58,13 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+ return -EACCES; + return -EACCES;
+ +
/* Do we allow access to perf_event_open(2) ? */ /* Do we allow access to perf_event_open(2) ? */
err = security_perf_event_open(&attr, PERF_SECURITY_OPEN); err = security_perf_event_open(PERF_SECURITY_OPEN);
if (err) if (err)
--- a/security/Kconfig --- a/security/Kconfig
+++ b/security/Kconfig +++ b/security/Kconfig
@@ -51,6 +51,15 @@ config PROC_MEM_NO_FORCE @@ -72,6 +72,15 @@ config MSEAL_SYSTEM_MAPPINGS
For complete descriptions of memory sealing, please see
endchoice Documentation/userspace-api/mseal.rst
+config SECURITY_PERF_EVENTS_RESTRICT +config SECURITY_PERF_EVENTS_RESTRICT
+ bool "Restrict unprivileged use of performance events" + bool "Restrict unprivileged use of performance events"

View File

@@ -15,7 +15,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
--- ---
--- a/drivers/iommu/intel/Kconfig --- a/drivers/iommu/intel/Kconfig
+++ b/drivers/iommu/intel/Kconfig +++ b/drivers/iommu/intel/Kconfig
@@ -57,13 +57,24 @@ config INTEL_IOMMU_SVM @@ -56,13 +56,24 @@ config INTEL_IOMMU_SVM
to access DMA resources through process address space by to access DMA resources through process address space by
means of a Process Address Space ID (PASID). means of a Process Address Space ID (PASID).
@@ -48,7 +48,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
def_bool y def_bool y
--- a/drivers/iommu/intel/iommu.c --- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c
@@ -214,13 +214,13 @@ static LIST_HEAD(dmar_satc_units); @@ -204,13 +204,13 @@ static LIST_HEAD(dmar_satc_units);
static void intel_iommu_domain_free(struct iommu_domain *domain); static void intel_iommu_domain_free(struct iommu_domain *domain);
@@ -64,7 +64,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
static int intel_iommu_superpage = 1; static int intel_iommu_superpage = 1;
static int iommu_identity_mapping; static int iommu_identity_mapping;
static int iommu_skip_te_disable; static int iommu_skip_te_disable;
@@ -259,6 +259,7 @@ static int __init intel_iommu_setup(char @@ -249,6 +249,7 @@ static int __init intel_iommu_setup(char
while (*str) { while (*str) {
if (!strncmp(str, "on", 2)) { if (!strncmp(str, "on", 2)) {
dmar_disabled = 0; dmar_disabled = 0;

View File

@@ -22,7 +22,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
--- a/Documentation/admin-guide/kernel-parameters.txt --- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -2201,6 +2201,8 @@ @@ -2288,6 +2288,8 @@
bypassed by not enabling DMAR with this option. In bypassed by not enabling DMAR with this option. In
this case, gfx device will use physical address for this case, gfx device will use physical address for
DMA. DMA.
@@ -33,7 +33,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
sp_off [Default Off] sp_off [Default Off]
--- a/drivers/iommu/intel/iommu.c --- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c
@@ -36,6 +36,9 @@ @@ -35,6 +35,9 @@
#define CONTEXT_SIZE VTD_PAGE_SIZE #define CONTEXT_SIZE VTD_PAGE_SIZE
#define IS_GFX_DEVICE(pdev) ((pdev->class >> 16) == PCI_BASE_CLASS_DISPLAY) #define IS_GFX_DEVICE(pdev) ((pdev->class >> 16) == PCI_BASE_CLASS_DISPLAY)
@@ -43,7 +43,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
#define IS_USB_DEVICE(pdev) ((pdev->class >> 8) == PCI_CLASS_SERIAL_USB) #define IS_USB_DEVICE(pdev) ((pdev->class >> 8) == PCI_CLASS_SERIAL_USB)
#define IS_ISA_DEVICE(pdev) ((pdev->class >> 8) == PCI_CLASS_BRIDGE_ISA) #define IS_ISA_DEVICE(pdev) ((pdev->class >> 8) == PCI_CLASS_BRIDGE_ISA)
#define IS_AZALIA(pdev) ((pdev)->vendor == 0x8086 && (pdev)->device == 0x3a3e) #define IS_AZALIA(pdev) ((pdev)->vendor == 0x8086 && (pdev)->device == 0x3a3e)
@@ -217,12 +220,14 @@ int intel_iommu_sm = IS_ENABLED(CONFIG_I @@ -207,12 +210,14 @@ int intel_iommu_sm = IS_ENABLED(CONFIG_I
int intel_iommu_enabled = 0; int intel_iommu_enabled = 0;
EXPORT_SYMBOL_GPL(intel_iommu_enabled); EXPORT_SYMBOL_GPL(intel_iommu_enabled);
@@ -58,7 +58,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
const struct iommu_ops intel_iommu_ops; const struct iommu_ops intel_iommu_ops;
static const struct iommu_dirty_ops intel_dirty_ops; static const struct iommu_dirty_ops intel_dirty_ops;
@@ -262,6 +267,9 @@ static int __init intel_iommu_setup(char @@ -252,6 +257,9 @@ static int __init intel_iommu_setup(char
} else if (!strncmp(str, "igfx_off", 8)) { } else if (!strncmp(str, "igfx_off", 8)) {
disable_igfx_iommu = 1; disable_igfx_iommu = 1;
pr_info("Disable GFX device mapping\n"); pr_info("Disable GFX device mapping\n");
@@ -68,7 +68,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
} else if (!strncmp(str, "forcedac", 8)) { } else if (!strncmp(str, "forcedac", 8)) {
pr_warn("intel_iommu=forcedac deprecated; use iommu.forcedac instead\n"); pr_warn("intel_iommu=forcedac deprecated; use iommu.forcedac instead\n");
iommu_dma_forcedac = true; iommu_dma_forcedac = true;
@@ -2156,6 +2164,9 @@ static int device_def_domain_type(struct @@ -1949,6 +1957,9 @@ static int device_def_domain_type(struct
if ((iommu_identity_mapping & IDENTMAP_AZALIA) && IS_AZALIA(pdev)) if ((iommu_identity_mapping & IDENTMAP_AZALIA) && IS_AZALIA(pdev))
return IOMMU_DOMAIN_IDENTITY; return IOMMU_DOMAIN_IDENTITY;
@@ -78,7 +78,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
} }
return 0; return 0;
@@ -2456,6 +2467,9 @@ static int __init init_dmars(void) @@ -2243,6 +2254,9 @@ static int __init init_dmars(void)
iommu_set_root_entry(iommu); iommu_set_root_entry(iommu);
} }
@@ -87,4 +87,4 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+ +
check_tylersburg_isoch(); check_tylersburg_isoch();
ret = si_domain_init(hw_pass_through); /*

View File

@@ -29,7 +29,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
--- a/Documentation/admin-guide/kernel-parameters.txt --- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -6578,6 +6578,10 @@ @@ -7044,6 +7044,10 @@
later by a loaded module cannot be set this way. later by a loaded module cannot be set this way.
Example: sysctl.vm.swappiness=40 Example: sysctl.vm.swappiness=40
@@ -42,7 +42,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Ignore sysrq setting - this boot parameter will Ignore sysrq setting - this boot parameter will
--- a/arch/x86/Kconfig --- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig +++ b/arch/x86/Kconfig
@@ -3065,6 +3065,14 @@ config COMPAT_32 @@ -3178,6 +3178,14 @@ config COMPAT_32
select HAVE_UID16 select HAVE_UID16
select OLD_SIGSUSPEND3 select OLD_SIGSUSPEND3
@@ -57,9 +57,70 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
config COMPAT config COMPAT
def_bool y def_bool y
depends on IA32_EMULATION || X86_X32_ABI depends on IA32_EMULATION || X86_X32_ABI
--- a/arch/x86/entry/common.c --- a/arch/x86/include/asm/elf.h
+++ b/arch/x86/entry/common.c +++ b/arch/x86/include/asm/elf.h
@@ -64,7 +64,7 @@ static __always_inline bool do_syscall_x @@ -12,6 +12,9 @@
#include <asm/user.h>
#include <asm/auxvec.h>
#include <asm/fsgsbase.h>
+#ifndef COMPILE_OFFSETS /* avoid a circular dependency on asm-offsets.h */
+#include <asm/syscall.h>
+#endif
typedef unsigned long elf_greg_t;
@@ -152,7 +155,8 @@ do { \
#define compat_elf_check_arch(x) \
((elf_check_arch_ia32(x) && ia32_enabled_verbose()) || \
- (IS_ENABLED(CONFIG_X86_X32_ABI) && (x)->e_machine == EM_X86_64))
+ (IS_ENABLED(CONFIG_X86_X32_ABI) && x32_enabled && \
+ (x)->e_machine == EM_X86_64))
static inline void elf_common_init(struct thread_struct *t,
struct pt_regs *regs, const u16 ds)
--- a/arch/x86/include/asm/syscall.h
+++ b/arch/x86/include/asm/syscall.h
@@ -13,6 +13,7 @@
#include <uapi/linux/audit.h>
#include <linux/sched.h>
#include <linux/err.h>
+#include <linux/jump_label.h>
#include <asm/thread_info.h> /* for TS_COMPAT */
#include <asm/unistd.h>
@@ -28,6 +29,18 @@ extern long ia32_sys_call(const struct p
extern long x32_sys_call(const struct pt_regs *, unsigned int nr);
extern long x64_sys_call(const struct pt_regs *, unsigned int nr);
+#if defined(CONFIG_X86_X32_ABI)
+#if defined(CONFIG_X86_X32_DISABLED)
+DECLARE_STATIC_KEY_FALSE(x32_enabled_skey);
+#define x32_enabled static_branch_unlikely(&x32_enabled_skey)
+#else
+DECLARE_STATIC_KEY_TRUE(x32_enabled_skey);
+#define x32_enabled static_branch_likely(&x32_enabled_skey)
+#endif
+#else
+#define x32_enabled 0
+#endif
+
/*
* Only the low 32 bits of orig_ax are meaningful, so we return int.
* This importantly ignores the high bits on 64-bit, so comparisons
--- a/arch/x86/entry/syscall_64.c
+++ b/arch/x86/entry/syscall_64.c
@@ -7,6 +7,9 @@
#include <linux/syscalls.h>
#include <linux/entry-common.h>
#include <linux/nospec.h>
+#include <linux/moduleparam.h>
+#undef MODULE_PARAM_PREFIX
+#define MODULE_PARAM_PREFIX "syscall."
#include <asm/syscall.h>
#define __SYSCALL(nr, sym) extern long __x64_##sym(const struct pt_regs *);
@@ -75,7 +78,7 @@ static __always_inline bool do_syscall_x
*/ */
unsigned int xnr = nr - __X32_SYSCALL_BIT; unsigned int xnr = nr - __X32_SYSCALL_BIT;
@@ -68,23 +129,12 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
xnr = array_index_nospec(xnr, X32_NR_syscalls); xnr = array_index_nospec(xnr, X32_NR_syscalls);
regs->ax = x32_sys_call(regs, xnr); regs->ax = x32_sys_call(regs, xnr);
return true; return true;
--- a/arch/x86/entry/syscall_x32.c @@ -139,3 +142,48 @@ __visible noinstr bool do_syscall_64(str
+++ b/arch/x86/entry/syscall_x32.c /* Use SYSRET to exit to userspace */
@@ -4,6 +4,9 @@ return true;
#include <linux/linkage.h>
#include <linux/sys.h>
#include <linux/cache.h>
+#include <linux/moduleparam.h>
+#undef MODULE_PARAM_PREFIX
+#define MODULE_PARAM_PREFIX "syscall."
#include <linux/syscalls.h>
#include <asm/syscall.h>
@@ -23,3 +26,46 @@ long x32_sys_call(const struct pt_regs *
default: return __x64_sys_ni_syscall(regs);
} }
};
+ +
+#ifdef CONFIG_X86_X32_ABI
+/* Maybe enable x32 syscalls */ +/* Maybe enable x32 syscalls */
+ +
+#if defined(CONFIG_X86_X32_DISABLED) +#if defined(CONFIG_X86_X32_DISABLED)
@@ -127,54 +177,4 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+}; +};
+ +
+arch_param_cb(x32, &x32_param_ops, NULL, 0444); +arch_param_cb(x32, &x32_param_ops, NULL, 0444);
--- a/arch/x86/include/asm/elf.h
+++ b/arch/x86/include/asm/elf.h
@@ -12,6 +12,9 @@
#include <asm/user.h>
#include <asm/auxvec.h>
#include <asm/fsgsbase.h>
+#ifndef COMPILE_OFFSETS /* avoid a circular dependency on asm-offsets.h */
+#include <asm/syscall.h>
+#endif +#endif
typedef unsigned long elf_greg_t;
@@ -151,7 +154,8 @@ do { \
#define compat_elf_check_arch(x) \
((elf_check_arch_ia32(x) && ia32_enabled_verbose()) || \
- (IS_ENABLED(CONFIG_X86_X32_ABI) && (x)->e_machine == EM_X86_64))
+ (IS_ENABLED(CONFIG_X86_X32_ABI) && x32_enabled && \
+ (x)->e_machine == EM_X86_64))
static inline void elf_common_init(struct thread_struct *t,
struct pt_regs *regs, const u16 ds)
--- a/arch/x86/include/asm/syscall.h
+++ b/arch/x86/include/asm/syscall.h
@@ -13,6 +13,7 @@
#include <uapi/linux/audit.h>
#include <linux/sched.h>
#include <linux/err.h>
+#include <linux/jump_label.h>
#include <asm/thread_info.h> /* for TS_COMPAT */
#include <asm/unistd.h>
@@ -28,6 +29,18 @@ extern long ia32_sys_call(const struct p
extern long x32_sys_call(const struct pt_regs *, unsigned int nr);
extern long x64_sys_call(const struct pt_regs *, unsigned int nr);
+#if defined(CONFIG_X86_X32_ABI)
+#if defined(CONFIG_X86_X32_DISABLED)
+DECLARE_STATIC_KEY_FALSE(x32_enabled_skey);
+#define x32_enabled static_branch_unlikely(&x32_enabled_skey)
+#else
+DECLARE_STATIC_KEY_TRUE(x32_enabled_skey);
+#define x32_enabled static_branch_likely(&x32_enabled_skey)
+#endif
+#else
+#define x32_enabled 0
+#endif
+
/*
* Only the low 32 bits of orig_ax are meaningful, so we return int.
* This importantly ignores the high bits on 64-bit, so comparisons

View File

@@ -1,52 +0,0 @@
this reverts following commit:
From: Josh Poimboeuf <jpoimboe@redhat.com>
Date: Thu, 14 Jan 2021 16:32:42 -0600
Subject: objtool: Don't fail the kernel build on fatal errors
[ Upstream commit 655cf86548a3938538642a6df27dd359e13c86bd ]
This is basically a revert of commit 644592d32837 ("objtool: Fail the
kernel build on fatal errors").
That change turned out to be more trouble than it's worth. Failing the
build is an extreme measure which sometimes gets too much attention and
blocks CI build testing.
These fatal-type warnings aren't yet as rare as we'd hope, due to the
ever-increasing matrix of supported toolchains/plugins and their
fast-changing nature as of late.
Also, there are more people (and bots) looking for objtool warnings than
ever before, so even non-fatal warnings aren't likely to be ignored for
long.
Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -4872,10 +4872,14 @@ int check(struct objtool_file *file)
}
out:
- /*
- * For now, don't fail the kernel build on fatal warnings. These
- * errors are still fairly common due to the growing matrix of
- * supported toolchains and their recent pace of change.
- */
+ if (ret < 0) {
+ /*
+ * Fatal error. The binary is corrupt or otherwise broken in
+ * some way, or objtool itself is broken. Fail the kernel
+ * build.
+ */
+ return ret;
+ }
+
return 0;
}

View File

@@ -1,6 +1,6 @@
--- a/net/ipv4/af_inet.c --- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c
@@ -1802,7 +1802,7 @@ static __net_init int inet_init_net(stru @@ -1790,7 +1790,7 @@ static __net_init int inet_init_net(stru
/* /*
* Set defaults for local port range * Set defaults for local port range
*/ */

View File

@@ -1,9 +1,9 @@
--- a/net/bridge/br_input.c --- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c +++ b/net/bridge/br_input.c
@@ -374,7 +374,11 @@ static rx_handler_result_t br_handle_fra @@ -383,7 +383,11 @@ static rx_handler_result_t br_handle_fra
return RX_HANDLER_PASS;
case 0x01: /* IEEE MAC (Pause) */ case 0x01: /* IEEE MAC (Pause) */
reason = SKB_DROP_REASON_MAC_IEEE_MAC_CONTROL;
- goto drop; - goto drop;
+ fwd_mask |= p->br->group_fwd_mask; + fwd_mask |= p->br->group_fwd_mask;
+ if (fwd_mask & (1u << dest[5])) + if (fwd_mask & (1u << dest[5]))

View File

@@ -0,0 +1,11 @@
--- a/certs/Makefile
+++ b/certs/Makefile
@@ -47,7 +47,7 @@ keytype-$(CONFIG_MODULE_SIG_KEY_TYPE_ECD
quiet_cmd_gen_key = GENKEY $@
cmd_gen_key = openssl req -new -nodes -utf8 -$(CONFIG_MODULE_SIG_HASH) -days 36500 \
-batch -x509 -config $< \
- -outform PEM -out $@ -keyout $@ $(keytype-y) 2>&1
+ -outform PEM -out $@ -keyout $@ $(keytype-y) 2>/dev/null
$(obj)/signing_key.pem: $(obj)/x509.genkey FORCE
$(call if_changed,gen_key)

View File

@@ -1,42 +0,0 @@
From 39838c2f0b09bec02004c092904aada85da2bc2e Mon Sep 17 00:00:00 2001
From: Alexandre Frade <kernel@xanmod.org>
Date: Mon, 11 Mar 2024 12:01:13 -0300
Subject: [PATCH 19/19] x86/cfi,bpf: Add tso_segs and skb_marked_lost to
bpf_struct_ops CFI
Rebased-by: Oleksandr Natalenko <oleksandr@natalenko.name>
[ https://github.com/sirlucjan/kernel-patches/blob/master/6.8/bbr3-patches/0001-tcp-bbr3-initial-import.patch ]
Signed-off-by: Alexandre Frade <kernel@xanmod.org>
---
net/ipv4/bpf_tcp_ca.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
--- a/net/ipv4/bpf_tcp_ca.c
+++ b/net/ipv4/bpf_tcp_ca.c
@@ -305,11 +305,15 @@ static void bpf_tcp_ca_pkts_acked(struct
{
}
-static u32 bpf_tcp_ca_min_tso_segs(struct sock *sk)
+static u32 bpf_tcp_ca_tso_segs(struct sock *sk, unsigned int mss_now)
{
return 0;
}
+static void bpf_tcp_ca_skb_marked_lost(struct sock *sk, const struct sk_buff *skb)
+{
+}
+
static void bpf_tcp_ca_cong_control(struct sock *sk, u32 ack, int flag,
const struct rate_sample *rs)
{
@@ -340,7 +344,8 @@ static struct tcp_congestion_ops __bpf_o
.cwnd_event = bpf_tcp_ca_cwnd_event,
.in_ack_event = bpf_tcp_ca_in_ack_event,
.pkts_acked = bpf_tcp_ca_pkts_acked,
- .min_tso_segs = bpf_tcp_ca_min_tso_segs,
+ .tso_segs = bpf_tcp_ca_tso_segs,
+ .skb_marked_lost = bpf_tcp_ca_skb_marked_lost,
.cong_control = bpf_tcp_ca_cong_control,
.undo_cwnd = bpf_tcp_ca_undo_cwnd,
.sndbuf_expand = bpf_tcp_ca_sndbuf_expand,

View File

@@ -1,375 +0,0 @@
From 60b01019526236e40466cf20bf1192074e5e1a7c Mon Sep 17 00:00:00 2001
From: Elizabeth Figura <zfigura@codeweavers.com>
Date: Sun, 19 May 2024 15:24:27 -0500
Subject: ntsync: Introduce NTSYNC_IOC_WAIT_ANY.
This corresponds to part of the functionality of the NT syscall
NtWaitForMultipleObjects(). Specifically, it implements the behaviour where
the third argument (wait_any) is TRUE, and it does not handle alertable waits.
Those features have been split out into separate patches to ease review.
This patch therefore implements the wait/wake infrastructure which comprises the
core of ntsync's functionality.
NTSYNC_IOC_WAIT_ANY is a vectored wait function similar to poll(). Unlike
poll(), it "consumes" objects when they are signaled. For semaphores, this means
decreasing one from the internal counter. At most one object can be consumed by
this function.
This wait/wake model is fundamentally different from that used anywhere else in
the kernel, and for that reason ntsync does not use any existing infrastructure,
such as futexes, kernel mutexes or semaphores, or wait_event().
Up to 64 objects can be waited on at once. As soon as one is signaled, the
object with the lowest index is consumed, and that index is returned via the
"index" field.
A timeout is supported. The timeout is passed as a u64 nanosecond value, which
represents absolute time measured against either the MONOTONIC or REALTIME clock
(controlled by the flags argument). If U64_MAX is passed, the ioctl waits
indefinitely.
This ioctl validates that all objects belong to the relevant device. This is not
necessary for any technical reason related to NTSYNC_IOC_WAIT_ANY, but will be
necessary for NTSYNC_IOC_WAIT_ALL introduced in the following patch.
Some padding fields are added for alignment and for fields which will be added
in future patches (split out to ease review).
Signed-off-by: Elizabeth Figura <zfigura@codeweavers.com>
---
drivers/misc/ntsync.c | 245 ++++++++++++++++++++++++++++++++++++
include/uapi/linux/ntsync.h | 14 +++
2 files changed, 259 insertions(+)
--- a/drivers/misc/ntsync.c
+++ b/drivers/misc/ntsync.c
@@ -6,11 +6,16 @@
*/
#include <linux/anon_inodes.h>
+#include <linux/atomic.h>
#include <linux/file.h>
#include <linux/fs.h>
+#include <linux/hrtimer.h>
+#include <linux/ktime.h>
#include <linux/miscdevice.h>
#include <linux/module.h>
#include <linux/overflow.h>
+#include <linux/sched.h>
+#include <linux/sched/signal.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <uapi/linux/ntsync.h>
@@ -30,6 +35,8 @@ enum ntsync_type {
*
* Both rely on struct file for reference counting. Individual
* ntsync_obj objects take a reference to the device when created.
+ * Wait operations take a reference to each object being waited on for
+ * the duration of the wait.
*/
struct ntsync_obj {
@@ -47,12 +54,55 @@ struct ntsync_obj {
__u32 max;
} sem;
} u;
+
+ struct list_head any_waiters;
+};
+
+struct ntsync_q_entry {
+ struct list_head node;
+ struct ntsync_q *q;
+ struct ntsync_obj *obj;
+ __u32 index;
+};
+
+struct ntsync_q {
+ struct task_struct *task;
+
+ /*
+ * Protected via atomic_try_cmpxchg(). Only the thread that wins the
+ * compare-and-swap may actually change object states and wake this
+ * task.
+ */
+ atomic_t signaled;
+
+ __u32 count;
+ struct ntsync_q_entry entries[];
};
struct ntsync_device {
struct file *file;
};
+static void try_wake_any_sem(struct ntsync_obj *sem)
+{
+ struct ntsync_q_entry *entry;
+
+ lockdep_assert_held(&sem->lock);
+
+ list_for_each_entry(entry, &sem->any_waiters, node) {
+ struct ntsync_q *q = entry->q;
+ int signaled = -1;
+
+ if (!sem->u.sem.count)
+ break;
+
+ if (atomic_try_cmpxchg(&q->signaled, &signaled, entry->index)) {
+ sem->u.sem.count--;
+ wake_up_process(q->task);
+ }
+ }
+}
+
/*
* Actually change the semaphore state, returning -EOVERFLOW if it is made
* invalid.
@@ -88,6 +138,8 @@ static int ntsync_sem_post(struct ntsync
prev_count = sem->u.sem.count;
ret = post_sem_state(sem, args);
+ if (!ret)
+ try_wake_any_sem(sem);
spin_unlock(&sem->lock);
@@ -141,6 +193,7 @@ static struct ntsync_obj *ntsync_alloc_o
obj->dev = dev;
get_file(dev->file);
spin_lock_init(&obj->lock);
+ INIT_LIST_HEAD(&obj->any_waiters);
return obj;
}
@@ -191,6 +244,196 @@ static int ntsync_create_sem(struct ntsy
return put_user(fd, &user_args->sem);
}
+static struct ntsync_obj *get_obj(struct ntsync_device *dev, int fd)
+{
+ struct file *file = fget(fd);
+ struct ntsync_obj *obj;
+
+ if (!file)
+ return NULL;
+
+ if (file->f_op != &ntsync_obj_fops) {
+ fput(file);
+ return NULL;
+ }
+
+ obj = file->private_data;
+ if (obj->dev != dev) {
+ fput(file);
+ return NULL;
+ }
+
+ return obj;
+}
+
+static void put_obj(struct ntsync_obj *obj)
+{
+ fput(obj->file);
+}
+
+static int ntsync_schedule(const struct ntsync_q *q, const struct ntsync_wait_args *args)
+{
+ ktime_t timeout = ns_to_ktime(args->timeout);
+ clockid_t clock = CLOCK_MONOTONIC;
+ ktime_t *timeout_ptr;
+ int ret = 0;
+
+ timeout_ptr = (args->timeout == U64_MAX ? NULL : &timeout);
+
+ if (args->flags & NTSYNC_WAIT_REALTIME)
+ clock = CLOCK_REALTIME;
+
+ do {
+ if (signal_pending(current)) {
+ ret = -ERESTARTSYS;
+ break;
+ }
+
+ set_current_state(TASK_INTERRUPTIBLE);
+ if (atomic_read(&q->signaled) != -1) {
+ ret = 0;
+ break;
+ }
+ ret = schedule_hrtimeout_range_clock(timeout_ptr, 0, HRTIMER_MODE_ABS, clock);
+ } while (ret < 0);
+ __set_current_state(TASK_RUNNING);
+
+ return ret;
+}
+
+/*
+ * Allocate and initialize the ntsync_q structure, but do not queue us yet.
+ */
+static int setup_wait(struct ntsync_device *dev,
+ const struct ntsync_wait_args *args,
+ struct ntsync_q **ret_q)
+{
+ const __u32 count = args->count;
+ int fds[NTSYNC_MAX_WAIT_COUNT];
+ struct ntsync_q *q;
+ __u32 i, j;
+
+ if (args->pad[0] || args->pad[1] || args->pad[2] || (args->flags & ~NTSYNC_WAIT_REALTIME))
+ return -EINVAL;
+
+ if (args->count > NTSYNC_MAX_WAIT_COUNT)
+ return -EINVAL;
+
+ if (copy_from_user(fds, u64_to_user_ptr(args->objs),
+ array_size(count, sizeof(*fds))))
+ return -EFAULT;
+
+ q = kmalloc(struct_size(q, entries, count), GFP_KERNEL);
+ if (!q)
+ return -ENOMEM;
+ q->task = current;
+ atomic_set(&q->signaled, -1);
+ q->count = count;
+
+ for (i = 0; i < count; i++) {
+ struct ntsync_q_entry *entry = &q->entries[i];
+ struct ntsync_obj *obj = get_obj(dev, fds[i]);
+
+ if (!obj)
+ goto err;
+
+ entry->obj = obj;
+ entry->q = q;
+ entry->index = i;
+ }
+
+ *ret_q = q;
+ return 0;
+
+err:
+ for (j = 0; j < i; j++)
+ put_obj(q->entries[j].obj);
+ kfree(q);
+ return -EINVAL;
+}
+
+static void try_wake_any_obj(struct ntsync_obj *obj)
+{
+ switch (obj->type) {
+ case NTSYNC_TYPE_SEM:
+ try_wake_any_sem(obj);
+ break;
+ }
+}
+
+static int ntsync_wait_any(struct ntsync_device *dev, void __user *argp)
+{
+ struct ntsync_wait_args args;
+ struct ntsync_q *q;
+ int signaled;
+ __u32 i;
+ int ret;
+
+ if (copy_from_user(&args, argp, sizeof(args)))
+ return -EFAULT;
+
+ ret = setup_wait(dev, &args, &q);
+ if (ret < 0)
+ return ret;
+
+ /* queue ourselves */
+
+ for (i = 0; i < args.count; i++) {
+ struct ntsync_q_entry *entry = &q->entries[i];
+ struct ntsync_obj *obj = entry->obj;
+
+ spin_lock(&obj->lock);
+ list_add_tail(&entry->node, &obj->any_waiters);
+ spin_unlock(&obj->lock);
+ }
+
+ /* check if we are already signaled */
+
+ for (i = 0; i < args.count; i++) {
+ struct ntsync_obj *obj = q->entries[i].obj;
+
+ if (atomic_read(&q->signaled) != -1)
+ break;
+
+ spin_lock(&obj->lock);
+ try_wake_any_obj(obj);
+ spin_unlock(&obj->lock);
+ }
+
+ /* sleep */
+
+ ret = ntsync_schedule(q, &args);
+
+ /* and finally, unqueue */
+
+ for (i = 0; i < args.count; i++) {
+ struct ntsync_q_entry *entry = &q->entries[i];
+ struct ntsync_obj *obj = entry->obj;
+
+ spin_lock(&obj->lock);
+ list_del(&entry->node);
+ spin_unlock(&obj->lock);
+
+ put_obj(obj);
+ }
+
+ signaled = atomic_read(&q->signaled);
+ if (signaled != -1) {
+ struct ntsync_wait_args __user *user_args = argp;
+
+ /* even if we caught a signal, we need to communicate success */
+ ret = 0;
+
+ if (put_user(signaled, &user_args->index))
+ ret = -EFAULT;
+ } else if (!ret) {
+ ret = -ETIMEDOUT;
+ }
+
+ kfree(q);
+ return ret;
+}
+
static int ntsync_char_open(struct inode *inode, struct file *file)
{
struct ntsync_device *dev;
@@ -222,6 +465,8 @@ static long ntsync_char_ioctl(struct fil
switch (cmd) {
case NTSYNC_IOC_CREATE_SEM:
return ntsync_create_sem(dev, argp);
+ case NTSYNC_IOC_WAIT_ANY:
+ return ntsync_wait_any(dev, argp);
default:
return -ENOIOCTLCMD;
}
--- a/include/uapi/linux/ntsync.h
+++ b/include/uapi/linux/ntsync.h
@@ -16,7 +16,21 @@ struct ntsync_sem_args {
__u32 max;
};
+#define NTSYNC_WAIT_REALTIME 0x1
+
+struct ntsync_wait_args {
+ __u64 timeout;
+ __u64 objs;
+ __u32 count;
+ __u32 index;
+ __u32 flags;
+ __u32 pad[3];
+};
+
+#define NTSYNC_MAX_WAIT_COUNT 64
+
#define NTSYNC_IOC_CREATE_SEM _IOWR('N', 0x80, struct ntsync_sem_args)
+#define NTSYNC_IOC_WAIT_ANY _IOWR('N', 0x82, struct ntsync_wait_args)
#define NTSYNC_IOC_SEM_POST _IOWR('N', 0x81, __u32)

View File

@@ -1,532 +0,0 @@
From 73fc33606fcb7028ec1ee6027a361de4e85ab5d6 Mon Sep 17 00:00:00 2001
From: Elizabeth Figura <zfigura@codeweavers.com>
Date: Sun, 19 May 2024 15:24:28 -0500
Subject: ntsync: Introduce NTSYNC_IOC_WAIT_ALL.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This is similar to NTSYNC_IOC_WAIT_ANY, but waits until all of the objects are
simultaneously signaled, and then acquires all of them as a single atomic
operation.
Because acquisition of multiple objects is atomic, some complex locking is
required. We cannot simply spin-lock multiple objects simultaneously, as that
may disable preëmption for a problematically long time.
Instead, modifying any object which may be involved in a wait-all operation takes
a device-wide sleeping mutex, "wait_all_lock", instead of the normal object
spinlock.
Because wait-for-all is a rare operation, in order to optimize wait-for-any,
this lock is only taken when necessary. "all_hint" is used to mark objects which
are involved in a wait-for-all operation, and if an object is not, only its
spinlock is taken.
The locking scheme used here was written by Peter Zijlstra.
Signed-off-by: Elizabeth Figura <zfigura@codeweavers.com>
---
drivers/misc/ntsync.c | 334 ++++++++++++++++++++++++++++++++++--
include/uapi/linux/ntsync.h | 1 +
2 files changed, 322 insertions(+), 13 deletions(-)
--- a/drivers/misc/ntsync.c
+++ b/drivers/misc/ntsync.c
@@ -13,6 +13,7 @@
#include <linux/ktime.h>
#include <linux/miscdevice.h>
#include <linux/module.h>
+#include <linux/mutex.h>
#include <linux/overflow.h>
#include <linux/sched.h>
#include <linux/sched/signal.h>
@@ -41,6 +42,7 @@ enum ntsync_type {
struct ntsync_obj {
spinlock_t lock;
+ int dev_locked;
enum ntsync_type type;
@@ -55,7 +57,30 @@ struct ntsync_obj {
} sem;
} u;
+ /*
+ * any_waiters is protected by the object lock, but all_waiters is
+ * protected by the device wait_all_lock.
+ */
struct list_head any_waiters;
+ struct list_head all_waiters;
+
+ /*
+ * Hint describing how many tasks are queued on this object in a
+ * wait-all operation.
+ *
+ * Any time we do a wake, we may need to wake "all" waiters as well as
+ * "any" waiters. In order to atomically wake "all" waiters, we must
+ * lock all of the objects, and that means grabbing the wait_all_lock
+ * below (and, due to lock ordering rules, before locking this object).
+ * However, wait-all is a rare operation, and grabbing the wait-all
+ * lock for every wake would create unnecessary contention.
+ * Therefore we first check whether all_hint is zero, and, if it is,
+ * we skip trying to wake "all" waiters.
+ *
+ * Since wait requests must originate from user-space threads, we're
+ * limited here by PID_MAX_LIMIT, so there's no risk of overflow.
+ */
+ atomic_t all_hint;
};
struct ntsync_q_entry {
@@ -75,19 +100,198 @@ struct ntsync_q {
*/
atomic_t signaled;
+ bool all;
__u32 count;
struct ntsync_q_entry entries[];
};
struct ntsync_device {
+ /*
+ * Wait-all operations must atomically grab all objects, and be totally
+ * ordered with respect to each other and wait-any operations.
+ * If one thread is trying to acquire several objects, another thread
+ * cannot touch the object at the same time.
+ *
+ * This device-wide lock is used to serialize wait-for-all
+ * operations, and operations on an object that is involved in a
+ * wait-for-all.
+ */
+ struct mutex wait_all_lock;
+
struct file *file;
};
+/*
+ * Single objects are locked using obj->lock.
+ *
+ * Multiple objects are 'locked' while holding dev->wait_all_lock.
+ * In this case however, individual objects are not locked by holding
+ * obj->lock, but by setting obj->dev_locked.
+ *
+ * This means that in order to lock a single object, the sequence is slightly
+ * more complicated than usual. Specifically it needs to check obj->dev_locked
+ * after acquiring obj->lock, if set, it needs to drop the lock and acquire
+ * dev->wait_all_lock in order to serialize against the multi-object operation.
+ */
+
+static void dev_lock_obj(struct ntsync_device *dev, struct ntsync_obj *obj)
+{
+ lockdep_assert_held(&dev->wait_all_lock);
+ lockdep_assert(obj->dev == dev);
+ spin_lock(&obj->lock);
+ /*
+ * By setting obj->dev_locked inside obj->lock, it is ensured that
+ * anyone holding obj->lock must see the value.
+ */
+ obj->dev_locked = 1;
+ spin_unlock(&obj->lock);
+}
+
+static void dev_unlock_obj(struct ntsync_device *dev, struct ntsync_obj *obj)
+{
+ lockdep_assert_held(&dev->wait_all_lock);
+ lockdep_assert(obj->dev == dev);
+ spin_lock(&obj->lock);
+ obj->dev_locked = 0;
+ spin_unlock(&obj->lock);
+}
+
+static void obj_lock(struct ntsync_obj *obj)
+{
+ struct ntsync_device *dev = obj->dev;
+
+ for (;;) {
+ spin_lock(&obj->lock);
+ if (likely(!obj->dev_locked))
+ break;
+
+ spin_unlock(&obj->lock);
+ mutex_lock(&dev->wait_all_lock);
+ spin_lock(&obj->lock);
+ /*
+ * obj->dev_locked should be set and released under the same
+ * wait_all_lock section, since we now own this lock, it should
+ * be clear.
+ */
+ lockdep_assert(!obj->dev_locked);
+ spin_unlock(&obj->lock);
+ mutex_unlock(&dev->wait_all_lock);
+ }
+}
+
+static void obj_unlock(struct ntsync_obj *obj)
+{
+ spin_unlock(&obj->lock);
+}
+
+static bool ntsync_lock_obj(struct ntsync_device *dev, struct ntsync_obj *obj)
+{
+ bool all;
+
+ obj_lock(obj);
+ all = atomic_read(&obj->all_hint);
+ if (unlikely(all)) {
+ obj_unlock(obj);
+ mutex_lock(&dev->wait_all_lock);
+ dev_lock_obj(dev, obj);
+ }
+
+ return all;
+}
+
+static void ntsync_unlock_obj(struct ntsync_device *dev, struct ntsync_obj *obj, bool all)
+{
+ if (all) {
+ dev_unlock_obj(dev, obj);
+ mutex_unlock(&dev->wait_all_lock);
+ } else {
+ obj_unlock(obj);
+ }
+}
+
+#define ntsync_assert_held(obj) \
+ lockdep_assert((lockdep_is_held(&(obj)->lock) != LOCK_STATE_NOT_HELD) || \
+ ((lockdep_is_held(&(obj)->dev->wait_all_lock) != LOCK_STATE_NOT_HELD) && \
+ (obj)->dev_locked))
+
+static bool is_signaled(struct ntsync_obj *obj)
+{
+ ntsync_assert_held(obj);
+
+ switch (obj->type) {
+ case NTSYNC_TYPE_SEM:
+ return !!obj->u.sem.count;
+ }
+
+ WARN(1, "bad object type %#x\n", obj->type);
+ return false;
+}
+
+/*
+ * "locked_obj" is an optional pointer to an object which is already locked and
+ * should not be locked again. This is necessary so that changing an object's
+ * state and waking it can be a single atomic operation.
+ */
+static void try_wake_all(struct ntsync_device *dev, struct ntsync_q *q,
+ struct ntsync_obj *locked_obj)
+{
+ __u32 count = q->count;
+ bool can_wake = true;
+ int signaled = -1;
+ __u32 i;
+
+ lockdep_assert_held(&dev->wait_all_lock);
+ if (locked_obj)
+ lockdep_assert(locked_obj->dev_locked);
+
+ for (i = 0; i < count; i++) {
+ if (q->entries[i].obj != locked_obj)
+ dev_lock_obj(dev, q->entries[i].obj);
+ }
+
+ for (i = 0; i < count; i++) {
+ if (!is_signaled(q->entries[i].obj)) {
+ can_wake = false;
+ break;
+ }
+ }
+
+ if (can_wake && atomic_try_cmpxchg(&q->signaled, &signaled, 0)) {
+ for (i = 0; i < count; i++) {
+ struct ntsync_obj *obj = q->entries[i].obj;
+
+ switch (obj->type) {
+ case NTSYNC_TYPE_SEM:
+ obj->u.sem.count--;
+ break;
+ }
+ }
+ wake_up_process(q->task);
+ }
+
+ for (i = 0; i < count; i++) {
+ if (q->entries[i].obj != locked_obj)
+ dev_unlock_obj(dev, q->entries[i].obj);
+ }
+}
+
+static void try_wake_all_obj(struct ntsync_device *dev, struct ntsync_obj *obj)
+{
+ struct ntsync_q_entry *entry;
+
+ lockdep_assert_held(&dev->wait_all_lock);
+ lockdep_assert(obj->dev_locked);
+
+ list_for_each_entry(entry, &obj->all_waiters, node)
+ try_wake_all(dev, entry->q, obj);
+}
+
static void try_wake_any_sem(struct ntsync_obj *sem)
{
struct ntsync_q_entry *entry;
- lockdep_assert_held(&sem->lock);
+ ntsync_assert_held(sem);
+ lockdep_assert(sem->type == NTSYNC_TYPE_SEM);
list_for_each_entry(entry, &sem->any_waiters, node) {
struct ntsync_q *q = entry->q;
@@ -111,7 +315,7 @@ static int post_sem_state(struct ntsync_
{
__u32 sum;
- lockdep_assert_held(&sem->lock);
+ ntsync_assert_held(sem);
if (check_add_overflow(sem->u.sem.count, count, &sum) ||
sum > sem->u.sem.max)
@@ -123,9 +327,11 @@ static int post_sem_state(struct ntsync_
static int ntsync_sem_post(struct ntsync_obj *sem, void __user *argp)
{
+ struct ntsync_device *dev = sem->dev;
__u32 __user *user_args = argp;
__u32 prev_count;
__u32 args;
+ bool all;
int ret;
if (copy_from_user(&args, argp, sizeof(args)))
@@ -134,14 +340,17 @@ static int ntsync_sem_post(struct ntsync
if (sem->type != NTSYNC_TYPE_SEM)
return -EINVAL;
- spin_lock(&sem->lock);
+ all = ntsync_lock_obj(dev, sem);
prev_count = sem->u.sem.count;
ret = post_sem_state(sem, args);
- if (!ret)
+ if (!ret) {
+ if (all)
+ try_wake_all_obj(dev, sem);
try_wake_any_sem(sem);
+ }
- spin_unlock(&sem->lock);
+ ntsync_unlock_obj(dev, sem, all);
if (!ret && put_user(prev_count, user_args))
ret = -EFAULT;
@@ -194,6 +403,8 @@ static struct ntsync_obj *ntsync_alloc_o
get_file(dev->file);
spin_lock_init(&obj->lock);
INIT_LIST_HEAD(&obj->any_waiters);
+ INIT_LIST_HEAD(&obj->all_waiters);
+ atomic_set(&obj->all_hint, 0);
return obj;
}
@@ -305,7 +516,7 @@ static int ntsync_schedule(const struct
* Allocate and initialize the ntsync_q structure, but do not queue us yet.
*/
static int setup_wait(struct ntsync_device *dev,
- const struct ntsync_wait_args *args,
+ const struct ntsync_wait_args *args, bool all,
struct ntsync_q **ret_q)
{
const __u32 count = args->count;
@@ -328,6 +539,7 @@ static int setup_wait(struct ntsync_devi
return -ENOMEM;
q->task = current;
atomic_set(&q->signaled, -1);
+ q->all = all;
q->count = count;
for (i = 0; i < count; i++) {
@@ -337,6 +549,16 @@ static int setup_wait(struct ntsync_devi
if (!obj)
goto err;
+ if (all) {
+ /* Check that the objects are all distinct. */
+ for (j = 0; j < i; j++) {
+ if (obj == q->entries[j].obj) {
+ put_obj(obj);
+ goto err;
+ }
+ }
+ }
+
entry->obj = obj;
entry->q = q;
entry->index = i;
@@ -366,13 +588,14 @@ static int ntsync_wait_any(struct ntsync
struct ntsync_wait_args args;
struct ntsync_q *q;
int signaled;
+ bool all;
__u32 i;
int ret;
if (copy_from_user(&args, argp, sizeof(args)))
return -EFAULT;
- ret = setup_wait(dev, &args, &q);
+ ret = setup_wait(dev, &args, false, &q);
if (ret < 0)
return ret;
@@ -382,9 +605,9 @@ static int ntsync_wait_any(struct ntsync
struct ntsync_q_entry *entry = &q->entries[i];
struct ntsync_obj *obj = entry->obj;
- spin_lock(&obj->lock);
+ all = ntsync_lock_obj(dev, obj);
list_add_tail(&entry->node, &obj->any_waiters);
- spin_unlock(&obj->lock);
+ ntsync_unlock_obj(dev, obj, all);
}
/* check if we are already signaled */
@@ -395,9 +618,9 @@ static int ntsync_wait_any(struct ntsync
if (atomic_read(&q->signaled) != -1)
break;
- spin_lock(&obj->lock);
+ all = ntsync_lock_obj(dev, obj);
try_wake_any_obj(obj);
- spin_unlock(&obj->lock);
+ ntsync_unlock_obj(dev, obj, all);
}
/* sleep */
@@ -410,13 +633,94 @@ static int ntsync_wait_any(struct ntsync
struct ntsync_q_entry *entry = &q->entries[i];
struct ntsync_obj *obj = entry->obj;
- spin_lock(&obj->lock);
+ all = ntsync_lock_obj(dev, obj);
list_del(&entry->node);
- spin_unlock(&obj->lock);
+ ntsync_unlock_obj(dev, obj, all);
+
+ put_obj(obj);
+ }
+
+ signaled = atomic_read(&q->signaled);
+ if (signaled != -1) {
+ struct ntsync_wait_args __user *user_args = argp;
+
+ /* even if we caught a signal, we need to communicate success */
+ ret = 0;
+
+ if (put_user(signaled, &user_args->index))
+ ret = -EFAULT;
+ } else if (!ret) {
+ ret = -ETIMEDOUT;
+ }
+
+ kfree(q);
+ return ret;
+}
+
+static int ntsync_wait_all(struct ntsync_device *dev, void __user *argp)
+{
+ struct ntsync_wait_args args;
+ struct ntsync_q *q;
+ int signaled;
+ __u32 i;
+ int ret;
+
+ if (copy_from_user(&args, argp, sizeof(args)))
+ return -EFAULT;
+
+ ret = setup_wait(dev, &args, true, &q);
+ if (ret < 0)
+ return ret;
+
+ /* queue ourselves */
+
+ mutex_lock(&dev->wait_all_lock);
+
+ for (i = 0; i < args.count; i++) {
+ struct ntsync_q_entry *entry = &q->entries[i];
+ struct ntsync_obj *obj = entry->obj;
+
+ atomic_inc(&obj->all_hint);
+
+ /*
+ * obj->all_waiters is protected by dev->wait_all_lock rather
+ * than obj->lock, so there is no need to acquire obj->lock
+ * here.
+ */
+ list_add_tail(&entry->node, &obj->all_waiters);
+ }
+
+ /* check if we are already signaled */
+
+ try_wake_all(dev, q, NULL);
+
+ mutex_unlock(&dev->wait_all_lock);
+
+ /* sleep */
+
+ ret = ntsync_schedule(q, &args);
+
+ /* and finally, unqueue */
+
+ mutex_lock(&dev->wait_all_lock);
+
+ for (i = 0; i < args.count; i++) {
+ struct ntsync_q_entry *entry = &q->entries[i];
+ struct ntsync_obj *obj = entry->obj;
+
+ /*
+ * obj->all_waiters is protected by dev->wait_all_lock rather
+ * than obj->lock, so there is no need to acquire it here.
+ */
+ list_del(&entry->node);
+
+ atomic_dec(&obj->all_hint);
put_obj(obj);
}
+ mutex_unlock(&dev->wait_all_lock);
+
signaled = atomic_read(&q->signaled);
if (signaled != -1) {
struct ntsync_wait_args __user *user_args = argp;
@@ -442,6 +746,8 @@ static int ntsync_char_open(struct inode
if (!dev)
return -ENOMEM;
+ mutex_init(&dev->wait_all_lock);
+
file->private_data = dev;
dev->file = file;
return nonseekable_open(inode, file);
@@ -465,6 +771,8 @@ static long ntsync_char_ioctl(struct fil
switch (cmd) {
case NTSYNC_IOC_CREATE_SEM:
return ntsync_create_sem(dev, argp);
+ case NTSYNC_IOC_WAIT_ALL:
+ return ntsync_wait_all(dev, argp);
case NTSYNC_IOC_WAIT_ANY:
return ntsync_wait_any(dev, argp);
default:
--- a/include/uapi/linux/ntsync.h
+++ b/include/uapi/linux/ntsync.h
@@ -31,6 +31,7 @@ struct ntsync_wait_args {
#define NTSYNC_IOC_CREATE_SEM _IOWR('N', 0x80, struct ntsync_sem_args)
#define NTSYNC_IOC_WAIT_ANY _IOWR('N', 0x82, struct ntsync_wait_args)
+#define NTSYNC_IOC_WAIT_ALL _IOWR('N', 0x83, struct ntsync_wait_args)
#define NTSYNC_IOC_SEM_POST _IOWR('N', 0x81, __u32)

View File

@@ -1,226 +0,0 @@
From fdeceab49078a80987c665ed837ee4f1b8a942a8 Mon Sep 17 00:00:00 2001
From: Elizabeth Figura <zfigura@codeweavers.com>
Date: Sun, 19 May 2024 15:24:29 -0500
Subject: ntsync: Introduce NTSYNC_IOC_CREATE_MUTEX.
This corresponds to the NT syscall NtCreateMutant().
An NT mutex is recursive, with a 32-bit recursion counter. When acquired via
NtWaitForMultipleObjects(), the recursion counter is incremented by one. The OS
records the thread which acquired it.
The OS records the thread which acquired it. However, in order to keep this
driver self-contained, the owning thread ID is managed by user-space, and passed
as a parameter to all relevant ioctls.
The initial owner and recursion count, if any, are specified when the mutex is
created.
Signed-off-by: Elizabeth Figura <zfigura@codeweavers.com>
---
drivers/misc/ntsync.c | 77 +++++++++++++++++++++++++++++++++++--
include/uapi/linux/ntsync.h | 10 ++++-
2 files changed, 83 insertions(+), 4 deletions(-)
--- a/drivers/misc/ntsync.c
+++ b/drivers/misc/ntsync.c
@@ -25,6 +25,7 @@
enum ntsync_type {
NTSYNC_TYPE_SEM,
+ NTSYNC_TYPE_MUTEX,
};
/*
@@ -55,6 +56,10 @@ struct ntsync_obj {
__u32 count;
__u32 max;
} sem;
+ struct {
+ __u32 count;
+ pid_t owner;
+ } mutex;
} u;
/*
@@ -92,6 +97,7 @@ struct ntsync_q_entry {
struct ntsync_q {
struct task_struct *task;
+ __u32 owner;
/*
* Protected via atomic_try_cmpxchg(). Only the thread that wins the
@@ -214,13 +220,17 @@ static void ntsync_unlock_obj(struct nts
((lockdep_is_held(&(obj)->dev->wait_all_lock) != LOCK_STATE_NOT_HELD) && \
(obj)->dev_locked))
-static bool is_signaled(struct ntsync_obj *obj)
+static bool is_signaled(struct ntsync_obj *obj, __u32 owner)
{
ntsync_assert_held(obj);
switch (obj->type) {
case NTSYNC_TYPE_SEM:
return !!obj->u.sem.count;
+ case NTSYNC_TYPE_MUTEX:
+ if (obj->u.mutex.owner && obj->u.mutex.owner != owner)
+ return false;
+ return obj->u.mutex.count < UINT_MAX;
}
WARN(1, "bad object type %#x\n", obj->type);
@@ -250,7 +260,7 @@ static void try_wake_all(struct ntsync_d
}
for (i = 0; i < count; i++) {
- if (!is_signaled(q->entries[i].obj)) {
+ if (!is_signaled(q->entries[i].obj, q->owner)) {
can_wake = false;
break;
}
@@ -264,6 +274,10 @@ static void try_wake_all(struct ntsync_d
case NTSYNC_TYPE_SEM:
obj->u.sem.count--;
break;
+ case NTSYNC_TYPE_MUTEX:
+ obj->u.mutex.count++;
+ obj->u.mutex.owner = q->owner;
+ break;
}
}
wake_up_process(q->task);
@@ -307,6 +321,30 @@ static void try_wake_any_sem(struct ntsy
}
}
+static void try_wake_any_mutex(struct ntsync_obj *mutex)
+{
+ struct ntsync_q_entry *entry;
+
+ ntsync_assert_held(mutex);
+ lockdep_assert(mutex->type == NTSYNC_TYPE_MUTEX);
+
+ list_for_each_entry(entry, &mutex->any_waiters, node) {
+ struct ntsync_q *q = entry->q;
+ int signaled = -1;
+
+ if (mutex->u.mutex.count == UINT_MAX)
+ break;
+ if (mutex->u.mutex.owner && mutex->u.mutex.owner != q->owner)
+ continue;
+
+ if (atomic_try_cmpxchg(&q->signaled, &signaled, entry->index)) {
+ mutex->u.mutex.count++;
+ mutex->u.mutex.owner = q->owner;
+ wake_up_process(q->task);
+ }
+ }
+}
+
/*
* Actually change the semaphore state, returning -EOVERFLOW if it is made
* invalid.
@@ -455,6 +493,33 @@ static int ntsync_create_sem(struct ntsy
return put_user(fd, &user_args->sem);
}
+static int ntsync_create_mutex(struct ntsync_device *dev, void __user *argp)
+{
+ struct ntsync_mutex_args __user *user_args = argp;
+ struct ntsync_mutex_args args;
+ struct ntsync_obj *mutex;
+ int fd;
+
+ if (copy_from_user(&args, argp, sizeof(args)))
+ return -EFAULT;
+
+ if (!args.owner != !args.count)
+ return -EINVAL;
+
+ mutex = ntsync_alloc_obj(dev, NTSYNC_TYPE_MUTEX);
+ if (!mutex)
+ return -ENOMEM;
+ mutex->u.mutex.count = args.count;
+ mutex->u.mutex.owner = args.owner;
+ fd = ntsync_obj_get_fd(mutex);
+ if (fd < 0) {
+ kfree(mutex);
+ return fd;
+ }
+
+ return put_user(fd, &user_args->mutex);
+}
+
static struct ntsync_obj *get_obj(struct ntsync_device *dev, int fd)
{
struct file *file = fget(fd);
@@ -524,7 +589,7 @@ static int setup_wait(struct ntsync_devi
struct ntsync_q *q;
__u32 i, j;
- if (args->pad[0] || args->pad[1] || args->pad[2] || (args->flags & ~NTSYNC_WAIT_REALTIME))
+ if (args->pad[0] || args->pad[1] || (args->flags & ~NTSYNC_WAIT_REALTIME))
return -EINVAL;
if (args->count > NTSYNC_MAX_WAIT_COUNT)
@@ -538,6 +603,7 @@ static int setup_wait(struct ntsync_devi
if (!q)
return -ENOMEM;
q->task = current;
+ q->owner = args->owner;
atomic_set(&q->signaled, -1);
q->all = all;
q->count = count;
@@ -580,6 +646,9 @@ static void try_wake_any_obj(struct ntsy
case NTSYNC_TYPE_SEM:
try_wake_any_sem(obj);
break;
+ case NTSYNC_TYPE_MUTEX:
+ try_wake_any_mutex(obj);
+ break;
}
}
@@ -769,6 +838,8 @@ static long ntsync_char_ioctl(struct fil
void __user *argp = (void __user *)parm;
switch (cmd) {
+ case NTSYNC_IOC_CREATE_MUTEX:
+ return ntsync_create_mutex(dev, argp);
case NTSYNC_IOC_CREATE_SEM:
return ntsync_create_sem(dev, argp);
case NTSYNC_IOC_WAIT_ALL:
--- a/include/uapi/linux/ntsync.h
+++ b/include/uapi/linux/ntsync.h
@@ -16,6 +16,12 @@ struct ntsync_sem_args {
__u32 max;
};
+struct ntsync_mutex_args {
+ __u32 mutex;
+ __u32 owner;
+ __u32 count;
+};
+
#define NTSYNC_WAIT_REALTIME 0x1
struct ntsync_wait_args {
@@ -24,7 +30,8 @@ struct ntsync_wait_args {
__u32 count;
__u32 index;
__u32 flags;
- __u32 pad[3];
+ __u32 owner;
+ __u32 pad[2];
};
#define NTSYNC_MAX_WAIT_COUNT 64
@@ -32,6 +39,7 @@ struct ntsync_wait_args {
#define NTSYNC_IOC_CREATE_SEM _IOWR('N', 0x80, struct ntsync_sem_args)
#define NTSYNC_IOC_WAIT_ANY _IOWR('N', 0x82, struct ntsync_wait_args)
#define NTSYNC_IOC_WAIT_ALL _IOWR('N', 0x83, struct ntsync_wait_args)
+#define NTSYNC_IOC_CREATE_MUTEX _IOWR('N', 0x84, struct ntsync_sem_args)
#define NTSYNC_IOC_SEM_POST _IOWR('N', 0x81, __u32)

View File

@@ -1,95 +0,0 @@
From cc9ade623cd90cd002fb86f3aa249af2e6e4019e Mon Sep 17 00:00:00 2001
From: Elizabeth Figura <zfigura@codeweavers.com>
Date: Sun, 19 May 2024 15:24:30 -0500
Subject: ntsync: Introduce NTSYNC_IOC_MUTEX_UNLOCK.
This corresponds to the NT syscall NtReleaseMutant().
This syscall decrements the mutex's recursion count by one, and returns the
previous value. If the mutex is not owned by the current task, the function
instead fails and returns -EPERM.
Signed-off-by: Elizabeth Figura <zfigura@codeweavers.com>
---
drivers/misc/ntsync.c | 53 +++++++++++++++++++++++++++++++++++++
include/uapi/linux/ntsync.h | 1 +
2 files changed, 54 insertions(+)
--- a/drivers/misc/ntsync.c
+++ b/drivers/misc/ntsync.c
@@ -396,6 +396,57 @@ static int ntsync_sem_post(struct ntsync
return ret;
}
+/*
+ * Actually change the mutex state, returning -EPERM if not the owner.
+ */
+static int unlock_mutex_state(struct ntsync_obj *mutex,
+ const struct ntsync_mutex_args *args)
+{
+ ntsync_assert_held(mutex);
+
+ if (mutex->u.mutex.owner != args->owner)
+ return -EPERM;
+
+ if (!--mutex->u.mutex.count)
+ mutex->u.mutex.owner = 0;
+ return 0;
+}
+
+static int ntsync_mutex_unlock(struct ntsync_obj *mutex, void __user *argp)
+{
+ struct ntsync_mutex_args __user *user_args = argp;
+ struct ntsync_device *dev = mutex->dev;
+ struct ntsync_mutex_args args;
+ __u32 prev_count;
+ bool all;
+ int ret;
+
+ if (copy_from_user(&args, argp, sizeof(args)))
+ return -EFAULT;
+ if (!args.owner)
+ return -EINVAL;
+
+ if (mutex->type != NTSYNC_TYPE_MUTEX)
+ return -EINVAL;
+
+ all = ntsync_lock_obj(dev, mutex);
+
+ prev_count = mutex->u.mutex.count;
+ ret = unlock_mutex_state(mutex, &args);
+ if (!ret) {
+ if (all)
+ try_wake_all_obj(dev, mutex);
+ try_wake_any_mutex(mutex);
+ }
+
+ ntsync_unlock_obj(dev, mutex, all);
+
+ if (!ret && put_user(prev_count, &user_args->count))
+ ret = -EFAULT;
+
+ return ret;
+}
+
static int ntsync_obj_release(struct inode *inode, struct file *file)
{
struct ntsync_obj *obj = file->private_data;
@@ -415,6 +466,8 @@ static long ntsync_obj_ioctl(struct file
switch (cmd) {
case NTSYNC_IOC_SEM_POST:
return ntsync_sem_post(obj, argp);
+ case NTSYNC_IOC_MUTEX_UNLOCK:
+ return ntsync_mutex_unlock(obj, argp);
default:
return -ENOIOCTLCMD;
}
--- a/include/uapi/linux/ntsync.h
+++ b/include/uapi/linux/ntsync.h
@@ -42,5 +42,6 @@ struct ntsync_wait_args {
#define NTSYNC_IOC_CREATE_MUTEX _IOWR('N', 0x84, struct ntsync_sem_args)
#define NTSYNC_IOC_SEM_POST _IOWR('N', 0x81, __u32)
+#define NTSYNC_IOC_MUTEX_UNLOCK _IOWR('N', 0x85, struct ntsync_mutex_args)
#endif

View File

@@ -1,156 +0,0 @@
From dca3fe766afa42e34f5d3f62c0f2850760663176 Mon Sep 17 00:00:00 2001
From: Elizabeth Figura <zfigura@codeweavers.com>
Date: Sun, 19 May 2024 15:24:31 -0500
Subject: ntsync: Introduce NTSYNC_IOC_MUTEX_KILL.
This does not correspond to any NT syscall. Rather, when a thread dies, it
should be called by the NT emulator for each mutex, with the TID of the dying
thread.
NT mutexes are robust (in the pthread sense). When an NT thread dies, any
mutexes it owned are immediately released. Acquisition of those mutexes by other
threads will return a special value indicating that the mutex was abandoned,
like EOWNERDEAD returned from pthread_mutex_lock(), and EOWNERDEAD is indeed
used here for that purpose.
Signed-off-by: Elizabeth Figura <zfigura@codeweavers.com>
---
drivers/misc/ntsync.c | 61 +++++++++++++++++++++++++++++++++++--
include/uapi/linux/ntsync.h | 1 +
2 files changed, 60 insertions(+), 2 deletions(-)
--- a/drivers/misc/ntsync.c
+++ b/drivers/misc/ntsync.c
@@ -59,6 +59,7 @@ struct ntsync_obj {
struct {
__u32 count;
pid_t owner;
+ bool ownerdead;
} mutex;
} u;
@@ -107,6 +108,7 @@ struct ntsync_q {
atomic_t signaled;
bool all;
+ bool ownerdead;
__u32 count;
struct ntsync_q_entry entries[];
};
@@ -275,6 +277,9 @@ static void try_wake_all(struct ntsync_d
obj->u.sem.count--;
break;
case NTSYNC_TYPE_MUTEX:
+ if (obj->u.mutex.ownerdead)
+ q->ownerdead = true;
+ obj->u.mutex.ownerdead = false;
obj->u.mutex.count++;
obj->u.mutex.owner = q->owner;
break;
@@ -338,6 +343,9 @@ static void try_wake_any_mutex(struct nt
continue;
if (atomic_try_cmpxchg(&q->signaled, &signaled, entry->index)) {
+ if (mutex->u.mutex.ownerdead)
+ q->ownerdead = true;
+ mutex->u.mutex.ownerdead = false;
mutex->u.mutex.count++;
mutex->u.mutex.owner = q->owner;
wake_up_process(q->task);
@@ -447,6 +455,52 @@ static int ntsync_mutex_unlock(struct nt
return ret;
}
+/*
+ * Actually change the mutex state to mark its owner as dead,
+ * returning -EPERM if not the owner.
+ */
+static int kill_mutex_state(struct ntsync_obj *mutex, __u32 owner)
+{
+ ntsync_assert_held(mutex);
+
+ if (mutex->u.mutex.owner != owner)
+ return -EPERM;
+
+ mutex->u.mutex.ownerdead = true;
+ mutex->u.mutex.owner = 0;
+ mutex->u.mutex.count = 0;
+ return 0;
+}
+
+static int ntsync_mutex_kill(struct ntsync_obj *mutex, void __user *argp)
+{
+ struct ntsync_device *dev = mutex->dev;
+ __u32 owner;
+ bool all;
+ int ret;
+
+ if (get_user(owner, (__u32 __user *)argp))
+ return -EFAULT;
+ if (!owner)
+ return -EINVAL;
+
+ if (mutex->type != NTSYNC_TYPE_MUTEX)
+ return -EINVAL;
+
+ all = ntsync_lock_obj(dev, mutex);
+
+ ret = kill_mutex_state(mutex, owner);
+ if (!ret) {
+ if (all)
+ try_wake_all_obj(dev, mutex);
+ try_wake_any_mutex(mutex);
+ }
+
+ ntsync_unlock_obj(dev, mutex, all);
+
+ return ret;
+}
+
static int ntsync_obj_release(struct inode *inode, struct file *file)
{
struct ntsync_obj *obj = file->private_data;
@@ -468,6 +522,8 @@ static long ntsync_obj_ioctl(struct file
return ntsync_sem_post(obj, argp);
case NTSYNC_IOC_MUTEX_UNLOCK:
return ntsync_mutex_unlock(obj, argp);
+ case NTSYNC_IOC_MUTEX_KILL:
+ return ntsync_mutex_kill(obj, argp);
default:
return -ENOIOCTLCMD;
}
@@ -659,6 +715,7 @@ static int setup_wait(struct ntsync_devi
q->owner = args->owner;
atomic_set(&q->signaled, -1);
q->all = all;
+ q->ownerdead = false;
q->count = count;
for (i = 0; i < count; i++) {
@@ -767,7 +824,7 @@ static int ntsync_wait_any(struct ntsync
struct ntsync_wait_args __user *user_args = argp;
/* even if we caught a signal, we need to communicate success */
- ret = 0;
+ ret = q->ownerdead ? -EOWNERDEAD : 0;
if (put_user(signaled, &user_args->index))
ret = -EFAULT;
@@ -848,7 +905,7 @@ static int ntsync_wait_all(struct ntsync
struct ntsync_wait_args __user *user_args = argp;
/* even if we caught a signal, we need to communicate success */
- ret = 0;
+ ret = q->ownerdead ? -EOWNERDEAD : 0;
if (put_user(signaled, &user_args->index))
ret = -EFAULT;
--- a/include/uapi/linux/ntsync.h
+++ b/include/uapi/linux/ntsync.h
@@ -43,5 +43,6 @@ struct ntsync_wait_args {
#define NTSYNC_IOC_SEM_POST _IOWR('N', 0x81, __u32)
#define NTSYNC_IOC_MUTEX_UNLOCK _IOWR('N', 0x85, struct ntsync_mutex_args)
+#define NTSYNC_IOC_MUTEX_KILL _IOW ('N', 0x86, __u32)
#endif

View File

@@ -1,166 +0,0 @@
From 3f3bbc85f1e613364261d685b8197c32ffdeaad0 Mon Sep 17 00:00:00 2001
From: Elizabeth Figura <zfigura@codeweavers.com>
Date: Sun, 19 May 2024 15:24:32 -0500
Subject: ntsync: Introduce NTSYNC_IOC_CREATE_EVENT.
This correspond to the NT syscall NtCreateEvent().
An NT event holds a single bit of state denoting whether it is signaled or
unsignaled.
There are two types of events: manual-reset and automatic-reset. When an
automatic-reset event is acquired via a wait function, its state is reset to
unsignaled. Manual-reset events are not affected by wait functions.
Whether the event is manual-reset, and its initial state, are specified at
creation time.
Signed-off-by: Elizabeth Figura <zfigura@codeweavers.com>
---
drivers/misc/ntsync.c | 62 +++++++++++++++++++++++++++++++++++++
include/uapi/linux/ntsync.h | 7 +++++
2 files changed, 69 insertions(+)
--- a/drivers/misc/ntsync.c
+++ b/drivers/misc/ntsync.c
@@ -26,6 +26,7 @@
enum ntsync_type {
NTSYNC_TYPE_SEM,
NTSYNC_TYPE_MUTEX,
+ NTSYNC_TYPE_EVENT,
};
/*
@@ -61,6 +62,10 @@ struct ntsync_obj {
pid_t owner;
bool ownerdead;
} mutex;
+ struct {
+ bool manual;
+ bool signaled;
+ } event;
} u;
/*
@@ -233,6 +238,8 @@ static bool is_signaled(struct ntsync_ob
if (obj->u.mutex.owner && obj->u.mutex.owner != owner)
return false;
return obj->u.mutex.count < UINT_MAX;
+ case NTSYNC_TYPE_EVENT:
+ return obj->u.event.signaled;
}
WARN(1, "bad object type %#x\n", obj->type);
@@ -283,6 +290,10 @@ static void try_wake_all(struct ntsync_d
obj->u.mutex.count++;
obj->u.mutex.owner = q->owner;
break;
+ case NTSYNC_TYPE_EVENT:
+ if (!obj->u.event.manual)
+ obj->u.event.signaled = false;
+ break;
}
}
wake_up_process(q->task);
@@ -353,6 +364,28 @@ static void try_wake_any_mutex(struct nt
}
}
+static void try_wake_any_event(struct ntsync_obj *event)
+{
+ struct ntsync_q_entry *entry;
+
+ ntsync_assert_held(event);
+ lockdep_assert(event->type == NTSYNC_TYPE_EVENT);
+
+ list_for_each_entry(entry, &event->any_waiters, node) {
+ struct ntsync_q *q = entry->q;
+ int signaled = -1;
+
+ if (!event->u.event.signaled)
+ break;
+
+ if (atomic_try_cmpxchg(&q->signaled, &signaled, entry->index)) {
+ if (!event->u.event.manual)
+ event->u.event.signaled = false;
+ wake_up_process(q->task);
+ }
+ }
+}
+
/*
* Actually change the semaphore state, returning -EOVERFLOW if it is made
* invalid.
@@ -629,6 +662,30 @@ static int ntsync_create_mutex(struct nt
return put_user(fd, &user_args->mutex);
}
+static int ntsync_create_event(struct ntsync_device *dev, void __user *argp)
+{
+ struct ntsync_event_args __user *user_args = argp;
+ struct ntsync_event_args args;
+ struct ntsync_obj *event;
+ int fd;
+
+ if (copy_from_user(&args, argp, sizeof(args)))
+ return -EFAULT;
+
+ event = ntsync_alloc_obj(dev, NTSYNC_TYPE_EVENT);
+ if (!event)
+ return -ENOMEM;
+ event->u.event.manual = args.manual;
+ event->u.event.signaled = args.signaled;
+ fd = ntsync_obj_get_fd(event);
+ if (fd < 0) {
+ kfree(event);
+ return fd;
+ }
+
+ return put_user(fd, &user_args->event);
+}
+
static struct ntsync_obj *get_obj(struct ntsync_device *dev, int fd)
{
struct file *file = fget(fd);
@@ -759,6 +816,9 @@ static void try_wake_any_obj(struct ntsy
case NTSYNC_TYPE_MUTEX:
try_wake_any_mutex(obj);
break;
+ case NTSYNC_TYPE_EVENT:
+ try_wake_any_event(obj);
+ break;
}
}
@@ -948,6 +1008,8 @@ static long ntsync_char_ioctl(struct fil
void __user *argp = (void __user *)parm;
switch (cmd) {
+ case NTSYNC_IOC_CREATE_EVENT:
+ return ntsync_create_event(dev, argp);
case NTSYNC_IOC_CREATE_MUTEX:
return ntsync_create_mutex(dev, argp);
case NTSYNC_IOC_CREATE_SEM:
--- a/include/uapi/linux/ntsync.h
+++ b/include/uapi/linux/ntsync.h
@@ -22,6 +22,12 @@ struct ntsync_mutex_args {
__u32 count;
};
+struct ntsync_event_args {
+ __u32 event;
+ __u32 manual;
+ __u32 signaled;
+};
+
#define NTSYNC_WAIT_REALTIME 0x1
struct ntsync_wait_args {
@@ -40,6 +46,7 @@ struct ntsync_wait_args {
#define NTSYNC_IOC_WAIT_ANY _IOWR('N', 0x82, struct ntsync_wait_args)
#define NTSYNC_IOC_WAIT_ALL _IOWR('N', 0x83, struct ntsync_wait_args)
#define NTSYNC_IOC_CREATE_MUTEX _IOWR('N', 0x84, struct ntsync_sem_args)
+#define NTSYNC_IOC_CREATE_EVENT _IOWR('N', 0x87, struct ntsync_event_args)
#define NTSYNC_IOC_SEM_POST _IOWR('N', 0x81, __u32)
#define NTSYNC_IOC_MUTEX_UNLOCK _IOWR('N', 0x85, struct ntsync_mutex_args)

View File

@@ -1,67 +0,0 @@
From a6f107f17a976008b85c3e269bf4196e595d3f52 Mon Sep 17 00:00:00 2001
From: Elizabeth Figura <zfigura@codeweavers.com>
Date: Sun, 19 May 2024 15:24:33 -0500
Subject: ntsync: Introduce NTSYNC_IOC_EVENT_SET.
This corresponds to the NT syscall NtSetEvent().
This sets the event to the signaled state, and returns its previous state.
Signed-off-by: Elizabeth Figura <zfigura@codeweavers.com>
---
drivers/misc/ntsync.c | 27 +++++++++++++++++++++++++++
include/uapi/linux/ntsync.h | 1 +
2 files changed, 28 insertions(+)
--- a/drivers/misc/ntsync.c
+++ b/drivers/misc/ntsync.c
@@ -534,6 +534,31 @@ static int ntsync_mutex_kill(struct ntsy
return ret;
}
+static int ntsync_event_set(struct ntsync_obj *event, void __user *argp)
+{
+ struct ntsync_device *dev = event->dev;
+ __u32 prev_state;
+ bool all;
+
+ if (event->type != NTSYNC_TYPE_EVENT)
+ return -EINVAL;
+
+ all = ntsync_lock_obj(dev, event);
+
+ prev_state = event->u.event.signaled;
+ event->u.event.signaled = true;
+ if (all)
+ try_wake_all_obj(dev, event);
+ try_wake_any_event(event);
+
+ ntsync_unlock_obj(dev, event, all);
+
+ if (put_user(prev_state, (__u32 __user *)argp))
+ return -EFAULT;
+
+ return 0;
+}
+
static int ntsync_obj_release(struct inode *inode, struct file *file)
{
struct ntsync_obj *obj = file->private_data;
@@ -557,6 +582,8 @@ static long ntsync_obj_ioctl(struct file
return ntsync_mutex_unlock(obj, argp);
case NTSYNC_IOC_MUTEX_KILL:
return ntsync_mutex_kill(obj, argp);
+ case NTSYNC_IOC_EVENT_SET:
+ return ntsync_event_set(obj, argp);
default:
return -ENOIOCTLCMD;
}
--- a/include/uapi/linux/ntsync.h
+++ b/include/uapi/linux/ntsync.h
@@ -51,5 +51,6 @@ struct ntsync_wait_args {
#define NTSYNC_IOC_SEM_POST _IOWR('N', 0x81, __u32)
#define NTSYNC_IOC_MUTEX_UNLOCK _IOWR('N', 0x85, struct ntsync_mutex_args)
#define NTSYNC_IOC_MUTEX_KILL _IOW ('N', 0x86, __u32)
+#define NTSYNC_IOC_EVENT_SET _IOR ('N', 0x88, __u32)
#endif

View File

@@ -1,64 +0,0 @@
From aa3ebb5870eb9ed259aba2ed4e07e9993e6cd978 Mon Sep 17 00:00:00 2001
From: Elizabeth Figura <zfigura@codeweavers.com>
Date: Sun, 19 May 2024 15:24:34 -0500
Subject: ntsync: Introduce NTSYNC_IOC_EVENT_RESET.
This corresponds to the NT syscall NtResetEvent().
This sets the event to the unsignaled state, and returns its previous state.
Signed-off-by: Elizabeth Figura <zfigura@codeweavers.com>
---
drivers/misc/ntsync.c | 24 ++++++++++++++++++++++++
include/uapi/linux/ntsync.h | 1 +
2 files changed, 25 insertions(+)
--- a/drivers/misc/ntsync.c
+++ b/drivers/misc/ntsync.c
@@ -559,6 +559,28 @@ static int ntsync_event_set(struct ntsyn
return 0;
}
+static int ntsync_event_reset(struct ntsync_obj *event, void __user *argp)
+{
+ struct ntsync_device *dev = event->dev;
+ __u32 prev_state;
+ bool all;
+
+ if (event->type != NTSYNC_TYPE_EVENT)
+ return -EINVAL;
+
+ all = ntsync_lock_obj(dev, event);
+
+ prev_state = event->u.event.signaled;
+ event->u.event.signaled = false;
+
+ ntsync_unlock_obj(dev, event, all);
+
+ if (put_user(prev_state, (__u32 __user *)argp))
+ return -EFAULT;
+
+ return 0;
+}
+
static int ntsync_obj_release(struct inode *inode, struct file *file)
{
struct ntsync_obj *obj = file->private_data;
@@ -584,6 +606,8 @@ static long ntsync_obj_ioctl(struct file
return ntsync_mutex_kill(obj, argp);
case NTSYNC_IOC_EVENT_SET:
return ntsync_event_set(obj, argp);
+ case NTSYNC_IOC_EVENT_RESET:
+ return ntsync_event_reset(obj, argp);
default:
return -ENOIOCTLCMD;
}
--- a/include/uapi/linux/ntsync.h
+++ b/include/uapi/linux/ntsync.h
@@ -52,5 +52,6 @@ struct ntsync_wait_args {
#define NTSYNC_IOC_MUTEX_UNLOCK _IOWR('N', 0x85, struct ntsync_mutex_args)
#define NTSYNC_IOC_MUTEX_KILL _IOW ('N', 0x86, __u32)
#define NTSYNC_IOC_EVENT_SET _IOR ('N', 0x88, __u32)
+#define NTSYNC_IOC_EVENT_RESET _IOR ('N', 0x89, __u32)
#endif

View File

@@ -1,60 +0,0 @@
From 99bca5d776a3011214041c42107a210fe315a35e Mon Sep 17 00:00:00 2001
From: Elizabeth Figura <zfigura@codeweavers.com>
Date: Sun, 19 May 2024 15:24:35 -0500
Subject: ntsync: Introduce NTSYNC_IOC_EVENT_PULSE.
This corresponds to the NT syscall NtPulseEvent().
This wakes up any waiters as if the event had been set, but does not set the
event, instead resetting it if it had been signalled. Thus, for a manual-reset
event, all waiters are woken, whereas for an auto-reset event, at most one
waiter is woken.
Signed-off-by: Elizabeth Figura <zfigura@codeweavers.com>
---
drivers/misc/ntsync.c | 8 ++++++--
include/uapi/linux/ntsync.h | 1 +
2 files changed, 7 insertions(+), 2 deletions(-)
--- a/drivers/misc/ntsync.c
+++ b/drivers/misc/ntsync.c
@@ -534,7 +534,7 @@ static int ntsync_mutex_kill(struct ntsy
return ret;
}
-static int ntsync_event_set(struct ntsync_obj *event, void __user *argp)
+static int ntsync_event_set(struct ntsync_obj *event, void __user *argp, bool pulse)
{
struct ntsync_device *dev = event->dev;
__u32 prev_state;
@@ -550,6 +550,8 @@ static int ntsync_event_set(struct ntsyn
if (all)
try_wake_all_obj(dev, event);
try_wake_any_event(event);
+ if (pulse)
+ event->u.event.signaled = false;
ntsync_unlock_obj(dev, event, all);
@@ -605,9 +607,11 @@ static long ntsync_obj_ioctl(struct file
case NTSYNC_IOC_MUTEX_KILL:
return ntsync_mutex_kill(obj, argp);
case NTSYNC_IOC_EVENT_SET:
- return ntsync_event_set(obj, argp);
+ return ntsync_event_set(obj, argp, false);
case NTSYNC_IOC_EVENT_RESET:
return ntsync_event_reset(obj, argp);
+ case NTSYNC_IOC_EVENT_PULSE:
+ return ntsync_event_set(obj, argp, true);
default:
return -ENOIOCTLCMD;
}
--- a/include/uapi/linux/ntsync.h
+++ b/include/uapi/linux/ntsync.h
@@ -53,5 +53,6 @@ struct ntsync_wait_args {
#define NTSYNC_IOC_MUTEX_KILL _IOW ('N', 0x86, __u32)
#define NTSYNC_IOC_EVENT_SET _IOR ('N', 0x88, __u32)
#define NTSYNC_IOC_EVENT_RESET _IOR ('N', 0x89, __u32)
+#define NTSYNC_IOC_EVENT_PULSE _IOR ('N', 0x8a, __u32)
#endif

View File

@@ -1,66 +0,0 @@
From 1ef0ea672662bd19e7c6a4eac1067d11e50844b2 Mon Sep 17 00:00:00 2001
From: Elizabeth Figura <zfigura@codeweavers.com>
Date: Sun, 19 May 2024 15:24:36 -0500
Subject: ntsync: Introduce NTSYNC_IOC_SEM_READ.
This corresponds to the NT syscall NtQuerySemaphore().
This returns the current count and maximum count of the semaphore.
Signed-off-by: Elizabeth Figura <zfigura@codeweavers.com>
---
drivers/misc/ntsync.c | 26 ++++++++++++++++++++++++++
include/uapi/linux/ntsync.h | 1 +
2 files changed, 27 insertions(+)
--- a/drivers/misc/ntsync.c
+++ b/drivers/misc/ntsync.c
@@ -583,6 +583,30 @@ static int ntsync_event_reset(struct nts
return 0;
}
+static int ntsync_sem_read(struct ntsync_obj *sem, void __user *argp)
+{
+ struct ntsync_sem_args __user *user_args = argp;
+ struct ntsync_device *dev = sem->dev;
+ struct ntsync_sem_args args;
+ bool all;
+
+ if (sem->type != NTSYNC_TYPE_SEM)
+ return -EINVAL;
+
+ args.sem = 0;
+
+ all = ntsync_lock_obj(dev, sem);
+
+ args.count = sem->u.sem.count;
+ args.max = sem->u.sem.max;
+
+ ntsync_unlock_obj(dev, sem, all);
+
+ if (copy_to_user(user_args, &args, sizeof(args)))
+ return -EFAULT;
+ return 0;
+}
+
static int ntsync_obj_release(struct inode *inode, struct file *file)
{
struct ntsync_obj *obj = file->private_data;
@@ -602,6 +626,8 @@ static long ntsync_obj_ioctl(struct file
switch (cmd) {
case NTSYNC_IOC_SEM_POST:
return ntsync_sem_post(obj, argp);
+ case NTSYNC_IOC_SEM_READ:
+ return ntsync_sem_read(obj, argp);
case NTSYNC_IOC_MUTEX_UNLOCK:
return ntsync_mutex_unlock(obj, argp);
case NTSYNC_IOC_MUTEX_KILL:
--- a/include/uapi/linux/ntsync.h
+++ b/include/uapi/linux/ntsync.h
@@ -54,5 +54,6 @@ struct ntsync_wait_args {
#define NTSYNC_IOC_EVENT_SET _IOR ('N', 0x88, __u32)
#define NTSYNC_IOC_EVENT_RESET _IOR ('N', 0x89, __u32)
#define NTSYNC_IOC_EVENT_PULSE _IOR ('N', 0x8a, __u32)
+#define NTSYNC_IOC_SEM_READ _IOR ('N', 0x8b, struct ntsync_sem_args)
#endif

View File

@@ -1,68 +0,0 @@
From 7891b7d15abd12975aebb955821fbc43353b45d6 Mon Sep 17 00:00:00 2001
From: Elizabeth Figura <zfigura@codeweavers.com>
Date: Sun, 19 May 2024 15:24:37 -0500
Subject: ntsync: Introduce NTSYNC_IOC_MUTEX_READ.
This corresponds to the NT syscall NtQueryMutant().
This returns the recursion count, owner, and abandoned state of the mutex.
Signed-off-by: Elizabeth Figura <zfigura@codeweavers.com>
---
drivers/misc/ntsync.c | 28 ++++++++++++++++++++++++++++
include/uapi/linux/ntsync.h | 1 +
2 files changed, 29 insertions(+)
--- a/drivers/misc/ntsync.c
+++ b/drivers/misc/ntsync.c
@@ -607,6 +607,32 @@ static int ntsync_sem_read(struct ntsync
return 0;
}
+static int ntsync_mutex_read(struct ntsync_obj *mutex, void __user *argp)
+{
+ struct ntsync_mutex_args __user *user_args = argp;
+ struct ntsync_device *dev = mutex->dev;
+ struct ntsync_mutex_args args;
+ bool all;
+ int ret;
+
+ if (mutex->type != NTSYNC_TYPE_MUTEX)
+ return -EINVAL;
+
+ args.mutex = 0;
+
+ all = ntsync_lock_obj(dev, mutex);
+
+ args.count = mutex->u.mutex.count;
+ args.owner = mutex->u.mutex.owner;
+ ret = mutex->u.mutex.ownerdead ? -EOWNERDEAD : 0;
+
+ ntsync_unlock_obj(dev, mutex, all);
+
+ if (copy_to_user(user_args, &args, sizeof(args)))
+ return -EFAULT;
+ return ret;
+}
+
static int ntsync_obj_release(struct inode *inode, struct file *file)
{
struct ntsync_obj *obj = file->private_data;
@@ -632,6 +658,8 @@ static long ntsync_obj_ioctl(struct file
return ntsync_mutex_unlock(obj, argp);
case NTSYNC_IOC_MUTEX_KILL:
return ntsync_mutex_kill(obj, argp);
+ case NTSYNC_IOC_MUTEX_READ:
+ return ntsync_mutex_read(obj, argp);
case NTSYNC_IOC_EVENT_SET:
return ntsync_event_set(obj, argp, false);
case NTSYNC_IOC_EVENT_RESET:
--- a/include/uapi/linux/ntsync.h
+++ b/include/uapi/linux/ntsync.h
@@ -55,5 +55,6 @@ struct ntsync_wait_args {
#define NTSYNC_IOC_EVENT_RESET _IOR ('N', 0x89, __u32)
#define NTSYNC_IOC_EVENT_PULSE _IOR ('N', 0x8a, __u32)
#define NTSYNC_IOC_SEM_READ _IOR ('N', 0x8b, struct ntsync_sem_args)
+#define NTSYNC_IOC_MUTEX_READ _IOR ('N', 0x8c, struct ntsync_mutex_args)
#endif

View File

@@ -1,66 +0,0 @@
From 35ff252f99aa4002e0c2ecef37314a422969791b Mon Sep 17 00:00:00 2001
From: Elizabeth Figura <zfigura@codeweavers.com>
Date: Sun, 19 May 2024 15:24:38 -0500
Subject: ntsync: Introduce NTSYNC_IOC_EVENT_READ.
This corresponds to the NT syscall NtQueryEvent().
This returns the signaled state of the event and whether it is manual-reset.
Signed-off-by: Elizabeth Figura <zfigura@codeweavers.com>
---
drivers/misc/ntsync.c | 26 ++++++++++++++++++++++++++
include/uapi/linux/ntsync.h | 1 +
2 files changed, 27 insertions(+)
--- a/drivers/misc/ntsync.c
+++ b/drivers/misc/ntsync.c
@@ -633,6 +633,30 @@ static int ntsync_mutex_read(struct ntsy
return ret;
}
+static int ntsync_event_read(struct ntsync_obj *event, void __user *argp)
+{
+ struct ntsync_event_args __user *user_args = argp;
+ struct ntsync_device *dev = event->dev;
+ struct ntsync_event_args args;
+ bool all;
+
+ if (event->type != NTSYNC_TYPE_EVENT)
+ return -EINVAL;
+
+ args.event = 0;
+
+ all = ntsync_lock_obj(dev, event);
+
+ args.manual = event->u.event.manual;
+ args.signaled = event->u.event.signaled;
+
+ ntsync_unlock_obj(dev, event, all);
+
+ if (copy_to_user(user_args, &args, sizeof(args)))
+ return -EFAULT;
+ return 0;
+}
+
static int ntsync_obj_release(struct inode *inode, struct file *file)
{
struct ntsync_obj *obj = file->private_data;
@@ -666,6 +690,8 @@ static long ntsync_obj_ioctl(struct file
return ntsync_event_reset(obj, argp);
case NTSYNC_IOC_EVENT_PULSE:
return ntsync_event_set(obj, argp, true);
+ case NTSYNC_IOC_EVENT_READ:
+ return ntsync_event_read(obj, argp);
default:
return -ENOIOCTLCMD;
}
--- a/include/uapi/linux/ntsync.h
+++ b/include/uapi/linux/ntsync.h
@@ -56,5 +56,6 @@ struct ntsync_wait_args {
#define NTSYNC_IOC_EVENT_PULSE _IOR ('N', 0x8a, __u32)
#define NTSYNC_IOC_SEM_READ _IOR ('N', 0x8b, struct ntsync_sem_args)
#define NTSYNC_IOC_MUTEX_READ _IOR ('N', 0x8c, struct ntsync_mutex_args)
+#define NTSYNC_IOC_EVENT_READ _IOR ('N', 0x8d, struct ntsync_event_args)
#endif

View File

@@ -1,187 +0,0 @@
From 2c391d57d1393cd46bf8bab08232ddc3dd32d5e5 Mon Sep 17 00:00:00 2001
From: Elizabeth Figura <zfigura@codeweavers.com>
Date: Sun, 19 May 2024 15:24:39 -0500
Subject: ntsync: Introduce alertable waits.
NT waits can optionally be made "alertable". This is a special channel for
thread wakeup that is mildly similar to SIGIO. A thread has an internal single
bit of "alerted" state, and if a thread is alerted while an alertable wait, the
wait will return a special value, consume the "alerted" state, and will not
consume any of its objects.
Alerts are implemented using events; the user-space NT emulator is expected to
create an internal ntsync event for each thread and pass that event to wait
functions.
Signed-off-by: Elizabeth Figura <zfigura@codeweavers.com>
---
drivers/misc/ntsync.c | 70 ++++++++++++++++++++++++++++++++-----
include/uapi/linux/ntsync.h | 3 +-
2 files changed, 63 insertions(+), 10 deletions(-)
--- a/drivers/misc/ntsync.c
+++ b/drivers/misc/ntsync.c
@@ -885,22 +885,29 @@ static int setup_wait(struct ntsync_devi
const struct ntsync_wait_args *args, bool all,
struct ntsync_q **ret_q)
{
+ int fds[NTSYNC_MAX_WAIT_COUNT + 1];
const __u32 count = args->count;
- int fds[NTSYNC_MAX_WAIT_COUNT];
struct ntsync_q *q;
+ __u32 total_count;
__u32 i, j;
- if (args->pad[0] || args->pad[1] || (args->flags & ~NTSYNC_WAIT_REALTIME))
+ if (args->pad || (args->flags & ~NTSYNC_WAIT_REALTIME))
return -EINVAL;
if (args->count > NTSYNC_MAX_WAIT_COUNT)
return -EINVAL;
+ total_count = count;
+ if (args->alert)
+ total_count++;
+
if (copy_from_user(fds, u64_to_user_ptr(args->objs),
array_size(count, sizeof(*fds))))
return -EFAULT;
+ if (args->alert)
+ fds[count] = args->alert;
- q = kmalloc(struct_size(q, entries, count), GFP_KERNEL);
+ q = kmalloc(struct_size(q, entries, total_count), GFP_KERNEL);
if (!q)
return -ENOMEM;
q->task = current;
@@ -910,7 +917,7 @@ static int setup_wait(struct ntsync_devi
q->ownerdead = false;
q->count = count;
- for (i = 0; i < count; i++) {
+ for (i = 0; i < total_count; i++) {
struct ntsync_q_entry *entry = &q->entries[i];
struct ntsync_obj *obj = get_obj(dev, fds[i]);
@@ -960,10 +967,10 @@ static void try_wake_any_obj(struct ntsy
static int ntsync_wait_any(struct ntsync_device *dev, void __user *argp)
{
struct ntsync_wait_args args;
+ __u32 i, total_count;
struct ntsync_q *q;
int signaled;
bool all;
- __u32 i;
int ret;
if (copy_from_user(&args, argp, sizeof(args)))
@@ -973,9 +980,13 @@ static int ntsync_wait_any(struct ntsync
if (ret < 0)
return ret;
+ total_count = args.count;
+ if (args.alert)
+ total_count++;
+
/* queue ourselves */
- for (i = 0; i < args.count; i++) {
+ for (i = 0; i < total_count; i++) {
struct ntsync_q_entry *entry = &q->entries[i];
struct ntsync_obj *obj = entry->obj;
@@ -984,9 +995,15 @@ static int ntsync_wait_any(struct ntsync
ntsync_unlock_obj(dev, obj, all);
}
- /* check if we are already signaled */
+ /*
+ * Check if we are already signaled.
+ *
+ * Note that the API requires that normal objects are checked before
+ * the alert event. Hence we queue the alert event last, and check
+ * objects in order.
+ */
- for (i = 0; i < args.count; i++) {
+ for (i = 0; i < total_count; i++) {
struct ntsync_obj *obj = q->entries[i].obj;
if (atomic_read(&q->signaled) != -1)
@@ -1003,7 +1020,7 @@ static int ntsync_wait_any(struct ntsync
/* and finally, unqueue */
- for (i = 0; i < args.count; i++) {
+ for (i = 0; i < total_count; i++) {
struct ntsync_q_entry *entry = &q->entries[i];
struct ntsync_obj *obj = entry->obj;
@@ -1063,6 +1080,14 @@ static int ntsync_wait_all(struct ntsync
*/
list_add_tail(&entry->node, &obj->all_waiters);
}
+ if (args.alert) {
+ struct ntsync_q_entry *entry = &q->entries[args.count];
+ struct ntsync_obj *obj = entry->obj;
+
+ dev_lock_obj(dev, obj);
+ list_add_tail(&entry->node, &obj->any_waiters);
+ dev_unlock_obj(dev, obj);
+ }
/* check if we are already signaled */
@@ -1070,6 +1095,21 @@ static int ntsync_wait_all(struct ntsync
mutex_unlock(&dev->wait_all_lock);
+ /*
+ * Check if the alert event is signaled, making sure to do so only
+ * after checking if the other objects are signaled.
+ */
+
+ if (args.alert) {
+ struct ntsync_obj *obj = q->entries[args.count].obj;
+
+ if (atomic_read(&q->signaled) == -1) {
+ bool all = ntsync_lock_obj(dev, obj);
+ try_wake_any_obj(obj);
+ ntsync_unlock_obj(dev, obj, all);
+ }
+ }
+
/* sleep */
ret = ntsync_schedule(q, &args);
@@ -1095,6 +1135,18 @@ static int ntsync_wait_all(struct ntsync
mutex_unlock(&dev->wait_all_lock);
+ if (args.alert) {
+ struct ntsync_q_entry *entry = &q->entries[args.count];
+ struct ntsync_obj *obj = entry->obj;
+ bool all;
+
+ all = ntsync_lock_obj(dev, obj);
+ list_del(&entry->node);
+ ntsync_unlock_obj(dev, obj, all);
+
+ put_obj(obj);
+ }
+
signaled = atomic_read(&q->signaled);
if (signaled != -1) {
struct ntsync_wait_args __user *user_args = argp;
--- a/include/uapi/linux/ntsync.h
+++ b/include/uapi/linux/ntsync.h
@@ -37,7 +37,8 @@ struct ntsync_wait_args {
__u32 index;
__u32 flags;
__u32 owner;
- __u32 pad[2];
+ __u32 alert;
+ __u32 pad;
};
#define NTSYNC_MAX_WAIT_COUNT 64

View File

@@ -1,30 +0,0 @@
From 8d87043cd76368bb9996ba541d12e40cbb4201e5 Mon Sep 17 00:00:00 2001
From: Elizabeth Figura <zfigura@codeweavers.com>
Date: Sun, 19 May 2024 15:24:52 -0500
Subject: maintainers: Add an entry for ntsync.
Add myself as maintainer, supported by CodeWeavers.
Signed-off-by: Elizabeth Figura <zfigura@codeweavers.com>
---
MAINTAINERS | 9 +++++++++
1 file changed, 9 insertions(+)
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -16319,6 +16319,15 @@ T: git https://github.com/Paragon-Softwa
F: Documentation/filesystems/ntfs3.rst
F: fs/ntfs3/
+NTSYNC SYNCHRONIZATION PRIMITIVE DRIVER
+M: Elizabeth Figura <zfigura@codeweavers.com>
+L: wine-devel@winehq.org
+S: Supported
+F: Documentation/userspace-api/ntsync.rst
+F: drivers/misc/ntsync.c
+F: include/uapi/linux/ntsync.h
+F: tools/testing/selftests/drivers/ntsync/
+
NUBUS SUBSYSTEM
M: Finn Thain <fthain@linux-m68k.org>
L: linux-m68k@lists.linux-m68k.org

View File

@@ -1,426 +0,0 @@
From 4cb25d42d38f1e0b144b084674591b70afa60bb0 Mon Sep 17 00:00:00 2001
From: Elizabeth Figura <zfigura@codeweavers.com>
Date: Sun, 19 May 2024 15:24:53 -0500
Subject: docs: ntsync: Add documentation for the ntsync uAPI.
Add an overall explanation of the driver architecture, and complete and precise
specification for its intended behaviour.
Signed-off-by: Elizabeth Figura <zfigura@codeweavers.com>
---
Documentation/userspace-api/index.rst | 1 +
Documentation/userspace-api/ntsync.rst | 398 +++++++++++++++++++++++++
2 files changed, 399 insertions(+)
create mode 100644 Documentation/userspace-api/ntsync.rst
--- a/Documentation/userspace-api/index.rst
+++ b/Documentation/userspace-api/index.rst
@@ -63,6 +63,7 @@ Everything else
vduse
futex2
perf_ring_buffer
+ ntsync
.. only:: subproject and html
--- /dev/null
+++ b/Documentation/userspace-api/ntsync.rst
@@ -0,0 +1,398 @@
+===================================
+NT synchronization primitive driver
+===================================
+
+This page documents the user-space API for the ntsync driver.
+
+ntsync is a support driver for emulation of NT synchronization
+primitives by user-space NT emulators. It exists because implementation
+in user-space, using existing tools, cannot match Windows performance
+while offering accurate semantics. It is implemented entirely in
+software, and does not drive any hardware device.
+
+This interface is meant as a compatibility tool only, and should not
+be used for general synchronization. Instead use generic, versatile
+interfaces such as futex(2) and poll(2).
+
+Synchronization primitives
+==========================
+
+The ntsync driver exposes three types of synchronization primitives:
+semaphores, mutexes, and events.
+
+A semaphore holds a single volatile 32-bit counter, and a static 32-bit
+integer denoting the maximum value. It is considered signaled (that is,
+can be acquired without contention, or will wake up a waiting thread)
+when the counter is nonzero. The counter is decremented by one when a
+wait is satisfied. Both the initial and maximum count are established
+when the semaphore is created.
+
+A mutex holds a volatile 32-bit recursion count, and a volatile 32-bit
+identifier denoting its owner. A mutex is considered signaled when its
+owner is zero (indicating that it is not owned). The recursion count is
+incremented when a wait is satisfied, and ownership is set to the given
+identifier.
+
+A mutex also holds an internal flag denoting whether its previous owner
+has died; such a mutex is said to be abandoned. Owner death is not
+tracked automatically based on thread death, but rather must be
+communicated using ``NTSYNC_IOC_MUTEX_KILL``. An abandoned mutex is
+inherently considered unowned.
+
+Except for the "unowned" semantics of zero, the actual value of the
+owner identifier is not interpreted by the ntsync driver at all. The
+intended use is to store a thread identifier; however, the ntsync
+driver does not actually validate that a calling thread provides
+consistent or unique identifiers.
+
+An event is similar to a semaphore with a maximum count of one. It holds
+a volatile boolean state denoting whether it is signaled or not. There
+are two types of events, auto-reset and manual-reset. An auto-reset
+event is designaled when a wait is satisfied; a manual-reset event is
+not. The event type is specified when the event is created.
+
+Unless specified otherwise, all operations on an object are atomic and
+totally ordered with respect to other operations on the same object.
+
+Objects are represented by files. When all file descriptors to an
+object are closed, that object is deleted.
+
+Char device
+===========
+
+The ntsync driver creates a single char device /dev/ntsync. Each file
+description opened on the device represents a unique instance intended
+to back an individual NT virtual machine. Objects created by one ntsync
+instance may only be used with other objects created by the same
+instance.
+
+ioctl reference
+===============
+
+All operations on the device are done through ioctls. There are four
+structures used in ioctl calls::
+
+ struct ntsync_sem_args {
+ __u32 sem;
+ __u32 count;
+ __u32 max;
+ };
+
+ struct ntsync_mutex_args {
+ __u32 mutex;
+ __u32 owner;
+ __u32 count;
+ };
+
+ struct ntsync_event_args {
+ __u32 event;
+ __u32 signaled;
+ __u32 manual;
+ };
+
+ struct ntsync_wait_args {
+ __u64 timeout;
+ __u64 objs;
+ __u32 count;
+ __u32 owner;
+ __u32 index;
+ __u32 alert;
+ __u32 flags;
+ __u32 pad;
+ };
+
+Depending on the ioctl, members of the structure may be used as input,
+output, or not at all. All ioctls return 0 on success.
+
+The ioctls on the device file are as follows:
+
+.. c:macro:: NTSYNC_IOC_CREATE_SEM
+
+ Create a semaphore object. Takes a pointer to struct
+ :c:type:`ntsync_sem_args`, which is used as follows:
+
+ .. list-table::
+
+ * - ``sem``
+ - On output, contains a file descriptor to the created semaphore.
+ * - ``count``
+ - Initial count of the semaphore.
+ * - ``max``
+ - Maximum count of the semaphore.
+
+ Fails with ``EINVAL`` if ``count`` is greater than ``max``.
+
+.. c:macro:: NTSYNC_IOC_CREATE_MUTEX
+
+ Create a mutex object. Takes a pointer to struct
+ :c:type:`ntsync_mutex_args`, which is used as follows:
+
+ .. list-table::
+
+ * - ``mutex``
+ - On output, contains a file descriptor to the created mutex.
+ * - ``count``
+ - Initial recursion count of the mutex.
+ * - ``owner``
+ - Initial owner of the mutex.
+
+ If ``owner`` is nonzero and ``count`` is zero, or if ``owner`` is
+ zero and ``count`` is nonzero, the function fails with ``EINVAL``.
+
+.. c:macro:: NTSYNC_IOC_CREATE_EVENT
+
+ Create an event object. Takes a pointer to struct
+ :c:type:`ntsync_event_args`, which is used as follows:
+
+ .. list-table::
+
+ * - ``event``
+ - On output, contains a file descriptor to the created event.
+ * - ``signaled``
+ - If nonzero, the event is initially signaled, otherwise
+ nonsignaled.
+ * - ``manual``
+ - If nonzero, the event is a manual-reset event, otherwise
+ auto-reset.
+
+The ioctls on the individual objects are as follows:
+
+.. c:macro:: NTSYNC_IOC_SEM_POST
+
+ Post to a semaphore object. Takes a pointer to a 32-bit integer,
+ which on input holds the count to be added to the semaphore, and on
+ output contains its previous count.
+
+ If adding to the semaphore's current count would raise the latter
+ past the semaphore's maximum count, the ioctl fails with
+ ``EOVERFLOW`` and the semaphore is not affected. If raising the
+ semaphore's count causes it to become signaled, eligible threads
+ waiting on this semaphore will be woken and the semaphore's count
+ decremented appropriately.
+
+.. c:macro:: NTSYNC_IOC_MUTEX_UNLOCK
+
+ Release a mutex object. Takes a pointer to struct
+ :c:type:`ntsync_mutex_args`, which is used as follows:
+
+ .. list-table::
+
+ * - ``mutex``
+ - Ignored.
+ * - ``owner``
+ - Specifies the owner trying to release this mutex.
+ * - ``count``
+ - On output, contains the previous recursion count.
+
+ If ``owner`` is zero, the ioctl fails with ``EINVAL``. If ``owner``
+ is not the current owner of the mutex, the ioctl fails with
+ ``EPERM``.
+
+ The mutex's count will be decremented by one. If decrementing the
+ mutex's count causes it to become zero, the mutex is marked as
+ unowned and signaled, and eligible threads waiting on it will be
+ woken as appropriate.
+
+.. c:macro:: NTSYNC_IOC_SET_EVENT
+
+ Signal an event object. Takes a pointer to a 32-bit integer, which on
+ output contains the previous state of the event.
+
+ Eligible threads will be woken, and auto-reset events will be
+ designaled appropriately.
+
+.. c:macro:: NTSYNC_IOC_RESET_EVENT
+
+ Designal an event object. Takes a pointer to a 32-bit integer, which
+ on output contains the previous state of the event.
+
+.. c:macro:: NTSYNC_IOC_PULSE_EVENT
+
+ Wake threads waiting on an event object while leaving it in an
+ unsignaled state. Takes a pointer to a 32-bit integer, which on
+ output contains the previous state of the event.
+
+ A pulse operation can be thought of as a set followed by a reset,
+ performed as a single atomic operation. If two threads are waiting on
+ an auto-reset event which is pulsed, only one will be woken. If two
+ threads are waiting a manual-reset event which is pulsed, both will
+ be woken. However, in both cases, the event will be unsignaled
+ afterwards, and a simultaneous read operation will always report the
+ event as unsignaled.
+
+.. c:macro:: NTSYNC_IOC_READ_SEM
+
+ Read the current state of a semaphore object. Takes a pointer to
+ struct :c:type:`ntsync_sem_args`, which is used as follows:
+
+ .. list-table::
+
+ * - ``sem``
+ - Ignored.
+ * - ``count``
+ - On output, contains the current count of the semaphore.
+ * - ``max``
+ - On output, contains the maximum count of the semaphore.
+
+.. c:macro:: NTSYNC_IOC_READ_MUTEX
+
+ Read the current state of a mutex object. Takes a pointer to struct
+ :c:type:`ntsync_mutex_args`, which is used as follows:
+
+ .. list-table::
+
+ * - ``mutex``
+ - Ignored.
+ * - ``owner``
+ - On output, contains the current owner of the mutex, or zero
+ if the mutex is not currently owned.
+ * - ``count``
+ - On output, contains the current recursion count of the mutex.
+
+ If the mutex is marked as abandoned, the function fails with
+ ``EOWNERDEAD``. In this case, ``count`` and ``owner`` are set to
+ zero.
+
+.. c:macro:: NTSYNC_IOC_READ_EVENT
+
+ Read the current state of an event object. Takes a pointer to struct
+ :c:type:`ntsync_event_args`, which is used as follows:
+
+ .. list-table::
+
+ * - ``event``
+ - Ignored.
+ * - ``signaled``
+ - On output, contains the current state of the event.
+ * - ``manual``
+ - On output, contains 1 if the event is a manual-reset event,
+ and 0 otherwise.
+
+.. c:macro:: NTSYNC_IOC_KILL_OWNER
+
+ Mark a mutex as unowned and abandoned if it is owned by the given
+ owner. Takes an input-only pointer to a 32-bit integer denoting the
+ owner. If the owner is zero, the ioctl fails with ``EINVAL``. If the
+ owner does not own the mutex, the function fails with ``EPERM``.
+
+ Eligible threads waiting on the mutex will be woken as appropriate
+ (and such waits will fail with ``EOWNERDEAD``, as described below).
+
+.. c:macro:: NTSYNC_IOC_WAIT_ANY
+
+ Poll on any of a list of objects, atomically acquiring at most one.
+ Takes a pointer to struct :c:type:`ntsync_wait_args`, which is
+ used as follows:
+
+ .. list-table::
+
+ * - ``timeout``
+ - Absolute timeout in nanoseconds. If ``NTSYNC_WAIT_REALTIME``
+ is set, the timeout is measured against the REALTIME clock;
+ otherwise it is measured against the MONOTONIC clock. If the
+ timeout is equal to or earlier than the current time, the
+ function returns immediately without sleeping. If ``timeout``
+ is U64_MAX, the function will sleep until an object is
+ signaled, and will not fail with ``ETIMEDOUT``.
+ * - ``objs``
+ - Pointer to an array of ``count`` file descriptors
+ (specified as an integer so that the structure has the same
+ size regardless of architecture). If any object is
+ invalid, the function fails with ``EINVAL``.
+ * - ``count``
+ - Number of objects specified in the ``objs`` array.
+ If greater than ``NTSYNC_MAX_WAIT_COUNT``, the function fails
+ with ``EINVAL``.
+ * - ``owner``
+ - Mutex owner identifier. If any object in ``objs`` is a mutex,
+ the ioctl will attempt to acquire that mutex on behalf of
+ ``owner``. If ``owner`` is zero, the ioctl fails with
+ ``EINVAL``.
+ * - ``index``
+ - On success, contains the index (into ``objs``) of the object
+ which was signaled. If ``alert`` was signaled instead,
+ this contains ``count``.
+ * - ``alert``
+ - Optional event object file descriptor. If nonzero, this
+ specifies an "alert" event object which, if signaled, will
+ terminate the wait. If nonzero, the identifier must point to a
+ valid event.
+ * - ``flags``
+ - Zero or more flags. Currently the only flag is
+ ``NTSYNC_WAIT_REALTIME``, which causes the timeout to be
+ measured against the REALTIME clock instead of MONOTONIC.
+ * - ``pad``
+ - Unused, must be set to zero.
+
+ This function attempts to acquire one of the given objects. If unable
+ to do so, it sleeps until an object becomes signaled, subsequently
+ acquiring it, or the timeout expires. In the latter case the ioctl
+ fails with ``ETIMEDOUT``. The function only acquires one object, even
+ if multiple objects are signaled.
+
+ A semaphore is considered to be signaled if its count is nonzero, and
+ is acquired by decrementing its count by one. A mutex is considered
+ to be signaled if it is unowned or if its owner matches the ``owner``
+ argument, and is acquired by incrementing its recursion count by one
+ and setting its owner to the ``owner`` argument. An auto-reset event
+ is acquired by designaling it; a manual-reset event is not affected
+ by acquisition.
+
+ Acquisition is atomic and totally ordered with respect to other
+ operations on the same object. If two wait operations (with different
+ ``owner`` identifiers) are queued on the same mutex, only one is
+ signaled. If two wait operations are queued on the same semaphore,
+ and a value of one is posted to it, only one is signaled.
+
+ If an abandoned mutex is acquired, the ioctl fails with
+ ``EOWNERDEAD``. Although this is a failure return, the function may
+ otherwise be considered successful. The mutex is marked as owned by
+ the given owner (with a recursion count of 1) and as no longer
+ abandoned, and ``index`` is still set to the index of the mutex.
+
+ The ``alert`` argument is an "extra" event which can terminate the
+ wait, independently of all other objects.
+
+ It is valid to pass the same object more than once, including by
+ passing the same event in the ``objs`` array and in ``alert``. If a
+ wakeup occurs due to that object being signaled, ``index`` is set to
+ the lowest index corresponding to that object.
+
+ The function may fail with ``EINTR`` if a signal is received.
+
+.. c:macro:: NTSYNC_IOC_WAIT_ALL
+
+ Poll on a list of objects, atomically acquiring all of them. Takes a
+ pointer to struct :c:type:`ntsync_wait_args`, which is used
+ identically to ``NTSYNC_IOC_WAIT_ANY``, except that ``index`` is
+ always filled with zero on success if not woken via alert.
+
+ This function attempts to simultaneously acquire all of the given
+ objects. If unable to do so, it sleeps until all objects become
+ simultaneously signaled, subsequently acquiring them, or the timeout
+ expires. In the latter case the ioctl fails with ``ETIMEDOUT`` and no
+ objects are modified.
+
+ Objects may become signaled and subsequently designaled (through
+ acquisition by other threads) while this thread is sleeping. Only
+ once all objects are simultaneously signaled does the ioctl acquire
+ them and return. The entire acquisition is atomic and totally ordered
+ with respect to other operations on any of the given objects.
+
+ If an abandoned mutex is acquired, the ioctl fails with
+ ``EOWNERDEAD``. Similarly to ``NTSYNC_IOC_WAIT_ANY``, all objects are
+ nevertheless marked as acquired. Note that if multiple mutex objects
+ are specified, there is no way to know which were marked as
+ abandoned.
+
+ As with "any" waits, the ``alert`` argument is an "extra" event which
+ can terminate the wait. Critically, however, an "all" wait will
+ succeed if all members in ``objs`` are signaled, *or* if ``alert`` is
+ signaled. In the latter case ``index`` will be set to ``count``. As
+ with "any" waits, if both conditions are filled, the former takes
+ priority, and objects in ``objs`` will be acquired.
+
+ Unlike ``NTSYNC_IOC_WAIT_ANY``, it is not valid to pass the same
+ object more than once, nor is it valid to pass the same object in
+ ``objs`` and in ``alert``. If this is attempted, the function fails
+ with ``EINVAL``.

View File

@@ -1,21 +0,0 @@
From 06bc88f16094c6f38e0890992af4a32415716c5d Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <heftig@archlinux.org>
Date: Thu, 18 Jul 2024 21:19:39 +0200
Subject: Revert "misc: ntsync: mark driver as "broken" to prevent from
building"
This reverts commit f5b335dc025cfee90957efa90dc72fada0d5abb4.
---
drivers/misc/Kconfig | 1 -
1 file changed, 1 deletion(-)
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -507,7 +507,6 @@ config OPEN_DICE
config NTSYNC
tristate "NT synchronization primitive emulation"
- depends on BROKEN
help
This module provides kernel support for emulation of Windows NT
synchronization primitives. It is not a hardware driver.

View File

@@ -21,12 +21,12 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
--- a/net/mac80211/iface.c --- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c +++ b/net/mac80211/iface.c
@@ -62,7 +62,8 @@ bool __ieee80211_recalc_txpower(struct i @@ -62,7 +62,8 @@ bool __ieee80211_recalc_txpower(struct i
if (sdata->deflink.user_power_level != IEEE80211_UNSET_POWER_LEVEL) if (link->user_power_level != IEEE80211_UNSET_POWER_LEVEL)
power = min(power, sdata->deflink.user_power_level); power = min(power, link->user_power_level);
- if (sdata->deflink.ap_power_level != IEEE80211_UNSET_POWER_LEVEL) - if (link->ap_power_level != IEEE80211_UNSET_POWER_LEVEL)
+ if (sdata->deflink.ap_power_level != IEEE80211_UNSET_POWER_LEVEL && + if (link->ap_power_level != IEEE80211_UNSET_POWER_LEVEL &&
+ sdata->vif.bss_conf.txpower_type != NL80211_TX_POWER_FIXED) + link->conf->txpower_type != NL80211_TX_POWER_FIXED)
power = min(power, sdata->deflink.ap_power_level); power = min(power, link->ap_power_level);
if (power != sdata->vif.bss_conf.txpower) { if (power != link->conf->txpower) {

View File

@@ -0,0 +1,34 @@
From: David Bauer <mail@david-bauer.net>
Date: Thu, 30 Nov 2023 07:32:52 +0100
Subject: [PATCH] mac80211: avoid crashing on invalid band info
Frequent crashes have been observed on MT7916 based platforms. While the
root of these crashes are currently unknown, they happen when decoding
rate information of connected STAs in AP mode. The rate-information is
associated with a band which is not available on the PHY.
Check for this condition in order to avoid crashing the whole system.
This patch should be removed once the roout cause has been found and
fixed.
Link: https://github.com/freifunk-gluon/gluon/issues/2980
Signed-off-by: David Bauer <mail@david-bauer.net>
---
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -2467,6 +2467,13 @@ static void sta_stats_decode_rate(struct
sband = local->hw.wiphy->bands[band];
+ if (!sband) {
+ wiphy_warn(local->hw.wiphy,
+ "Invalid band %d\n",
+ band);
+ break;
+ }
+
if (WARN_ON_ONCE(!sband->bitrates))
break;

Some files were not shown because too many files have changed in this diff Show More