Skip to contentSkip to conversation

powerpc/64s: Use relon prolog for EXC_VIRT_OOL_MASKABLE_HV handlers

PATCH Applied Nicholas Piggin 3 participants 4 messages Apr 13, 2017 – Apr 21, 2017 PowerPC

lore
Share & tools
lore

Nicholas Piggin

author reviewer
#0 lore raw

PATCH 1/1 powerpc/64s: Use relon prolog for EXC_VIRT_OOL_MASKABLE_HV handlers

Hypervisor Virtualization and Directed Hypervisor Doorbell interrupt handlers use the macro EXC_VIRT_OOL_MASKABLE_HV for their relocation-on handlers, which calls MASKABLE_RELON_EXCEPTION_HV_OOL, which uses the real mode interrupt prolog.

Use the RELON variant instead to reduce overhead.

Fixes 1707dd1613 ("powerpc: Save CFAR before branching in interrupt entry paths")
Cc Paul Mackerras <[email protected]>

---

I was hesitant about using the Fixes: tag on this one because it's not a correctness bug as far as I can see.

Thanks,
Nick

 arch/powerpc/include/asm/exception-64s.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/include/asm/exception-64s.h +1 -1
index 14752eee3d0c..b89c91e27dd0 100644
@@ -522,7 +522,7 @@ END_FTR_SECTION_NESTED(ftr,ftr,943)
 
 #define MASKABLE_RELON_EXCEPTION_HV_OOL(vec, label)			\
 	EXCEPTION_PROLOG_1(PACA_EXGEN, SOFTEN_TEST_HV, vec);		\
-	EXCEPTION_PROLOG_PSERIES_1(label, EXC_HV)
+	EXCEPTION_RELON_PROLOG_PSERIES_1(label, EXC_HV)
 
 /*
  * Our exception common code can be passed various "additions"
Signature · 1 line
2.11.0
#1 lore raw
Quoted 7 lines · Nicholas Piggin

Hypervisor Virtualization and Directed Hypervisor Doorbell interrupt handlers use the macro EXC_VIRT_OOL_MASKABLE_HV for their relocation-on handlers, which calls MASKABLE_RELON_EXCEPTION_HV_OOL, which uses the real mode interrupt prolog.

Use the RELON variant instead to reduce overhead.

Quoted 7 lines
Fixes 1707dd1613 ("powerpc: Save CFAR before branching in interrupt entry paths")
Cc Paul Mackerras <[email protected]>

---

I was hesitant about using the Fixes: tag on this one because it's not a correctness bug as far as I can see.

Fixes can just mean "if you have this other commit you'll most likely want this one too".

You can clarify the degree of Fixness in the change log, which then allows a backporter to decide if they want it or not.

In this case I think it's entirely right, this is a fairly unfortunate bug from a performance point of view if I'm reading it right.

cheers

Quoted 15 lines
arch/powerpc/include/asm/exception-64s.h +1 -1
index 14752eee3d0c..b89c91e27dd0 100644
@@ -522,7 +522,7 @@ END_FTR_SECTION_NESTED(ftr,ftr,943)
 
 #define MASKABLE_RELON_EXCEPTION_HV_OOL(vec, label)			\
 	EXCEPTION_PROLOG_1(PACA_EXGEN, SOFTEN_TEST_HV, vec);		\
-	EXCEPTION_PROLOG_PSERIES_1(label, EXC_HV)
+	EXCEPTION_RELON_PROLOG_PSERIES_1(label, EXC_HV)
 
 /*
  * Our exception common code can be passed various "additions"
Signature · 1 line
2.11.0
author reviewer
#2 lore raw
Quoted 17 lines · On Thu, 13 Apr 2017 23:31:23 +1000 Michael Ellerman <[email protected]> wrote:
Quoted 7 lines · Nicholas Piggin

Hypervisor Virtualization and Directed Hypervisor Doorbell interrupt handlers use the macro EXC_VIRT_OOL_MASKABLE_HV for their relocation-on handlers, which calls MASKABLE_RELON_EXCEPTION_HV_OOL, which uses the real mode interrupt prolog.

Use the RELON variant instead to reduce overhead.

Quoted 7 lines
Fixes 1707dd1613 ("powerpc: Save CFAR before branching in interrupt entry paths")
Cc Paul Mackerras <[email protected]>

---

I was hesitant about using the Fixes: tag on this one because it's not a correctness bug as far as I can see.

Quoted 8 lines

Fixes can just mean "if you have this other commit you'll most likely want this one too".

You can clarify the degree of Fixness in the change log, which then allows a backporter to decide if they want it or not.

In this case I think it's entirely right, this is a fairly unfortunate bug from a performance point of view if I'm reading it right.

Okay, makes sense. For POWER8 it only affects doorbell IPIs. Context switch microbenchmark between threads with snooze disabled (which causes IPI) gets about 3% faster, about 370 cycles. Should be more important on POWER9 with global doorbells and HVI for host interrupts.

Thanks,
Nick

#3 lore raw
In reply to Nicholas Piggin
Quoted 10 lines · Nicholas Piggin

Hypervisor Virtualization and Directed Hypervisor Doorbell interrupt handlers use the macro EXC_VIRT_OOL_MASKABLE_HV for their relocation-on handlers, which calls MASKABLE_RELON_EXCEPTION_HV_OOL, which uses the real mode interrupt prolog.

Use the RELON variant instead to reduce overhead.

Fixes 1707dd1613 ("powerpc: Save CFAR before branching in interrupt entry paths")
Cc Paul Mackerras <[email protected]>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/a050d20d024dc3e1b988e715e2d811

cheers