Skip to content

Commit 533b092

Browse files
zeddiirpurdie
authored andcommitted
linux-yocto/6.6: fix AB-INT: QEMU kernel panic: No irq handler for vector
Integrating the following commit(s) to linux-yocto/6.6: 1/2 [ Author: Thomas Gleixner Email: tglx@linutronix.de Subject: x86/alternatives: Sync core before enabling interrupts Date: Thu, 7 Dec 2023 20:49:24 +0100 text_poke_early() does: local_irq_save(flags); memcpy(addr, opcode, len); local_irq_restore(flags); sync_core(); That's not really correct because the synchronization should happen before interrupts are reenabled to ensure that a pending interrupt observes the complete update of the opcodes. It's not entirely clear whether the interrupt entry provides enough serialization already, but moving the sync_core() invocation into interrupt disabled region does no harm and is obviously correct. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> ] 2/2 [ Author: Thomas Gleixner Email: tglx@linutronix.de Subject: x86/alternatives: Disable interrupts and sync when optimizing NOPs in place Date: Thu, 7 Dec 2023 20:49:26 +0100 apply_alternatives() treats alternatives with the ALT_FLAG_NOT flag set special as it optimizes the existing NOPs in place. Unfortunately this happens with interrupts enabled and does not provide any form of core synchronization. So an interrupt hitting in the middle of the update and using the affected code path will observe a half updated NOP and crash and burn. The following 3 NOP sequence was observed to expose this crash halfways reliably under QEMU 32bit: 0x90 0x90 0x90 which is replaced by the optimized 3 byte NOP: 0x8d 0x76 0x00 So an interrupt can observe: 1) 0x90 0x90 0x90 nop nop nop 2) 0x8d 0x90 0x90 undefined 3) 0x8d 0x76 0x90 lea -0x70(%esi),%esi 4) 0x8d 0x76 0x00 lea 0x0(%esi),%esi Where only #1 and #4 are true NOPs. The same problem exists for 64bit obviously. Disable interrupts around this NOP optimization and invoke sync_core() before reenabling them. Fixes: 270a69c4485d ("x86/alternative: Support relocations in alternatives") Reported-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: stable@vger.kernel.org Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> ] Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
1 parent 88aa039 commit 533b092

3 files changed

Lines changed: 13 additions & 13 deletions

File tree

meta/recipes-kernel/linux/linux-yocto-rt_6.6.bb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ python () {
1414
raise bb.parse.SkipRecipe("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it")
1515
}
1616

17-
SRCREV_machine ?= "bce0cb6bbe24682d839c3e212270e3744e32aabe"
17+
SRCREV_machine ?= "3364e561d527a5dcca1803dcf5a7e2a7aa3a398e"
1818
SRCREV_meta ?= "8ab17895c185426442d80a60829619270f9ac51d"
1919

2020
SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;branch=${KBRANCH};name=machine;protocol=https \

meta/recipes-kernel/linux/linux-yocto-tiny_6.6.bb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ DEPENDS += "openssl-native util-linux-native"
1717
KMETA = "kernel-meta"
1818
KCONF_BSP_AUDIT_LEVEL = "2"
1919

20-
SRCREV_machine ?= "09118b4441395fadf233eec03e2b68e7d6d63cdd"
20+
SRCREV_machine ?= "58e5c91d6701f62e0f72b1f10c2e9f14b2eb4480"
2121
SRCREV_meta ?= "8ab17895c185426442d80a60829619270f9ac51d"
2222

2323
PV = "${LINUX_VERSION}+git"

meta/recipes-kernel/linux/linux-yocto_6.6.bb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ KBRANCH:qemux86-64 ?= "v6.6/standard/base"
1818
KBRANCH:qemuloongarch64 ?= "v6.6/standard/base"
1919
KBRANCH:qemumips64 ?= "v6.6/standard/mti-malta64"
2020

21-
SRCREV_machine:qemuarm ?= "8a23d09163eedc42ed63f2741ae2fa7d8aa926aa"
22-
SRCREV_machine:qemuarm64 ?= "09118b4441395fadf233eec03e2b68e7d6d63cdd"
23-
SRCREV_machine:qemuloongarch64 ?= "09118b4441395fadf233eec03e2b68e7d6d63cdd"
24-
SRCREV_machine:qemumips ?= "a0a00df5c1cd3cdd346f410f71998a120e284f78"
25-
SRCREV_machine:qemuppc ?= "09118b4441395fadf233eec03e2b68e7d6d63cdd"
26-
SRCREV_machine:qemuriscv64 ?= "09118b4441395fadf233eec03e2b68e7d6d63cdd"
27-
SRCREV_machine:qemuriscv32 ?= "09118b4441395fadf233eec03e2b68e7d6d63cdd"
28-
SRCREV_machine:qemux86 ?= "09118b4441395fadf233eec03e2b68e7d6d63cdd"
29-
SRCREV_machine:qemux86-64 ?= "09118b4441395fadf233eec03e2b68e7d6d63cdd"
30-
SRCREV_machine:qemumips64 ?= "971214747a173452ae3ab4c6dcf1d91451b6e9be"
31-
SRCREV_machine ?= "09118b4441395fadf233eec03e2b68e7d6d63cdd"
21+
SRCREV_machine:qemuarm ?= "ff8331e10427c145659bf6a5f87b9109011159cf"
22+
SRCREV_machine:qemuarm64 ?= "58e5c91d6701f62e0f72b1f10c2e9f14b2eb4480"
23+
SRCREV_machine:qemuloongarch64 ?= "58e5c91d6701f62e0f72b1f10c2e9f14b2eb4480"
24+
SRCREV_machine:qemumips ?= "afa3730deded0bc56f1470b59f65d86f20dfb256"
25+
SRCREV_machine:qemuppc ?= "58e5c91d6701f62e0f72b1f10c2e9f14b2eb4480"
26+
SRCREV_machine:qemuriscv64 ?= "58e5c91d6701f62e0f72b1f10c2e9f14b2eb4480"
27+
SRCREV_machine:qemuriscv32 ?= "58e5c91d6701f62e0f72b1f10c2e9f14b2eb4480"
28+
SRCREV_machine:qemux86 ?= "58e5c91d6701f62e0f72b1f10c2e9f14b2eb4480"
29+
SRCREV_machine:qemux86-64 ?= "58e5c91d6701f62e0f72b1f10c2e9f14b2eb4480"
30+
SRCREV_machine:qemumips64 ?= "a93ff794461d9ba7ec5b02d482b60d9ca582e97f"
31+
SRCREV_machine ?= "58e5c91d6701f62e0f72b1f10c2e9f14b2eb4480"
3232
SRCREV_meta ?= "8ab17895c185426442d80a60829619270f9ac51d"
3333

3434
# set your preferred provider of linux-yocto to 'linux-yocto-upstream', and you'll

0 commit comments

Comments
 (0)