* [PATCH 0/2] couple of minor DAWR fixes
From: Nicholas Piggin @ 2018-04-01 5:50 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Nicholas Piggin
Nicholas Piggin (2):
KVM: PPC: Book3S HV: Fix ppc_breakpoint_available compile error
powerpc: Fix DABR write in the case of DAWR disabled
arch/powerpc/kernel/process.c | 13 +++++++++----
arch/powerpc/kvm/book3s_hv.c | 1 +
2 files changed, 10 insertions(+), 4 deletions(-)
--
2.16.3
^ permalink raw reply
* [PATCH v3 3/3] powerpc/64s/idle: POWER9 ESL=0 stop avoid save/restore overhead
From: Nicholas Piggin @ 2018-04-01 5:48 UTC (permalink / raw)
To: linuxppc-dev
Cc: Nicholas Piggin, Vaidyanathan Srinivasan, Gautham R . Shenoy,
Paul Mackerras
In-Reply-To: <20180401054855.17864-1-npiggin@gmail.com>
When stop is executed with EC=ESL=0, it appears to execute like a
normal instruction (resuming from NIP when woken by interrupt). So all
the save/restore handling can be avoided completely. In particular NV
GPRs do not have to be saved, and MSR does not have to be switched
back to kernel MSR.
So move the test for EC=ESL=0 sleep states out to power9_idle_stop,
and return directly to the caller after stop in that case.
This improves performance for ping-pong benchmark with the stop0_lite
idle state by 2.54% for 2 threads in the same core, and 2.57% for
different cores. Performance increase with HV_POSSIBLE defined will be
improved further by avoiding the hwsync.
Cc: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Cc: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
Cc: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/kernel/idle_book3s.S | 45 ++++++++++++++-------------------------
1 file changed, 16 insertions(+), 29 deletions(-)
diff --git a/arch/powerpc/kernel/idle_book3s.S b/arch/powerpc/kernel/idle_book3s.S
index 68fa97885fc0..dedcd78a204a 100644
--- a/arch/powerpc/kernel/idle_book3s.S
+++ b/arch/powerpc/kernel/idle_book3s.S
@@ -324,32 +324,8 @@ enter_winkle:
/*
* r3 - PSSCR value corresponding to the requested stop state.
*/
-power_enter_stop:
-/*
- * Check if we are executing the lite variant with ESL=EC=0
- */
- andis. r4,r3,PSSCR_EC_ESL_MASK_SHIFTED
+power_enter_stop_esl:
clrldi r3,r3,60 /* r3 = Bits[60:63] = Requested Level (RL) */
- bne .Lhandle_esl_ec_set
- PPC_STOP
- li r3,0 /* Since we didn't lose state, return 0 */
- std r3, PACA_REQ_PSSCR(r13)
-
- /*
- * pnv_wakeup_noloss() expects r12 to contain the SRR1 value so
- * it can determine if the wakeup reason is an HMI in
- * CHECK_HMI_INTERRUPT.
- *
- * However, when we wakeup with ESL=0, SRR1 will not contain the wakeup
- * reason, so there is no point setting r12 to SRR1.
- *
- * Further, we clear r12 here, so that we don't accidentally enter the
- * HMI in pnv_wakeup_noloss() if the value of r12[42:45] == WAKE_HMI.
- */
- li r12, 0
- b pnv_wakeup_noloss
-
-.Lhandle_esl_ec_set:
BEGIN_FTR_SECTION
/*
* POWER9 DD2.0 or earlier can incorrectly set PMAO when waking up after
@@ -439,21 +415,32 @@ _GLOBAL(power9_offline_stop)
stb r4,HSTATE_HWTHREAD_STATE(r13)
#endif
_GLOBAL(power9_idle_stop)
+ mtspr SPRN_PSSCR,r3
+ /*
+ * The ESL=EC=0 case does not wake up at 0x100, and it does not
+ * allow SMT mode switching, so it does not require PSSCR to be
+ * saved.
+ */
+ andis. r4,r3,PSSCR_EC_ESL_MASK_SHIFTED
+ bne 1f
+ PPC_STOP
+ li r3,0 /* Since we didn't lose state, return 0 */
+ blr
+1:
std r3, PACA_REQ_PSSCR(r13)
#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
BEGIN_FTR_SECTION
sync
lwz r5, PACA_DONT_STOP(r13)
cmpwi r5, 0
- bne 1f
+ bne 2f
END_FTR_SECTION_IFSET(CPU_FTR_P9_TM_XER_SO_BUG)
#endif
- mtspr SPRN_PSSCR,r3
- LOAD_REG_ADDR(r4,power_enter_stop)
+ LOAD_REG_ADDR(r4,power_enter_stop_esl)
b pnv_powersave_common
/* No return */
#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
-1:
+2:
/*
* We get here when TM / thread reconfiguration bug workaround
* code wants to get the CPU into SMT4 mode, and therefore
--
2.16.3
^ permalink raw reply related
* [PATCH v3 2/3] powerpc/64s/idle: avoid sync for KVM state when waking from idle
From: Nicholas Piggin @ 2018-04-01 5:48 UTC (permalink / raw)
To: linuxppc-dev
Cc: Nicholas Piggin, Vaidyanathan Srinivasan, Gautham R . Shenoy,
Paul Mackerras
In-Reply-To: <20180401054855.17864-1-npiggin@gmail.com>
When waking from a CPU idle instruction (e.g., nap or stop), the sync
for ordering the KVM secondary thread state can be avoided if there
wakeup is coming from a kernel context rather than KVM context.
This improves performance for ping-pong benchmark with the stop0 idle
state by 0.46% for 2 threads in the same core, and 1.02% for different
cores.
Cc: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Cc: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
Cc: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/kernel/idle_book3s.S | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/powerpc/kernel/idle_book3s.S b/arch/powerpc/kernel/idle_book3s.S
index fc2e5cf2c74c..68fa97885fc0 100644
--- a/arch/powerpc/kernel/idle_book3s.S
+++ b/arch/powerpc/kernel/idle_book3s.S
@@ -549,6 +549,9 @@ ALT_FTR_SECTION_END_IFSET(CPU_FTR_ARCH_300)
mr r3,r12
#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
+ lbz r0,HSTATE_HWTHREAD_STATE(r13)
+ cmpwi r0,KVM_HWTHREAD_IN_KERNEL
+ beq 1f
li r0,KVM_HWTHREAD_IN_KERNEL
stb r0,HSTATE_HWTHREAD_STATE(r13)
/* Order setting hwthread_state vs. testing hwthread_req */
--
2.16.3
^ permalink raw reply related
* [PATCH v3 1/3] powerpc/64s/idle: POWER9 implement a separate idle stop function for hotplug
From: Nicholas Piggin @ 2018-04-01 5:48 UTC (permalink / raw)
To: linuxppc-dev
Cc: Nicholas Piggin, Vaidyanathan Srinivasan, Gautham R . Shenoy,
Paul Mackerras
In-Reply-To: <20180401054855.17864-1-npiggin@gmail.com>
Implement a new function to invoke stop, power9_offline_stop, which is
like power9_idle_stop but used by the cpu hotplug code.
Move KVM secondary state manipulation code to the offline case.
Cc: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Cc: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
Cc: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/include/asm/processor.h | 1 +
arch/powerpc/kernel/idle_book3s.S | 21 +++++++++++++++------
arch/powerpc/platforms/powernv/idle.c | 2 +-
3 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h
index bb9cb25ffb20..c4b36a494a63 100644
--- a/arch/powerpc/include/asm/processor.h
+++ b/arch/powerpc/include/asm/processor.h
@@ -518,6 +518,7 @@ extern int powersave_nap; /* set if nap mode can be used in idle loop */
extern unsigned long power7_idle_insn(unsigned long type); /* PNV_THREAD_NAP/etc*/
extern void power7_idle_type(unsigned long type);
extern unsigned long power9_idle_stop(unsigned long psscr_val);
+extern unsigned long power9_offline_stop(unsigned long psscr_val);
extern void power9_idle_type(unsigned long stop_psscr_val,
unsigned long stop_psscr_mask);
diff --git a/arch/powerpc/kernel/idle_book3s.S b/arch/powerpc/kernel/idle_book3s.S
index d503203842b0..fc2e5cf2c74c 100644
--- a/arch/powerpc/kernel/idle_book3s.S
+++ b/arch/powerpc/kernel/idle_book3s.S
@@ -325,12 +325,6 @@ enter_winkle:
* r3 - PSSCR value corresponding to the requested stop state.
*/
power_enter_stop:
-#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
- /* Tell KVM we're entering idle */
- li r4,KVM_HWTHREAD_IN_IDLE
- /* DO THIS IN REAL MODE! See comment above. */
- stb r4,HSTATE_HWTHREAD_STATE(r13)
-#endif
/*
* Check if we are executing the lite variant with ESL=EC=0
*/
@@ -428,7 +422,22 @@ ALT_FTR_SECTION_END_NESTED_IFSET(CPU_FTR_ARCH_207S, 66); \
/*
* Entered with MSR[EE]=0 and no soft-masked interrupts pending.
* r3 contains desired PSSCR register value.
+ *
+ * Offline (CPU unplug) case also must notify KVM that the CPU is
+ * idle.
*/
+_GLOBAL(power9_offline_stop)
+#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
+ /*
+ * Tell KVM we're entering idle.
+ * This does not have to be done in real mode because the P9 MMU
+ * is independent per-thread. Some steppings share radix/hash mode
+ * between threads, but in that case KVM has a barrier sync in real
+ * mode before and after switching between radix and hash.
+ */
+ li r4,KVM_HWTHREAD_IN_IDLE
+ stb r4,HSTATE_HWTHREAD_STATE(r13)
+#endif
_GLOBAL(power9_idle_stop)
std r3, PACA_REQ_PSSCR(r13)
#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
diff --git a/arch/powerpc/platforms/powernv/idle.c b/arch/powerpc/platforms/powernv/idle.c
index d9e366bb23da..378fde1f85a8 100644
--- a/arch/powerpc/platforms/powernv/idle.c
+++ b/arch/powerpc/platforms/powernv/idle.c
@@ -511,7 +511,7 @@ unsigned long pnv_cpu_offline(unsigned int cpu)
psscr = mfspr(SPRN_PSSCR);
psscr = (psscr & ~pnv_deepest_stop_psscr_mask) |
pnv_deepest_stop_psscr_val;
- srr1 = power9_idle_stop(psscr);
+ srr1 = power9_offline_stop(psscr);
} else if ((idle_states & OPAL_PM_WINKLE_ENABLED) &&
(idle_states & OPAL_PM_LOSE_FULL_CONTEXT)) {
--
2.16.3
^ permalink raw reply related
* [PATCH v3 0/3] idle improvements again
From: Nicholas Piggin @ 2018-04-01 5:48 UTC (permalink / raw)
To: linuxppc-dev
Cc: Nicholas Piggin, Vaidyanathan Srinivasan, Gautham R . Shenoy,
Paul Mackerras
Since last time, this has been rebased on top of the KVM / SMT4
forcing changes. It has also been updated so as to not disable
EC=ESL=0 idle states for CPU unplug.
That case (and powersave=off) continues to be broken for KVM with
unplugged dependent secondaries, but that's another issue.
This also has EC=ESL=0 states to skip the new hwsync added for the
KVM workaround, which should increase their performance advantage a
little further.
Thanks,
Nick
Nicholas Piggin (3):
powerpc/64s/idle: POWER9 implement a separate idle stop function for
hotplug
powerpc/64s/idle: avoid sync for KVM state when waking from idle
powerpc/64s/idle: POWER9 ESL=0 stop avoid save/restore overhead
arch/powerpc/include/asm/processor.h | 1 +
arch/powerpc/kernel/idle_book3s.S | 69 +++++++++++++++++------------------
arch/powerpc/platforms/powernv/idle.c | 2 +-
3 files changed, 36 insertions(+), 36 deletions(-)
--
2.16.3
^ permalink raw reply
* [PATCH] powerpc/powernv: Fix SMT4 forcing idle code
From: Nicholas Piggin @ 2018-04-01 5:38 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Nicholas Piggin, Paul Mackerras
PSSCR value is not stored to PACA_REQ_PSSCR in case the CPU does
not have the XER[SO] bug.
Fix this by storing up-front, outside the workaround code. The
initial test is not required because it is a slow path.
The workaround is made to depend on CONFIG_KVM_BOOK3S_HV_POSSIBLE, to
match pnv_power9_force_smt4_catch() where it is used.
Fixes: 7672691a08 ("powerpc/powernv: Provide a way to force a core into SMT4 mode")
Cc: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/kernel/idle_book3s.S | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/kernel/idle_book3s.S b/arch/powerpc/kernel/idle_book3s.S
index 89157cf452e3..d503203842b0 100644
--- a/arch/powerpc/kernel/idle_book3s.S
+++ b/arch/powerpc/kernel/idle_book3s.S
@@ -430,20 +430,20 @@ ALT_FTR_SECTION_END_NESTED_IFSET(CPU_FTR_ARCH_207S, 66); \
* r3 contains desired PSSCR register value.
*/
_GLOBAL(power9_idle_stop)
-BEGIN_FTR_SECTION
- lwz r5, PACA_DONT_STOP(r13)
- cmpwi r5, 0
- bne 1f
std r3, PACA_REQ_PSSCR(r13)
+#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
+BEGIN_FTR_SECTION
sync
lwz r5, PACA_DONT_STOP(r13)
cmpwi r5, 0
bne 1f
END_FTR_SECTION_IFSET(CPU_FTR_P9_TM_XER_SO_BUG)
+#endif
mtspr SPRN_PSSCR,r3
LOAD_REG_ADDR(r4,power_enter_stop)
b pnv_powersave_common
/* No return */
+#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
1:
/*
* We get here when TM / thread reconfiguration bug workaround
@@ -453,6 +453,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_P9_TM_XER_SO_BUG)
li r3, 0
std r3, PACA_REQ_PSSCR(r13)
blr /* return 0 for wakeup cause / SRR1 value */
+#endif
/*
* On waking up from stop 0,1,2 with ESL=1 on POWER9 DD1,
--
2.16.3
^ permalink raw reply related
* [PATCH 09/12] block/swim: Rename macros to avoid inconsistent inverted logic
From: Finn Thain @ 2018-04-01 1:41 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Laurent Vivier, Jens Axboe, linux-m68k, linux-kernel,
Benjamin Herrenschmidt, linuxppc-dev
In-Reply-To: <cover.1522546571.git.fthain@telegraphics.com.au>
The Sony drive status bits use active-low logic. The swim_readbit()
function converts that to 'C' logic for readability. Hence, the
sense of the names of the status bit macros should not be inverted.
Mostly they are correct. However, the TWOMEG_DRIVE, MFM_MODE and
TWOMEG_MEDIA macros have inverted sense (like MkLinux). Fix this
inconsistency and make the following patches less confusing.
The same problem affects swim3.c so fix that too.
No functional change.
The FDHD drive status bits are documented in sonydriv.cpp from MAME
and in swimiii.h from MkLinux.
Cc: Laurent Vivier <lvivier@redhat.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Jens Axboe <axboe@kernel.dk>
Tested-by: Stan Johnson <userm57@yahoo.com>
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
---
drivers/block/swim.c | 8 ++++----
drivers/block/swim3.c | 6 +++---
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/block/swim.c b/drivers/block/swim.c
index 8be0d92bc431..d69cc5dadbfc 100644
--- a/drivers/block/swim.c
+++ b/drivers/block/swim.c
@@ -111,7 +111,7 @@ struct iwm {
/* Select values for swim_select and swim_readbit */
#define READ_DATA_0 0x074
-#define TWOMEG_DRIVE 0x075
+#define ONEMEG_DRIVE 0x075
#define SINGLE_SIDED 0x076
#define DRIVE_PRESENT 0x077
#define DISK_IN 0x170
@@ -119,9 +119,9 @@ struct iwm {
#define TRACK_ZERO 0x172
#define TACHO 0x173
#define READ_DATA_1 0x174
-#define MFM_MODE 0x175
+#define GCR_MODE 0x175
#define SEEK_COMPLETE 0x176
-#define ONEMEG_MEDIA 0x177
+#define TWOMEG_MEDIA 0x177
/* Bits in handshake register */
@@ -619,7 +619,7 @@ static void setup_medium(struct floppy_state *fs)
struct floppy_struct *g;
fs->disk_in = 1;
fs->write_protected = swim_readbit(base, WRITE_PROT);
- fs->type = swim_readbit(base, ONEMEG_MEDIA);
+ fs->type = swim_readbit(base, TWOMEG_MEDIA);
if (swim_track00(base))
printk(KERN_ERR
diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c
index af51015d056e..469541c1e51e 100644
--- a/drivers/block/swim3.c
+++ b/drivers/block/swim3.c
@@ -148,7 +148,7 @@ struct swim3 {
#define MOTOR_ON 2
#define RELAX 3 /* also eject in progress */
#define READ_DATA_0 4
-#define TWOMEG_DRIVE 5
+#define ONEMEG_DRIVE 5
#define SINGLE_SIDED 6 /* drive or diskette is 4MB type? */
#define DRIVE_PRESENT 7
#define DISK_IN 8
@@ -156,9 +156,9 @@ struct swim3 {
#define TRACK_ZERO 10
#define TACHO 11
#define READ_DATA_1 12
-#define MFM_MODE 13
+#define GCR_MODE 13
#define SEEK_COMPLETE 14
-#define ONEMEG_MEDIA 15
+#define TWOMEG_MEDIA 15
/* Definitions of values used in writing and formatting */
#define DATA_ESCAPE 0x99
--
2.16.1
^ permalink raw reply related
* Re: [PATCH] Patch to replace DEFINE_SEMAPHORE with DEFINE_BINARY_SEMAPHORE
From: Greg Kroah-Hartman @ 2018-03-31 14:08 UTC (permalink / raw)
To: Wasim Nazir
Cc: jhogan, kys, linuxdrivers, linux-kernel, devel, linux-arm-kernel,
Ralf Baechle, Ard Biesheuvel, Haiyang Zhang, Stephen Hemminger,
Benjamin Herrenschmidt, Ariel Elior, everest-linux-l2,
James E.J. Bottomley, Martin K. Petersen, Eric Anholt,
Stefan Wahren, Petr Mladek, Sergey Senozhatsky, Steven Rostedt,
David Daney, Mihaela Muraru, Kishore KP, Sidong Yang, Al Viro,
Phil Elwell, Ingo Molnar, Tycho Andersen, linux-mips, linux-efi,
linuxppc-dev, netdev, linux-scsi, linux-rpi-kernel, devel
In-Reply-To: <CAAYn-eg8L=-2rX4ZcsA6r9J+6ESEvQFrWk1=f+k1ToP2f=6WHQ@mail.gmail.com>
On Sat, Mar 31, 2018 at 07:16:21PM +0530, Wasim Nazir wrote:
> This message contains confidential information and is intended only for the
> individual(s) named. If you are not the intended recipient, you are
> notified that disclosing, copying, distributing or taking any action in
> reliance on the contents of this mail and attached file/s is strictly
> prohibited. Please notify the sender immediately and delete this e-mail
> from your system. E-mail transmission cannot be guaranteed to be secured or
> error-free as information could be intercepted, corrupted, lost, destroyed,
> arrive late or incomplete, or contain viruses. The sender therefore does
> not accept liability for any errors or omissions in the contents of this
> message, which arise as a result of e-mail transmission.
This footer is not compatible with patches submitted to the kernel,
sorry. email is now deleted.
greg k-h
^ permalink raw reply
* Re: powerpc/mpic: Check if cpu_possible() in mpic_physmask()
From: Michael Ellerman @ 2018-03-31 14:05 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev; +Cc: npiggin
In-Reply-To: <20180331140024.1610-1-mpe@ellerman.id.au>
On Sat, 2018-03-31 at 14:00:24 UTC, Michael Ellerman wrote:
> In mpic_physmask() we loop over all CPUs up to 32, then get the hard
> SMP processor id of that CPU.
>
> Currently that's possibly walking off the end of the paca array, but
> in a future patch we will change the paca array to be an array of
> pointers, and in that case we will get a NULL for missing CPUs and
> oops. eg:
>
> Unable to handle kernel paging request for data at address 0x88888888888888b8
> Faulting instruction address: 0xc00000000004e380
> Oops: Kernel access of bad area, sig: 11 [#1]
> ...
> NIP .mpic_set_affinity+0x60/0x1a0
> LR .irq_do_set_affinity+0x48/0x100
>
> Fix it by checking the CPU is possible, this also fixes the code if
> there are gaps in the CPU numbering which probably never happens on
> mpic systems but who knows.
>
> Debugged-by: Nicholas Piggin <npiggin@gmail.com>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Applied to powerpc next.
https://git.kernel.org/powerpc/c/0834d627fbea00c1444075eb3e448e
cheers
^ permalink raw reply
* Re: powerpc/64e: Fix oops due to deferral of paca allocation
From: Michael Ellerman @ 2018-03-31 14:04 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev; +Cc: npiggin
In-Reply-To: <20180331115138.5731-1-mpe@ellerman.id.au>
On Sat, 2018-03-31 at 11:51:38 UTC, Michael Ellerman wrote:
> On 64-bit Book3E systems, in setup_tlb_core_data() we reference other
> CPUs pacas. But in commit 59f577743d71 ("powerpc/64: Defer paca
> allocation until memory topology is discovered") the allocation of
> non-boot-CPU pacas was deferred until later in boot.
>
> This leads to an oops:
>
> CPU maps initialized for 1 thread per core
> Unable to handle kernel paging request for data at address 0x8888888888888918
> Faulting instruction address: 0xc000000000e2f0d0
> Oops: Kernel access of bad area, sig: 11 [#1]
> NIP .setup_tlb_core_data+0xdc/0x160
> Call Trace:
> .setup_tlb_core_data+0x5c/0x160 (unreliable)
> .setup_arch+0x80/0x348
> .start_kernel+0x7c/0x598
> start_here_common+0x1c/0x40
>
> Luckily setup_tlb_core_data() is called immediately prior to
> smp_setup_pacas(). So simply switching their order is sufficient to
> fix the oops and seems unlikely to have any other unwanted side
> effects.
>
> Fixes: 59f577743d71 ("powerpc/64: Defer paca allocation until memory topology is discovered")
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Applied to powerpc next.
https://git.kernel.org/powerpc/c/1d0afc0d5a7c281f8ced3bd39f61f3
cheers
^ permalink raw reply
* Re: powerpc/kvm: Fix guest boot issue DAWR cpu feature
From: Michael Ellerman @ 2018-03-31 14:04 UTC (permalink / raw)
To: Aneesh Kumar K.V, benh, paulus, Michael Neuling
Cc: Aneesh Kumar K.V, linuxppc-dev
In-Reply-To: <20180330115724.23826-1-aneesh.kumar@linux.ibm.com>
On Fri, 2018-03-30 at 11:57:24 UTC, "Aneesh Kumar K.V" wrote:
> SLOF check the 'sc 1' support by issuing a hcall with H_SET_DABR. With
> recent patch to make the hcall return H_UNSUPPORTED, we get guest boot
> failures. SLOF can work with the hcall failure H_HARDWARE for the above
> hcall. Switch the return value to H_HARDWARE instead of H_UNSUPPORTED so that
> we don't break the guest boot.
>
> Fixes: e8ebedbf ("KVM: PPC: Book3S HV: Return error from h_set_dabr() on POWER9")
>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/ca9a16c3bc1582da62ef9c47fc2200
cheers
^ permalink raw reply
* Re: powerpc: kexec_file: Fix error code when trying to load kdump kernel
From: Michael Ellerman @ 2018-03-31 14:04 UTC (permalink / raw)
To: Thiago Jung Bauermann, linuxppc-dev
Cc: kexec, linux-kernel, Thiago Jung Bauermann, Michal Suchánek,
Dave Young
In-Reply-To: <20180329190543.25118-1-bauerman@linux.vnet.ibm.com>
On Thu, 2018-03-29 at 19:05:43 UTC, Thiago Jung Bauermann wrote:
> kexec_file_load() on powerpc doesn't support kdump kernels yet, so it
> returns -ENOTSUPP in that case.
>
> I've recently learned that this errno is internal to the kernel and isn't
> supposed to be exposed to userspace. Therefore, change to -EOPNOTSUPP which
> is defined in an uapi header.
>
> This does indeed make kexec-tools happier. Before the patch, on ppc64le:
>
> # ~bauermann/src/kexec-tools/build/sbin/kexec -s -p /boot/vmlinuz
> kexec_file_load failed: Unknown error 524
>
> After the patch:
>
> # ~bauermann/src/kexec-tools/build/sbin/kexec -s -p /boot/vmlinuz
> kexec_file_load failed: Operation not supported
>
> Fixes: a0458284f062 ("powerpc: Add support code for kexec_file_load()")
> Reported-by: Dave Young <dyoung@redhat.com>
> Signed-off-by: Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
> Reviewed-by: Simon Horman <horms@verge.net.au>
> Reviewed-by: Dave Young <dyoung@redhat.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/bf8a1abc3ddbd6e9a8312ea7d96e5d
cheers
^ permalink raw reply
* Re: powerpc/pseries: Fix to clear security feature flags
From: Michael Ellerman @ 2018-03-31 14:04 UTC (permalink / raw)
To: Mauricio Faria de Oliveira, linuxppc-dev
In-Reply-To: <1522348331-30753-1-git-send-email-mauricfo@linux.vnet.ibm.com>
On Thu, 2018-03-29 at 18:32:11 UTC, Mauricio Faria de Oliveira wrote:
> The H_CPU_BEHAV_* flags should be checked for in the 'behaviour' field
> of 'struct h_cpu_char_result' -- 'character' is for H_CPU_CHAR_* flags.
>
> Found it by playing around with QEMU's implementation of the hypercall:
>
> Example:
> H_CPU_CHAR=0xf000000000000000
> H_CPU_BEHAV=0x0000000000000000
>
> This clears H_CPU_BEHAV_FAVOUR_SECURITY and H_CPU_BEHAV_L1D_FLUSH_PR
> so pseries_setup_rfi_flush() disables 'rfi_flush'; and it also clears
> H_CPU_CHAR_L1D_THREAD_PRIV flag. So there is no RFI flush mitigation
> at all for cpu_show_meltdown() to report; but currently it does:
>
> Original kernel:
>
> # cat /sys/devices/system/cpu/vulnerabilities/meltdown
> Mitigation: RFI Flush
>
> Patched kernel:
>
> # cat /sys/devices/system/cpu/vulnerabilities/meltdown
> Not affected
>
> Example:
> H_CPU_CHAR=0x0000000000000000
> H_CPU_BEHAV=0xf000000000000000
>
> This sets H_CPU_BEHAV_BNDS_CHK_SPEC_BAR so cpu_show_spectre_v1() should
> report vulnerable; but currently it doesn't:
>
> Original kernel:
>
> # cat /sys/devices/system/cpu/vulnerabilities/spectre_v1
> Not affected
>
> Patched kernel:
>
> # cat /sys/devices/system/cpu/vulnerabilities/spectre_v1
> Vulnerable
>
> Fixes: f636c14790ea ("powerpc/pseries: Set or clear security feature flags")
> Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/0f9bdfe3c77091e8704d2e510eb7c2
cheers
^ permalink raw reply
* Re: macintosh/adb: Use C99 initializers for struct adb_driver instances
From: Michael Ellerman @ 2018-03-31 14:04 UTC (permalink / raw)
To: Finn Thain, Jiri Kosina; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <alpine.LNX.2.21.1803291117110.30@nippy.intranet>
On Thu, 2018-03-29 at 00:36:04 UTC, Finn Thain wrote:
> No change to object files.
>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/3a52f6f980c45b0dfa667f30d3ff03
cheers
^ permalink raw reply
* Re: powerpc/mm: Fix thread_pkey_regs_init()
From: Michael Ellerman @ 2018-03-31 14:04 UTC (permalink / raw)
To: Ram Pai
Cc: fweimer, msuchanek, linuxram, mhocko, paulus, aneesh.kumar,
bauerman, linuxppc-dev
In-Reply-To: <1522118214-7040-1-git-send-email-linuxram@us.ibm.com>
On Tue, 2018-03-27 at 02:36:54 UTC, Ram Pai wrote:
> thread_pkey_regs_init() initializes the pkey related registers
> instead of initializing the fields in the task structures. Fortunately
> those key related registers are re-set to zero when the task
> gets scheduled on the cpu. However its good to fix this glaringly
> visible error.
>
> cc: Michael Ellermen <mpe@ellerman.id.au>
> Signed-off-by: Ram Pai <linuxram@us.ibm.com>
> Signed-off-by: Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
> Acked-by: Balbir Singh <bsingharora@gmail.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/f208638680e5cb4eb0d2871ce8c29a
cheers
^ permalink raw reply
* Re: [v2, 1/5] powerpc: mm: Simplify page_is_ram by using memblock_is_memory
From: Michael Ellerman @ 2018-03-31 14:04 UTC (permalink / raw)
To: Jonathan Neuschäfer, linuxppc-dev
Cc: Michal Hocko, linux-kernel, Jonathan Neuschäfer,
Paul Mackerras, Joe Perches, Oliver O'Halloran, Andrew Morton,
Vlastimil Babka
In-Reply-To: <20180328002544.18526-2-j.neuschaefer@gmx.net>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 336 bytes --]
On Wed, 2018-03-28 at 00:25:40 UTC, =?utf-8?q?Jonathan_Neusch=C3=A4fer?= wrote:
> Instead of open-coding the search in page_is_ram, call memblock_is_memory.
>
> Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Series applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/2615c93e5f52db62586112793d889f
cheers
^ permalink raw reply
* Re: powerpc/powernv/nvram: opal_nvram_write handle unknown OPAL errors
From: Michael Ellerman @ 2018-03-31 14:04 UTC (permalink / raw)
To: Nicholas Piggin, linuxppc-dev; +Cc: Nicholas Piggin
In-Reply-To: <20180326150233.23089-1-npiggin@gmail.com>
On Mon, 2018-03-26 at 15:02:33 UTC, Nicholas Piggin wrote:
> opal_nvram_write currently just assumes success if it encounters an
> error other than OPAL_BUSY or OPAL_BUSY_EVENT. Have it return -EIO
> on other errors instead.
>
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
> Acked-by: Stewart Smith <stewart@linux.ibm.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/741de617661794246f84a21a02fc5e
cheers
^ permalink raw reply
* Re: [-next] powerpc: Fix error return code in ppc4xx_msi_probe()
From: Michael Ellerman @ 2018-03-31 14:04 UTC (permalink / raw)
To: Wei Yongjun, Benjamin Herrenschmidt, Paul Mackerras, Rob Herring,
Markus Elfring, Tyrel Datwyler
Cc: linuxppc-dev, kernel-janitors, Wei Yongjun, linux-kernel
In-Reply-To: <1522075389-23511-1-git-send-email-weiyongjun1@huawei.com>
On Mon, 2018-03-26 at 14:43:09 UTC, Wei Yongjun wrote:
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.
>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/9a2c1d31e6910b9d5e0205f9167d0b
cheers
^ permalink raw reply
* Re: [v2] powerpc/eeh: Fix race with driver un/bind
From: Michael Ellerman @ 2018-03-31 14:04 UTC (permalink / raw)
To: Michael Neuling; +Cc: linuxppc-dev, sam.bobroff
In-Reply-To: <20180326041707.11246-1-mikey@neuling.org>
On Mon, 2018-03-26 at 04:17:07 UTC, Michael Neuling wrote:
> The current EEH callbacks can race with a driver unbind. This
> can result in a backtraces like this:
>
> [ 7.573055] EEH: Frozen PHB#0-PE#1fc detected
> [ 7.573063] EEH: PE location: S000009, PHB location: N/A
> [ 7.573069] CPU: 2 PID: 2312 Comm: kworker/u258:3 Not tainted 4.15.6-openpower1 #2
> [ 7.573078] Workqueue: nvme-wq nvme_reset_work [nvme]
> [ 7.573080] Call Trace:
> [ 7.573088] [c000000ff12a3a30] [c0000000005f5000] dump_stack+0x9c/0xd0
> [ 7.573093] (unreliable)
> [ 7.573106] [c000000ff12a3a70] [c00000000002385c] eeh_dev_check_failure+0x420/0x470
> [ 7.573111] [c000000ff12a3b10] [c00000000002394c] eeh_check_failure+0xa0/0xa4
> [ 7.573115] [c000000ff12a3b50] [c0080000088c2ff0] nvme_reset_work+0x138/0x1414 [nvme]
> [ 7.573122] [c000000ff12a3cb0] [c000000000089c78] process_one_work+0x1ec/0x328
> [ 7.573132] [c000000ff12a3d40] [c00000000008a3b4] worker_thread+0x2e4/0x3a8
> [ 7.573140] [c000000ff12a3dc0] [c00000000008fed0] kthread+0x14c/0x154
> [ 7.573150] [c000000ff12a3e30] [c00000000000b594] ret_from_kernel_thread+0x5c/0xc8
> [ 7.573183] nvme nvme1: Removing after probe failure status: -19
> <snip>
> cpu 0x23: Vector: 300 (Data Access) at [c000000ff50f3800]
> pc: c0080000089a0eb0: nvme_error_detected+0x4c/0x90 [nvme]
> lr: c000000000026564: eeh_report_error+0xe0/0x110
> sp: c000000ff50f3a80
> msr: 9000000000009033
> dar: 400
> dsisr: 40000000
> current = 0xc000000ff507c000
> paca = 0xc00000000fdc9d80 softe: 0 irq_happened: 0x01
> pid = 782, comm = eehd
> Linux version 4.15.6-openpower1 (smc@smc-desktop) (gcc version 6.4.0 (Buildroot 2017.11.2-00008-g4b6188e)) #2 SM P Tue Feb 27 12:33:27 PST 2018
> enter ? for help
> [c000000ff50f3af0] c000000000026564 eeh_report_error+0xe0/0x110
> [c000000ff50f3b30] c000000000025520 eeh_pe_dev_traverse+0xc0/0xdc
> [c000000ff50f3bc0] c000000000026bd0 eeh_handle_normal_event+0x184/0x4c4
> [c000000ff50f3c70] c000000000026ff4 eeh_handle_event+0x30/0x288
> [c000000ff50f3d10] c00000000002758c eeh_event_handler+0x124/0x170
> [c000000ff50f3dc0] c00000000008fed0 kthread+0x14c/0x154
> [c000000ff50f3e30] c00000000000b594 ret_from_kernel_thread+0x5c/0xc8
>
> The first part is an EEH (on boot), the second half is the resulting
> crash. nvme probe starts the nvme_reset_work() worker thread. This
> worker thread starts touching the device which see a device error
> (EEH) and hence queues up an event in the powerpc EEH worker
> thread. nvme_reset_work() then continues and runs
> nvme_remove_dead_ctrl_work() which results in unbinding the driver
> from the device and hence releases all resources. At the same time,
> the EEH worker thread starts doing the EEH .error_detected() driver
> callback, which no longer works since the resources have been freed.
>
> This fixes the problem in the same way the generic PCIe AER code (in
> drivers/pci/pcie/aer/aerdrv_core.c) does. It makes the EEH code hold
> the device_lock() while performing the driver EEH callbacks and
> associated code. This ensures either the callbacks are no longer
> register, or if they are registered the driver will not be removed
> from underneath us.
>
> This has been broken forever. The EEH call backs were first introduced
> in 2005 (in 77bd7415610) but it's not clear if a lock was needed back
> then.
>
> Signed-off-by: Michael Neuling <mikey@neuling.org>
> Cc: stable@vger.kernel.org
> Reviewed-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/f0295e047fcf52ccb42561fb7de694
cheers
^ permalink raw reply
* Re: [V6, 1/4] powerpc/mm/slice: Consolidate return path in slice_get_unmapped_area()
From: Michael Ellerman @ 2018-03-31 14:04 UTC (permalink / raw)
To: Aneesh Kumar K.V, benh, paulus; +Cc: linuxppc-dev, Aneesh Kumar K.V
In-Reply-To: <20180326100450.18614-2-aneesh.kumar@linux.vnet.ibm.com>
On Mon, 2018-03-26 at 10:04:47 UTC, "Aneesh Kumar K.V" wrote:
> In a following patch, on finding a free area we will need to do
> allocatinon of extra contexts as needed. Consolidating the return path
> for slice_get_unmapped_area() will make that easier.
>
> Split into a separate patch to make review easy.
>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Series applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/0dea04b288c06654b0de3563c5b8cd
cheers
^ permalink raw reply
* Re: powerpc: Fix smp_wmb barrier definition use use lwsync consistently
From: Michael Ellerman @ 2018-03-31 14:04 UTC (permalink / raw)
To: Nicholas Piggin, linuxppc-dev; +Cc: Anton Blanchard, Nicholas Piggin
In-Reply-To: <20180322104146.5350-1-npiggin@gmail.com>
On Thu, 2018-03-22 at 10:41:46 UTC, Nicholas Piggin wrote:
> asm/barrier.h is not always included after asm/synch.h, which meant
> it was missing __SUBARCH_HAS_LWSYNC, so in some files smp_wmb() would
> be eieio when it should be lwsync. kernel/time/hrtimer.c is one case.
>
> __SUBARCH_HAS_LWSYNC is only used in one place, so just fold it in
> to where it's used. Previously with my small simulator config, 377
> instances of eieio in the tree. After this patch there are 55.
>
> Cc: Anton Blanchard <anton@samba.org>
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/0bfdf598900fd62869659f360d3387
cheers
^ permalink raw reply
* Re: powerpc: wii.dts: Add drive slot LED
From: Michael Ellerman @ 2018-03-31 14:03 UTC (permalink / raw)
To: Jonathan Neuschäfer, linuxppc-dev
Cc: Mark Rutland, devicetree, linux-kernel, Jonathan Neuschäfer,
Rob Herring, Paul Mackerras
In-Reply-To: <20180317150617.26913-1-j.neuschaefer@gmx.net>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 399 bytes --]
On Sat, 2018-03-17 at 15:06:17 UTC, =?utf-8?q?Jonathan_Neusch=C3=A4fer?= wrote:
> The Wii has a blue LED in the disk drive slot, which is controlled via a
> GPIO line. Add this LED to wii.dts, and mark it as a panic-indicator.
>
> Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/041413b88d6e9c66582d0a38d0e82f
cheers
^ permalink raw reply
* Re: drivers: macintosh: rack-meter: really fix bogus memsets
From: Michael Ellerman @ 2018-03-31 14:03 UTC (permalink / raw)
To: Aaro Koskinen, PowerPC, Stephen Rothwell, Benjamin Herrenschmidt
Cc: Aaro Koskinen
In-Reply-To: <20180316201728.3377-1-aaro.koskinen@iki.fi>
On Fri, 2018-03-16 at 20:17:28 UTC, Aaro Koskinen wrote:
> We should zero an array using sizeof instead of number of elements.
>
> Fixes the following compiler (GCC 7.3.0) warnings:
>
> drivers/macintosh/rack-meter.c: In function 'rackmeter_do_pause':
> drivers/macintosh/rack-meter.c:157:2: warning: 'memset' used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
> drivers/macintosh/rack-meter.c:158:2: warning: 'memset' used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
>
> Fixes: 4f7bef7a9f69 ("drivers: macintosh: rack-meter: fix bogus memsets")
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/e283655b5abe26462d53d5196f186c
cheers
^ permalink raw reply
* Re: powerpc/xive: Fix wrong xmon output caused by typo
From: Michael Ellerman @ 2018-03-31 14:03 UTC (permalink / raw)
To: Frederic Barrat, linuxppc-dev
In-Reply-To: <20180314170114.27044-1-fbarrat@linux.vnet.ibm.com>
On Wed, 2018-03-14 at 17:01:14 UTC, Frederic Barrat wrote:
> Signed-off-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/16b19f1a03f6a49618611b76818f04
cheers
^ permalink raw reply
* Re: [1/2] powerpc/mm/keys: Move pte bits to correct headers
From: Michael Ellerman @ 2018-03-31 14:03 UTC (permalink / raw)
To: Aneesh Kumar K.V, benh, paulus, linuxram; +Cc: linuxppc-dev, Aneesh Kumar K.V
In-Reply-To: <20180307133645.29290-1-aneesh.kumar@linux.vnet.ibm.com>
On Wed, 2018-03-07 at 13:36:44 UTC, "Aneesh Kumar K.V" wrote:
> Memory keys are supported only with hash translation mode. Instead of #ifdef in
> generic code move the key related pte bits to respective headers
>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/1a2f778970c81273c121be160fb661
cheers
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox