Skip to content

[26.04_linux-nvidia-bos] Vera: Backporting removal of extra ISBs when using msr_hcr_el2 - #534

Closed
esot0 wants to merge 1 commit into
NVIDIA:26.04_linux-nvidia-bosfrom
esot0:26.04_linux-nvidia-bos-isb
Closed

[26.04_linux-nvidia-bos] Vera: Backporting removal of extra ISBs when using msr_hcr_el2#534
esot0 wants to merge 1 commit into
NVIDIA:26.04_linux-nvidia-bosfrom
esot0:26.04_linux-nvidia-bos-isb

Conversation

@esot0

@esot0 esot0 commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Backport of 54a3cc145456272b10c1452fe89e1dcf933d5c39, which removes redundant ISBs after msr_hcr_el2, so HCR_EL2 writes do one barrier instead of two and run a bit faster. Verified that patch is present in kernel using check-hcr-isb.sh.

Script output:

image   : /boot/vmlinuz-7.0.12-isb-patch+
symbols : /boot/System.map-7.0.12-isb-patch+
erratum : CONFIG_AMPERE_ERRATUM_AC04_CPU_23=y
note    : commit landed in v7.1-rc1; no Cc: stable, so no -stable backport

zstd: /*stdin*\: unsupported format 
image format: compressed Image  (72548352 bytes flat)
_text       : 0xffff800080000000

=== sites generated by the msr_hcr_el2 assembly macro (what the patch touches) ===
vaddr              symbol                                     prev      instr            next      next+1      pattern
--------------------------------------------------------------------------------------------------------------------------------------
0xffff800081ad0be0 __kvm_nvhe____kvm_hyp_init+0x18            dsb nsh   msr hcr_el2,x1   isb       0xd2c00082  single-isb
0xffff800081ad0cd0 __kvm_nvhe___kvm_hyp_init_cpu+0x40         dsb nsh   msr hcr_el2,x0   isb       0xd2800021  single-isb
0xffff800081ad0d04 __kvm_nvhe___kvm_hyp_init_cpu+0x74         dsb nsh   msr hcr_el2,x0   isb       0x97fffead  single-isb
0xffff800081ad1ad8 __finalise_el2+0x278                       dsb nsh   msr hcr_el2,x0   isb       0xd53c4100  single-isb
0xffff800082e7d1a4 init_el2+0x58                              dsb nsh   msr hcr_el2,x0   isb       0xd2800021  single-isb
0xffff800082e7d1d8 init_el2+0x8c                              dsb nsh   msr hcr_el2,x0   isb       0xd2a00000  single-isb

=== other HCR_EL2 writes: C write_sysreg_hcr(), NOT touched by this patch ===
38 sites (5 of them double-isb) -- expected noise, ignore for the verdict

======================================================================================================================================
CONFIG_AMPERE_ERRATUM_AC04_CPU_23=y -> signature is the double ISB
RESULT: commit 54a3cc145456 IS PRESENT (0/6 macro sites have back-to-back ISBs)
======================================================================================================================================

Launchpad: https://bugs.launchpad.net/ubuntu/+source/linux-nvidia-bos/+bug/2163052

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

PR Validation Report

Patchscan ✅ No Missing Fixes

All cherry-picked commits checked — no missing upstream fixes found.

PR Lint ✅ All checks passed

Details
Checking 1 commits...

Cherry-pick digest:
┌──────────────┬──────────────────────────────────────────────────────────────────┬────────────┬─────────┬───────────────────────────┐
│ Local        │ Referenced upstream / Patch subject                              │ Patch-ID   │ Subject │ SoB chain                 │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 281813fa9655 │ 54a3cc145456 KVM: arm64: Remove extra ISBs when using msr_hcr_el │ match      │ match   │ preserved + emilys added  │
└──────────────┴──────────────────────────────────────────────────────────────────┴────────────┴─────────┴───────────────────────────┘

Lint: all checks passed.

@clsotog

clsotog commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Acked-by: Carol L Soto <csoto@nvidia.com>

The msr_hcr_el2 macro is slightly awkward, as it provides an ISB
when CONFIG_AMPERE_ERRATUM_AC04_CPU_23 is present, and none
otherwise. Note that this this option is 'default y', meaning that
it is likely to be selected.

Most instances of msr_hcr_el2 are also immediately followed by an ISB,
meaning that in most cases, you end-up with two back-to-back ISBs.
This isn't a big deal, but once you have seen that, you can't unsee it.

Rework the msr_hcr_el2 macro to always provide the ISB, and drop
the superfluous ISBs everywhere else.

Reviewed-by: Fuad Tabba <tabba@google.com>
Tested-by: Fuad Tabba <tabba@google.com>
Link: https://patch.msgid.link/20260321212419.2803972-6-maz@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
(cherry picked from commit 54a3cc1)
Signed-off-by: Emily Soto <emilys@nvidia.com>
@esot0
esot0 force-pushed the 26.04_linux-nvidia-bos-isb branch from 64ea834 to 281813f Compare August 7, 2026 16:31
@nvmochs

nvmochs commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

LGTM!

Acked-by: Matthew R. Ochs <mochs@nvidia.com>

@jamieNguyenNVIDIA

Copy link
Copy Markdown
Collaborator

Acked-by: Jamie Nguyen <jamien@nvidia.com>

@nirmoy nirmoy added has_2_acks and removed help wanted Extra attention is needed has_1_ack labels Aug 7, 2026
@nvmochs

nvmochs commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Merged, closing PR.

445f64f0252c (nresolute/nvidia-bos-next) KVM: arm64: Remove extra ISBs when using msr_hcr_el2

@nvmochs nvmochs closed this Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants