* [PATCH] powerpc: set default kernel thread priority to medium-low
From: Philippe Bergheaud @ 2013-12-10 7:39 UTC (permalink / raw)
To: Linuxppc-dev; +Cc: Philippe Bergheaud
All the important PThread locking occurs in GLIBC libpthread.so
For scaling to large core counts we need to stay out of the kernel and scheduler as much as possible which implies increasing the spin time in user mode. For POWER implementations with SMT this implies that user mode needs to manage SMT priority for spinning and active (in the critical region) threads.
Libpthread must be able to raise and lower the the SMT priority versus the default to be effective.
This lowers the default kernel thread priority from medium to medium-low.
Signed-off-by: Philippe Bergheaud <felix@linux.vnet.ibm.com>
---
arch/powerpc/include/asm/exception-64s.h | 2 +-
arch/powerpc/include/asm/ppc_asm.h | 4 ++--
arch/powerpc/include/asm/processor.h | 2 +-
arch/powerpc/include/asm/spinlock.h | 8 ++++----
arch/powerpc/kernel/entry_64.S | 2 +-
arch/powerpc/kernel/exceptions-64s.S | 4 ++--
arch/powerpc/kernel/head_64.S | 4 ++--
arch/powerpc/kernel/idle.c | 2 +-
arch/powerpc/kernel/prom_init.c | 2 +-
arch/powerpc/kernel/time.c | 2 +-
arch/powerpc/kvm/book3s_hv.c | 2 +-
arch/powerpc/kvm/book3s_hv_rmhandlers.S | 4 ++--
arch/powerpc/lib/locks.c | 2 +-
arch/powerpc/platforms/cell/beat_hvCall.S | 16 ++++++++--------
arch/powerpc/platforms/powernv/opal-takeover.S | 2 +-
arch/powerpc/platforms/pseries/hvCall.S | 10 +++++-----
arch/powerpc/platforms/pseries/processor_idle.c | 4 ++--
17 files changed, 36 insertions(+), 36 deletions(-)
diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h
index 402c1c4..30bedd9 100644
--- a/arch/powerpc/include/asm/exception-64s.h
+++ b/arch/powerpc/include/asm/exception-64s.h
@@ -135,7 +135,7 @@ END_FTR_SECTION_NESTED(CPU_FTR_HAS_PPR,CPU_FTR_HAS_PPR,941)
*/
#define HMT_MEDIUM_PPR_DISCARD \
BEGIN_FTR_SECTION_NESTED(942) \
- HMT_MEDIUM; \
+ HMT_MEDIUM_LOW; \
END_FTR_SECTION_NESTED(CPU_FTR_HAS_PPR,0,942) /*non P7*/
/*
diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h
index ce05bba..22d4ba4 100644
--- a/arch/powerpc/include/asm/ppc_asm.h
+++ b/arch/powerpc/include/asm/ppc_asm.h
@@ -478,9 +478,9 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601)
* PPR restore macros used in entry_64.S
* Used for P7 or later processors
*/
-#define HMT_MEDIUM_LOW_HAS_PPR \
+#define HMT_LOW_HAS_PPR \
BEGIN_FTR_SECTION_NESTED(944) \
- HMT_MEDIUM_LOW; \
+ HMT_LOW; \
END_FTR_SECTION_NESTED(CPU_FTR_HAS_PPR,CPU_FTR_HAS_PPR,944)
#define SET_DEFAULT_THREAD_PPR(ra, rb) \
diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h
index b4a3045..2f8625b 100644
--- a/arch/powerpc/include/asm/processor.h
+++ b/arch/powerpc/include/asm/processor.h
@@ -387,7 +387,7 @@ static inline unsigned long __pack_fe01(unsigned int fpmode)
}
#ifdef CONFIG_PPC64
-#define cpu_relax() do { HMT_low(); HMT_medium(); barrier(); } while (0)
+#define cpu_relax() do { HMT_low(); HMT_medium_low(); barrier(); } while (0)
#else
#define cpu_relax() barrier()
#endif
diff --git a/arch/powerpc/include/asm/spinlock.h b/arch/powerpc/include/asm/spinlock.h
index 5f54a74..b047a6a 100644
--- a/arch/powerpc/include/asm/spinlock.h
+++ b/arch/powerpc/include/asm/spinlock.h
@@ -120,7 +120,7 @@ static inline void arch_spin_lock(arch_spinlock_t *lock)
if (SHARED_PROCESSOR)
__spin_yield(lock);
} while (unlikely(lock->slock != 0));
- HMT_medium();
+ HMT_medium_low();
}
}
@@ -140,7 +140,7 @@ void arch_spin_lock_flags(arch_spinlock_t *lock, unsigned long flags)
if (SHARED_PROCESSOR)
__spin_yield(lock);
} while (unlikely(lock->slock != 0));
- HMT_medium();
+ HMT_medium_low();
local_irq_restore(flags_dis);
}
}
@@ -240,7 +240,7 @@ static inline void arch_read_lock(arch_rwlock_t *rw)
if (SHARED_PROCESSOR)
__rw_yield(rw);
} while (unlikely(rw->lock < 0));
- HMT_medium();
+ HMT_medium_low();
}
}
@@ -254,7 +254,7 @@ static inline void arch_write_lock(arch_rwlock_t *rw)
if (SHARED_PROCESSOR)
__rw_yield(rw);
} while (unlikely(rw->lock != 0));
- HMT_medium();
+ HMT_medium_low();
}
}
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index 889ea2b..c3ee079 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -229,7 +229,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_STCX_CHECKS_ADDRESS)
beq- 1f
ACCOUNT_CPU_USER_EXIT(r11, r12)
- HMT_MEDIUM_LOW_HAS_PPR
+ HMT_LOW_HAS_PPR
ld r13,GPR13(r1) /* only restore r13 if returning to usermode */
1: ld r2,GPR2(r1)
ld r1,GPR1(r1)
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 2a273be..dd704d1 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -271,7 +271,7 @@ decrementer_pSeries:
. = 0xc00
.globl system_call_pSeries
system_call_pSeries:
- HMT_MEDIUM
+ HMT_MEDIUM_LOW
#ifdef CONFIG_KVM_BOOK3S_64_HANDLER
SET_SCRATCH0(r13)
GET_PACA(r13)
@@ -825,7 +825,7 @@ hardware_interrupt_relon_hv:
. = 0x4c00
.globl system_call_relon_pSeries
system_call_relon_pSeries:
- HMT_MEDIUM
+ HMT_MEDIUM_LOW
SYSCALL_PSERIES_1
SYSCALL_PSERIES_2_DIRECT
SYSCALL_PSERIES_3
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 2ae41ab..278c499 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -605,8 +605,8 @@ _GLOBAL(pmac_secondary_start)
.globl __secondary_start
__secondary_start:
- /* Set thread priority to MEDIUM */
- HMT_MEDIUM
+ /* Set thread priority to MEDIUM_LOW */
+ HMT_MEDIUM_LOW
/* Initialize the kernel stack */
LOAD_REG_ADDR(r3, current_set)
diff --git a/arch/powerpc/kernel/idle.c b/arch/powerpc/kernel/idle.c
index d7216c9..2c1e403 100644
--- a/arch/powerpc/kernel/idle.c
+++ b/arch/powerpc/kernel/idle.c
@@ -75,7 +75,7 @@ void arch_cpu_idle(void)
HMT_very_low();
}
- HMT_medium();
+ HMT_medium_low();
ppc64_runlatch_on();
}
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 5fe2842..60ec3c7 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -1383,7 +1383,7 @@ static void __init prom_opal_hold_cpus(void)
HMT_low();
mb();
}
- HMT_medium();
+ HMT_medium_low();
if (data->ack != -1)
prom_debug("done, PIR=0x%x\n", data->ack);
else
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 192b051..576ba95 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -399,7 +399,7 @@ void __delay(unsigned long loops)
start = get_tbl();
while (get_tbl() - start < loops)
HMT_low();
- HMT_medium();
+ HMT_medium_low();
}
}
EXPORT_SYMBOL(__delay);
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 350bc34..c82832b 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -1249,7 +1249,7 @@ static void kvmppc_wait_for_nap(struct kvmppc_vcore *vc)
}
cpu_relax();
}
- HMT_medium();
+ HMT_medium_low();
}
/*
diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
index 89d4fbe..b30724e 100644
--- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S
+++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
@@ -1045,7 +1045,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_201)
13: lbz r3,VCORE_IN_GUEST(r5)
cmpwi r3,0
bne 13b
- HMT_MEDIUM
+ HMT_MEDIUM_LOW
b 16f
/* Primary thread waits for all the secondaries to exit guest */
@@ -1317,7 +1317,7 @@ secondary_too_late:
13: lbz r3,VCORE_IN_GUEST(r5)
cmpwi r3,0
bne 13b
- HMT_MEDIUM
+ HMT_MEDIUM_LOW
li r0, KVM_GUEST_MODE_NONE
stb r0, HSTATE_IN_GUEST(r13)
ld r11,PACA_SLBSHADOWPTR(r13)
diff --git a/arch/powerpc/lib/locks.c b/arch/powerpc/lib/locks.c
index 0c9c8d7..d6eb1cf 100644
--- a/arch/powerpc/lib/locks.c
+++ b/arch/powerpc/lib/locks.c
@@ -75,7 +75,7 @@ void arch_spin_unlock_wait(arch_spinlock_t *lock)
if (SHARED_PROCESSOR)
__spin_yield(lock);
}
- HMT_medium();
+ HMT_medium_low();
}
EXPORT_SYMBOL(arch_spin_unlock_wait);
diff --git a/arch/powerpc/platforms/cell/beat_hvCall.S b/arch/powerpc/platforms/cell/beat_hvCall.S
index 96c8019..c4a929b 100644
--- a/arch/powerpc/platforms/cell/beat_hvCall.S
+++ b/arch/powerpc/platforms/cell/beat_hvCall.S
@@ -32,7 +32,7 @@
/* Note: takes only 7 input parameters at maximum */
_GLOBAL(beat_hcall_norets)
- HMT_MEDIUM
+ HMT_MEDIUM_LOW
mfcr r0
stw r0,8(r1)
@@ -58,7 +58,7 @@ _GLOBAL(beat_hcall_norets)
/* Note: takes 8 input parameters at maximum */
_GLOBAL(beat_hcall_norets8)
- HMT_MEDIUM
+ HMT_MEDIUM_LOW
mfcr r0
stw r0,8(r1)
@@ -85,7 +85,7 @@ _GLOBAL(beat_hcall_norets8)
/* Note: takes only 6 input parameters, 1 output parameters at maximum */
_GLOBAL(beat_hcall1)
- HMT_MEDIUM
+ HMT_MEDIUM_LOW
mfcr r0
stw r0,8(r1)
@@ -116,7 +116,7 @@ _GLOBAL(beat_hcall1)
/* Note: takes only 6 input parameters, 2 output parameters at maximum */
_GLOBAL(beat_hcall2)
- HMT_MEDIUM
+ HMT_MEDIUM_LOW
mfcr r0
stw r0,8(r1)
@@ -148,7 +148,7 @@ _GLOBAL(beat_hcall2)
/* Note: takes only 6 input parameters, 3 output parameters at maximum */
_GLOBAL(beat_hcall3)
- HMT_MEDIUM
+ HMT_MEDIUM_LOW
mfcr r0
stw r0,8(r1)
@@ -181,7 +181,7 @@ _GLOBAL(beat_hcall3)
/* Note: takes only 6 input parameters, 4 output parameters at maximum */
_GLOBAL(beat_hcall4)
- HMT_MEDIUM
+ HMT_MEDIUM_LOW
mfcr r0
stw r0,8(r1)
@@ -215,7 +215,7 @@ _GLOBAL(beat_hcall4)
/* Note: takes only 6 input parameters, 5 output parameters at maximum */
_GLOBAL(beat_hcall5)
- HMT_MEDIUM
+ HMT_MEDIUM_LOW
mfcr r0
stw r0,8(r1)
@@ -250,7 +250,7 @@ _GLOBAL(beat_hcall5)
/* Note: takes only 6 input parameters, 6 output parameters at maximum */
_GLOBAL(beat_hcall6)
- HMT_MEDIUM
+ HMT_MEDIUM_LOW
mfcr r0
stw r0,8(r1)
diff --git a/arch/powerpc/platforms/powernv/opal-takeover.S b/arch/powerpc/platforms/powernv/opal-takeover.S
index 3cd2628..e350790 100644
--- a/arch/powerpc/platforms/powernv/opal-takeover.S
+++ b/arch/powerpc/platforms/powernv/opal-takeover.S
@@ -74,7 +74,7 @@ opal_secondary_entry:
ld r4,8(r3)
cmpli cr0,r4,0
beq 1b
- HMT_MEDIUM
+ HMT_MEDIUM_LOW
1: addi r3,r31,16
bl __opal_do_takeover
b 1b
diff --git a/arch/powerpc/platforms/pseries/hvCall.S b/arch/powerpc/platforms/pseries/hvCall.S
index 444fe77..be90f7b 100644
--- a/arch/powerpc/platforms/pseries/hvCall.S
+++ b/arch/powerpc/platforms/pseries/hvCall.S
@@ -107,7 +107,7 @@ END_FTR_SECTION(0, 1); \
.text
_GLOBAL(plpar_hcall_norets)
- HMT_MEDIUM
+ HMT_MEDIUM_LOW
mfcr r0
stw r0,8(r1)
@@ -123,7 +123,7 @@ _GLOBAL(plpar_hcall_norets)
blr /* return r3 = status */
_GLOBAL(plpar_hcall)
- HMT_MEDIUM
+ HMT_MEDIUM_LOW
mfcr r0
stw r0,8(r1)
@@ -161,7 +161,7 @@ _GLOBAL(plpar_hcall)
* since these variables may not be present in the RMO region.
*/
_GLOBAL(plpar_hcall_raw)
- HMT_MEDIUM
+ HMT_MEDIUM_LOW
mfcr r0
stw r0,8(r1)
@@ -189,7 +189,7 @@ _GLOBAL(plpar_hcall_raw)
blr /* return r3 = status */
_GLOBAL(plpar_hcall9)
- HMT_MEDIUM
+ HMT_MEDIUM_LOW
mfcr r0
stw r0,8(r1)
@@ -231,7 +231,7 @@ _GLOBAL(plpar_hcall9)
/* See plpar_hcall_raw to see why this is needed */
_GLOBAL(plpar_hcall9_raw)
- HMT_MEDIUM
+ HMT_MEDIUM_LOW
mfcr r0
stw r0,8(r1)
diff --git a/arch/powerpc/platforms/pseries/processor_idle.c b/arch/powerpc/platforms/pseries/processor_idle.c
index a166e38..8124e24 100644
--- a/arch/powerpc/platforms/pseries/processor_idle.c
+++ b/arch/powerpc/platforms/pseries/processor_idle.c
@@ -68,7 +68,7 @@ static int snooze_loop(struct cpuidle_device *dev,
HMT_very_low();
}
- HMT_medium();
+ HMT_medium_low();
clear_thread_flag(TIF_POLLING_NRFLAG);
smp_mb();
@@ -104,7 +104,7 @@ static int dedicated_cede_loop(struct cpuidle_device *dev,
get_lppaca()->donate_dedicated_cpu = 1;
ppc64_runlatch_off();
- HMT_medium();
+ HMT_medium_low();
check_and_cede_processor();
get_lppaca()->donate_dedicated_cpu = 0;
--
1.7.10.4
^ permalink raw reply related
* Re: [PATCH V4 07/10] powerpc, lib: Add new branch instruction analysis support functions
From: Anshuman Khandual @ 2013-12-10 6:09 UTC (permalink / raw)
To: Michael Ellerman
Cc: mikey, ak, linux-kernel, eranian, linuxppc-dev, acme, sukadev,
mingo
In-Reply-To: <20131209062146.6D5C12C00BF@ozlabs.org>
On 12/09/2013 11:51 AM, Michael Ellerman wrote:
> On Wed, 2013-04-12 at 10:32:39 UTC, Anshuman Khandual wrote:
>> Generic powerpc branch instruction analysis support added in the code
>> patching library which will help the subsequent patch on SW based
>> filtering of branch records in perf. This patch also converts and
>> exports some of the existing local static functions through the header
>> file to be used else where.
>>
>> diff --git a/arch/powerpc/include/asm/code-patching.h b/arch/powerpc/include/asm/code-patching.h
>> index a6f8c7a..8bab417 100644
>> --- a/arch/powerpc/include/asm/code-patching.h
>> +++ b/arch/powerpc/include/asm/code-patching.h
>> @@ -22,6 +22,36 @@
>> #define BRANCH_SET_LINK 0x1
>> #define BRANCH_ABSOLUTE 0x2
>>
>> +#define XL_FORM_LR 0x4C000020
>> +#define XL_FORM_CTR 0x4C000420
>> +#define XL_FORM_TAR 0x4C000460
>> +
>> +#define BO_ALWAYS 0x02800000
>> +#define BO_CTR 0x02000000
>> +#define BO_CRBI_OFF 0x00800000
>> +#define BO_CRBI_ON 0x01800000
>> +#define BO_CRBI_HINT 0x00400000
>> +
>> +/* Forms of branch instruction */
>> +int instr_is_branch_iform(unsigned int instr);
>> +int instr_is_branch_bform(unsigned int instr);
>> +int instr_is_branch_xlform(unsigned int instr);
>> +
>> +/* Classification of XL-form instruction */
>> +int is_xlform_lr(unsigned int instr);
>> +int is_xlform_ctr(unsigned int instr);
>> +int is_xlform_tar(unsigned int instr);
>> +
>> +/* Branch instruction is a call */
>> +int is_branch_link_set(unsigned int instr);
>> +
>> +/* BO field analysis (B-form or XL-form) */
>> +int is_bo_always(unsigned int instr);
>> +int is_bo_ctr(unsigned int instr);
>> +int is_bo_crbi_off(unsigned int instr);
>> +int is_bo_crbi_on(unsigned int instr);
>> +int is_bo_crbi_hint(unsigned int instr);
>
>
> I think this is the wrong API.
>
> We end up with all these micro checks, which don't actually encapsulate much,
> and don't implement the logic perf needs. If we had another user for this level
> of detail then it might make sense, but for a single user I think we're better
> off just implementing the semantics it wants.
>
Having a comprehensive list of branch instruction analysis APIs which some other
user can also use in the future does not make it wrong. Being more elaborate and
detailed makes this one a better choice than the API you have suggested below.
> So that would be something more like:
>
> bool instr_is_return_branch(unsigned int instr);
> bool instr_is_conditional_branch(unsigned int instr);
> bool instr_is_func_call(unsigned int instr);
> bool instr_is_indirect_func_call(unsigned int instr);
>
>
> These would then encapsulate something like the logic in your 8/10 patch. You
> can hopefully also optimise the checking logic in each routine because you know
> the exact semantics you're implementing.
^ permalink raw reply
* Re: [PATCH V4 08/10] powerpc, perf: Enable SW filtering in branch stack sampling framework
From: Anshuman Khandual @ 2013-12-10 5:57 UTC (permalink / raw)
To: Michael Ellerman
Cc: mikey, ak, linux-kernel, eranian, linuxppc-dev, acme, sukadev,
mingo
In-Reply-To: <20131209062146.EABBE2C00C1@ozlabs.org>
On 12/09/2013 11:51 AM, Michael Ellerman wrote:
> This code was already in need of some unindentation, and now it's just
> ridiculous.
>
> To start with at the beginning of this routine we have:
>
> while (..) {
> if (!val)
> break;
> else {
> // Bulk of the logic
> ...
> }
> }
>
> That should almost always become:
>
> while (..) {
> if (!val)
> break;
>
> // Bulk of the logic
> ...
> }
>
>
> But in this case that's not enough. Please send a precursor patch which moves
> this logic out into a helper function.
Hey Michael,
I believe this patch should be able to take care of this.
commit d66d729715cabe0cfd8e34861a6afa8ad639ddf3
Author: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Date: Tue Dec 10 11:10:06 2013 +0530
power, perf: Clean up BHRB processing
This patch cleans up some indentation problem and re-organizes the
BHRB processing code with an additional helper function.
Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
index 29b89e8..9ae96c5 100644
--- a/arch/powerpc/perf/core-book3s.c
+++ b/arch/powerpc/perf/core-book3s.c
@@ -400,11 +400,20 @@ static __u64 power_pmu_bhrb_to(u64 addr)
return target - (unsigned long)&instr + addr;
}
+void update_branch_entry(struct cpu_hw_events *cpuhw, int u_index, u64 from, u64 to, int pred)
+{
+ cpuhw->bhrb_entries[u_index].from = from;
+ cpuhw->bhrb_entries[u_index].to = to;
+ cpuhw->bhrb_entries[u_index].mispred = pred;
+ cpuhw->bhrb_entries[u_index].predicted = ~pred;
+ return;
+}
+
/* Processing BHRB entries */
void power_pmu_bhrb_read(struct cpu_hw_events *cpuhw)
{
u64 val;
- u64 addr;
+ u64 addr, tmp;
int r_index, u_index, pred;
r_index = 0;
@@ -415,62 +424,54 @@ void power_pmu_bhrb_read(struct cpu_hw_events *cpuhw)
if (!val)
/* Terminal marker: End of valid BHRB entries */
break;
- else {
- addr = val & BHRB_EA;
- pred = val & BHRB_PREDICTION;
- if (!addr)
- /* invalid entry */
- continue;
+ addr = val & BHRB_EA;
+ pred = val & BHRB_PREDICTION;
- /* Branches are read most recent first (ie. mfbhrb 0 is
- * the most recent branch).
- * There are two types of valid entries:
- * 1) a target entry which is the to address of a
- * computed goto like a blr,bctr,btar. The next
- * entry read from the bhrb will be branch
- * corresponding to this target (ie. the actual
- * blr/bctr/btar instruction).
- * 2) a from address which is an actual branch. If a
- * target entry proceeds this, then this is the
- * matching branch for that target. If this is not
- * following a target entry, then this is a branch
- * where the target is given as an immediate field
- * in the instruction (ie. an i or b form branch).
- * In this case we need to read the instruction from
- * memory to determine the target/to address.
+ if (!addr)
+ /* invalid entry */
+ continue;
+
+ /* Branches are read most recent first (ie. mfbhrb 0 is
+ * the most recent branch).
+ * There are two types of valid entries:
+ * 1) a target entry which is the to address of a
+ * computed goto like a blr,bctr,btar. The next
+ * entry read from the bhrb will be branch
+ * corresponding to this target (ie. the actual
+ * blr/bctr/btar instruction).
+ * 2) a from address which is an actual branch. If a
+ * target entry proceeds this, then this is the
+ * matching branch for that target. If this is not
+ * following a target entry, then this is a branch
+ * where the target is given as an immediate field
+ * in the instruction (ie. an i or b form branch).
+ * In this case we need to read the instruction from
+ * memory to determine the target/to address.
+ */
+ if (val & BHRB_TARGET) {
+ /* Target branches use two entries
+ * (ie. computed gotos/XL form)
*/
+ tmp = addr;
+ /* Get from address in next entry */
+ val = read_bhrb(r_index++);
+ addr = val & BHRB_EA;
if (val & BHRB_TARGET) {
- /* Target branches use two entries
- * (ie. computed gotos/XL form)
- */
- cpuhw->bhrb_entries[u_index].to = addr;
- cpuhw->bhrb_entries[u_index].mispred = pred;
- cpuhw->bhrb_entries[u_index].predicted = ~pred;
-
- /* Get from address in next entry */
- val = read_bhrb(r_index++);
- addr = val & BHRB_EA;
- if (val & BHRB_TARGET) {
- /* Shouldn't have two targets in a
- row.. Reset index and try again */
- r_index--;
- addr = 0;
- }
- cpuhw->bhrb_entries[u_index].from = addr;
- } else {
- /* Branches to immediate field
- (ie I or B form) */
- cpuhw->bhrb_entries[u_index].from = addr;
- cpuhw->bhrb_entries[u_index].to =
- power_pmu_bhrb_to(addr);
- cpuhw->bhrb_entries[u_index].mispred = pred;
- cpuhw->bhrb_entries[u_index].predicted = ~pred;
+ /* Shouldn't have two targets in a
+ row.. Reset index and try again */
+ r_index--;
+ addr = 0;
}
- u_index++;
-
+ update_branch_entry(cpuhw, u_index, addr, tmp, pred);
+ } else {
+ /* Branches to immediate field
+ (ie I or B form) */
+ tmp = power_pmu_bhrb_to(addr);
+ update_branch_entry(cpuhw, u_index, addr, tmp, pred);
}
+ u_index++;
}
cpuhw->bhrb_stack.nr = u_index;
return;
^ permalink raw reply related
* Re: [PATCH 0/9 v2] vfio-pci: add support for Freescale IOMMU (PAMU)
From: Alex Williamson @ 2013-12-10 5:53 UTC (permalink / raw)
To: Bharat.Bhushan@freescale.com
Cc: linux-pci@vger.kernel.org, agraf@suse.de, Stuart Yoder,
bhelgaas@google.com, iommu@lists.linux-foundation.org, Scott Wood,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
In-Reply-To: <326a93628a9141a9abce97b7bb4e04fd@BN1PR03MB266.namprd03.prod.outlook.com>
On Tue, 2013-12-10 at 05:37 +0000, Bharat.Bhushan@freescale.com wrote:
>
> > -----Original Message-----
> > From: Alex Williamson [mailto:alex.williamson@redhat.com]
> > Sent: Saturday, December 07, 2013 1:00 AM
> > To: Wood Scott-B07421
> > Cc: Bhushan Bharat-R65777; linux-pci@vger.kernel.org; agraf@suse.de; Yoder
> > Stuart-B08248; iommu@lists.linux-foundation.org; bhelgaas@google.com; linuxppc-
> > dev@lists.ozlabs.org; linux-kernel@vger.kernel.org
> > Subject: Re: [PATCH 0/9 v2] vfio-pci: add support for Freescale IOMMU (PAMU)
> >
> > On Fri, 2013-12-06 at 12:59 -0600, Scott Wood wrote:
> > > On Thu, 2013-12-05 at 22:11 -0600, Bharat Bhushan wrote:
> > > >
> > > > > -----Original Message-----
> > > > > From: Wood Scott-B07421
> > > > > Sent: Friday, December 06, 2013 5:52 AM
> > > > > To: Bhushan Bharat-R65777
> > > > > Cc: Alex Williamson; linux-pci@vger.kernel.org; agraf@suse.de;
> > > > > Yoder Stuart- B08248; iommu@lists.linux-foundation.org;
> > > > > bhelgaas@google.com; linuxppc- dev@lists.ozlabs.org;
> > > > > linux-kernel@vger.kernel.org
> > > > > Subject: Re: [PATCH 0/9 v2] vfio-pci: add support for Freescale
> > > > > IOMMU (PAMU)
> > > > >
> > > > > On Thu, 2013-11-28 at 03:19 -0600, Bharat Bhushan wrote:
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: Bhushan Bharat-R65777
> > > > > > > Sent: Wednesday, November 27, 2013 9:39 PM
> > > > > > > To: 'Alex Williamson'
> > > > > > > Cc: Wood Scott-B07421; linux-pci@vger.kernel.org;
> > > > > > > agraf@suse.de; Yoder Stuart- B08248;
> > > > > > > iommu@lists.linux-foundation.org; bhelgaas@google.com;
> > > > > > > linuxppc- dev@lists.ozlabs.org; linux-kernel@vger.kernel.org
> > > > > > > Subject: RE: [PATCH 0/9 v2] vfio-pci: add support for
> > > > > > > Freescale IOMMU (PAMU)
> > > > > > >
> > > > > > > If we just provide the size of MSI bank to userspace then
> > > > > > > userspace cannot do anything wrong.
> > > > > >
> > > > > > So userspace does not know address, so it cannot mmap and cause
> > > > > > any
> > > > > interference by directly reading/writing.
> > > > >
> > > > > That's security through obscurity... Couldn't the malicious user
> > > > > find out the address via other means, such as experimentation on
> > > > > another system over which they have full control? What would
> > > > > happen if the user reads from their device's PCI config space? Or
> > > > > gets the information via some back door in the PCI device they
> > > > > own? Or pokes throughout the address space looking for something that
> > generates an interrupt to its own device?
> > > >
> > > > So how to solve this problem, Any suggestion ?
> > > >
> > > > We have to map one window in PAMU for MSIs and a malicious user can
> > > > ask its device to do DMA to MSI window region with any pair of
> > > > address and data, which can lead to unexpected MSIs in system?
> > >
> > > I don't think there are any solutions other than to limit each bank to
> > > one user, unless the admin turns some knob that says they're OK with
> > > the partial loss of isolation.
> >
> > Even if the admin does opt-in to an allow_unsafe_interrupts options, it should
> > still be reasonably difficult for one guest to interfere with the other. I
> > don't think we want to rely on the blind luck of making the full MSI bank
> > accessible to multiple guests and hoping they don't step on each other.
>
> Not sure how to solve in this case (sharing MSI page)
>
> > That probably means that vfio needs to manage the space rather than the guest.
>
> What you mean by " vfio needs to manage the space rather than the guest"?
I mean there needs to be some kernel component managing the contents of
the MSI page rather than just handing it out to the user and hoping for
the best. The user API also needs to remain the same whether the user
has the MSI page exclusively or it's shared with others (kernel or
users). Thanks,
Alex
^ permalink raw reply
* RE: [PATCH 0/9 v2] vfio-pci: add support for Freescale IOMMU (PAMU)
From: Bharat.Bhushan @ 2013-12-10 5:37 UTC (permalink / raw)
To: Alex Williamson, Scott Wood
Cc: linux-pci@vger.kernel.org, agraf@suse.de, Stuart Yoder,
Bharat.Bhushan@freescale.com, iommu@lists.linux-foundation.org,
bhelgaas@google.com, linuxppc-dev@lists.ozlabs.org,
linux-kernel@vger.kernel.org
In-Reply-To: <1386358226.25738.506.camel@ul30vt.home>
DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogQWxleCBXaWxsaWFtc29u
IFttYWlsdG86YWxleC53aWxsaWFtc29uQHJlZGhhdC5jb21dDQo+IFNlbnQ6IFNhdHVyZGF5LCBE
ZWNlbWJlciAwNywgMjAxMyAxOjAwIEFNDQo+IFRvOiBXb29kIFNjb3R0LUIwNzQyMQ0KPiBDYzog
Qmh1c2hhbiBCaGFyYXQtUjY1Nzc3OyBsaW51eC1wY2lAdmdlci5rZXJuZWwub3JnOyBhZ3JhZkBz
dXNlLmRlOyBZb2Rlcg0KPiBTdHVhcnQtQjA4MjQ4OyBpb21tdUBsaXN0cy5saW51eC1mb3VuZGF0
aW9uLm9yZzsgYmhlbGdhYXNAZ29vZ2xlLmNvbTsgbGludXhwcGMtDQo+IGRldkBsaXN0cy5vemxh
YnMub3JnOyBsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnDQo+IFN1YmplY3Q6IFJlOiBbUEFU
Q0ggMC85IHYyXSB2ZmlvLXBjaTogYWRkIHN1cHBvcnQgZm9yIEZyZWVzY2FsZSBJT01NVSAoUEFN
VSkNCj4gDQo+IE9uIEZyaSwgMjAxMy0xMi0wNiBhdCAxMjo1OSAtMDYwMCwgU2NvdHQgV29vZCB3
cm90ZToNCj4gPiBPbiBUaHUsIDIwMTMtMTItMDUgYXQgMjI6MTEgLTA2MDAsIEJoYXJhdCBCaHVz
aGFuIHdyb3RlOg0KPiA+ID4NCj4gPiA+ID4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4g
PiA+ID4gRnJvbTogV29vZCBTY290dC1CMDc0MjENCj4gPiA+ID4gU2VudDogRnJpZGF5LCBEZWNl
bWJlciAwNi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XB0cyBvcHRp
b25zLCBpdCBzaG91bGQNCj4gc3RpbGwgYmUgcmVhc29uYWJseSBkaWZmaWN1bHQgZm9yIG9uZSBn
dWVzdCB0byBpbnRlcmZlcmUgd2l0aCB0aGUgb3RoZXIuICBJDQo+IGRvbid0IHRoaW5rIHdlIHdh
bnQgdG8gcmVseSBvbiB0aGUgYmxpbmQgbHVjayBvZiBtYWtpbmcgdGhlIGZ1bGwgTVNJIGJhbmsN
Cj4gYWNjZXNzaWJsZSB0byBtdWx0aXBsZSBndWVzdHMgYW5kIGhvcGluZyB0aGV5IGRvbid0IHN0
ZXAgb24gZWFjaCBvdGhlci4NCg0KTm90IHN1cmUgaG93IHRvIHNvbHZlIGluIHRoaXMgY2FzZSAo
c2hhcmluZyBNU0kgcGFnZSkNCg0KPiAgVGhhdCBwcm9iYWJseSBtZWFucyB0aGF0IHZmaW8gbmVl
ZHMgdG8gbWFuYWdlIHRoZSBzcGFjZSByYXRoZXIgdGhhbiB0aGUgZ3Vlc3QuDQoNCldoYXQgeW91
IG1lYW4gYnkgIiB2ZmlvIG5lZWRzIHRvIG1hbmFnZSB0aGUgc3BhY2UgcmF0aGVyIHRoYW4gdGhl
IGd1ZXN0Ij8NCg0KVGhhbmtzDQotQmhhcmF0DQoNCj4gVGhhbmtzLA0KPiANCj4gQWxleA0KPiAN
Cg0K
^ permalink raw reply
* RE: [PATCH 0/9 v2] vfio-pci: add support for Freescale IOMMU (PAMU)
From: Bharat.Bhushan @ 2013-12-10 5:37 UTC (permalink / raw)
To: 'Wood Scott-B07421', Bharat.Bhushan@freescale.com
Cc: linux-pci@vger.kernel.org, agraf@suse.de,
iommu@lists.linux-foundation.org, Stuart Yoder, Alex Williamson,
bhelgaas@google.com, linuxppc-dev@lists.ozlabs.org,
linux-kernel@vger.kernel.org
In-Reply-To: <1386357907.7375.127.camel@snotra.buserror.net>
DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogV29vZCBTY290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us Torvalds; +Cc: linuxppc-dev, Linux Kernel list
In-Reply-To: <CA+55aFz_VXtkX0vH+T2kGpzA90Zqys=_quJFq3fGT68YTCnBtw@mail.gmail.com>
On Mon, 2013-12-09 at 19:58 -0800, Linus Torvalds wrote:
> On Mon, Dec 9, 2013 at 5:57 PM, Benjamin Herrenschmidt
> <benh@kernel.crashing.org> wrote:
> >
> > Here are a handful of powerpc fixes for 3.13.
>
> Grr.
>
> I've pulled it, but looking at that history, it's just pure and utter
> f*cking garbage.
>
> It was rebased *minutes* before sending it, as far as I can tell. Why?
It was *created* shortly before sending it:
Basically I put that thing together as a patchwork bundle which I grew
over this week.
Today I just applied them to my git, ran my build testers, booted a
machine to dbl check and sent. I tend to not let things linger long in
git when it's just fixes like that.
> And it has a pointless merge that you must have created with "--no-ff"
> for no apparent good reason.
Oh that's my fault. I thought you preferred that way to keep track of
cases where I pull from somebody since then the patch don't have my
s-o-b... my bad for misunderstanding that part of the process.
> WTF? What the hell happened here, and why? As mentioned, it's in my
> tree, but I was *this* close to just unpulling and saying "fuck that"
> when I started looking at it.
Heh sorry.
Cheers,
Ben.
>
> Linus
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply
* Re: [PATCH 1/9] PCI: Use dev_is_pci() to check whether it is pci device
From: Benjamin Herrenschmidt @ 2013-12-10 3:59 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linux-ia64, linux-parisc, linux-pci, linux-alpha, linux-kernel,
sparclinux, Hanjun Guo, Yijing Wang, linuxppc-dev,
linux-arm-kernel
In-Reply-To: <20131210000154.GE4699@google.com>
On Mon, 2013-12-09 at 17:01 -0700, Bjorn Helgaas wrote:
> [+cc arch lists]
>
> On Thu, Dec 05, 2013 at 07:52:53PM +0800, Yijing Wang wrote:
> > Use dev_is_pci() instead of directly compare
> > pci_bus_type to check whether it is pci device.
> >
> > Signed-off-by: Yijing Wang <wangyijing@huawei.com>
>
> I applied all these to my pci/yijing-dev_is_pci branch for v3.14, thanks!
>
> Browse them here: http://git.kernel.org/cgit/linux/kernel/git/helgaas/pci.git/log/?h=pci/yijing-dev_is_pci
Ah ok. I also have the powerpc one in powerpc -next, no biggie though
Cheers,
Ben.
> This should be no functional change.
>
> arch/alpha/kernel/pci_iommu.c | 2 +-
> arch/arm/common/it8152.c | 4 ++--
> arch/arm/mach-ixp4xx/common-pci.c | 6 +++---
> arch/ia64/hp/common/sba_iommu.c | 2 +-
> arch/ia64/sn/pci/pci_dma.c | 24 ++++++++++++------------
> arch/parisc/kernel/drivers.c | 22 +++++-----------------
> arch/powerpc/sysdev/fsl_pci.c | 2 +-
> arch/sparc/include/asm/dma-mapping.h | 10 ++++------
> arch/sparc/kernel/iommu.c | 2 +-
> arch/sparc/kernel/ioport.c | 4 +---
> arch/x86/kernel/acpi/boot.c | 4 +---
> drivers/pci/pci-acpi.c | 2 +-
> 12 files changed, 33 insertions(+), 51 deletions(-)
>
> Bjorn
>
> > ---
> > drivers/pci/pci-acpi.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
> > index 577074e..e0431f1 100644
> > --- a/drivers/pci/pci-acpi.c
> > +++ b/drivers/pci/pci-acpi.c
> > @@ -358,7 +358,7 @@ static void pci_acpi_cleanup(struct device *dev)
> >
> > static bool pci_acpi_bus_match(struct device *dev)
> > {
> > - return dev->bus == &pci_bus_type;
> > + return dev_is_pci(dev);
> > }
> >
> > static struct acpi_bus_type acpi_pci_bus = {
> > --
> > 1.7.1
> >
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
^ permalink raw reply
* Re: [git pull] Please pull powerpc.git merge branch
From: Linus Torvalds @ 2013-12-10 3:58 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Linux Kernel list
In-Reply-To: <1386640667.32037.53.camel@pasglop>
On Mon, Dec 9, 2013 at 5:57 PM, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
>
> Here are a handful of powerpc fixes for 3.13.
Grr.
I've pulled it, but looking at that history, it's just pure and utter
f*cking garbage.
It was rebased *minutes* before sending it, as far as I can tell. Why?
And it has a pointless merge that you must have created with "--no-ff"
for no apparent good reason.
WTF? What the hell happened here, and why? As mentioned, it's in my
tree, but I was *this* close to just unpulling and saying "fuck that"
when I started looking at it.
Linus
^ permalink raw reply
* [PATCH] powerpc/pseries: Select ARCH_RANDOM on pseries
From: Michael Ellerman @ 2013-12-10 3:02 UTC (permalink / raw)
To: linuxppc-dev
We have a driver for the ARCH_RANDOM hook in rng.c, so we should select
ARCH_RANDOM on pseries.
Without this the build breaks if you turn ARCH_RANDOM off.
This hasn't broken the build because pseries_defconfig doesn't specify a
value for PPC_POWERNV, which is default y, and selects ARCH_RANDOM.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/platforms/pseries/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig
index 62b4f80..c8fe7be 100644
--- a/arch/powerpc/platforms/pseries/Kconfig
+++ b/arch/powerpc/platforms/pseries/Kconfig
@@ -20,6 +20,7 @@ config PPC_PSERIES
select PPC_DOORBELL
select HAVE_CONTEXT_TRACKING
select HOTPLUG_CPU if SMP
+ select ARCH_RANDOM
default y
config PPC_SPLPAR
--
1.8.3.2
^ permalink raw reply related
* Re: [PATCH] powerpc/pseries: Don't try to register pseries cpu hotplug on non-pseries
From: Benjamin Herrenschmidt @ 2013-12-10 2:07 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev list
In-Reply-To: <1386640934.26691.5.camel@concordia>
On Tue, 2013-12-10 at 13:02 +1100, Michael Ellerman wrote:
> On Tue, 2013-12-10 at 11:31 +1100, Benjamin Herrenschmidt wrote:
> > This results in oddball messages at boot on other platforms telling us
> > that CPU hotplug isn't supported even when it is.
>
> We have a bunch more. Most are probably safe because they rely on the device
> tree but we should probably convert them anyway?
Possibly :-) This one I spotted specifically because I was looking at a
boot log on powernv and it was insulting me !
> $ git grep initcall arch/powerpc/platforms/pseries/ | grep -v machine_
> arch/powerpc/platforms/pseries/dtl.c:arch_initcall(dtl_init);
> arch/powerpc/platforms/pseries/eeh_pseries.c:early_initcall(eeh_pseries_init);
> arch/powerpc/platforms/pseries/hotplug-cpu.c:arch_initcall(pseries_cpu_hotplug_init);
> arch/powerpc/platforms/pseries/hvCall_inst.c:__initcall(hcall_inst_init);
> arch/powerpc/platforms/pseries/mobility.c:device_initcall(mobility_sysfs_init);
> arch/powerpc/platforms/pseries/msi.c:arch_initcall(rtas_msi_init);
> arch/powerpc/platforms/pseries/power.c:core_initcall(pm_init);
> arch/powerpc/platforms/pseries/power.c:__initcall(apo_pm_init);
> arch/powerpc/platforms/pseries/ras.c:subsys_initcall(init_ras_IRQ);
> arch/powerpc/platforms/pseries/reconfig.c:__initcall(proc_ppc64_create_ofdt);
> arch/powerpc/platforms/pseries/rng.c:subsys_initcall(rng_init);
> arch/powerpc/platforms/pseries/setup.c:early_initcall(alloc_dispatch_log_kmem_cache);
> arch/powerpc/platforms/pseries/suspend.c:__initcall(pseries_suspend_init);
>
> cheers
>
^ permalink raw reply
* Re: [PATCH] powerpc/pseries: Don't try to register pseries cpu hotplug on non-pseries
From: Michael Ellerman @ 2013-12-10 2:02 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev list
In-Reply-To: <1386635462.32037.44.camel@pasglop>
On Tue, 2013-12-10 at 11:31 +1100, Benjamin Herrenschmidt wrote:
> This results in oddball messages at boot on other platforms telling us
> that CPU hotplug isn't supported even when it is.
We have a bunch more. Most are probably safe because they rely on the device
tree but we should probably convert them anyway?
$ git grep initcall arch/powerpc/platforms/pseries/ | grep -v machine_
arch/powerpc/platforms/pseries/dtl.c:arch_initcall(dtl_init);
arch/powerpc/platforms/pseries/eeh_pseries.c:early_initcall(eeh_pseries_init);
arch/powerpc/platforms/pseries/hotplug-cpu.c:arch_initcall(pseries_cpu_hotplug_init);
arch/powerpc/platforms/pseries/hvCall_inst.c:__initcall(hcall_inst_init);
arch/powerpc/platforms/pseries/mobility.c:device_initcall(mobility_sysfs_init);
arch/powerpc/platforms/pseries/msi.c:arch_initcall(rtas_msi_init);
arch/powerpc/platforms/pseries/power.c:core_initcall(pm_init);
arch/powerpc/platforms/pseries/power.c:__initcall(apo_pm_init);
arch/powerpc/platforms/pseries/ras.c:subsys_initcall(init_ras_IRQ);
arch/powerpc/platforms/pseries/reconfig.c:__initcall(proc_ppc64_create_ofdt);
arch/powerpc/platforms/pseries/rng.c:subsys_initcall(rng_init);
arch/powerpc/platforms/pseries/setup.c:early_initcall(alloc_dispatch_log_kmem_cache);
arch/powerpc/platforms/pseries/suspend.c:__initcall(pseries_suspend_init);
cheers
^ permalink raw reply
* [git pull] Please pull powerpc.git merge branch
From: Benjamin Herrenschmidt @ 2013-12-10 1:57 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linuxppc-dev, Linux Kernel list
Hi Linus !
Here are a handful of powerpc fixes for 3.13.
The patches are reasonably trivial and self contained. Note the
offb patches outside of arch/powerpc, they are LE fixes for our
open-firmware "dumb" framebuffer.
Cheers,
Ben.
The following changes since commit 721cb59e9d95eb7f47ec73711ed35ef85e1ea1ca:
powerpc/windfarm: Fix XServe G5 fan control Makefile issue (2013-11-27 11:35:47 +1100)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git merge
for you to fetch changes up to e641eb03ab2b0f065fa5e64b4202fb5b0441b427:
powerpc: Fix up the kdump base cap to 128M (2013-12-10 11:28:39 +1100)
----------------------------------------------------------------
Anatolij Gustschin (1):
powerpc/52xx: Re-enable bestcomm driver in defconfigs
Cedric Le Goater (2):
offb: Little endian fixes
offb: Add palette hack for little endian
Gerhard Sittig (1):
powerpc/512x: dts: remove misplaced IRQ spec from 'soc' node
Hong H. Pham (1):
powerpc: Fix PTE page address mismatch in pgtable ctor/dtor
Ilia Mirkin (1):
powerpc/44x: Fix ocm_block allocation
Mahesh Salgaonkar (1):
powerpc: Fix up the kdump base cap to 128M
Michael Ellerman (1):
powerpc: Fix build break with PPC_EARLY_DEBUG_BOOTX=y
Olof Johansson (1):
powerpc/pasemi: Turn on devtmpfs in defconfig
Thadeu Lima de Souza Cascardo (1):
powernv: Fix VFIO support with PHB3
arch/powerpc/boot/dts/mpc5121.dtsi | 1 -
arch/powerpc/configs/52xx/cm5200_defconfig | 3 ++-
arch/powerpc/configs/52xx/lite5200b_defconfig | 3 ++-
arch/powerpc/configs/52xx/motionpro_defconfig | 3 ++-
arch/powerpc/configs/52xx/pcm030_defconfig | 3 ++-
arch/powerpc/configs/52xx/tqm5200_defconfig | 3 ++-
arch/powerpc/configs/mpc5200_defconfig | 3 ++-
arch/powerpc/configs/pasemi_defconfig | 7 +++----
arch/powerpc/include/asm/pgalloc-32.h | 6 ++----
arch/powerpc/include/asm/pgalloc-64.h | 6 ++----
arch/powerpc/kernel/machine_kexec.c | 2 +-
arch/powerpc/kernel/misc_64.S | 5 ++++-
arch/powerpc/platforms/powernv/pci-ioda.c | 1 +
arch/powerpc/sysdev/ppc4xx_ocm.c | 2 +-
drivers/video/offb.c | 29 +++++++++++++++++++--------
15 files changed, 47 insertions(+), 30 deletions(-)
^ permalink raw reply
* [PATCH] powerpc/pseries: Don't try to register pseries cpu hotplug on non-pseries
From: Benjamin Herrenschmidt @ 2013-12-10 0:31 UTC (permalink / raw)
To: linuxppc-dev list
This results in oddball messages at boot on other platforms telling us
that CPU hotplug isn't supported even when it is.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
arch/powerpc/platforms/pseries/hotplug-cpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index a8ef932..171b0c7 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -420,4 +420,4 @@ static int __init pseries_cpu_hotplug_init(void)
return 0;
}
-arch_initcall(pseries_cpu_hotplug_init);
+machine_arch_initcall(pseries, pseries_cpu_hotplug_init);
^ permalink raw reply related
* Re: [PATCH 1/9] PCI: Use dev_is_pci() to check whether it is pci device
From: Bjorn Helgaas @ 2013-12-10 0:01 UTC (permalink / raw)
To: Yijing Wang
Cc: linux-ia64, linux-parisc, linux-pci, Hanjun Guo, linux-kernel,
linux-alpha, sparclinux, linuxppc-dev, linux-arm-kernel
In-Reply-To: <1386244373-35796-1-git-send-email-wangyijing@huawei.com>
[+cc arch lists]
On Thu, Dec 05, 2013 at 07:52:53PM +0800, Yijing Wang wrote:
> Use dev_is_pci() instead of directly compare
> pci_bus_type to check whether it is pci device.
>
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
I applied all these to my pci/yijing-dev_is_pci branch for v3.14, thanks!
Browse them here: http://git.kernel.org/cgit/linux/kernel/git/helgaas/pci.git/log/?h=pci/yijing-dev_is_pci
This should be no functional change.
arch/alpha/kernel/pci_iommu.c | 2 +-
arch/arm/common/it8152.c | 4 ++--
arch/arm/mach-ixp4xx/common-pci.c | 6 +++---
arch/ia64/hp/common/sba_iommu.c | 2 +-
arch/ia64/sn/pci/pci_dma.c | 24 ++++++++++++------------
arch/parisc/kernel/drivers.c | 22 +++++-----------------
arch/powerpc/sysdev/fsl_pci.c | 2 +-
arch/sparc/include/asm/dma-mapping.h | 10 ++++------
arch/sparc/kernel/iommu.c | 2 +-
arch/sparc/kernel/ioport.c | 4 +---
arch/x86/kernel/acpi/boot.c | 4 +---
drivers/pci/pci-acpi.c | 2 +-
12 files changed, 33 insertions(+), 51 deletions(-)
Bjorn
> ---
> drivers/pci/pci-acpi.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
> index 577074e..e0431f1 100644
> --- a/drivers/pci/pci-acpi.c
> +++ b/drivers/pci/pci-acpi.c
> @@ -358,7 +358,7 @@ static void pci_acpi_cleanup(struct device *dev)
>
> static bool pci_acpi_bus_match(struct device *dev)
> {
> - return dev->bus == &pci_bus_type;
> + return dev_is_pci(dev);
> }
>
> static struct acpi_bus_type acpi_pci_bus = {
> --
> 1.7.1
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH] powerpc/pasemi: turn on devtmpfs in defconfig
From: Olof Johansson @ 2013-12-09 23:40 UTC (permalink / raw)
To: benh; +Cc: Olof Johansson, linuxppc-dev
At least some distros expect it these days; turn it on. Also, random
churn from doing a savedefconfig for the first time in a year or so.
Signed-off-by: Olof Johansson <olof@lixom.net>
---
arch/powerpc/configs/pasemi_defconfig | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/configs/pasemi_defconfig b/arch/powerpc/configs/pasemi_defconfig
index bd8a6f7..cec044a 100644
--- a/arch/powerpc/configs/pasemi_defconfig
+++ b/arch/powerpc/configs/pasemi_defconfig
@@ -2,7 +2,6 @@ CONFIG_PPC64=y
CONFIG_ALTIVEC=y
CONFIG_SMP=y
CONFIG_NR_CPUS=2
-CONFIG_EXPERIMENTAL=y
CONFIG_SYSVIPC=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
@@ -45,8 +44,9 @@ CONFIG_INET_AH=y
CONFIG_INET_ESP=y
# CONFIG_IPV6 is not set
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
CONFIG_MTD=y
-CONFIG_MTD_CHAR=y
CONFIG_MTD_BLOCK=y
CONFIG_MTD_SLRAM=y
CONFIG_MTD_PHRAM=y
@@ -88,7 +88,6 @@ CONFIG_BLK_DEV_DM=y
CONFIG_DM_CRYPT=y
CONFIG_NETDEVICES=y
CONFIG_DUMMY=y
-CONFIG_MII=y
CONFIG_TIGON3=y
CONFIG_E1000=y
CONFIG_PASEMI_MAC=y
@@ -174,8 +173,8 @@ CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=y
CONFIG_CRC_CCITT=y
CONFIG_PRINTK_TIME=y
-CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_FS=y
+CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_KERNEL=y
CONFIG_DETECT_HUNG_TASK=y
# CONFIG_SCHED_DEBUG is not set
--
1.7.10.4
^ permalink raw reply related
* Re: [PATCH] powerpc: Fix "attempt to move .org backwards" error
From: Benjamin Herrenschmidt @ 2013-12-09 23:26 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Mahesh J Salgaonkar, linux-next, Paul Mackerras, Linux Kernel,
linuxppc-dev
In-Reply-To: <20131210101031.82b02468d32ddb89481b24b9@canb.auug.org.au>
On Tue, 2013-12-10 at 10:10 +1100, Stephen Rothwell wrote:
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Tested-by: Stephen Rothwell <sfr@canb.auug.org.au>
>
> Works for me. Thanks. I will add this to linux-next today if Ben
> doesn't add it to his tree.
I will but probably not soon enough for your cut today
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH] powerpc: Fix "attempt to move .org backwards" error
From: Stephen Rothwell @ 2013-12-09 23:10 UTC (permalink / raw)
To: Mahesh J Salgaonkar
Cc: linuxppc-dev, linux-next, Paul Mackerras, Linux Kernel
In-Reply-To: <20131209191015.22974.31604.stgit@mars>
[-- Attachment #1: Type: text/plain, Size: 1827 bytes --]
Hi,
On Tue, 10 Dec 2013 00:40:15 +0530 Mahesh J Salgaonkar <mahesh@linux.vnet.ibm.com> wrote:
>
> From: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
>
> With recent machine check patch series changes, The exception vectors
> starting from 0x4300 are now overflowing with allyesconfig. Fix that by
> moving machine_check_common and machine_check_handle_early code out of
> that region to make enough room for exception vector area.
>
> Fixes this build error reportes by Stephen:
>
> arch/powerpc/kernel/exceptions-64s.S: Assembler messages:
> arch/powerpc/kernel/exceptions-64s.S:958: Error: attempt to move .org backwards
> arch/powerpc/kernel/exceptions-64s.S:959: Error: attempt to move .org backwards
> arch/powerpc/kernel/exceptions-64s.S:983: Error: attempt to move .org backwards
> arch/powerpc/kernel/exceptions-64s.S:984: Error: attempt to move .org backwards
> arch/powerpc/kernel/exceptions-64s.S:1003: Error: attempt to move .org backwards
> arch/powerpc/kernel/exceptions-64s.S:1013: Error: attempt to move .org backwards
> arch/powerpc/kernel/exceptions-64s.S:1014: Error: attempt to move .org backwards
> arch/powerpc/kernel/exceptions-64s.S:1015: Error: attempt to move .org backwards
> arch/powerpc/kernel/exceptions-64s.S:1016: Error: attempt to move .org backwards
> arch/powerpc/kernel/exceptions-64s.S:1017: Error: attempt to move .org backwards
> arch/powerpc/kernel/exceptions-64s.S:1018: Error: attempt to move .org backwards
>
> Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Tested-by: Stephen Rothwell <sfr@canb.auug.org.au>
Works for me. Thanks. I will add this to linux-next today if Ben
doesn't add it to his tree.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: questions: second of the 2 pcie controllers does not scan the bus.
From: Scott Wood @ 2013-12-09 22:50 UTC (permalink / raw)
To: Ruchika; +Cc: linuxppc-dev
In-Reply-To: <52A2706A.7030205@servergy.com>
On Fri, 2013-12-06 at 18:48 -0600, Ruchika wrote:
> Hi,
> I am working with an p4080 based board. I am trying to get 2 PCIE
> controllers probed properly.
>
> In uboot I have no problems scanning and discovering what is connected
> to both controllers/PCI bridges.
>
> For both PCIE1/2 uboot sets up the Primary, secondary and Subordinate
> bus numbers to 0,1,1 respectively.
>
> When linux boots up and probes the controllers, PCIE1 is probed and the
> bridge scanned properly but PCIE2 is probed at the bridge but not
> attempted a scan.
> I see this message
> "pci 0001:02:00.0: bridge configuration invalid ([bus 01-01]), reconfiguring
> "
>
> I updated uboot to set the secondary and subordinate numbers to 2 (left
> the primary number to 0) and a subsequent kernel boot scanned the bus
> for PCIE2 successfully.
> I found these numbers to be very critical since the device tree blob
> (bus-range) for pci is also based off these.
>
> I'd like to get a good fix rather than the uboot hack and get better
> understanding of the problem. If there are any pointers someone could
> provide it would be awesome.
This is the code that prints that:
/* Check if setup is sensible at all */
if (!pass &&
(primary != bus->number || secondary <= bus->number ||
secondary > subordinate)) {
dev_info(&dev->dev, "bridge configuration invalid ([bus %02x-%0
secondary, subordinate);
broken = 1;
}
Start by printing out more information to determine which of those
checks is failing (e.g. what is primary and bus->number). If it turns
out that U-Boot is configuring the PCI bus incorrectly, send e-mail to
the U-Boot list. Be sure to mention what version of Linux and U-Boot
you're using.
-Scott
^ permalink raw reply
* Please pull 'merge' branch of 5xxx tree
From: Anatolij Gustschin @ 2013-12-09 21:55 UTC (permalink / raw)
To: linuxppc-dev list, Benjamin Herrenschmidt
Hi Ben !
Please pull a device tree fix for v3.13. The booting on mpc512x
is broken since v3.13-rc1, this patch repairs it.
Thanks,
Anatolij
The following changes since commit 721cb59e9d95eb7f47ec73711ed35ef85e1ea1ca:
powerpc/windfarm: Fix XServe G5 fan control Makefile issue (2013-11-27 11:35:47 +1100)
are available in the git repository at:
git://git.denx.de/linux-2.6-agust.git merge
for you to fetch changes up to c65ec135960e4555f65d8c9243f65b2fb88ac071:
powerpc/512x: dts: remove misplaced IRQ spec from 'soc' node (2013-12-07 09:43:28 +0100)
----------------------------------------------------------------
Gerhard Sittig (1):
powerpc/512x: dts: remove misplaced IRQ spec from 'soc' node
arch/powerpc/boot/dts/mpc5121.dtsi | 1 -
1 file changed, 1 deletion(-)
^ permalink raw reply
* [PATCH] powerpc/52xx: re-enable bestcomm driver in defconfigs
From: Anatolij Gustschin @ 2013-12-09 21:15 UTC (permalink / raw)
To: linuxppc-dev
The bestcomm driver has been moved to drivers/dma, so to select
this driver by default additionally CONFIG_DMADEVICES has to be
enabled. Currently it is not enabled in the config despite existing
CONFIG_PPC_BESTCOMM=y in the config files. Fix it.
Signed-off-by: Anatolij Gustschin <agust@denx.de>
---
arch/powerpc/configs/52xx/cm5200_defconfig | 3 ++-
arch/powerpc/configs/52xx/lite5200b_defconfig | 3 ++-
arch/powerpc/configs/52xx/motionpro_defconfig | 3 ++-
arch/powerpc/configs/52xx/pcm030_defconfig | 3 ++-
arch/powerpc/configs/52xx/tqm5200_defconfig | 3 ++-
arch/powerpc/configs/mpc5200_defconfig | 3 ++-
6 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/configs/52xx/cm5200_defconfig b/arch/powerpc/configs/52xx/cm5200_defconfig
index 69b57da..0b88c7b 100644
--- a/arch/powerpc/configs/52xx/cm5200_defconfig
+++ b/arch/powerpc/configs/52xx/cm5200_defconfig
@@ -12,7 +12,6 @@ CONFIG_EXPERT=y
CONFIG_PPC_MPC52xx=y
CONFIG_PPC_MPC5200_SIMPLE=y
# CONFIG_PPC_PMAC is not set
-CONFIG_PPC_BESTCOMM=y
CONFIG_SPARSE_IRQ=y
CONFIG_PM=y
# CONFIG_PCI is not set
@@ -71,6 +70,8 @@ CONFIG_USB_DEVICEFS=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
CONFIG_USB_STORAGE=y
+CONFIG_DMADEVICES=y
+CONFIG_PPC_BESTCOMM=y
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
diff --git a/arch/powerpc/configs/52xx/lite5200b_defconfig b/arch/powerpc/configs/52xx/lite5200b_defconfig
index f3638ae..104a332 100644
--- a/arch/powerpc/configs/52xx/lite5200b_defconfig
+++ b/arch/powerpc/configs/52xx/lite5200b_defconfig
@@ -15,7 +15,6 @@ CONFIG_PPC_MPC52xx=y
CONFIG_PPC_MPC5200_SIMPLE=y
CONFIG_PPC_LITE5200=y
# CONFIG_PPC_PMAC is not set
-CONFIG_PPC_BESTCOMM=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_SPARSE_IRQ=y
@@ -59,6 +58,8 @@ CONFIG_I2C_CHARDEV=y
CONFIG_I2C_MPC=y
# CONFIG_HWMON is not set
CONFIG_VIDEO_OUTPUT_CONTROL=m
+CONFIG_DMADEVICES=y
+CONFIG_PPC_BESTCOMM=y
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
diff --git a/arch/powerpc/configs/52xx/motionpro_defconfig b/arch/powerpc/configs/52xx/motionpro_defconfig
index 0c7de96..0d13ad7 100644
--- a/arch/powerpc/configs/52xx/motionpro_defconfig
+++ b/arch/powerpc/configs/52xx/motionpro_defconfig
@@ -12,7 +12,6 @@ CONFIG_EXPERT=y
CONFIG_PPC_MPC52xx=y
CONFIG_PPC_MPC5200_SIMPLE=y
# CONFIG_PPC_PMAC is not set
-CONFIG_PPC_BESTCOMM=y
CONFIG_SPARSE_IRQ=y
CONFIG_PM=y
# CONFIG_PCI is not set
@@ -84,6 +83,8 @@ CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_DS1307=y
+CONFIG_DMADEVICES=y
+CONFIG_PPC_BESTCOMM=y
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
diff --git a/arch/powerpc/configs/52xx/pcm030_defconfig b/arch/powerpc/configs/52xx/pcm030_defconfig
index 22e7195..430aa18 100644
--- a/arch/powerpc/configs/52xx/pcm030_defconfig
+++ b/arch/powerpc/configs/52xx/pcm030_defconfig
@@ -21,7 +21,6 @@ CONFIG_MODULE_UNLOAD=y
CONFIG_PPC_MPC52xx=y
CONFIG_PPC_MPC5200_SIMPLE=y
# CONFIG_PPC_PMAC is not set
-CONFIG_PPC_BESTCOMM=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_HZ_100=y
@@ -87,6 +86,8 @@ CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
CONFIG_USB_STORAGE=m
CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_PCF8563=m
+CONFIG_DMADEVICES=y
+CONFIG_PPC_BESTCOMM=y
CONFIG_EXT2_FS=m
CONFIG_EXT3_FS=m
# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
diff --git a/arch/powerpc/configs/52xx/tqm5200_defconfig b/arch/powerpc/configs/52xx/tqm5200_defconfig
index 716a37b..7af4c5b 100644
--- a/arch/powerpc/configs/52xx/tqm5200_defconfig
+++ b/arch/powerpc/configs/52xx/tqm5200_defconfig
@@ -17,7 +17,6 @@ CONFIG_PPC_MPC52xx=y
CONFIG_PPC_MPC5200_SIMPLE=y
CONFIG_PPC_MPC5200_BUGFIX=y
# CONFIG_PPC_PMAC is not set
-CONFIG_PPC_BESTCOMM=y
CONFIG_PM=y
# CONFIG_PCI is not set
CONFIG_NET=y
@@ -86,6 +85,8 @@ CONFIG_USB_STORAGE=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_DS1307=y
CONFIG_RTC_DRV_DS1374=y
+CONFIG_DMADEVICES=y
+CONFIG_PPC_BESTCOMM=y
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
diff --git a/arch/powerpc/configs/mpc5200_defconfig b/arch/powerpc/configs/mpc5200_defconfig
index 6640a35..8b682d1c 100644
--- a/arch/powerpc/configs/mpc5200_defconfig
+++ b/arch/powerpc/configs/mpc5200_defconfig
@@ -15,7 +15,6 @@ CONFIG_PPC_MEDIA5200=y
CONFIG_PPC_MPC5200_BUGFIX=y
CONFIG_PPC_MPC5200_LPBFIFO=m
# CONFIG_PPC_PMAC is not set
-CONFIG_PPC_BESTCOMM=y
CONFIG_SIMPLE_GPIO=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
@@ -125,6 +124,8 @@ CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_DS1307=y
CONFIG_RTC_DRV_DS1374=y
CONFIG_RTC_DRV_PCF8563=m
+CONFIG_DMADEVICES=y
+CONFIG_PPC_BESTCOMM=y
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
--
1.7.9.5
^ permalink raw reply related
* [PATCH] powerpc: Fix "attempt to move .org backwards" error
From: Mahesh J Salgaonkar @ 2013-12-09 19:10 UTC (permalink / raw)
To: linuxppc-dev, Benjamin Herrenschmidt
Cc: Stephen Rothwell, linux-next, Paul Mackerras, Linux Kernel
From: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
With recent machine check patch series changes, The exception vectors
starting from 0x4300 are now overflowing with allyesconfig. Fix that by
moving machine_check_common and machine_check_handle_early code out of
that region to make enough room for exception vector area.
Fixes this build error reportes by Stephen:
arch/powerpc/kernel/exceptions-64s.S: Assembler messages:
arch/powerpc/kernel/exceptions-64s.S:958: Error: attempt to move .org backwards
arch/powerpc/kernel/exceptions-64s.S:959: Error: attempt to move .org backwards
arch/powerpc/kernel/exceptions-64s.S:983: Error: attempt to move .org backwards
arch/powerpc/kernel/exceptions-64s.S:984: Error: attempt to move .org backwards
arch/powerpc/kernel/exceptions-64s.S:1003: Error: attempt to move .org backwards
arch/powerpc/kernel/exceptions-64s.S:1013: Error: attempt to move .org backwards
arch/powerpc/kernel/exceptions-64s.S:1014: Error: attempt to move .org backwards
arch/powerpc/kernel/exceptions-64s.S:1015: Error: attempt to move .org backwards
arch/powerpc/kernel/exceptions-64s.S:1016: Error: attempt to move .org backwards
arch/powerpc/kernel/exceptions-64s.S:1017: Error: attempt to move .org backwards
arch/powerpc/kernel/exceptions-64s.S:1018: Error: attempt to move .org backwards
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
---
arch/powerpc/kernel/exceptions-64s.S | 280 +++++++++++++++++-----------------
1 file changed, 140 insertions(+), 140 deletions(-)
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 862b9dd..b5c3313 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -768,146 +768,6 @@ kvmppc_skip_Hinterrupt:
STD_EXCEPTION_COMMON(0x100, system_reset, .system_reset_exception)
- /*
- * Machine check is different because we use a different
- * save area: PACA_EXMC instead of PACA_EXGEN.
- */
- .align 7
- .globl machine_check_common
-machine_check_common:
-
- mfspr r10,SPRN_DAR
- std r10,PACA_EXGEN+EX_DAR(r13)
- mfspr r10,SPRN_DSISR
- stw r10,PACA_EXGEN+EX_DSISR(r13)
- EXCEPTION_PROLOG_COMMON(0x200, PACA_EXMC)
- FINISH_NAP
- DISABLE_INTS
- ld r3,PACA_EXGEN+EX_DAR(r13)
- lwz r4,PACA_EXGEN+EX_DSISR(r13)
- std r3,_DAR(r1)
- std r4,_DSISR(r1)
- bl .save_nvgprs
- addi r3,r1,STACK_FRAME_OVERHEAD
- bl .machine_check_exception
- b .ret_from_except
-
-#define MACHINE_CHECK_HANDLER_WINDUP \
- /* Clear MSR_RI before setting SRR0 and SRR1. */\
- li r0,MSR_RI; \
- mfmsr r9; /* get MSR value */ \
- andc r9,r9,r0; \
- mtmsrd r9,1; /* Clear MSR_RI */ \
- /* Move original SRR0 and SRR1 into the respective regs */ \
- ld r9,_MSR(r1); \
- mtspr SPRN_SRR1,r9; \
- ld r3,_NIP(r1); \
- mtspr SPRN_SRR0,r3; \
- ld r9,_CTR(r1); \
- mtctr r9; \
- ld r9,_XER(r1); \
- mtxer r9; \
- ld r9,_LINK(r1); \
- mtlr r9; \
- REST_GPR(0, r1); \
- REST_8GPRS(2, r1); \
- REST_GPR(10, r1); \
- ld r11,_CCR(r1); \
- mtcr r11; \
- /* Decrement paca->in_mce. */ \
- lhz r12,PACA_IN_MCE(r13); \
- subi r12,r12,1; \
- sth r12,PACA_IN_MCE(r13); \
- REST_GPR(11, r1); \
- REST_2GPRS(12, r1); \
- /* restore original r1. */ \
- ld r1,GPR1(r1)
-
- /*
- * Handle machine check early in real mode. We come here with
- * ME=1, MMU (IR=0 and DR=0) off and using MC emergency stack.
- */
- .align 7
- .globl machine_check_handle_early
-machine_check_handle_early:
-BEGIN_FTR_SECTION
- std r0,GPR0(r1) /* Save r0 */
- EXCEPTION_PROLOG_COMMON_3(0x200)
- bl .save_nvgprs
- addi r3,r1,STACK_FRAME_OVERHEAD
- bl .machine_check_early
- ld r12,_MSR(r1)
-#ifdef CONFIG_PPC_P7_NAP
- /*
- * Check if thread was in power saving mode. We come here when any
- * of the following is true:
- * a. thread wasn't in power saving mode
- * b. thread was in power saving mode with no state loss or
- * supervisor state loss
- *
- * Go back to nap again if (b) is true.
- */
- rlwinm. r11,r12,47-31,30,31 /* Was it in power saving mode? */
- beq 4f /* No, it wasn;t */
- /* Thread was in power saving mode. Go back to nap again. */
- cmpwi r11,2
- bne 3f
- /* Supervisor state loss */
- li r0,1
- stb r0,PACA_NAPSTATELOST(r13)
-3: bl .machine_check_queue_event
- MACHINE_CHECK_HANDLER_WINDUP
- GET_PACA(r13)
- ld r1,PACAR1(r13)
- b .power7_enter_nap_mode
-4:
-#endif
- /*
- * Check if we are coming from hypervisor userspace. If yes then we
- * continue in host kernel in V mode to deliver the MC event.
- */
- rldicl. r11,r12,4,63 /* See if MC hit while in HV mode. */
- beq 5f
- andi. r11,r12,MSR_PR /* See if coming from user. */
- bne 9f /* continue in V mode if we are. */
-
-5:
-#ifdef CONFIG_KVM_BOOK3S_64_HV
- /*
- * We are coming from kernel context. Check if we are coming from
- * guest. if yes, then we can continue. We will fall through
- * do_kvm_200->kvmppc_interrupt to deliver the MC event to guest.
- */
- lbz r11,HSTATE_IN_GUEST(r13)
- cmpwi r11,0 /* Check if coming from guest */
- bne 9f /* continue if we are. */
-#endif
- /*
- * At this point we are not sure about what context we come from.
- * Queue up the MCE event and return from the interrupt.
- * But before that, check if this is an un-recoverable exception.
- * If yes, then stay on emergency stack and panic.
- */
- andi. r11,r12,MSR_RI
- bne 2f
-1: addi r3,r1,STACK_FRAME_OVERHEAD
- bl .unrecoverable_exception
- b 1b
-2:
- /*
- * Return from MC interrupt.
- * Queue up the MCE event so that we can log it later, while
- * returning from kernel or opal call.
- */
- bl .machine_check_queue_event
- MACHINE_CHECK_HANDLER_WINDUP
- rfid
-9:
- /* Deliver the machine check to host kernel in V mode. */
- MACHINE_CHECK_HANDLER_WINDUP
- b machine_check_pSeries
-END_FTR_SECTION_IFSET(CPU_FTR_HVMODE)
-
STD_EXCEPTION_COMMON_ASYNC(0x500, hardware_interrupt, do_IRQ)
STD_EXCEPTION_COMMON_ASYNC(0x900, decrementer, .timer_interrupt)
STD_EXCEPTION_COMMON(0x980, hdecrementer, .hdec_interrupt)
@@ -1458,6 +1318,146 @@ _GLOBAL(opal_mc_secondary_handler)
b machine_check_pSeries
#endif /* CONFIG_PPC_POWERNV */
+ /*
+ * Machine check is different because we use a different
+ * save area: PACA_EXMC instead of PACA_EXGEN.
+ */
+ .align 7
+ .globl machine_check_common
+machine_check_common:
+
+ mfspr r10,SPRN_DAR
+ std r10,PACA_EXGEN+EX_DAR(r13)
+ mfspr r10,SPRN_DSISR
+ stw r10,PACA_EXGEN+EX_DSISR(r13)
+ EXCEPTION_PROLOG_COMMON(0x200, PACA_EXMC)
+ FINISH_NAP
+ DISABLE_INTS
+ ld r3,PACA_EXGEN+EX_DAR(r13)
+ lwz r4,PACA_EXGEN+EX_DSISR(r13)
+ std r3,_DAR(r1)
+ std r4,_DSISR(r1)
+ bl .save_nvgprs
+ addi r3,r1,STACK_FRAME_OVERHEAD
+ bl .machine_check_exception
+ b .ret_from_except
+
+#define MACHINE_CHECK_HANDLER_WINDUP \
+ /* Clear MSR_RI before setting SRR0 and SRR1. */\
+ li r0,MSR_RI; \
+ mfmsr r9; /* get MSR value */ \
+ andc r9,r9,r0; \
+ mtmsrd r9,1; /* Clear MSR_RI */ \
+ /* Move original SRR0 and SRR1 into the respective regs */ \
+ ld r9,_MSR(r1); \
+ mtspr SPRN_SRR1,r9; \
+ ld r3,_NIP(r1); \
+ mtspr SPRN_SRR0,r3; \
+ ld r9,_CTR(r1); \
+ mtctr r9; \
+ ld r9,_XER(r1); \
+ mtxer r9; \
+ ld r9,_LINK(r1); \
+ mtlr r9; \
+ REST_GPR(0, r1); \
+ REST_8GPRS(2, r1); \
+ REST_GPR(10, r1); \
+ ld r11,_CCR(r1); \
+ mtcr r11; \
+ /* Decrement paca->in_mce. */ \
+ lhz r12,PACA_IN_MCE(r13); \
+ subi r12,r12,1; \
+ sth r12,PACA_IN_MCE(r13); \
+ REST_GPR(11, r1); \
+ REST_2GPRS(12, r1); \
+ /* restore original r1. */ \
+ ld r1,GPR1(r1)
+
+ /*
+ * Handle machine check early in real mode. We come here with
+ * ME=1, MMU (IR=0 and DR=0) off and using MC emergency stack.
+ */
+ .align 7
+ .globl machine_check_handle_early
+machine_check_handle_early:
+BEGIN_FTR_SECTION
+ std r0,GPR0(r1) /* Save r0 */
+ EXCEPTION_PROLOG_COMMON_3(0x200)
+ bl .save_nvgprs
+ addi r3,r1,STACK_FRAME_OVERHEAD
+ bl .machine_check_early
+ ld r12,_MSR(r1)
+#ifdef CONFIG_PPC_P7_NAP
+ /*
+ * Check if thread was in power saving mode. We come here when any
+ * of the following is true:
+ * a. thread wasn't in power saving mode
+ * b. thread was in power saving mode with no state loss or
+ * supervisor state loss
+ *
+ * Go back to nap again if (b) is true.
+ */
+ rlwinm. r11,r12,47-31,30,31 /* Was it in power saving mode? */
+ beq 4f /* No, it wasn;t */
+ /* Thread was in power saving mode. Go back to nap again. */
+ cmpwi r11,2
+ bne 3f
+ /* Supervisor state loss */
+ li r0,1
+ stb r0,PACA_NAPSTATELOST(r13)
+3: bl .machine_check_queue_event
+ MACHINE_CHECK_HANDLER_WINDUP
+ GET_PACA(r13)
+ ld r1,PACAR1(r13)
+ b .power7_enter_nap_mode
+4:
+#endif
+ /*
+ * Check if we are coming from hypervisor userspace. If yes then we
+ * continue in host kernel in V mode to deliver the MC event.
+ */
+ rldicl. r11,r12,4,63 /* See if MC hit while in HV mode. */
+ beq 5f
+ andi. r11,r12,MSR_PR /* See if coming from user. */
+ bne 9f /* continue in V mode if we are. */
+
+5:
+#ifdef CONFIG_KVM_BOOK3S_64_HV
+ /*
+ * We are coming from kernel context. Check if we are coming from
+ * guest. if yes, then we can continue. We will fall through
+ * do_kvm_200->kvmppc_interrupt to deliver the MC event to guest.
+ */
+ lbz r11,HSTATE_IN_GUEST(r13)
+ cmpwi r11,0 /* Check if coming from guest */
+ bne 9f /* continue if we are. */
+#endif
+ /*
+ * At this point we are not sure about what context we come from.
+ * Queue up the MCE event and return from the interrupt.
+ * But before that, check if this is an un-recoverable exception.
+ * If yes, then stay on emergency stack and panic.
+ */
+ andi. r11,r12,MSR_RI
+ bne 2f
+1: addi r3,r1,STACK_FRAME_OVERHEAD
+ bl .unrecoverable_exception
+ b 1b
+2:
+ /*
+ * Return from MC interrupt.
+ * Queue up the MCE event so that we can log it later, while
+ * returning from kernel or opal call.
+ */
+ bl .machine_check_queue_event
+ MACHINE_CHECK_HANDLER_WINDUP
+ rfid
+9:
+ /* Deliver the machine check to host kernel in V mode. */
+ MACHINE_CHECK_HANDLER_WINDUP
+ b machine_check_pSeries
+END_FTR_SECTION_IFSET(CPU_FTR_HVMODE)
+
/*
* r13 points to the PACA, r9 contains the saved CR,
^ permalink raw reply related
* [PATCH] powernv: fix VFIO support with PHB3
From: Thadeu Lima de Souza Cascardo @ 2013-12-09 16:41 UTC (permalink / raw)
To: benh
Cc: shangw, aik, linux-kernel, paulus, Thadeu Lima de Souza Cascardo,
linuxppc-dev
I have recently found out that no iommu_groups could be found under
/sys/ on a P8. That prevents PCI passthrough from working.
During my investigation, I found out there seems to be a missing
iommu_register_group for PHB3. The following patch seems to fix the
problem. After applying it, I see iommu_groups under
/sys/kernel/iommu_groups/, and can also bind vfio-pci to an adapter,
which gives me a device at /dev/vfio/.
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
---
This is now applied on top of benh's tree, branch next.
Alexey, is this now OK for you?
Thanks.
Cascardo.
---
arch/powerpc/platforms/powernv/pci-ioda.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 614356c..f0e6871 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -720,6 +720,7 @@ static void pnv_pci_ioda2_setup_dma_pe(struct pnv_phb *phb,
tbl->it_type = TCE_PCI_SWINV_CREATE | TCE_PCI_SWINV_FREE;
}
iommu_init_table(tbl, phb->hose->node);
+ iommu_register_group(tbl, pci_domain_nr(pe->pbus), pe->pe_number);
if (pe->pdev)
set_iommu_table_base_and_group(&pe->pdev->dev, tbl);
--
1.7.1
^ permalink raw reply related
* Re: [PATCH] powerpc/44x: fix ocm_block allocation
From: Ilia Mirkin @ 2013-12-09 15:28 UTC (permalink / raw)
To: Vinh Huu Tuong Nguyen; +Cc: linuxppc-dev
In-Reply-To: <CAM9eBokeHwgDnddrH5PVNK9bCT7b1_7GA98DsJaUwKPJfLCvgw@mail.gmail.com>
On Mon, Dec 9, 2013 at 3:38 AM, Vinh Huu Tuong Nguyen <vhtnguyen@apm.com> wrote:
>
> Hi Ilia Mirkin,
> Thanks for your info. I did investigated why our test didn't detect it and found out that
> the struct ocm_block is only used on ocm_debugfs_show function when we want to
> know information about ocm and it's available when we enable debugfs. But our test
> only tried to use the OCM block functions and didn't care about the OCM information.
> So I think we should apply your patch to solve this issue instead of removing ocm part.
>
OK, perhaps there's something clever gong on. However on my git tree
(updated as of a few days ago):
$ git grep ppc4xx_ocm_alloc
arch/powerpc/include/asm/ppc4xx_ocm.h:void
*ppc4xx_ocm_alloc(phys_addr_t *phys, int size, int align,
arch/powerpc/include/asm/ppc4xx_ocm.h:#define ppc4xx_ocm_alloc(phys,
size, align, flags, owner) NULL
arch/powerpc/sysdev/ppc4xx_ocm.c:void *ppc4xx_ocm_alloc(phys_addr_t
*phys, int size, int align,
So... no users. Unless there's macro-related cleverness going on (I'll
freely admit to not having read/understood the full code, so could
well be.) Perhaps it was meant to be used but the call got lost?
-ilia
>
>
>
> On Sat, Dec 7, 2013 at 7:43 AM, Ilia Mirkin <imirkin@alum.mit.edu> wrote:
>>
>> Allocate enough memory for the ocm_block structure, not just a pointer
>> to it.
>>
>> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
>> ---
>>
>> I have neither the hardware to test nor the toolchain to even build-test
>> this. However this seems like a fairly obvious fix (and I have to wonder how
>> this ever worked at all). Found with spatch.
>>
>> Actually further investigation makes it seem like this function is never
>> called, perhaps it should just be removed? If it is kept around though, would
>> be nice to apply this patch so that tools don't trip over this wrong code.
>>
>> arch/powerpc/sysdev/ppc4xx_ocm.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/powerpc/sysdev/ppc4xx_ocm.c b/arch/powerpc/sysdev/ppc4xx_ocm.c
>> index b7c4345..85d9e37 100644
>> --- a/arch/powerpc/sysdev/ppc4xx_ocm.c
>> +++ b/arch/powerpc/sysdev/ppc4xx_ocm.c
>> @@ -339,7 +339,7 @@ void *ppc4xx_ocm_alloc(phys_addr_t *phys, int size, int align,
>> if (IS_ERR_VALUE(offset))
>> continue;
>>
>> - ocm_blk = kzalloc(sizeof(struct ocm_block *), GFP_KERNEL);
>> + ocm_blk = kzalloc(sizeof(struct ocm_block), GFP_KERNEL);
>> if (!ocm_blk) {
>> printk(KERN_ERR "PPC4XX OCM: could not allocate ocm block");
>> rh_free(ocm_reg->rh, offset);
>> --
>> 1.8.3.2
>>
>
>
>
> --
>
> Vinh Nguyen Huu Tuong | Staff SW Engineer
>
> C: 090.335.7841 | O: 083.770.0640 ext: 3719
>
> F: 083.770.0641 | vhtnguyen@apm.com
>
>
>
>
>
>
>
>
^ permalink raw reply
* [PATCH] powerpc: Fix up the kdump base cap to 128M
From: Mahesh J Salgaonkar @ 2013-12-09 10:03 UTC (permalink / raw)
To: linuxppc-dev, Benjamin Herrenschmidt; +Cc: Anton Blanchard
From: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
The current logic sets the kdump base to min of 2G or ppc64_rma_size/2.
On PowerNV kernel the first memory block 'memory@0' can be very large,
equal to the DIMM size with ppc64_rma_size value capped to 1G. Hence on
PowerNV, kdump base is set to 512M resulting kdump to fail while allocating
paca array. This is because, paca need its memory from RMA region capped
at 256M (see allocate_pacas()).
This patch lowers the kdump base cap to 128M so that kdump kernel can
successfully get memory below 256M for paca allocation.
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
---
arch/powerpc/kernel/machine_kexec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c
index 88a7fb4..75d4f73 100644
--- a/arch/powerpc/kernel/machine_kexec.c
+++ b/arch/powerpc/kernel/machine_kexec.c
@@ -148,7 +148,7 @@ void __init reserve_crashkernel(void)
* a small SLB (128MB) since the crash kernel needs to place
* itself and some stacks to be in the first segment.
*/
- crashk_res.start = min(0x80000000ULL, (ppc64_rma_size / 2));
+ crashk_res.start = min(0x8000000ULL, (ppc64_rma_size / 2));
#else
crashk_res.start = KDUMP_KERNELBASE;
#endif
^ permalink raw reply related
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