From 523f3b58fda9553eb41871413041f28389b3811d Mon Sep 17 00:00:00 2001 From: Daniele Rondina Date: Mon, 24 Aug 2026 01:28:23 +0000 Subject: [PATCH] Bump sys-kernel/debian-sources-6.12.101_p1-r201 --- sys-kernel/debian-sources/Manifest | 6 + .../debian-sources-6.12.101_p1-r201.ebuild | 499 ++++++++++++ ...levels-and-uarches-for-kernel-7.1.x+.patch | 721 ++++++++++++++++++ 3 files changed, 1226 insertions(+) create mode 100644 sys-kernel/debian-sources/debian-sources-6.12.101_p1-r201.ebuild create mode 100644 sys-kernel/debian-sources/files/7.1+/more-ISA-levels-and-uarches-for-kernel-7.1.x+.patch diff --git a/sys-kernel/debian-sources/Manifest b/sys-kernel/debian-sources/Manifest index eb89f1b..a6071d5 100644 --- a/sys-kernel/debian-sources/Manifest +++ b/sys-kernel/debian-sources/Manifest @@ -1,16 +1,22 @@ DIST linux-6.1.162.tar.xz 135402204 BLAKE2B 896f671313ba243cbd11c96a474599c51c779838404f730d2bfa8ed504b3853bfb7dbf0a597c24a1f300ca7fdf828a94036c888266abc5b52e33eebc60132ce6 SHA512 4c07fbc875941d969417361029001ac436e20f45bf30761101645a483a1872958aebae7aa27c27f66f9f95ace629c9313d96949fa8094fd7caeb1bde6ec39d13 DIST linux-6.1.164.tar.xz 135378304 BLAKE2B 2533f05c81486b563ec7959e3434eff699fb59be43bb5c2c5c2a831482238c29648b85f8204bb067248135025e81aefc515bc69b3ddb13955b3d1a42997c6adf SHA512 a91b3859a1b1019e86efde206eae8253683cf4ec2c8aa261c47c66180d719482d4777ba75b57530a187ae87641e2544894d1db0c1a0a276d063f3a2279c26baa DIST linux-6.1.170.tar.xz 135436044 BLAKE2B 70c62807f6d97c945f8cbe24058b5ab02ad5dc98ba865dec68ece96e4620f9c9fa7b624f4532451277d3cce0afe2a8d50fc1852ded2ef3066d20c5ab90316d05 SHA512 c49bca145a57d42fcf4b89b7500868f829910059195b07648de95afeb2d7ca5b080adcb4acc5eda4dc711ff2e914727cb010da87d266106ce006f4014adfdd3d +DIST linux-6.12.101.tar.xz 148404228 BLAKE2B 716eafcc791311a3aaea6928bd954dbe712f6b342fc4f08d482f624f37942c67f9b5b122e740147227549e5cbfeb6eea339f2f100608d4d41b2c9b0c0fc0f0fc SHA512 083a86cc283486e8e214939637a2ed7cb44261a51c38a6c9ea579693dae79531fca18217e24811246f796185a638cb505ad01b2da8e56b052307b8b57f05ae23 DIST linux-6.12.74.tar.xz 148229948 BLAKE2B 702eee7dd67c6d090d3340138c2f3ed40d5eb54b59d5d9e2706cfafe97a44ac17cdd65adbcb12a3d0871431bd19df7bc91ae72c348bc6c8d74b59cc0e1ef2308 SHA512 7a9a28345146a570720722344571a77b976f6f04c782ab31d82c3af2ed9d222a026a20c868eb2b2c086d47b4f48fed27cf69f34c94578481da1f97aa9e517cee DIST linux-6.12.86.tar.xz 148255976 BLAKE2B 79b33470d1a115e19a29fc9dc6ab450029584e7656976a5a09c5e2d8aebcdcc1bb7f5980d7fa28fab7775a20f572afb60b3ca0ef44f35ada726fe0e5ccd6c037 SHA512 02c377c66ad4f418474e9e0fb73adc96591716f407d3678d1c3ae4a8695747df19e660352ab9dba02628afadbddca54523b6adb8d17f563ba40cf1d236e89a4c DIST linux-6.19.11.tar.xz 156159916 BLAKE2B 7304717954b8ad9eec54071d28d2d6c9af108d2c84686cee9b401e38078d4b39810541a854e458c85349de10959d96edb2ba7e38b0e0a7ebc46949e69e7816b3 SHA512 d458fdf65f08b501978d1e274c777633b8473628fb099e2a9a8aac3a943b157fa5132a8ec026cc242f836eb2c441701b5e342f30402d10b12f6759097775de2a DIST linux-6.19.13.tar.xz 156131084 BLAKE2B bd6ae85226bcbaba096c64d5cd20ad18d24e9fb5484394ce7db27326d37da500ffdc7bd765493a0a167944836be7275bb84807991a0266f072c0d87ec5df84b3 SHA512 02a70cfc1b557d1a2309843276aa32e9f4864f07905a787fd072cd1209d77d209ebfac7b5738f14f0470c0d14f27137d24395803101099133e1e0381dcc7b242 DIST linux-6.19.14.tar.xz 156141352 BLAKE2B 64c2a0003d8080f268772d36923ff6ef8b2d55320ea08b77ad39384c98c9a5c1a8e71425470619aa3aa4dda8941f46aa9da364748cfa8fd9f8507a5ddd7ac03a SHA512 a24e506eaf45afe0ee23448ccbdfba2742d9308c9cadefcdefdc96b1fd4bdc8b1cff0ebb5a1deffc3f209f92a6cae2ad930cdb5fc5f91637101dd1cc602869ad +DIST linux-7.1.8.tar.xz 158434924 BLAKE2B 84b59e5572d91f5ea1bb603aa7691851bd9549e1bf18a6bec8e27eb8a6e2de2e33da2ad3e3aad501c793e9756e70245a16545e76b65a44ee52b33ccf5c3dd8e7 SHA512 e17057478fd498fd4d83c4b6d3712fdfc3c6ae1d077114ea74ee41186cbd75add292f5e5f810fdf41242fd506a476d34447392b1c8194b5e8a6af1a59ac48a74 +DIST linux-7.1.9.tar.xz 158435316 BLAKE2B 873b4d4426295e291118481d911dc2bc67588bb9b1025c19faf7c2a3971cad439efce1c4f244a40a2983d9e7fe405adfb880c0df92ff2e616d0880178129a551 SHA512 b139d559aba45cebd69d9172372f11d9d30e95008f0d721f160352390c91b5e42955c66c0e725f9eab461165e51f6685d0402e5349624b9e4d48eb6f166413be DIST linux_6.1.162-1.debian.tar.xz 1812632 BLAKE2B 680cfdd2f755260f52850835e237ab5f036af80e8fa47ce29e8736f2826a1837aa4889e6184116e3bad61e7221d326d3b9f11cfdd40ffbf1231b4172031bf2f2 SHA512 0fd46bad050bfd5ce312e409b4f7708f2188e634278ef78ea38becdc8f91a408384777e90beee3cf68d531496f9136d5f34702dc648f087d46343096bfca1c94 DIST linux_6.1.164-1.debian.tar.xz 1830072 BLAKE2B 2c73b0ce6df6fef7fe82795840120bc98a36c0e8d6dedba1379acac79405f988faccfb07c1def789555733fcdae611332f8a308755de53a592c8e7b13ae88c66 SHA512 781ce2a6b00ea2180f5f450db37a0adecf71d2fc2d73059e22ccade37de2f895bedf008ffe2e5c002c01e76dc26b361446562bf386299be392c16252ca92e7c7 DIST linux_6.1.170-1.debian.tar.xz 1837236 BLAKE2B 31941f98a0a1a16d3b728d488cbcd5402f8c089d1bf40746452f6e2f676c27727eb51ae4c9a2022583479f112e3357535a7a85049a96a750be5cbcf59da8683b SHA512 1dad04429ba2ceb1ddc9e64b45250ce46f4b9f9f4df28b0748ff74d1ec5015bf6831b9bae426b66b4344bafe2d3a42985864a6db15bf9dae1a4bd582254723af +DIST linux_6.12.101-1.debian.tar.xz 1874152 BLAKE2B c1849e9f48321a9f0351719136546631e1403caea081f60eb60cc573db5250a432b714334267fbbcb43393f9c5122bd77262efb315a64e6d886a92620e9eccf3 SHA512 5302ab9dfc83ccb13c71c1baddf87dd1d2602f058bbb0ef16dc55df1ec7bde3e02e9d43ffd0838b15729dea17d1f3567a4be859b1580ce077eab5b1d4c9f4c8a DIST linux_6.12.74-2.debian.tar.xz 1783784 BLAKE2B 5d0bd6e9d1d47d29ee9b146d6ded5a2b4aaf3819599e387389429526368baffae92272a6a380e1371859c1839a1f89f72b10cadbb2041245d8d44ad00b4c610b SHA512 eb2724656beca90db4c4f7a5e095f552a14ad1be2cfc0993c6fd35e373d020d29ef7e1cb505c1a903e007767ec4da96541048e32104d25f5e2488f9f7e3d9cce DIST linux_6.12.86-1.debian.tar.xz 1812972 BLAKE2B 44179c8e5dce791197104c1a4b003ae8a30f7798674acc0a96a218c8b859c0cf08b396cc8d2b92159791c75cc6ab47225bb3040f8e190ded8ccfa9453df59925 SHA512 3c5088a82d18afc0e05f6b127629af96bb9da2f5be3d9ed9b6d8daf9906e79beff622effb1e4dd498b458f68c1f707294d96311e157b3dcc89c750dad0c9728f DIST linux_6.19.11-1.debian.tar.xz 1485108 BLAKE2B 3b5f427acc13025a82e7da65ca3e3efc7889ac78b97bc50201a3ee8be68f8f7a5d39e13132dfcaee976e7060707d2f211d7accdb7b2a4c1f58f99d4802e30f1f SHA512 ffa9ad9dcdbd2579e22dda87480c30dff3c6725682db14d3549ced575d3f9ce1ac387015b63c94b0168748356f4100e2189895eb21c69f709e7b5d84189de13e DIST linux_6.19.13-1.debian.tar.xz 1490440 BLAKE2B 54b633ca64fd3f5de47a3272db0de5faa3e56083cd43533bbb0a709ea14afd3ab06e71319bca398b9b64cc3a0f21c38d9b6c7ebfad9bc3c04d33b4a78cce273c SHA512 6e278f7b02278ec3bd460ecf54af7dcdede3fba0ffdde29609f00f0ac5938b842cff82ad72999ab6be7c8d65ceca8ba9461eb636adb26c1ac33e5266211f10e0 DIST linux_6.19.14-1.debian.tar.xz 1494168 BLAKE2B 07866a555232a143d2bc972a467dbf4a8331f91c3977554c262a1c72dc87b22b95d4919555c51fbb2bb98b5e31349e1423ccbd0c1513320fc5c3687dc9cffee0 SHA512 9a3bdc9533912db0ab539c7489f9b0d502c6ef5010d0e3b4ec5f03efef00d0afe6b783ed1e6c5c9b823fe40bf7ab46b4275af77321090c643c5ce558e5be720e +DIST linux_7.1.8-2.debian.tar.xz 1531220 BLAKE2B 6e7e257578917011bd0a9beb8912d7ebfb5fef9fa12535b34cd1ecc43baa2a9b53c645989c2c88b9532e858da611f630e51122f1d9951817118b0233113bd49d SHA512 5046be76545cd7872691ed745cad36dd148a03fb95aaf553cfbb02e2aa314feeae33e356035a7b5d0c3209a6f97d25cf0134802c380660266b0b5a1d3572afd7 +DIST linux_7.1.9-1.debian.tar.xz 1535584 BLAKE2B b2eac859e93d10820c93a366e2a4df16479f0c98798bff801591132e485dec29476676f2cd2b252cda23d9305cd71837623830a10988bd10c79eadba0a2a1fc0 SHA512 2e25cd690d72dfef3309b2a9f4a2d63ea0714dc09346d951a90dc63a9b46b8ea0bce408200f08d3fc72ad6666c8ae9ab13712841dd9a6273022b81db83dfa9ab diff --git a/sys-kernel/debian-sources/debian-sources-6.12.101_p1-r201.ebuild b/sys-kernel/debian-sources/debian-sources-6.12.101_p1-r201.ebuild new file mode 100644 index 0000000..c37ec3e --- /dev/null +++ b/sys-kernel/debian-sources/debian-sources-6.12.101_p1-r201.ebuild @@ -0,0 +1,499 @@ +# Distributed under the terms of the GNU General Public License v2 +# Autogen by MARK Devkit + +EAPI=7 +KERNEL_TRIPLET="6.12.101" +MACARONI_KTYPE="debian" +MACARONI_KSUFFIX="debian1-mark" +REVISION_SUFFIX="-trixie" +EXTRAVERSION="-trixie-debian1-mark" +LINUX_SRCDIR="linux-6.12.101-trixie-debian1-mark" +MOD_DIR_NAME="6.12.101-trixie-debian1-mark" +inherit check-reqs eutils ego savedconfig + +DESCRIPTION="Debian Sources (and optional binary kernel)" +HOMEPAGE="https://packages.debian.org/unstable/kernel/" +SRC_URI=" +https://deb.debian.org/debian/pool/main/l/linux/linux_6.12.101-1.debian.tar.xz -> linux_6.12.101-1.debian.tar.xz +https://mirrors.edge.kernel.org/pub/linux/kernel/v6.x/linux-6.12.101.tar.xz -> linux-6.12.101.tar.xz" +LICENSE="GPL-2" +SLOT="trixie/6.12.101_p1" +KEYWORDS="*" +IUSE="acpi-ec binary btrfs custom-cflags dracut ec2 +logo luks lvm mdadm savedconfig sshd sign-modules zfs" +REQUIRED_USE="binary? ( + ^^ ( dracut ) + btrfs? ( dracut ) + mdadm? ( dracut ) + luks? ( dracut ) + lvm? ( dracut ) + sshd? ( dracut ) +) +dracut? ( binary ) +sshd? ( binary ) +" +RESTRICT="binchecks strip" +BDEPEND="# Build-time only. Available from src_prepare through + # pkg_postinst, then dep-cleanable. Not needed at runtime. + virtual/libelf + sys-apps/gawk + binary? ( + app-admin/whip + sys-apps/whip-catalog + sys-kernel/dracut + virtual/dracut-mark + ) + sign-modules? ( sys-apps/findutils ) + +" +RDEPEND="# Root-filesystem managers: needed at RUNTIME to activate/manage + # the root (lvm/luks/raid/btrfs/zfs), so they persist with the + # package. Also required at build time for dracut initramfs + # generation (RDEPEND is available through pkg_postinst). + btrfs? ( sys-fs/btrfs-progs ) + zfs? ( sys-fs/zfs ) + luks? ( sys-fs/cryptsetup ) + lvm? ( sys-fs/lvm2 ) + mdadm? ( sys-fs/mdadm ) + +" +S="${WORKDIR}/linux-${KERNEL_TRIPLET}" +# Helper functions +get_patch_list() { + [[ -z "${1}" ]] && die "No patch series file specified" + local patch_series="${1}" + while read line ; do + if [[ "${line:0:1}" != "#" ]] ; then + echo "${line}" + fi + done < "${patch_series}" +} + +tweak_config() { + einfo "Setting $2=$3 in kernel config." + case "$2" in + *\*) + # Wildcard: expand to sed pattern (e.g., CONFIG_DEBUG* → CONFIG_DEBUG.*) + local base="${2%\*}" + sed -i -e "s/^${base}\(.*\)=.*/${base}\1=${3}/g" "$1" + ;; + *) + # Exact: remove old line, append new + sed -i -e "/^${2}=/d" "$1" + echo "${2}=${3}" >> "$1" + ;; + esac +} + +get_vendor() { + vendor_string=$(grep vendor /proc/cpuinfo | uniq | cut -d ':' -f 2) + vendor=$([[ ${vendor_string^^} =~ (INTEL)|(AMD) ]] && echo ${BASH_REMATCH[0]}) + echo $vendor +} + +pkg_pretend() { + # Ensure we have enough disk space to compile + if use binary ; then + CHECKREQS_DISK_BUILD="6G" + check-reqs_pkg_setup + echo "binary" + fi +} + +get_certs_dir() { + # find a certificate dir in /etc/kernel/certs/ that contains signing cert for modules. + for subdir in $PF $P linux; do + certdir=/etc/kernel/certs/$subdir + if [ -d $certdir ]; then + if [ ! -e $certdir/signing_key.pem ]; then + eerror "$certdir exists but missing signing key; exiting." + exit 1 + fi + echo $certdir + return + fi + done +} + +pkg_setup() { + export REAL_ARCH="$ARCH" + unset ARCH; unset LDFLAGS #will interfere with Makefile if set + export FEATURESET="standard" +} + +src_prepare() { + default + # Apply Debian patchset + for debpatch in $( get_patch_list "${WORKDIR}/debian/patches/series" ); do + eapply -p1 "${WORKDIR}/debian/patches/${debpatch}" + done + + # do not include debian devs certificates + rm -rf "${WORKDIR}"/debian/certs + + # remove references to debian uefi certs + sed -i -e 's|\${CURDIR}\/debian\/certs\/debian-uefi-certs\.pem||g' "${WORKDIR}"/debian/rules.gen + + cd "${S}" || die + sed -i -e "s:^\(EXTRAVERSION =\).*:\1 ${EXTRAVERSION}:" Makefile || die + sed -i -e 's:#export\tINSTALL_PATH:export\tINSTALL_PATH:' Makefile || die + rm -f .config >/dev/null + cp -a "${WORKDIR}"/debian "${T}" + make -s mrproper || die "make mrproper failed" + cp -aR "${WORKDIR}"/debian "${S}"/debian + +# patches common to all kernel versions + + # Apply USE-gated patches (applied before kernel config) + if use custom-cflags; then + eapply "${FILESDIR}/6.1.79+/more-ISA-levels-and-uarches-for-kernel-6.1.79+.patch" || die "use-patch 6.1.79+/more-ISA-levels-and-uarches-for-kernel-6.1.79+.patch failed" + fi + + # patches for this particular branch (applied via PATCHES array, not here) + + if use savedconfig; then + einfo Restoring saved .config ... + restore_config .config + else + cp "${FILESDIR}"/config-extract-6.6 ./config-extract || die + chmod +x config-extract || die + fi + + # Set up arch-specific variables and this will fail if run in pkg_setup() + # since ARCH can be unset there: + if [ "${REAL_ARCH}" = x86 ]; then + export DEB_ARCH="i386" + export DEB_SUBARCH="686-pae" + export KERN_ARCH="i686" + elif [ "${REAL_ARCH}" = amd64 ]; then + export DEB_ARCH="amd64" + export DEB_SUBARCH="amd64" + export KERN_ARCH="x86_64" + elif [ "${REAL_ARCH}" = arm ]; then + export DEB_ARCH="arm" + export DEB_SUBARCH="arm" + export KERN_ARCH="arm" + elif [ "${REAL_ARCH}" = arm64 ]; then + export DEB_ARCH="arm64" + export DEB_SUBARCH="arm64" + export KERN_ARCH="aarch64" + else + die "Architecture '${REAL_ARCH}' not handled in ebuild" + fi + # like "debian-x86_64-6.12.38-trixie-debian1-mark" + # EXTRAVERSION/MOD_DIR_NAME/REVISION_SUFFIX provided by generator (use ${PR} from ebuild filename) + # MACARONI_KVER = KERNEL_TRIPLET + REVISION_SUFFIX (no duplicate ARCH) + MACARONI_KVER="${KERNEL_TRIPLET}${REVISION_SUFFIX}" + export KERN_SUFFIX="${MACARONI_KTYPE}-${KERN_ARCH}-${MACARONI_KVER}-${MACARONI_KSUFFIX}" + + if ! use savedconfig; then + ./config-extract ${DEB_ARCH} ${FEATURESET} ${DEB_SUBARCH} || die + fi + + # Apply unconditional options (wildcards supported, applied in order) + tweak_config .config CONFIG_DEBUG* n + tweak_config .config CONFIG_MODULE_COMPRESS* n + tweak_config .config CONFIG_MODULE_COMPRESS_NONE y + tweak_config .config CONFIG_CRYPTO_CRC32C y + + # Apply USE-gated kernel config options + if use acpi-ec; then + tweak_config .config CONFIG_ACPI_EC_DEBUGFS m + tweak_config .config CONFIG_DEBUG_FS y # custom-cflags + fi # if ne $name "unconditional" + if use custom-cflags; then + # Detect architecture and apply custom-cflags optimization (ISA patch applied via use_patches in src_prepare) + # Extract -march flag from CFLAGS using bash word splitting (handles tabs/spaces/quotes) + MARCH="" + for _flag in $(python3 -c 'import portage; print(portage.settings["CFLAGS"])'); do + [[ "$_flag" == -march=* ]] && MARCH="$_flag" && break + done + + if [ -n "$MARCH" ]; then + CONFIG_MARCH="" + if [ "${KERN_ARCH}" = "x86_64" ] || [ "${KERN_ARCH}" = "i686" ]; then + # Build march-to-CONFIG mapping from arch/x86/Makefile (after ISA patch applied) + # Exclude "-march=native" entries: they map multiple configs (CONFIG_MNATIVE_INTEL, + # CONFIG_MNATIVE_AMD) to the same "native" key, causing last-write-wins collisions. + # Those are handled separately by the vendor-detection fallback below. + declare -A MARCH_MAP + while IFS= read -r line; do + cfg=$(echo "$line" | grep -oP 'CONFIG_M[A-Z0-9_]+') + mch=$(echo "$line" | sed 's/.*-march=//;s/[[:space:]].*//') + # Skip "native" — handled by vendor detection + [[ "$mch" == "native" ]] && continue + [ -n "$cfg" ] && [ -n "$mch" ] && MARCH_MAP[$mch]=$cfg + done < <(grep -E '^\s+cflags-\$\(CONFIG_M' arch/x86/Makefile | grep 'march=') + + # Extract subarch from -march=subarch + SUBARCH=$(echo "$MARCH" | sed 's/.*-march=//') + + # Try exact match first + if [ "${MARCH_MAP[$SUBARCH]}" ]; then + CONFIG_MARCH="${MARCH_MAP[$SUBARCH]}" + einfo "Optimizing kernel for ${CONFIG_MARCH} (matched -march=${SUBARCH})" + elif [[ "$MARCH" =~ (native) ]] && [ -n "$(get_vendor)" ]; then + VENDOR=$(get_vendor) + CONFIG_MARCH="CONFIG_MNATIVE_${VENDOR}" + einfo "Detected -march=native on ${VENDOR}, using ${CONFIG_MARCH}" + fi + + # Fallback: vendor native if specific match failed + if [ -z "$CONFIG_MARCH" ] && [ -n "$(get_vendor)" ]; then + VENDOR=$(get_vendor) + CONFIG_MARCH="CONFIG_MNATIVE_${VENDOR}" + einfo "Subarch '${SUBARCH}' not mapped, using ${CONFIG_MARCH}" + fi + elif [ "${KERN_ARCH}" = "arm" ] || [ "${KERN_ARCH}" = "aarch64" ]; then + # ARM architecture - check for vendor-specific optimization + if [[ $MARCH =~ (native) ]]; then + ARM_VENDOR="" + if [ -f /proc/cpuinfo ]; then + ARM_VENDOR=$(grep "CPU implementer" /proc/cpuinfo | head -1 | awk '{print $3}') + case $ARM_VENDOR in + 0x41) ARM_VENDOR="arm";; + 0x43) ARM_VENDOR="cavium";; + 0x46) ARM_VENDOR="freescale";; + 0x49) ARM_VENDOR="intel";; + 0x4d) ARM_VENDOR="motorola";; + 0x50) ARM_VENDOR="primecell";; + 0x51) ARM_VENDOR="arm";; + 0x56) ARM_VENDOR="marvell";; + 0x58) ARM_VENDOR="amd";; + 0x69) ARM_VENDOR="intel";; + 0x6b) ARM_VENDOR="broadcom";; + 0x6c) ARM_VENDOR="nvidia";; + 0x70) ARM_VENDOR="apm";; + 0xc0) ARM_VENDOR="qualcomm";; + *) ;; + esac + fi + if [ -n "$ARM_VENDOR" ]; then + ARM_CONFIG="CONFIG_${ARM_VENDOR^^}_OPTIMIZED" + if grep -q "${ARM_CONFIG}" arch/arm/Makefile 2>/dev/null || grep -q "${ARM_CONFIG}" arch/arm64/Makefile 2>/dev/null; then + einfo "Detected -march=native on ARM ${ARM_VENDOR}, using ${ARM_CONFIG}" + CONFIG_MARCH="${ARM_CONFIG}" + else + ewarn "No ${ARM_VENDOR} optimized config found, compiling generic ARM kernel." + fi + else + ewarn "Could not detect ARM vendor for native optimization, compiling generic kernel." + fi + else + # ARM specific subarch - try to match to kernel config + ARM_SUBARCH="$(echo ${MARCH} | sed 's/march=//;s/-//g')" + ARM_CONFIG="CONFIG_CPU_${ARM_SUBARCH^^}" + if grep -q "${ARM_CONFIG}" arch/arm/Makefile 2>/dev/null || grep -q "${ARM_CONFIG}" arch/arm64/Makefile 2>/dev/null; then + einfo "Optimizing ${KERN_ARCH} kernel for ${ARM_CONFIG}" + CONFIG_MARCH="${ARM_CONFIG}" + else + ewarn "Could not find optimized settings for ${MARCH}, compiling generic ${KERN_ARCH} kernel." + fi + fi + else + ewarn "Custom-cflags not supported for architecture ${KERN_ARCH}, compiling generic kernel." + fi + + # Apply if found + if [ -n "$CONFIG_MARCH" ]; then + tweak_config .config CONFIG_GENERIC_CPU n + tweak_config .config "$CONFIG_MARCH" y + elif [ -z "$MARCH_MAP[$SUBARCH]" ] && [ -z "$CONFIG_MARCH" ]; then + ewarn "No optimization found for ${MARCH}, compiling generic kernel." + fi + fi # custom-cflags + fi # if ne $name "unconditional" + if use ec2; then + tweak_config .config CONFIG_BLK_DEV_NVME y + tweak_config .config CONFIG_XEN_BLKDEV_FRONTEND y + tweak_config .config CONFIG_XEN_BLKDEV_BACKEND y + tweak_config .config CONFIG_IXGBEVF y # custom-cflags + fi # if ne $name "unconditional" + if use logo; then + tweak_config .config CONFIG_LOGO y + cp "${FILESDIR}"/latest/macaroni-os_logo_clut224.ppm "$S"/drivers/video/logo/logo_linux_clut224.ppm || die + ewarn "Linux kernel frame buffer boot logo is now enabled with a custom MacaroniOS pixmap." + ewarn "The new logo can be viewed at /usr/src/linux/drivers/video/logo/logo_linux_clut224.ppm" + ewarn "Remove the quiet kernel parameter (from params in /etc/boot.conf, and re-run boot-update)." + ewarn "This will ensure the custom kernel logo is displayed during boot over frame buffer." + ewarn "" # custom-cflags + fi # if ne $name "unconditional" + if use sign-modules; then + tweak_config .config CONFIG_MODULE_SIG y + tweak_config .config CONFIG_MODULE_SIG_FORCE n + tweak_config .config CONFIG_MODULE_SIG_ALL n + tweak_config .config CONFIG_MODULE_SIG_HASH "sha512" + tweak_config .config CONFIG_MODULE_SIG_KEY "${certs_dir}/signing_key.pem" + tweak_config .config CONFIG_SYSTEM_TRUSTED_KEYRING y + tweak_config .config CONFIG_SYSTEM_EXTRA_CERTIFICATE y + tweak_config .config CONFIG_SYSTEM_EXTRA_CERTIFICATE_SIZE 4096 + tweak_config .config CONFIG_MODULE_SIG_SHA512 y + certs_dir=$(get_certs_dir) + echo + if [ -z "$certs_dir" ]; then + eerror "No certs dir found in /etc/kernel/certs; aborting." + die + else + einfo "Using certificate directory of $certs_dir for kernel module signing." + fi + echo + ewarn "This kernel will ALLOW non-signed modules to be loaded with a WARNING." + ewarn "To enable strict enforcement, YOU MUST add module.sig_enforce=1 as a kernel boot" + ewarn "parameter (to params in /etc/boot.conf, and re-run boot-update.)" + ewarn "" # custom-cflags + fi # if ne $name "unconditional" # if ne $name "unconditional" # range $name, $opts := .Values.kernel_config_options + + # get config into good state: + yes "" | make oldconfig >/dev/null 2>&1 || die + cp .config "${T}"/config || die + make -s mrproper || die "make mrproper failed" +} + +src_compile() { + ! use binary && return + install -d "${WORKDIR}"/build + cp "${T}"/config "${WORKDIR}"/build/.config || die "couldn't copy kernel config" + make ${MAKEOPTS} O="${WORKDIR}"/build bzImage || die "kernel build failure" + make ${MAKEOPTS} O="${WORKDIR}"/build modules || die "modules build failure" +} + +src_install() { + # copy sources into place: + dodir /usr/src + cp -a "${S}" "${D}"/usr/src/${LINUX_SRCDIR} || die + cd "${D}"/usr/src/${LINUX_SRCDIR} + # prepare for real-world use and 3rd-party module building: + make mrproper || die + cp "${T}"/config .config || die + cp -a "${T}"/debian debian || die + + # if we didn't compile a kernel, we're done. The kernel source tree is left in + # an unconfigured state - you can't compile 3rd-party modules against it yet. + use binary || return + make ${MAKEOPTS} O="${WORKDIR}"/build INSTALL_MOD_PATH="${D}" modules_install || die "modules install failure" + insinto /boot + newins ${WORKDIR}/build/arch/x86/boot/bzImage "vmlinuz-${KERN_SUFFIX}.tmp" + newins ${WORKDIR}/build/System.map "System.map-${KERN_SUFFIX}.tmp" + newins ${WORKDIR}/build/.config "config-${KERN_SUFFIX}.tmp" + make prepare || die + make scripts || die + # FL-8004: In Linux 5.10, module.lds is generated by 'modules_prepare', + # so we need to run it as well to be able to compile modules + make modules_prepare || die + + # module symlink fixup: + rm -f "${D}"/lib/modules/*/source || die + rm -f "${D}"/lib/modules/*/build || die + cd "${D}"/lib/modules + local moddir="$(make -s -C "${WORKDIR}"/build kernelrelease)" + ln -s /usr/src/${LINUX_SRCDIR} "${D}"/lib/modules/${moddir}/source || die + ln -s /usr/src/${LINUX_SRCDIR} "${D}"/lib/modules/${moddir}/build || die + # Move to .tmp so Portage tracks it; pkg_postinst renames to MOD_DIR_NAME + mv "${D}"/lib/modules/${moddir}{,.tmp} || die + # Fixes FL-14 + cp "${WORKDIR}/build/System.map" "${D}/usr/src/${LINUX_SRCDIR}/" || die + cp "${WORKDIR}/build/Module.symvers" "${D}/usr/src/${LINUX_SRCDIR}/" || die + if use sign-modules; then + # FIXME: only signs uncompressed .ko modules; compressed .ko.xz are skipped. + # Requires kernel >= 6.12+ CONFIG_MODULE_COMPRESS_XZ support detection. + find "${D}"/lib/modules -iname *.ko ! -iname *.ko.xz \ + -exec ${WORKDIR}/build/scripts/sign-file sha512 \ + $certs_dir/signing_key.pem $certs_dir/signing_key.x509 {} \; || die + # install the sign-file executable for future use. + exeinto /usr/src/${LINUX_SRCDIR}/scripts + doexe ${WORKDIR}/build/scripts/sign-file + fi + # The following line associates the .tmp dir with this package, so that + # when the package is uninstalled, the modules are not removed. + # Otherwise, modules for the current running kernel might be erased! + mv "${D}"/lib/modules/${moddir}{,.tmp} +} + +pkg_postinst() { + # Ensure that /boot is mounted in this phase + ego_pkg_preinst + + # Back up existing initramfs as .old before generating a new one + # (matches kernel backup pattern: vmlinuz, System.map, config) + if use binary && use dracut; then + if [[ -f "/boot/initramfs-${KERN_SUFFIX}" ]]; then + rm -f "/boot/initramfs-${KERN_SUFFIX}.old" + einfo "Preserving: mv /boot/initramfs-${KERN_SUFFIX}{,.old}" + mv /boot/initramfs-${KERN_SUFFIX}{,.old} || die + fi + fi + + # Pattern: install everything as .tmp in src_install, move to real names here. + # Portage tracks .tmp files; on uninstall it removes them, but the real + # files (moved into place by postinst) are not tracked by portage. + # If the destination already exists, erase stale .old first, then back up as .old. + if use binary; then + # Move boot files from .tmp to real names (back up existing as .old) + for i in vmlinuz System.map config; do + if [[ -f "/boot/${i}-${KERN_SUFFIX}.tmp" ]]; then + if [[ -f "/boot/${i}-${KERN_SUFFIX}" ]]; then + rm -f "/boot/${i}-${KERN_SUFFIX}.old" + einfo "Preserving: mv /boot/${i}-${KERN_SUFFIX}{,.old}" + mv "/boot/${i}-${KERN_SUFFIX}" "/boot/${i}-${KERN_SUFFIX}.old" || die + fi + mv "/boot/${i}-${KERN_SUFFIX}.tmp" "/boot/${i}-${KERN_SUFFIX}" || die + fi + done + # Move modules from .tmp to real name (back up existing as .old) + local tmp_moddir + tmp_moddir="$(ls -d /lib/modules/*.tmp 2>/dev/null | head -1)" + if [[ -n "$tmp_moddir" ]]; then + if [[ -d "/lib/modules/${MOD_DIR_NAME}" ]]; then + rm -rf "/lib/modules/${MOD_DIR_NAME}.old" + einfo "Preserving: mv /lib/modules/${MOD_DIR_NAME}{,.old}" + mv "/lib/modules/${MOD_DIR_NAME}" "/lib/modules/${MOD_DIR_NAME}.old" || die + fi + mv "$tmp_moddir" "/lib/modules/${MOD_DIR_NAME}" || die + fi + fi + + # Finally, generate a new initramfs with dracut, via whip + # NOTE: For now, the initramfs is generic. + if use binary && use dracut; then + dracut_modules_pre=" + $(use btrfs && echo btrfs) + $(use luks && echo crypt) + $(use lvm && echo lvm) + $(use mdadm && echo mdraid) + $(use sshd && echo sshd) + " + dracut_drivers_pre=" + $(use luks && echo dm-crypt) + " + DRACUT_ADD_MODULES="$(echo ${dracut_modules_pre} | xargs)" \ + DRACUT_ADD_DRIVERS="$(echo ${dracut_drivers_pre} | xargs)" \ + KVER="${KERN_ARCH}-${MACARONI_KVER}" \ + KTYPE="${MACARONI_KTYPE}" \ + KSUFFIX="${MACARONI_KSUFFIX}" \ + KMODDIR="/lib/modules/$MOD_DIR_NAME" \ + whip h initramfs.generate_with_dracut || ewarn "whip initramfs generation failed (non-fatal)" + fi + + if use binary && [[ -h /usr/src/linux ]]; then + rm /usr/src/linux || die + fi + + if use binary && [[ ! -e /usr/src/linux ]]; then + ewarn "With binary use flag enabled /usr/src/linux" + ewarn "symlink automatically set to debian kernel" + ewarn "If you have external modules, don't forget to rebuild them with:" + ewarn "" + ewarn " emerge @module-rebuild" + ewarn "" + ln -sf "${LINUX_SRCDIR}" /usr/src/linux || die + fi + + if [ -e /lib/modules ]; then + depmod -a $MOD_DIR_NAME || die + fi + + # Update bootloader and unmount /boot + ego_pkg_postinst +} + + +# vim: filetype=ebuild diff --git a/sys-kernel/debian-sources/files/7.1+/more-ISA-levels-and-uarches-for-kernel-7.1.x+.patch b/sys-kernel/debian-sources/files/7.1+/more-ISA-levels-and-uarches-for-kernel-7.1.x+.patch new file mode 100644 index 0000000..d2b7723 --- /dev/null +++ b/sys-kernel/debian-sources/files/7.1+/more-ISA-levels-and-uarches-for-kernel-7.1.x+.patch @@ -0,0 +1,721 @@ +--- a/arch/x86/Kconfig.cpu ++++ b/arch/x86/Kconfig.cpu +@@ -30,6 +30,7 @@ + - "Pentium-4" for the Intel Pentium 4 or P4-based Celeron. + - "K6" for the AMD K6, K6-II and K6-III (aka K6-3D). + - "Athlon" for the AMD K7 family (Athlon/Duron/Thunderbird). ++ - "Opteron/Athlon64/Hammer/K8" for all K8 and newer AMD CPUs. + - "Crusoe" for the Transmeta Crusoe series. + - "Efficeon" for the Transmeta Efficeon series. + - "Winchip-C6" for original IDT Winchip. +@@ -40,7 +41,10 @@ + - "CyrixIII/VIA C3" for VIA Cyrix III or VIA C3. + - "VIA C3-2" for VIA C3-2 "Nehemiah" (model 9 and above). + - "VIA C7" for VIA C7. ++ - "Intel P4" for the Pentium 4/Netburst microarchitecture. ++ - "Core 2/newer Xeon" for all core2 and newer Intel CPUs. + - "Intel Atom" for the Atom-microarchitecture CPUs. ++ - "Generic-x86-64" for a kernel which runs on any x86-64 CPU. + + See each option's help text for additional details. If you don't know + what to do, choose "Pentium-Pro". +@@ -120,10 +124,21 @@ + -Mobile Pentium 4 + -Mobile Pentium 4 M + -Extreme Edition (Gallatin) ++ -Prescott ++ -Prescott 2M ++ -Cedar Mill ++ -Presler ++ -Smithfiled + Xeons (Intel Xeon, Xeon MP, Xeon LV, Xeon MV) corename: + -Foster + -Prestonia + -Gallatin ++ -Nocona ++ -Irwindale ++ -Cranford ++ -Potomac ++ -Paxville ++ -Dempsey + + config MK6 + bool "K6/K6-II/K6-III" +@@ -258,6 +273,402 @@ + This is really intended for distributors who need more + generic optimizations. + ++choice ++ prompt "x86_64 Compiler Build Optimization" ++ depends on !X86_NATIVE_CPU ++ default GENERIC_CPU ++ ++config GENERIC_CPU ++ bool "Generic-x86-64" ++ depends on X86_64 ++ help ++ Generic x86-64 CPU. ++ Runs equally well on all x86-64 CPUs. ++ ++config MK8 ++ bool "AMD Opteron/Athlon64/Hammer/K8" ++ help ++ Select this for an AMD Opteron or Athlon64 Hammer-family processor. ++ Enables use of some extended instructions, and passes appropriate ++ optimization flags to GCC. ++ ++config MK8SSE3 ++ bool "AMD Opteron/Athlon64/Hammer/K8 with SSE3" ++ help ++ Select this for improved AMD Opteron or Athlon64 Hammer-family processors. ++ Enables use of some extended instructions, and passes appropriate ++ optimization flags to GCC. ++ ++config MK10 ++ bool "AMD 61xx/7x50/PhenomX3/X4/II/K10" ++ help ++ Select this for an AMD 61xx Eight-Core Magny-Cours, Athlon X2 7x50, ++ Phenom X3/X4/II, Athlon II X2/X3/X4, or Turion II-family processor. ++ Enables use of some extended instructions, and passes appropriate ++ optimization flags to GCC. ++ ++config MBARCELONA ++ bool "AMD Barcelona" ++ help ++ Select this for AMD Family 10h Barcelona processors. ++ ++ Enables -march=barcelona ++ ++config MBOBCAT ++ bool "AMD Bobcat" ++ help ++ Select this for AMD Family 14h Bobcat processors. ++ ++ Enables -march=btver1 ++ ++config MJAGUAR ++ bool "AMD Jaguar" ++ help ++ Select this for AMD Family 16h Jaguar processors. ++ ++ Enables -march=btver2 ++ ++config MBULLDOZER ++ bool "AMD Bulldozer" ++ help ++ Select this for AMD Family 15h Bulldozer processors. ++ ++ Enables -march=bdver1 ++ ++config MPILEDRIVER ++ bool "AMD Piledriver" ++ help ++ Select this for AMD Family 15h Piledriver processors. ++ ++ Enables -march=bdver2 ++ ++config MSTEAMROLLER ++ bool "AMD Steamroller" ++ help ++ Select this for AMD Family 15h Steamroller processors. ++ ++ Enables -march=bdver3 ++ ++config MEXCAVATOR ++ bool "AMD Excavator" ++ help ++ Select this for AMD Family 15h Excavator processors. ++ ++ Enables -march=bdver4 ++ ++config MZEN ++ bool "AMD Ryzen" ++ help ++ Select this for AMD Family 17h Zen processors. ++ ++ Enables -march=znver1 ++ ++config MZEN2 ++ bool "AMD Ryzen 2" ++ help ++ Select this for AMD Family 17h Zen 2 processors. ++ ++ Enables -march=znver2 ++ ++config MZEN3 ++ bool "AMD Ryzen 3" ++ depends on (CC_IS_GCC && GCC_VERSION >= 100300) || (CC_IS_CLANG && CLANG_VERSION >= 120000) ++ help ++ Select this for AMD Family 19h Zen 3 processors. ++ ++ Enables -march=znver3 ++ ++config MZEN4 ++ bool "AMD Ryzen 4" ++ depends on (CC_IS_GCC && GCC_VERSION >= 130000) || (CC_IS_CLANG && CLANG_VERSION >= 160000) ++ help ++ Select this for AMD Family 19h Zen 4 processors. ++ ++ Enables -march=znver4 ++ ++config MZEN5 ++ bool "AMD Ryzen 5" ++ depends on (CC_IS_GCC && GCC_VERSION > 140000) || (CC_IS_CLANG && CLANG_VERSION >= 190100) ++ help ++ Select this for AMD Family 19h Zen 5 processors. ++ ++ Enables -march=znver5 ++ ++config MPSC ++ bool "Intel P4 / older Netburst based Xeon" ++ depends on X86_64 ++ help ++ Optimize for Intel Pentium 4, Pentium D and older Nocona/Dempsey ++ Xeon CPUs with Intel 64bit which is compatible with x86-64. ++ Note that the latest Xeons (Xeon 51xx and 53xx) are not based on the ++ Netburst core and shouldn't use this option. You can distinguish them ++ using the cpu family field ++ in /proc/cpuinfo. Family 15 is an older Xeon, Family 6 a newer one. ++ ++config MCORE2 ++ bool "Intel Core 2" ++ depends on X86_64 ++ help ++ ++ Select this for Intel Core 2 and newer Core 2 Xeons (Xeon 51xx and ++ 53xx) CPUs. You can distinguish newer from older Xeons by the CPU ++ family in /proc/cpuinfo. Newer ones have 6 and older ones 15 ++ (not a typo) ++ ++ Enables -march=core2 ++ ++config MNEHALEM ++ bool "Intel Nehalem" ++ depends on X86_64 ++ help ++ ++ Select this for 1st Gen Core processors in the Nehalem family. ++ ++ Enables -march=nehalem ++ ++config MWESTMERE ++ bool "Intel Westmere" ++ depends on X86_64 ++ help ++ ++ Select this for the Intel Westmere formerly Nehalem-C family. ++ ++ Enables -march=westmere ++ ++config MSILVERMONT ++ bool "Intel Silvermont" ++ depends on X86_64 ++ help ++ ++ Select this for the Intel Silvermont platform. ++ ++ Enables -march=silvermont ++ ++config MGOLDMONT ++ bool "Intel Goldmont" ++ depends on X86_64 ++ help ++ ++ Select this for the Intel Goldmont platform including Apollo Lake and Denverton. ++ ++ Enables -march=goldmont ++ ++config MGOLDMONTPLUS ++ bool "Intel Goldmont Plus" ++ depends on X86_64 ++ help ++ ++ Select this for the Intel Goldmont Plus platform including Gemini Lake. ++ ++ Enables -march=goldmont-plus ++ ++config MSANDYBRIDGE ++ bool "Intel Sandy Bridge" ++ depends on X86_64 ++ help ++ ++ Select this for 2nd Gen Core processors in the Sandy Bridge family. ++ ++ Enables -march=sandybridge ++ ++config MIVYBRIDGE ++ bool "Intel Ivy Bridge" ++ depends on X86_64 ++ help ++ ++ Select this for 3rd Gen Core processors in the Ivy Bridge family. ++ ++ Enables -march=ivybridge ++ ++config MHASWELL ++ bool "Intel Haswell" ++ depends on X86_64 ++ help ++ ++ Select this for 4th Gen Core processors in the Haswell family. ++ ++ Enables -march=haswell ++ ++config MBROADWELL ++ bool "Intel Broadwell" ++ depends on X86_64 ++ help ++ ++ Select this for 5th Gen Core processors in the Broadwell family. ++ ++ Enables -march=broadwell ++ ++config MSKYLAKE ++ bool "Intel Skylake" ++ depends on X86_64 ++ help ++ ++ Select this for 6th Gen Core processors in the Skylake family. ++ ++ Enables -march=skylake ++ ++config MSKYLAKEX ++ bool "Intel Skylake-X (7th Gen Core i7/i9)" ++ depends on X86_64 ++ help ++ ++ Select this for 7th Gen Core i7/i9 processors in the Skylake-X family. ++ ++ Enables -march=skylake-avx512 ++ ++config MCANNONLAKE ++ bool "Intel Coffee Lake/Kaby Lake Refresh (8th Gen Core i3/i5/i7)" ++ depends on X86_64 ++ help ++ ++ Select this for 8th Gen Core i3/i5/i7 processors in the Coffee Lake or Kaby Lake Refresh families. ++ ++ Enables -march=cannonlake ++ ++config MICELAKE_CLIENT ++ bool "Intel Ice Lake" ++ depends on X86_64 ++ help ++ ++ Select this for 10th Gen Core client processors in the Ice Lake family. ++ ++ Enables -march=icelake-client ++ ++config MICELAKE_SERVER ++ bool "Intel Ice Lake-SP (3rd Gen Xeon Scalable)" ++ depends on X86_64 ++ help ++ ++ Select this for 3rd Gen Xeon Scalable processors in the Ice Lake-SP family. ++ ++ Enables -march=icelake-server ++ ++config MCOOPERLAKE ++ bool "Intel Cooper Lake" ++ depends on X86_64 ++ depends on (CC_IS_GCC && GCC_VERSION > 100100) || (CC_IS_CLANG && CLANG_VERSION >= 100000) ++ help ++ ++ Select this for Xeon processors in the Cooper Lake family. ++ ++ Enables -march=cooperlake ++ ++config MCASCADELAKE ++ bool "Intel Cascade Lake" ++ depends on X86_64 ++ depends on (CC_IS_GCC && GCC_VERSION > 100100) || (CC_IS_CLANG && CLANG_VERSION >= 100000) ++ help ++ ++ Select this for Xeon processors in the Cascade Lake family. ++ ++ Enables -march=cascadelake ++ ++config MTIGERLAKE ++ bool "Intel Tiger Lake" ++ depends on X86_64 ++ depends on (CC_IS_GCC && GCC_VERSION > 100100) || (CC_IS_CLANG && CLANG_VERSION >= 100000) ++ help ++ ++ Select this for third-generation 10 nm process processors in the Tiger Lake family. ++ ++ Enables -march=tigerlake ++ ++config MSAPPHIRERAPIDS ++ bool "Intel Sapphire Rapids" ++ depends on X86_64 ++ depends on (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000) ++ help ++ ++ Select this for fourth-generation 10 nm process processors in the Sapphire Rapids family. ++ ++ Enables -march=sapphirerapids ++ ++config MROCKETLAKE ++ bool "Intel Rocket Lake" ++ depends on X86_64 ++ depends on (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000) ++ help ++ ++ Select this for eleventh-generation processors in the Rocket Lake family. ++ ++ Enables -march=rocketlake ++ ++config MALDERLAKE ++ bool "Intel Alder Lake" ++ depends on X86_64 ++ depends on (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000) ++ help ++ ++ Select this for twelfth-generation processors in the Alder Lake family. ++ ++ Enables -march=alderlake ++ ++config MRAPTORLAKE ++ bool "Intel Raptor Lake" ++ depends on X86_64 ++ depends on (CC_IS_GCC && GCC_VERSION >= 130000) || (CC_IS_CLANG && CLANG_VERSION >= 150500) ++ help ++ ++ Select this for thirteenth-generation processors in the Raptor Lake family. ++ ++ Enables -march=raptorlake ++ ++config MMETEORLAKE ++ bool "Intel Meteor Lake" ++ depends on X86_64 ++ depends on (CC_IS_GCC && GCC_VERSION >= 130000) || (CC_IS_CLANG && CLANG_VERSION >= 150500) ++ help ++ ++ Select this for fourteenth-generation processors in the Meteor Lake family. ++ ++ Enables -march=meteorlake ++ ++config MEMERALDRAPIDS ++ bool "Intel Emerald Rapids" ++ depends on X86_64 ++ depends on (CC_IS_GCC && GCC_VERSION > 130000) || (CC_IS_CLANG && CLANG_VERSION >= 150500) ++ help ++ ++ Select this for fifth-generation Xeon Scalable processors in the Emerald Rapids family. ++ ++ Enables -march=emeraldrapids ++ ++config MDIAMONDRAPIDS ++ bool "Intel Diamond Rapids (7th Gen Xeon Scalable)" ++ depends on X86_64 ++ depends on (CC_IS_GCC && GCC_VERSION > 150000) || (CC_IS_CLANG && CLANG_VERSION >= 200000) ++ help ++ ++ Select this for seventh-generation Xeon Scalable processors in the Diamond Rapids family. ++ ++ Enables -march=diamondrapids ++ ++endchoice ++ ++config X86_64_VERSION ++ int "x86-64 compiler ISA level" ++ range 1 3 ++ depends on (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000) ++ depends on X86_64 && GENERIC_CPU ++ help ++ Specify a specific x86-64 compiler ISA level. ++ ++ There are three x86-64 ISA levels that work on top of ++ the x86-64 baseline, namely: x86-64-v2 and x86-64-v3. ++ ++ x86-64-v2 brings support for vector instructions up to Streaming SIMD ++ Extensions 4.2 (SSE4.2) and Supplemental Streaming SIMD Extensions 3 ++ (SSSE3), the POPCNT instruction, and CMPXCHG16B. ++ ++ x86-64-v3 adds vector instructions up to AVX2, MOVBE, and additional ++ bit-manipulation instructions. ++ ++ x86-64-v4 is not included since the kernel does not use AVX512 instructions ++ ++ You can find the best version for your CPU by running one of the following: ++ /lib/ld-linux-x86-64.so.2 --help | grep supported ++ /lib64/ld-linux-x86-64.so.2 --help | grep supported ++ + # + # Define implied options from the CPU selection here + config X86_INTERNODE_CACHE_SHIFT +@@ -267,8 +678,8 @@ + + config X86_L1_CACHE_SHIFT + int +- default "7" if MPENTIUM4 +- default "6" if MK7 || MPENTIUMM || MATOM || MVIAC7 || X86_GENERIC || X86_64 ++ default "7" if MPENTIUM4 || MPSC ++ default "6" if MK7 || MK8 || MPENTIUMM || MCORE2 || MATOM || MVIAC7 || X86_GENERIC || GENERIC_CPU || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MJAGUAR || MBULLDOZER || MPILEDRIVER || MSTEAMROLLER || MEXCAVATOR || MZEN || MZEN2 || MZEN3 || MZEN4 || MZEN5 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE_CLIENT || MICELAKE_SERVER || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE || MSAPPHIRERAPIDS || MROCKETLAKE || MALDERLAKE || MRAPTORLAKE || MMETEORLAKE || MEMERALDRAPIDS || MDIAMONDRAPIDS || X86_NATIVE_CPU + default "4" if MGEODEGX1 + default "5" if MWINCHIP3D || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE_LX + +@@ -286,19 +697,19 @@ + + config X86_INTEL_USERCOPY + def_bool y +- depends on MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK7 || MEFFICEON ++ depends on MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK8 || MK7 || MEFFICEON || MCORE2 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE_CLIENT || MICELAKE_SERVER || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE || MSAPPHIRERAPIDS || MROCKETLAKE || MALDERLAKE || MRAPTORLAKE || MMETEORLAKE || MEMERALDRAPIDS || MDIAMONDRAPIDS + + config X86_USE_PPRO_CHECKSUM + def_bool y +- depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MGEODE_LX || MATOM ++ depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MVIAC3_2 || MVIAC7 || MEFFICEON || MGEODE_LX || MCORE2 || MATOM || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MJAGUAR || MBULLDOZER || MPILEDRIVER || MSTEAMROLLER || MEXCAVATOR || MZEN || MZEN2 || MZEN3 || MZEN4 || MZEN5 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE_CLIENT || MICELAKE_SERVER || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE || MSAPPHIRERAPIDS || MROCKETLAKE || MALDERLAKE || MRAPTORLAKE || MMETEORLAKE || MEMERALDRAPIDS || MDIAMONDRAPIDS + + config X86_TSC + def_bool y +- depends on (MWINCHIP3D || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MVIAC3_2 || MVIAC7 || MGEODEGX1 || MGEODE_LX || MATOM) || X86_64 ++ depends on (MWINCHIP3D || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MVIAC7 || MGEODEGX1 || MGEODE_LX || MCORE2 || MATOM) || X86_64 + + config X86_HAVE_PAE + def_bool y +- depends on MCRUSOE || MEFFICEON || MCYRIXIII || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC7 || MATOM || X86_64 ++ depends on MCRUSOE || MEFFICEON || MCYRIXIII || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MVIAC7 || MCORE2 || MATOM || X86_64 + + config X86_CX8 + def_bool y +@@ -308,12 +719,12 @@ + # generates cmov. + config X86_CMOV + def_bool y +- depends on (MK7 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || MATOM || MGEODE_LX || X86_64) ++ depends on (MK8 || MK7 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || X86_64 || MATOM || MGEODE_LX) + + config X86_MINIMUM_CPU_FAMILY + int + default "64" if X86_64 +- default "6" if X86_32 && (MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MATOM || MK7) ++ default "6" if X86_32 && (MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MATOM || MCORE2 || MK7 || MK8) + default "5" + + config X86_DEBUGCTLMSR +--- a/arch/x86/Makefile ++++ b/arch/x86/Makefile +@@ -168,10 +168,221 @@ + KBUILD_CFLAGS += -march=native + KBUILD_RUSTFLAGS += -Ctarget-cpu=native + else ++ifdef CONFIG_MK8 ++ KBUILD_CFLAGS += -march=k8 ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=k8 ++endif ++ ++ifdef CONFIG_MK8SSE3 ++ KBUILD_CFLAGS += -march=k8-sse3 ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=k8-sse3 ++endif ++ ++ifdef CONFIG_MK10 ++ KBUILD_CFLAGS += -march=amdfam10 ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=amdfam10 ++endif ++ ++ifdef CONFIG_MBARCELONA ++ KBUILD_CFLAGS += -march=barcelona ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=barcelona ++endif ++ ++ifdef CONFIG_MBOBCAT ++ KBUILD_CFLAGS += -march=btver1 ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=btver1 ++endif ++ ++ifdef CONFIG_MJAGUAR ++ KBUILD_CFLAGS += -march=btver2 ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=btver2 ++endif ++ ++ifdef CONFIG_MBULLDOZER ++ KBUILD_CFLAGS += -march=bdver1 ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=bdver1 ++endif ++ ++ifdef CONFIG_MPILEDRIVER ++ KBUILD_CFLAGS += -march=bdver2 -mno-tbm ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=bdver2 -mno-tbm ++endif ++ ++ifdef CONFIG_MSTEAMROLLER ++ KBUILD_CFLAGS += -march=bdver3 -mno-tbm ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=bdver3 -mno-tbm ++endif ++ ++ifdef CONFIG_MEXCAVATOR ++ KBUILD_CFLAGS += -march=bdver4 -mno-tbm ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=bdver4 -mno-tbm ++endif ++ ++ifdef CONFIG_MZEN ++ KBUILD_CFLAGS += -march=znver1 ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=znver1 ++endif ++ ++ifdef CONFIG_MZEN2 ++ KBUILD_CFLAGS += -march=znver2 ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=znver2 ++endif ++ ++ifdef CONFIG_MZEN3 ++ KBUILD_CFLAGS += -march=znver3 ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=znver3 ++endif ++ ++ifdef CONFIG_MZEN4 ++ KBUILD_CFLAGS += -march=znver4 ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=znver4 ++endif ++ ++ifdef CONFIG_MZEN5 ++ KBUILD_CFLAGS += -march=znver5 ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=znver5 ++endif ++ ++ifdef CONFIG_MPSC ++ KBUILD_CFLAGS += -march=nocona ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=nocona ++endif ++ ++ifdef CONFIG_MCORE2 ++ KBUILD_CFLAGS += -march=core2 ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=core2 ++endif ++ ++ifdef CONFIG_MNEHALEM ++ KBUILD_CFLAGS += -march=nehalem ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=nehalem ++endif ++ ++ifdef CONFIG_MWESTMERE ++ KBUILD_CFLAGS += -march=westmere ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=westmere ++endif ++ ++ifdef CONFIG_MSILVERMONT ++ KBUILD_CFLAGS += -march=silvermont ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=silvermont ++endif ++ ++ifdef CONFIG_MGOLDMONT ++ KBUILD_CFLAGS += -march=goldmont ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=goldmont ++endif ++ ++ifdef CONFIG_MGOLDMONTPLUS ++ KBUILD_CFLAGS += -march=goldmont-plus ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=goldmont-plus ++endif ++ ++ifdef CONFIG_MSANDYBRIDGE ++ KBUILD_CFLAGS += -march=sandybridge ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=sandybridge ++endif ++ ++ifdef CONFIG_MIVYBRIDGE ++ KBUILD_CFLAGS += -march=ivybridge ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=ivybridge ++endif ++ ++ifdef CONFIG_MHASWELL ++ KBUILD_CFLAGS += -march=haswell ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=haswell ++endif ++ ++ifdef CONFIG_MBROADWELL ++ KBUILD_CFLAGS += -march=broadwell ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=broadwell ++endif ++ ++ifdef CONFIG_MSKYLAKE ++ KBUILD_CFLAGS += -march=skylake ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=skylake ++endif ++ ++ifdef CONFIG_MSKYLAKEX ++ KBUILD_CFLAGS += -march=skylake-avx512 ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=skylake-avx512 ++endif ++ ++ifdef CONFIG_MCANNONLAKE ++ KBUILD_CFLAGS += -march=cannonlake ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=cannonlake ++endif ++ ++ifdef CONFIG_MICELAKE_CLIENT ++ KBUILD_CFLAGS += -march=icelake-client ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=icelake-client ++endif ++ ++ifdef CONFIG_MICELAKE_SERVER ++ KBUILD_CFLAGS += -march=icelake-server ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=icelake-server ++endif ++ ++ifdef CONFIG_MCOOPERLAKE ++ KBUILD_CFLAGS += -march=cooperlake ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=cooperlake ++endif ++ ++ifdef CONFIG_MCASCADELAKE ++ KBUILD_CFLAGS += -march=cascadelake ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=cascadelake ++endif ++ ++ifdef CONFIG_MTIGERLAKE ++ KBUILD_CFLAGS += -march=tigerlake ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=tigerlake ++endif ++ ++ifdef CONFIG_MSAPPHIRERAPIDS ++ KBUILD_CFLAGS += -march=sapphirerapids ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=sapphirerapids ++endif ++ ++ifdef CONFIG_MROCKETLAKE ++ KBUILD_CFLAGS += -march=rocketlake ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=rocketlake ++endif ++ ++ifdef CONFIG_MALDERLAKE ++ KBUILD_CFLAGS += -march=alderlake ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=alderlake ++endif ++ ++ifdef CONFIG_MRAPTORLAKE ++ KBUILD_CFLAGS += -march=raptorlake ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=raptorlake ++endif ++ ++ifdef CONFIG_MMETEORLAKE ++ KBUILD_CFLAGS += -march=meteorlake ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=meteorlake ++endif ++ ++ifdef CONFIG_MEMERALDRAPIDS ++ KBUILD_CFLAGS += -march=emeraldrapids ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=emeraldrapids ++endif ++ ++ifdef CONFIG_MDIAMONDRAPIDS ++ KBUILD_CFLAGS += -march=diamondrapids ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=diamondrapids ++endif ++ ++ifdef CONFIG_GENERIC_CPU ++ifeq ($(CONFIG_X86_64_VERSION),1) + KBUILD_CFLAGS += -march=x86-64 -mtune=generic + KBUILD_RUSTFLAGS += -Ctarget-cpu=x86-64 -Ztune-cpu=generic ++else ++ KBUILD_CFLAGS +=-march=x86-64-v$(CONFIG_X86_64_VERSION) ++ KBUILD_RUSTFLAGS += -Ctarget-cpu=x86-64-v$(CONFIG_X86_64_VERSION) ++endif ++endif + endif +- + KBUILD_CFLAGS += -mno-red-zone + KBUILD_CFLAGS += -mcmodel=kernel + KBUILD_RUSTFLAGS += -Cno-redzone=y