Skip to content

Commit 7ede531

Browse files
npigginmpe
authored andcommitted
KVM: PPC: Book3S: Move 64-bit KVM interrupt handler out from alt section
A subsequent patch to make KVM handlers relocation-safe makes them unusable from within alt section "else" cases (due to the way fixed addresses are taken from within fixed section head code). Stop open-coding the KVM handlers, and add them both as normal. A more optimal fix may be to allow some level of alternate feature patching in the exception macros themselves, but for now this will do. The TRAMP_KVM handlers must be moved to the "virt" fixed section area (name is arbitrary) in order to be closer to .text and avoid the dreaded "relocation truncated to fit" error. Signed-off-by: Nicholas Piggin <[email protected]> Acked-by: Paul Mackerras <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent d3918e7 commit 7ede531

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

arch/powerpc/include/asm/head-64.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ end_##sname:
218218

219219
#ifdef CONFIG_KVM_BOOK3S_64_HANDLER
220220
#define TRAMP_KVM_BEGIN(name) \
221-
TRAMP_REAL_BEGIN(name)
221+
TRAMP_VIRT_BEGIN(name)
222222
#else
223223
#define TRAMP_KVM_BEGIN(name)
224224
#endif

arch/powerpc/kernel/exceptions-64s.S

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -717,13 +717,9 @@ hardware_interrupt_hv:
717717
BEGIN_FTR_SECTION
718718
_MASKABLE_EXCEPTION_PSERIES(0x500, hardware_interrupt_common,
719719
EXC_HV, SOFTEN_TEST_HV)
720-
do_kvm_H0x500:
721-
KVM_HANDLER(PACA_EXGEN, EXC_HV, 0x502)
722720
FTR_SECTION_ELSE
723721
_MASKABLE_EXCEPTION_PSERIES(0x500, hardware_interrupt_common,
724722
EXC_STD, SOFTEN_TEST_PR)
725-
do_kvm_0x500:
726-
KVM_HANDLER(PACA_EXGEN, EXC_STD, 0x500)
727723
ALT_FTR_SECTION_END_IFSET(CPU_FTR_HVMODE | CPU_FTR_ARCH_206)
728724
EXC_REAL_END(hardware_interrupt, 0x500, 0x600)
729725

@@ -737,6 +733,8 @@ hardware_interrupt_relon_hv:
737733
ALT_FTR_SECTION_END_IFSET(CPU_FTR_HVMODE)
738734
EXC_VIRT_END(hardware_interrupt, 0x4500, 0x4600)
739735

736+
TRAMP_KVM(PACA_EXGEN, 0x500)
737+
TRAMP_KVM_HV(PACA_EXGEN, 0x500)
740738
EXC_COMMON_ASYNC(hardware_interrupt_common, 0x500, do_IRQ)
741739

742740

0 commit comments

Comments
 (0)