Skip to content

Commit ca37cec

Browse files
Alexandru Eliseigregkh
Alexandru Elisei
authored andcommitted
KVM: arm64: Annotate hyp NMI-related functions as __always_inline
commit 7733306 upstream. The "inline" keyword is a hint for the compiler to inline a function. The functions system_uses_irq_prio_masking() and gic_write_pmr() are used by the code running at EL2 on a non-VHE system, so mark them as __always_inline to make sure they'll always be part of the .hyp.text section. This fixes the following splat when trying to run a VM: [ 47.625273] Kernel panic - not syncing: HYP panic: [ 47.625273] PS:a00003c9 PC:0000ca0b42049fc4 ESR:86000006 [ 47.625273] FAR:0000ca0b42049fc4 HPFAR:0000000010001000 PAR:0000000000000000 [ 47.625273] VCPU:0000000000000000 [ 47.647261] CPU: 1 PID: 217 Comm: kvm-vcpu-0 Not tainted 5.8.0-rc1-ARCH+ #61 [ 47.654508] Hardware name: Globalscale Marvell ESPRESSOBin Board (DT) [ 47.661139] Call trace: [ 47.663659] dump_backtrace+0x0/0x1cc [ 47.667413] show_stack+0x18/0x24 [ 47.670822] dump_stack+0xb8/0x108 [ 47.674312] panic+0x124/0x2f4 [ 47.677446] panic+0x0/0x2f4 [ 47.680407] SMP: stopping secondary CPUs [ 47.684439] Kernel Offset: disabled [ 47.688018] CPU features: 0x240402,20002008 [ 47.692318] Memory Limit: none [ 47.695465] ---[ end Kernel panic - not syncing: HYP panic: [ 47.695465] PS:a00003c9 PC:0000ca0b42049fc4 ESR:86000006 [ 47.695465] FAR:0000ca0b42049fc4 HPFAR:0000000010001000 PAR:0000000000000000 [ 47.695465] VCPU:0000000000000000 ]--- The instruction abort was caused by the code running at EL2 trying to fetch an instruction which wasn't mapped in the EL2 translation tables. Using objdump showed the two functions as separate symbols in the .text section. Fixes: 85738e0 ("arm64: kvm: Unmask PMR before entering guest") Cc: [email protected] Signed-off-by: Alexandru Elisei <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Acked-by: James Morse <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 1166404 commit ca37cec

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

arch/arm64/include/asm/arch_gicv3.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static inline u32 gic_read_pmr(void)
109109
return read_sysreg_s(SYS_ICC_PMR_EL1);
110110
}
111111

112-
static inline void gic_write_pmr(u32 val)
112+
static __always_inline void gic_write_pmr(u32 val)
113113
{
114114
write_sysreg_s(val, SYS_ICC_PMR_EL1);
115115
}

arch/arm64/include/asm/cpufeature.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ static inline bool system_supports_generic_auth(void)
668668
cpus_have_const_cap(ARM64_HAS_GENERIC_AUTH);
669669
}
670670

671-
static inline bool system_uses_irq_prio_masking(void)
671+
static __always_inline bool system_uses_irq_prio_masking(void)
672672
{
673673
return IS_ENABLED(CONFIG_ARM64_PSEUDO_NMI) &&
674674
cpus_have_const_cap(ARM64_HAS_IRQ_PRIO_MASKING);

0 commit comments

Comments
 (0)