From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id F21ED1382C5 for ; Wed, 28 Apr 2021 20:07:37 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8A18BE08F0; Wed, 28 Apr 2021 20:07:36 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 601E2E08EF for ; Wed, 28 Apr 2021 20:07:36 +0000 (UTC) From: mpagano@gentoo.org To: gentoo-kernel@lists.gentoo.org Cc: Mike Pagano Subject: [gentoo-kernel] [PATCH] Transitional changes to the kernel-2 eclass to support future CPU OPT Date: Wed, 28 Apr 2021 16:07:16 -0400 Message-Id: <20210428200716.510449-1-mpagano@gentoo.org> X-Mailer: git-send-email 2.26.3 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-kernel@lists.gentoo.org Reply-to: gentoo-kernel@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: 2648451a-050b-4b91-80f9-eea4daaf1ab4 X-Archives-Hash: fedec7012f3c76f5fc66f56f1f249fe7 From: Mike Pagano The CPU OPT patch now contains gcc ver checks within the patch itself. This transitional change is to start support just that patch while trying not to break the older versions. The target state will *only* need the gcc version check. We should be able to slowly remove the legacy code as we stabilize kernels and remove old ones from the tree. --- eclass/kernel-2.eclass | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass index 67ad4acc1..f676e8421 100644 --- a/eclass/kernel-2.eclass +++ b/eclass/kernel-2.eclass @@ -1241,8 +1241,32 @@ unipatch() { local GCC_MAJOR_VER=$(gcc-major-version) local GCC_MINOR_VER=$(gcc-minor-version) - # optimization patch for gcc < 8.X and kernel > 4.13 - if kernel_is ge 4 13 ; then + # this section should be the target state to handle the cpu opt + # patch for kernels > 4.19.189, 5.4.115, 5.10.33 and 5.11.17, + # 5.12.0 and gcc >= 9 The patch now handles the + # gcc version enabled on the system through the Kconfig file as + # 'depends'. The legacy section can hopefully be retired in the future + # Note the patch for 4.19-5.8 version are the same and the path for + # 5.8+ version is the same + # eventually we can remove everything except the gcc ver <9 check + # based on stablization, time, kernel removals or a combo of all three + if ((kernel_is eq 4 19 && kernel_is gt 4 19 189) || + (kernel_is eq 5 4 && kernel_is gt 5 4 115) || + (kernel_is eq 5 10 && kernel_is gt 5 10 33) || + (kernel_is eq 5 11 && kernel_is gt 5 11 17) || + (kernel_is eq 5 12 && kernel_is gt 5 12 0)); then + UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc.patch" + UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch" + UNIPATCH_DROP+=" 5011_enable-cpu-optimizations-for-gcc8.patch" + UNIPATCH_DROP+=" 5012_enable-cpu-optimizations-for-gcc91.patch" + UNIPATCH_DROP+=" 5013_enable-cpu-optimizations-for-gcc10.patch" + if [[ ${GCC_MAJOR_VER} -lt 9 ]]; then + UNIPATCH_DROP+=" 5010_enable-cpu-optimizations-universal.patch" + fi + # this legacy section should be targeted for removal + # optimization patch for gcc < 8.X and kernel > 4.13 and < 4.19 + elif kernel_is ge 4 13; then + UNIPATCH_DROP+=" 5010_enable-cpu-optimizations-universal.patch" if [[ ${GCC_MAJOR_VER} -lt 8 ]] && [[ ${GCC_MAJOR_VER} -gt 4 ]]; then UNIPATCH_DROP+=" 5011_enable-cpu-optimizations-for-gcc8.patch" UNIPATCH_DROP+=" 5012_enable-cpu-optimizations-for-gcc91.patch" @@ -1272,6 +1296,7 @@ unipatch() { UNIPATCH_DROP+=" 5013_enable-cpu-optimizations-for-gcc10.patch" fi else + UNIPATCH_DROP+=" 5010_enable-cpu-optimizations-universal.patch" UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc.patch" UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch" UNIPATCH_DROP+=" 5011_enable-cpu-optimizations-for-gcc8.patch" -- 2.26.3