From: Stephen Rothwell <sfr@canb•auug.org.au>
To: Catalin Marinas <catalin.marinas@arm•com>,
Will Deacon <will@kernel•org>,
Paolo Bonzini <pbonzini@redhat•com>
Cc: Christoffer Dall <cdall@cs•columbia.edu>,
Marc Zyngier <maz@kernel•org>,
Douglas Anderson <dianders@chromium•org>,
Linux Kernel Mailing List <linux-kernel@vger•kernel.org>,
Linux Next Mailing List <linux-next@vger•kernel.org>,
Oliver Upton <oliver.upton@linux•dev>,
Shameer Kolothum <shameerali.kolothum.thodi@huawei•com>,
KVM <kvm@vger•kernel.org>
Subject: Re: linux-next: manual merge of the kvm-arm tree with the arm64 tree
Date: Fri, 21 Mar 2025 15:29:55 +1100 [thread overview]
Message-ID: <20250321152955.18426a1d@canb.auug.org.au> (raw)
In-Reply-To: <20250317171701.71c8677a@canb.auug.org.au>
[-- Attachment #1: Type: text/plain, Size: 6206 bytes --]
Hi all,
On Mon, 17 Mar 2025 17:17:01 +1100 Stephen Rothwell <sfr@canb•auug.org.au> wrote:
>
> Today's linux-next merge of the kvm-arm tree got a conflict in:
>
> arch/arm64/kernel/proton-pack.c
>
> between commits:
>
> e403e8538359 ("arm64: errata: Assume that unknown CPUs _are_ vulnerable to Spectre BHB")
> a5951389e58d ("arm64: errata: Add newer ARM cores to the spectre_bhb_loop_affected() lists")
>
> from the arm64 tree and commit:
>
> e3121298c7fc ("arm64: Modify _midr_range() functions to read MIDR/REVIDR internally")
>
> from the kvm-arm tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging. You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
>
>
> diff --cc arch/arm64/kernel/proton-pack.c
> index 0f51fd10b4b0,a573fa40d4b6..000000000000
> --- a/arch/arm64/kernel/proton-pack.c
> +++ b/arch/arm64/kernel/proton-pack.c
> @@@ -845,86 -845,52 +845,86 @@@ static unsigned long system_bhb_mitigat
> * This must be called with SCOPE_LOCAL_CPU for each type of CPU, before any
> * SCOPE_SYSTEM call will give the right answer.
> */
> -u8 spectre_bhb_loop_affected(int scope)
> +static bool is_spectre_bhb_safe(int scope)
> +{
> + static const struct midr_range spectre_bhb_safe_list[] = {
> + MIDR_ALL_VERSIONS(MIDR_CORTEX_A35),
> + MIDR_ALL_VERSIONS(MIDR_CORTEX_A53),
> + MIDR_ALL_VERSIONS(MIDR_CORTEX_A55),
> + MIDR_ALL_VERSIONS(MIDR_CORTEX_A510),
> + MIDR_ALL_VERSIONS(MIDR_CORTEX_A520),
> + MIDR_ALL_VERSIONS(MIDR_BRAHMA_B53),
> + MIDR_ALL_VERSIONS(MIDR_QCOM_KRYO_2XX_SILVER),
> + MIDR_ALL_VERSIONS(MIDR_QCOM_KRYO_3XX_SILVER),
> + MIDR_ALL_VERSIONS(MIDR_QCOM_KRYO_4XX_SILVER),
> + {},
> + };
> + static bool all_safe = true;
> +
> + if (scope != SCOPE_LOCAL_CPU)
> + return all_safe;
> +
> - if (is_midr_in_range_list(read_cpuid_id(), spectre_bhb_safe_list))
> ++ if (is_midr_in_range_list(spectre_bhb_safe_list))
> + return true;
> +
> + all_safe = false;
> +
> + return false;
> +}
> +
> +static u8 spectre_bhb_loop_affected(void)
> {
> u8 k = 0;
> - static u8 max_bhb_k;
>
> - if (scope == SCOPE_LOCAL_CPU) {
> - static const struct midr_range spectre_bhb_k32_list[] = {
> - MIDR_ALL_VERSIONS(MIDR_CORTEX_A78),
> - MIDR_ALL_VERSIONS(MIDR_CORTEX_A78AE),
> - MIDR_ALL_VERSIONS(MIDR_CORTEX_A78C),
> - MIDR_ALL_VERSIONS(MIDR_CORTEX_X1),
> - MIDR_ALL_VERSIONS(MIDR_CORTEX_A710),
> - MIDR_ALL_VERSIONS(MIDR_CORTEX_X2),
> - MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N2),
> - MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V1),
> - {},
> - };
> - static const struct midr_range spectre_bhb_k24_list[] = {
> - MIDR_ALL_VERSIONS(MIDR_CORTEX_A76),
> - MIDR_ALL_VERSIONS(MIDR_CORTEX_A77),
> - MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N1),
> - {},
> - };
> - static const struct midr_range spectre_bhb_k11_list[] = {
> - MIDR_ALL_VERSIONS(MIDR_AMPERE1),
> - {},
> - };
> - static const struct midr_range spectre_bhb_k8_list[] = {
> - MIDR_ALL_VERSIONS(MIDR_CORTEX_A72),
> - MIDR_ALL_VERSIONS(MIDR_CORTEX_A57),
> - {},
> - };
> + static const struct midr_range spectre_bhb_k132_list[] = {
> + MIDR_ALL_VERSIONS(MIDR_CORTEX_X3),
> + MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V2),
> + };
> + static const struct midr_range spectre_bhb_k38_list[] = {
> + MIDR_ALL_VERSIONS(MIDR_CORTEX_A715),
> + MIDR_ALL_VERSIONS(MIDR_CORTEX_A720),
> + };
> + static const struct midr_range spectre_bhb_k32_list[] = {
> + MIDR_ALL_VERSIONS(MIDR_CORTEX_A78),
> + MIDR_ALL_VERSIONS(MIDR_CORTEX_A78AE),
> + MIDR_ALL_VERSIONS(MIDR_CORTEX_A78C),
> + MIDR_ALL_VERSIONS(MIDR_CORTEX_X1),
> + MIDR_ALL_VERSIONS(MIDR_CORTEX_A710),
> + MIDR_ALL_VERSIONS(MIDR_CORTEX_X2),
> + MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N2),
> + MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V1),
> + {},
> + };
> + static const struct midr_range spectre_bhb_k24_list[] = {
> + MIDR_ALL_VERSIONS(MIDR_CORTEX_A76),
> + MIDR_ALL_VERSIONS(MIDR_CORTEX_A76AE),
> + MIDR_ALL_VERSIONS(MIDR_CORTEX_A77),
> + MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N1),
> + MIDR_ALL_VERSIONS(MIDR_QCOM_KRYO_4XX_GOLD),
> + {},
> + };
> + static const struct midr_range spectre_bhb_k11_list[] = {
> + MIDR_ALL_VERSIONS(MIDR_AMPERE1),
> + {},
> + };
> + static const struct midr_range spectre_bhb_k8_list[] = {
> + MIDR_ALL_VERSIONS(MIDR_CORTEX_A72),
> + MIDR_ALL_VERSIONS(MIDR_CORTEX_A57),
> + {},
> + };
>
> - if (is_midr_in_range_list(read_cpuid_id(), spectre_bhb_k132_list))
> - if (is_midr_in_range_list(spectre_bhb_k32_list))
> - k = 32;
> - else if (is_midr_in_range_list(spectre_bhb_k24_list))
> - k = 24;
> - else if (is_midr_in_range_list(spectre_bhb_k11_list))
> - k = 11;
> - else if (is_midr_in_range_list(spectre_bhb_k8_list))
> - k = 8;
> -
> - max_bhb_k = max(max_bhb_k, k);
> - } else {
> - k = max_bhb_k;
> - }
> ++ if (is_midr_in_range_list(spectre_bhb_k132_list))
> + k = 132;
> - else if (is_midr_in_range_list(read_cpuid_id(), spectre_bhb_k38_list))
> ++ else if (is_midr_in_range_list(spectre_bhb_k38_list))
> + k = 38;
> - else if (is_midr_in_range_list(read_cpuid_id(), spectre_bhb_k32_list))
> ++ else if (is_midr_in_range_list(spectre_bhb_k32_list))
> + k = 32;
> - else if (is_midr_in_range_list(read_cpuid_id(), spectre_bhb_k24_list))
> ++ else if (is_midr_in_range_list(spectre_bhb_k24_list))
> + k = 24;
> - else if (is_midr_in_range_list(read_cpuid_id(), spectre_bhb_k11_list))
> ++ else if (is_midr_in_range_list(spectre_bhb_k11_list))
> + k = 11;
> - else if (is_midr_in_range_list(read_cpuid_id(), spectre_bhb_k8_list))
> ++ else if (is_midr_in_range_list(spectre_bhb_k8_list))
> + k = 8;
>
> return k;
> }
This is now a conflict between the kvm tree and the arm64 tree.
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2025-03-21 4:29 UTC|newest]
Thread overview: 96+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-17 6:17 linux-next: manual merge of the kvm-arm tree with the arm64 tree Stephen Rothwell
2025-03-21 4:29 ` Stephen Rothwell [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-03-17 6:21 Stephen Rothwell
2025-03-17 11:08 ` Marc Zyngier
2025-03-17 14:22 ` Will Deacon
2025-03-17 6:04 Stephen Rothwell
2025-01-06 3:53 Stephen Rothwell
2025-01-06 9:40 ` Marc Zyngier
2024-10-31 3:35 Stephen Rothwell
2024-11-15 4:05 ` Stephen Rothwell
2024-09-05 6:08 Stephen Rothwell
2024-09-05 8:15 ` Marc Zyngier
2024-09-16 6:47 ` Stephen Rothwell
2024-03-08 1:54 Stephen Rothwell
2024-03-08 6:25 ` Oliver Upton
2024-03-08 12:30 ` Catalin Marinas
2024-03-08 1:47 Stephen Rothwell
2024-02-20 2:21 Stephen Rothwell
2024-02-19 2:58 Stephen Rothwell
2024-02-19 12:14 ` Catalin Marinas
2024-02-19 15:22 ` Marc Zyngier
2024-02-19 15:35 ` Mark Rutland
2024-02-19 15:43 ` Ard Biesheuvel
2024-02-19 16:49 ` Catalin Marinas
2023-10-24 2:28 Stephen Rothwell
2023-10-24 6:49 ` Oliver Upton
2023-10-17 1:30 Stephen Rothwell
2023-10-17 11:13 ` Catalin Marinas
2023-10-18 23:02 ` Oliver Upton
2023-11-01 2:36 ` Stephen Rothwell
2023-06-15 2:45 Stephen Rothwell
2023-06-15 7:37 ` Oliver Upton
2023-06-15 8:32 ` Catalin Marinas
2023-06-15 2:22 Stephen Rothwell
2023-06-15 7:14 ` Catalin Marinas
2023-07-03 0:50 ` Stephen Rothwell
2023-06-06 1:49 Stephen Rothwell
2023-06-06 9:20 ` Catalin Marinas
2023-06-07 1:05 ` Stephen Rothwell
2023-06-07 5:33 ` Oliver Upton
2023-06-07 8:45 ` Catalin Marinas
2023-02-06 1:44 Stephen Rothwell
2023-02-06 4:21 ` Stephen Rothwell
2023-02-06 8:37 ` Marc Zyngier
2023-02-06 8:43 ` Marc Zyngier
2022-09-19 4:05 Stephen Rothwell
2022-09-19 9:04 ` Marc Zyngier
2022-09-23 10:26 ` Catalin Marinas
2022-05-04 4:35 Stephen Rothwell
2022-05-04 7:06 ` Marc Zyngier
2022-05-04 8:08 ` Catalin Marinas
2022-05-23 6:36 ` Stephen Rothwell
2021-08-19 4:05 Stephen Rothwell
2021-08-20 9:27 ` Catalin Marinas
2021-08-12 3:33 Stephen Rothwell
2021-06-23 5:58 Stephen Rothwell
2021-04-13 5:43 Stephen Rothwell
2021-04-13 11:21 ` Ard Biesheuvel
2021-01-27 5:24 Stephen Rothwell
2020-12-04 5:44 Stephen Rothwell
2020-12-04 11:12 ` Marc Zyngier
2020-12-04 5:17 Stephen Rothwell
2020-09-30 6:26 Stephen Rothwell
2020-05-29 7:00 Stephen Rothwell
2019-07-08 7:24 Stephen Rothwell
2018-10-04 4:22 Stephen Rothwell
2018-10-04 4:07 Stephen Rothwell
2018-07-23 4:46 Stephen Rothwell
2018-07-23 10:45 ` Marc Zyngier
2018-08-16 0:15 ` Stephen Rothwell
2018-08-17 8:32 ` Paolo Bonzini
2018-08-17 9:33 ` Marc Zyngier
2018-06-01 6:23 Stephen Rothwell
2018-06-01 8:23 ` Marc Zyngier
2018-06-01 6:13 Stephen Rothwell
2018-03-28 5:05 Stephen Rothwell
2018-03-29 5:16 ` Stephen Rothwell
2018-03-28 5:00 Stephen Rothwell
2018-03-28 11:53 ` Will Deacon
2017-08-25 4:57 Stephen Rothwell
2017-08-25 8:11 ` Marc Zyngier
2017-08-25 8:44 ` Christoffer Dall
2016-02-29 5:18 Stephen Rothwell
2016-02-24 2:38 Stephen Rothwell
2016-02-22 2:33 Stephen Rothwell
2016-02-22 9:26 ` Catalin Marinas
2016-02-22 2:28 Stephen Rothwell
2016-02-22 9:24 ` Catalin Marinas
2016-02-12 2:26 Stephen Rothwell
2015-01-22 5:07 Stephen Rothwell
2015-01-22 8:51 ` Marc Zyngier
2015-01-22 10:29 ` Mark Rutland
2015-01-22 23:05 ` Stephen Rothwell
2015-01-23 1:36 ` Wei Huang
2015-01-23 11:53 ` Christoffer Dall
2015-01-22 5:06 Stephen Rothwell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250321152955.18426a1d@canb.auug.org.au \
--to=sfr@canb$(echo .)auug.org.au \
--cc=catalin.marinas@arm$(echo .)com \
--cc=cdall@cs$(echo .)columbia.edu \
--cc=dianders@chromium$(echo .)org \
--cc=kvm@vger$(echo .)kernel.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-next@vger$(echo .)kernel.org \
--cc=maz@kernel$(echo .)org \
--cc=oliver.upton@linux$(echo .)dev \
--cc=pbonzini@redhat$(echo .)com \
--cc=shameerali.kolothum.thodi@huawei$(echo .)com \
--cc=will@kernel$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox