On Mon, 12 Jun 2017 14:25:24 +1000
Benjamin Herrenschmidt wrote:
> On Sun, 2017-06-11 at 19:30 +1000, Nicholas Piggin wrote:
> > I rebased this on the powerpc next tree.
> >
> > A couple of things are changed since last post:
> >
> > - Patch 1 now properly accounts for the
On Sun, 2017-06-11 at 19:30 +1000, Nicholas Piggin wrote:
> I rebased this on the powerpc next tree.
>
> A couple of things are changed since last post:
>
> - Patch 1 now properly accounts for the fact the powernv idle
> wakeups do not re-enable interrupts until the cpuidle driver
> enables
2*mfmsr and 2*mtmsr can be avoided in the idle sleep/wake code
because we know the MSR[EE] is clear.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/platforms/powernv/idle.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git
The CTRL register is read-only except bit 63 which is the run latch
control. This means it can be updated with a mtspr rather than
mfspr/mtspr.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kernel/process.c | 12 ++--
1 file changed, 2 insertions(+), 10 deletions(-)
A memory barrier is not required after the task wakes up,
only if we clear the polling flag before waking. The case
where we have work to do is the important one, so optimise
for it.
Signed-off-by: Nicholas Piggin
---
drivers/cpuidle/cpuidle-powernv.c | 11 +--
Ensure these don't get put into bouncing cachelines.
Signed-off-by: Nicholas Piggin
---
drivers/cpuidle/cpuidle-powernv.c | 10 +-
drivers/cpuidle/cpuidle-pseries.c | 8
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git
local_irq_enable can cause interrupts to be taken which could
take significant amount of processing time. The idle process
should set its polling flag before this, so another process that
wakes it during this time will not have to send an IPI.
Expand the TIF_POLLING_NRFLAG coverage to as large as
In a busy system, idle wakeups can be expected from IPIs and device
interrupts.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/kernel/idle_book3s.S | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/idle_book3s.S
Idle code now always runs at the 0xc... effective address whether
in real or virtual mode. This means rfid can be ditched, along
with a lot of SRR manipulations.
In the wakeup path, carry SRR1 around in r12. Use mtmsrd to change
MSR states as required.
This also balances the return prediction
Have the system reset idle wakeup handlers branched to in real mode
with the 0xc... kernel address applied. This allows simplifications of
avoiding rfid when switching to virtual mode in the wakeup handler.
Signed-off-by: Nicholas Piggin
---
The __replay_interrupt code is branched to with bl, but the caller is
returned to directly with rfid from the interrupt.
Instead return to a return stub that returns to the caller with blr,
which should do better with the return predictor.
Signed-off-by: Nicholas Piggin
---
msgsnd doorbell exceptions are cleared when the doorbell interrupt is
taken. However if a doorbell exception causes a system reset interrupt
wake from power saving state, the message is not cleared. Processing
the doorbell from the system reset interrupt requires msgclr to avoid
taking the
When the CPU wakes from low power state, it begins at the system reset
interrupt with the exception that caused the wakeup encoded in SRR1.
Today, powernv idle wakeup ignores the wakeup reason (except a special
case for HMI), and the regular interrupt corresponding to the
exception will fire
Before the cpuidle driver is enabled, provide a default idle
function similarly to POWER7/8.
This should not have much effect, because the cpuidle driver
for powernv is mandatory, but if that changes we should have
a fallback.
Signed-off-by: Nicholas Piggin
---
Rather than concern ourselves with any soft-mask logic in the CPU
hotplug handler, just hard disable interrupts. This ensures there
are no lazy-irqs pending, which means we can call directly to idle
instruction in order to sleep.
Signed-off-by: Nicholas Piggin
---
This simplifies the asm and fixes irq-off tracing over sleep
instructions.
Also move powersave_nap check for POWER8 into C code, and move
PSSCR register value calculation for POWER9 into C.
Signed-off-by: Nicholas Piggin
---
arch/powerpc/include/asm/hw_irq.h| 3 ++
I rebased this on the powerpc next tree.
A couple of things are changed since last post:
- Patch 1 now properly accounts for the fact the powernv idle
wakeups do not re-enable interrupts until the cpuidle driver
enables them. This was not quite right in the previous patch
(and
I rebased this on the powerpc next tree.
A couple of things are changed since last post:
- Patch 1 now properly accounts for the fact the powernv idle
wakeups do not re-enable interrupts until the cpuidle driver
enables them. This was not quite right in the previous patch
(and
18 matches
Mail list logo