* Re: [PATCH kernel] powerpc/kuap: Restore AMR after replaying soft interrupts
From: Michal Suchánek @ 2021-02-03 8:45 UTC (permalink / raw)
To: Alexey Kardashevskiy; +Cc: linuxppc-dev, Nicholas Piggin
In-Reply-To: <20210202091541.36499-1-aik@ozlabs.ru>
Hello,
On Tue, Feb 02, 2021 at 08:15:41PM +1100, Alexey Kardashevskiy wrote:
> Since de78a9c "powerpc: Add a framework for Kernel Userspace Access
> Protection", user access helpers call user_{read|write}_access_{begin|end}
> when user space access is allowed.
>
> 890274c "powerpc/64s: Implement KUAP for Radix MMU" made the mentioned
> helpers program a AMR special register to allow such access for a short
> period of time, most of the time AMR is expected to block user memory
> access by the kernel.
>
> Since the code accesses the user space memory, unsafe_get_user()
> calls might_fault() which calls arch_local_irq_restore() if either
> CONFIG_PROVE_LOCKING or CONFIG_DEBUG_ATOMIC_SLEEP is enabled.
> arch_local_irq_restore() then attempts to replay pending soft interrupts
> as KUAP regions have hardware interrupts enabled.
> If a pending interrupt happens to do user access (performance interrupts
> do that), it enables access for a short period of time so after returning
> from the replay, the user access state remains blocked and if a user page
> fault happens - "Bug: Read fault blocked by AMR!" appears and SIGSEGV is
> sent.
>
> This saves/restores AMR when replaying interrupts.
>
> This adds a check if AMR was not blocked when before replaying interrupts.
>
> Found by syzkaller. The call stack for the bug is:
>
> copy_from_user_nofault+0xf8/0x250
> perf_callchain_user_64+0x3d8/0x8d0
> perf_callchain_user+0x38/0x50
> get_perf_callchain+0x28c/0x300
> perf_callchain+0xb0/0x130
> perf_prepare_sample+0x364/0xbf0
> perf_event_output_forward+0xe0/0x280
> __perf_event_overflow+0xa4/0x240
> perf_swevent_hrtimer+0x1d4/0x1f0
> __hrtimer_run_queues+0x328/0x900
> hrtimer_interrupt+0x128/0x350
> timer_interrupt+0x180/0x600
> replay_soft_interrupts+0x21c/0x4f0
> arch_local_irq_restore+0x94/0x150
> lock_is_held_type+0x140/0x200
> ___might_sleep+0x220/0x330
> __might_fault+0x88/0x120
> do_strncpy_from_user+0x108/0x2b0
> strncpy_from_user+0x1d0/0x2a0
> getname_flags+0x88/0x2c0
> do_sys_openat2+0x2d4/0x5f0
> do_sys_open+0xcc/0x140
> system_call_exception+0x160/0x240
> system_call_common+0xf0/0x27c
>
Can we get a Fixes tag?
Thanks
Michal
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
> ---
> Changes:
> v3:
> * do not block/unblock if AMR was blocked
> * reverted move of AMR_KUAP_***
> * added pr_warn
>
> v2:
> * fixed compile on hash
> * moved get/set to arch_local_irq_restore
> * block KUAP before replaying
>
> ---
>
> This is an example:
>
> ------------[ cut here ]------------
> Bug: Read fault blocked by AMR!
> WARNING: CPU: 0 PID: 1603 at /home/aik/p/kernel/arch/powerpc/include/asm/book3s/64/kup-radix.h:145 __do_page_fau
>
> Modules linked in:
> CPU: 0 PID: 1603 Comm: amr Not tainted 5.10.0-rc6_v5.10-rc6_a+fstn1 #24
> NIP: c00000000009ece8 LR: c00000000009ece4 CTR: 0000000000000000
> REGS: c00000000dc63560 TRAP: 0700 Not tainted (5.10.0-rc6_v5.10-rc6_a+fstn1)
> MSR: 8000000000021033 <SF,ME,IR,DR,RI,LE> CR: 28002888 XER: 20040000
> CFAR: c0000000001fa928 IRQMASK: 1
> GPR00: c00000000009ece4 c00000000dc637f0 c000000002397600 000000000000001f
> GPR04: c0000000020eb318 0000000000000000 c00000000dc63494 0000000000000027
> GPR08: c00000007fe4de68 c00000000dfe9180 0000000000000000 0000000000000001
> GPR12: 0000000000002000 c0000000030a0000 0000000000000000 0000000000000000
> GPR16: 0000000000000000 0000000000000000 0000000000000000 bfffffffffffffff
> GPR20: 0000000000000000 c0000000134a4020 c0000000019c2218 0000000000000fe0
> GPR24: 0000000000000000 0000000000000000 c00000000d106200 0000000040000000
> GPR28: 0000000000000000 0000000000000300 c00000000dc63910 c000000001946730
> NIP [c00000000009ece8] __do_page_fault+0xb38/0xde0
> LR [c00000000009ece4] __do_page_fault+0xb34/0xde0
> Call Trace:
> [c00000000dc637f0] [c00000000009ece4] __do_page_fault+0xb34/0xde0 (unreliable)
> [c00000000dc638a0] [c00000000000c968] handle_page_fault+0x10/0x2c
> --- interrupt: 300 at strncpy_from_user+0x290/0x440
> LR = strncpy_from_user+0x284/0x440
> [c00000000dc63ba0] [c000000000c3dcb0] strncpy_from_user+0x2f0/0x440 (unreliable)
> [c00000000dc63c30] [c00000000068b888] getname_flags+0x88/0x2c0
> [c00000000dc63c90] [c000000000662a44] do_sys_openat2+0x2d4/0x5f0
> [c00000000dc63d30] [c00000000066560c] do_sys_open+0xcc/0x140
> [c00000000dc63dc0] [c000000000045e10] system_call_exception+0x160/0x240
> [c00000000dc63e20] [c00000000000da60] system_call_common+0xf0/0x27c
> Instruction dump:
> 409c0048 3fe2ff5b 3bfff128 fac10060 fae10068 482f7a85 60000000 3c62ff5b
> 7fe4fb78 3863f250 4815bbd9 60000000 <0fe00000> 3c62ff5b 3863f2b8 4815c8b5
> irq event stamp: 254
> hardirqs last enabled at (253): [<c000000000019550>] arch_local_irq_restore+0xa0/0x150
> hardirqs last disabled at (254): [<c000000000008a10>] data_access_common_virt+0x1b0/0x1d0
> softirqs last enabled at (0): [<c0000000001f6d5c>] copy_process+0x78c/0x2120
> softirqs last disabled at (0): [<0000000000000000>] 0x0
> ---[ end trace ba98aec5151f3aeb ]---
> ---
> arch/powerpc/kernel/irq.c | 27 ++++++++++++++++++++++++++-
> 1 file changed, 26 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
> index cc7a6271b6b4..592abc798826 100644
> --- a/arch/powerpc/kernel/irq.c
> +++ b/arch/powerpc/kernel/irq.c
> @@ -269,6 +269,23 @@ void replay_soft_interrupts(void)
> }
> }
>
> +#if defined(CONFIG_PPC_BOOK3S_64) && defined(CONFIG_PPC_KUAP)
> +static inline void replay_soft_interrupts_irqrestore(void)
> +{
> + unsigned long kuap_state = get_kuap();
> +
> + if (kuap_state != AMR_KUAP_BLOCKED)
> + set_kuap(AMR_KUAP_BLOCKED);
> +
> + replay_soft_interrupts();
> +
> + if (kuap_state != AMR_KUAP_BLOCKED)
> + set_kuap(kuap_state);
> +}
> +#else
> +#define replay_soft_interrupts_irqrestore() replay_soft_interrupts()
> +#endif
> +
> notrace void arch_local_irq_restore(unsigned long mask)
> {
> unsigned char irq_happened;
> @@ -278,6 +295,14 @@ notrace void arch_local_irq_restore(unsigned long mask)
> if (mask)
> return;
>
> + /*
> + * It fires if anything calls local_irq_enable or restore when
> + * KUAP is enabled, and the code handles that just fine by saving
> + * and re-locking AMR but we would like to remove those calls,
> + * hence the warning.
> + */
> + kuap_check_amr();
> +
> /*
> * From this point onward, we can take interrupts, preempt,
> * etc... unless we got hard-disabled. We check if an event
> @@ -332,7 +357,7 @@ notrace void arch_local_irq_restore(unsigned long mask)
> irq_soft_mask_set(IRQS_ALL_DISABLED);
> trace_hardirqs_off();
>
> - replay_soft_interrupts();
> + replay_soft_interrupts_irqrestore();
> local_paca->irq_happened = 0;
>
> trace_hardirqs_on();
> --
> 2.17.1
>
^ permalink raw reply
* [PATCH] powerpc/perf: Record counter overflow always if SAMPLE_IP is unset
From: Athira Rajeev @ 2021-02-03 8:54 UTC (permalink / raw)
To: mpe; +Cc: maddy, linuxppc-dev
While sampling for marked events, currently we record the sample only
if the SIAR valid bit of Sampled Instruction Event Register (SIER) is
set. SIAR_VALID bit is used for fetching the instruction address from
Sampled Instruction Address Register(SIAR). But there are some usecases,
where the user is interested only in the PMU stats at each counter
overflow and the exact IP of the overflow event is not required.
Dropping SIAR invalid samples will fail to record some of the counter
overflows in such cases.
Example of such usecase is dumping the PMU stats (event counts)
after some regular amount of instructions/events from the userspace
(ex: via ptrace). Here counter overflow is indicated to userspace via
signal handler, and captured by monitoring and enabling I/O
signaling on the event file descriptor. In these cases, we expect to
get sample/overflow indication after each specified sample_period.
Perf event attribute will not have PERF_SAMPLE_IP set in the
sample_type if exact IP of the overflow event is not requested. So
while profiling if SAMPLE_IP is not set, just record the counter overflow
irrespective of SIAR_VALID check.
Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
---
arch/powerpc/perf/core-book3s.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
index 28206b1fe172..bb4828a05e4d 100644
--- a/arch/powerpc/perf/core-book3s.c
+++ b/arch/powerpc/perf/core-book3s.c
@@ -2166,10 +2166,16 @@ static void record_and_restart(struct perf_event *event, unsigned long val,
* address even when freeze on supervisor state (kernel) is set in
* MMCR2. Check attr.exclude_kernel and address to drop the sample in
* these cases.
+ *
+ * If address is not requested in the sample
+ * via PERF_SAMPLE_IP, just record that sample
+ * irrespective of SIAR valid check.
*/
- if (event->attr.exclude_kernel && record)
- if (is_kernel_addr(mfspr(SPRN_SIAR)))
+ if (event->attr.exclude_kernel && record) {
+ if (is_kernel_addr(mfspr(SPRN_SIAR)) && (event->attr.sample_type & PERF_SAMPLE_IP))
record = 0;
+ } else if (!record && !(event->attr.sample_type & PERF_SAMPLE_IP))
+ record = 1;
/*
* Finally record data if requested.
--
1.8.3.1
^ permalink raw reply related
* Re: [PATCH 05/13] kallsyms: refactor {,module_}kallsyms_on_each_symbol
From: Petr Mladek @ 2021-02-03 8:58 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jiri Kosina, Andrew Donnellan, linux-kbuild, David Airlie,
Masahiro Yamada, Josh Poimboeuf, Maarten Lankhorst, linux-kernel,
Maxime Ripard, live-patching, Michal Marek, Joe Lawrence,
dri-devel, Thomas Zimmermann, Jessica Yu, Frederic Barrat,
Daniel Vetter, Miroslav Benes, linuxppc-dev
In-Reply-To: <20210202121334.1361503-6-hch@lst.de>
On Tue 2021-02-02 13:13:26, Christoph Hellwig wrote:
> Require an explicit call to module_kallsyms_on_each_symbol to look
> for symbols in modules instead of the call from kallsyms_on_each_symbol,
> and acquire module_mutex inside of module_kallsyms_on_each_symbol instead
> of leaving that up to the caller. Note that this slightly changes the
> behavior for the livepatch code in that the symbols from vmlinux are not
> iterated anymore if objname is set, but that actually is the desired
> behavior in this case.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Acked-by: Miroslav Benes <mbenes@suse.cz>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Best Regards,
Petr
^ permalink raw reply
* Re: [PATCH 10/13] module: pass struct find_symbol_args to find_symbol
From: Christoph Hellwig @ 2021-02-03 9:04 UTC (permalink / raw)
To: Miroslav Benes
Cc: Petr Mladek, Jiri Kosina, Andrew Donnellan, linux-kbuild,
David Airlie, Masahiro Yamada, Josh Poimboeuf, Maarten Lankhorst,
linux-kernel, Maxime Ripard, live-patching, Michal Marek,
Joe Lawrence, dri-devel, Thomas Zimmermann, Jessica Yu,
Frederic Barrat, Daniel Vetter, linuxppc-dev, Christoph Hellwig
In-Reply-To: <alpine.LSU.2.21.2102021504550.570@pobox.suse.cz>
FYI, this is the updated version:
---
From 664ca3378deac7530fe8fc15fe73d583d3333df2 Mon Sep 17 00:00:00 2001
From: Christoph Hellwig <hch@lst.de>
Date: Wed, 20 Jan 2021 14:58:27 +0100
Subject: module: pass struct find_symbol_args to find_symbol
Simplify the calling convention by passing the find_symbol_args structure
to find_symbol instead of initializing it inside the function.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
kernel/module.c | 113 ++++++++++++++++++++++--------------------------
1 file changed, 52 insertions(+), 61 deletions(-)
diff --git a/kernel/module.c b/kernel/module.c
index ab219a16f35068..e63b16b85da68b 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -531,12 +531,7 @@ static bool find_exported_symbol_in_section(const struct symsearch *syms,
* Find an exported symbol and return it, along with, (optional) crc and
* (optional) module which owns it. Needs preempt disabled or module_mutex.
*/
-static const struct kernel_symbol *find_symbol(const char *name,
- struct module **owner,
- const s32 **crc,
- enum mod_license *license,
- bool gplok,
- bool warn)
+static bool find_symbol(struct find_symbol_arg *fsa)
{
static const struct symsearch arr[] = {
{ __start___ksymtab, __stop___ksymtab, __start___kcrctab,
@@ -556,19 +551,14 @@ static const struct kernel_symbol *find_symbol(const char *name,
GPL_ONLY, true },
#endif
};
- struct find_symbol_arg fsa = {
- .name = name,
- .gplok = gplok,
- .warn = warn,
- };
struct module *mod;
unsigned int i;
module_assert_mutex_or_preempt();
for (i = 0; i < ARRAY_SIZE(arr); i++)
- if (find_exported_symbol_in_section(&arr[i], NULL, &fsa))
- goto found;
+ if (find_exported_symbol_in_section(&arr[i], NULL, fsa))
+ return true;
list_for_each_entry_rcu(mod, &modules, list,
lockdep_is_held(&module_mutex)) {
@@ -598,21 +588,12 @@ static const struct kernel_symbol *find_symbol(const char *name,
continue;
for (i = 0; i < ARRAY_SIZE(arr); i++)
- if (find_exported_symbol_in_section(&arr[i], mod, &fsa))
- goto found;
+ if (find_exported_symbol_in_section(&arr[i], mod, fsa))
+ return true;
}
- pr_debug("Failed to find symbol %s\n", name);
- return NULL;
-
-found:
- if (owner)
- *owner = fsa.owner;
- if (crc)
- *crc = fsa.crc;
- if (license)
- *license = fsa.license;
- return fsa.sym;
+ pr_debug("Failed to find symbol %s\n", fsa->name);
+ return false;
}
/*
@@ -1074,12 +1055,15 @@ static inline void print_unload_info(struct seq_file *m, struct module *mod)
void __symbol_put(const char *symbol)
{
- struct module *owner;
+ struct find_symbol_arg fsa = {
+ .name = symbol,
+ .gplok = true,
+ };
preempt_disable();
- if (!find_symbol(symbol, &owner, NULL, NULL, true, false))
+ if (!find_symbol(&fsa))
BUG();
- module_put(owner);
+ module_put(fsa.owner);
preempt_enable();
}
EXPORT_SYMBOL(__symbol_put);
@@ -1348,19 +1332,22 @@ static int check_version(const struct load_info *info,
static inline int check_modstruct_version(const struct load_info *info,
struct module *mod)
{
- const s32 *crc;
+ struct find_symbol_arg fsa = {
+ .name = "module_layout",
+ .gplok = true,
+ };
/*
* Since this should be found in kernel (which can't be removed), no
* locking is necessary -- use preempt_disable() to placate lockdep.
*/
preempt_disable();
- if (!find_symbol("module_layout", NULL, &crc, NULL, true, false)) {
+ if (!find_symbol(&fsa)) {
preempt_enable();
BUG();
}
preempt_enable();
- return check_version(info, "module_layout", mod, crc);
+ return check_version(info, "module_layout", mod, fsa.crc);
}
/* First part is kernel version, which we ignore if module has crcs. */
@@ -1454,10 +1441,11 @@ static const struct kernel_symbol *resolve_symbol(struct module *mod,
const char *name,
char ownername[])
{
- struct module *owner;
- const struct kernel_symbol *sym;
- const s32 *crc;
- enum mod_license license;
+ struct find_symbol_arg fsa = {
+ .name = name,
+ .gplok = !(mod->taints & (1 << TAINT_PROPRIETARY_MODULE)),
+ .warn = true,
+ };
int err;
/*
@@ -1467,42 +1455,40 @@ static const struct kernel_symbol *resolve_symbol(struct module *mod,
*/
sched_annotate_sleep();
mutex_lock(&module_mutex);
- sym = find_symbol(name, &owner, &crc, &license,
- !(mod->taints & (1 << TAINT_PROPRIETARY_MODULE)), true);
- if (!sym)
+ if (!find_symbol(&fsa))
goto unlock;
- if (license == GPL_ONLY)
+ if (fsa.license == GPL_ONLY)
mod->using_gplonly_symbols = true;
- if (!inherit_taint(mod, owner)) {
- sym = NULL;
+ if (!inherit_taint(mod, fsa.owner)) {
+ fsa.sym = NULL;
goto getname;
}
- if (!check_version(info, name, mod, crc)) {
- sym = ERR_PTR(-EINVAL);
+ if (!check_version(info, name, mod, fsa.crc)) {
+ fsa.sym = ERR_PTR(-EINVAL);
goto getname;
}
- err = verify_namespace_is_imported(info, sym, mod);
+ err = verify_namespace_is_imported(info, fsa.sym, mod);
if (err) {
- sym = ERR_PTR(err);
+ fsa.sym = ERR_PTR(err);
goto getname;
}
- err = ref_module(mod, owner);
+ err = ref_module(mod, fsa.owner);
if (err) {
- sym = ERR_PTR(err);
+ fsa.sym = ERR_PTR(err);
goto getname;
}
getname:
/* We must make copy under the lock if we failed to get ref. */
- strncpy(ownername, module_name(owner), MODULE_NAME_LEN);
+ strncpy(ownername, module_name(fsa.owner), MODULE_NAME_LEN);
unlock:
mutex_unlock(&module_mutex);
- return sym;
+ return fsa.sym;
}
static const struct kernel_symbol *
@@ -2263,16 +2249,19 @@ static void free_module(struct module *mod)
void *__symbol_get(const char *symbol)
{
- struct module *owner;
- const struct kernel_symbol *sym;
+ struct find_symbol_arg fsa = {
+ .name = symbol,
+ .gplok = true,
+ .warn = true,
+ };
preempt_disable();
- sym = find_symbol(symbol, &owner, NULL, NULL, true, true);
- if (sym && strong_try_module_get(owner))
- sym = NULL;
+ if (!find_symbol(&fsa) || strong_try_module_get(fsa.owner)) {
+ preempt_enable();
+ return NULL;
+ }
preempt_enable();
-
- return sym ? (void *)kernel_symbol_value(sym) : NULL;
+ return (void *)kernel_symbol_value(fsa.sym);
}
EXPORT_SYMBOL_GPL(__symbol_get);
@@ -2285,7 +2274,6 @@ EXPORT_SYMBOL_GPL(__symbol_get);
static int verify_exported_symbols(struct module *mod)
{
unsigned int i;
- struct module *owner;
const struct kernel_symbol *s;
struct {
const struct kernel_symbol *sym;
@@ -2302,12 +2290,15 @@ static int verify_exported_symbols(struct module *mod)
for (i = 0; i < ARRAY_SIZE(arr); i++) {
for (s = arr[i].sym; s < arr[i].sym + arr[i].num; s++) {
- if (find_symbol(kernel_symbol_name(s), &owner, NULL,
- NULL, true, false)) {
+ struct find_symbol_arg fsa = {
+ .name = kernel_symbol_name(s),
+ .gplok = true,
+ };
+ if (find_symbol(&fsa)) {
pr_err("%s: exports duplicate symbol %s"
" (owned by %s)\n",
mod->name, kernel_symbol_name(s),
- module_name(owner));
+ module_name(fsa.owner));
return -ENOEXEC;
}
}
--
2.29.2
^ permalink raw reply related
* Re: [PATCH 10/13] module: pass struct find_symbol_args to find_symbol
From: Miroslav Benes @ 2021-02-03 9:31 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Petr Mladek, Jiri Kosina, Andrew Donnellan, linux-kbuild,
David Airlie, Masahiro Yamada, Josh Poimboeuf, Maarten Lankhorst,
linux-kernel, Maxime Ripard, live-patching, Michal Marek,
Joe Lawrence, dri-devel, Thomas Zimmermann, Jessica Yu,
Frederic Barrat, Daniel Vetter, linuxppc-dev
In-Reply-To: <20210203090418.GA7833@lst.de>
On Wed, 3 Feb 2021, Christoph Hellwig wrote:
> FYI, this is the updated version:
>
> ---
> >From 664ca3378deac7530fe8fc15fe73d583d3333df2 Mon Sep 17 00:00:00 2001
> From: Christoph Hellwig <hch@lst.de>
> Date: Wed, 20 Jan 2021 14:58:27 +0100
> Subject: module: pass struct find_symbol_args to find_symbol
>
> Simplify the calling convention by passing the find_symbol_args structure
> to find_symbol instead of initializing it inside the function.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
M
^ permalink raw reply
* Re: [PATCH v2 1/3] powerpc: sstep: Fix load and update emulation
From: Naveen N. Rao @ 2021-02-03 9:49 UTC (permalink / raw)
To: Sandipan Das; +Cc: ravi.bangoria, ananth, jniethe5, paulus, linuxppc-dev, dja
In-Reply-To: <20210203063841.431063-1-sandipan@linux.ibm.com>
On 2021/02/03 12:08PM, Sandipan Das wrote:
> The Power ISA says that the fixed-point load and update
> instructions must neither use R0 for the base address (RA)
> nor have the destination (RT) and the base address (RA) as
> the same register. In these cases, the instruction is
> invalid. This applies to the following instructions.
> * Load Byte and Zero with Update (lbzu)
> * Load Byte and Zero with Update Indexed (lbzux)
> * Load Halfword and Zero with Update (lhzu)
> * Load Halfword and Zero with Update Indexed (lhzux)
> * Load Halfword Algebraic with Update (lhau)
> * Load Halfword Algebraic with Update Indexed (lhaux)
> * Load Word and Zero with Update (lwzu)
> * Load Word and Zero with Update Indexed (lwzux)
> * Load Word Algebraic with Update Indexed (lwaux)
> * Load Doubleword with Update (ldu)
> * Load Doubleword with Update Indexed (ldux)
>
> However, the following behaviour is observed using some
> invalid opcodes where RA = RT.
>
> An userspace program using an invalid instruction word like
> 0xe9ce0001, i.e. "ldu r14, 0(r14)", runs and exits without
> getting terminated abruptly. The instruction performs the
> load operation but does not write the effective address to
> the base address register.
While the processor (p8 in my test) doesn't seem to be throwing an
exception, I don't think it is necessarily loading the value. Qemu
throws an exception though. It's probably best to term the behavior as
being undefined.
> Attaching an uprobe at that
> instruction's address results in emulation which writes the
> effective address to the base register. Thus, the final value
> of the base address register is different.
>
> To remove any inconsistencies, this adds an additional check
> for the aforementioned instructions to make sure that they
> are treated as unknown by the emulation infrastructure when
> RA = 0 or RA = RT. The kernel will then fallback to executing
> the instruction on hardware.
>
> Fixes: 0016a4cf5582 ("powerpc: Emulate most Book I instructions in emulate_step()")
> Reviewed-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
> Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
> ---
> Previous versions can be found at:
> v1: https://lore.kernel.org/linuxppc-dev/20201119054139.244083-1-sandipan@linux.ibm.com/
>
> Changes in v2:
> - Jump to unknown_opcode instead of returning -1 for invalid
> instruction forms.
>
> ---
> arch/powerpc/lib/sstep.c | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
Wouldn't it be easier to just do the below at the end? Or, am I missing something?
diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
index ede093e9623472..a2d726d2a5e9d1 100644
--- a/arch/powerpc/lib/sstep.c
+++ b/arch/powerpc/lib/sstep.c
@@ -2980,6 +2980,10 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
}
#endif /* CONFIG_VSX */
+ if (GETTYPE(op->type) == LOAD && (op->type & UPDATE) &&
+ (ra == 0 || ra == rd))
+ goto unknown_opcode;
+
return 0;
logical_done:
- Naveen
^ permalink raw reply related
* [PATCH] mm/memory.c: Remove pte_sw_mkyoung()
From: Christophe Leroy @ 2021-02-03 10:19 UTC (permalink / raw)
To: Thomas Bogendoerfer, Andrew Morton, Bibo Mao, Jia He
Cc: linux-arch, linux-mm, linuxppc-dev, linux-kernel, linux-mips
Commit 83d116c53058 ("mm: fix double page fault on arm64 if PTE_AF
is cleared") introduced arch_faults_on_old_pte() helper to identify
platforms that don't set page access bit in HW and require a page
fault to set it.
Commit 44bf431b47b4 ("mm/memory.c: Add memory read privilege on page
fault handling") added pte_sw_mkyoung() which is yet another way to
manage platforms that don't set page access bit in HW and require a
page fault to set it.
Remove that pte_sw_mkyoung() helper and use the already existing
arch_faults_on_old_pte() helper together with pte_mkyoung() instead.
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
arch/mips/include/asm/pgtable.h | 2 --
include/linux/pgtable.h | 16 ----------------
mm/memory.c | 9 ++++++---
3 files changed, 6 insertions(+), 21 deletions(-)
diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h
index 4f9c37616d42..3275495adccb 100644
--- a/arch/mips/include/asm/pgtable.h
+++ b/arch/mips/include/asm/pgtable.h
@@ -406,8 +406,6 @@ static inline pte_t pte_mkyoung(pte_t pte)
return pte;
}
-#define pte_sw_mkyoung pte_mkyoung
-
#ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT
static inline int pte_huge(pte_t pte) { return pte_val(pte) & _PAGE_HUGE; }
diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
index 8fcdfa52eb4b..70d04931dff4 100644
--- a/include/linux/pgtable.h
+++ b/include/linux/pgtable.h
@@ -424,22 +424,6 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addres
}
#endif
-/*
- * On some architectures hardware does not set page access bit when accessing
- * memory page, it is responsibilty of software setting this bit. It brings
- * out extra page fault penalty to track page access bit. For optimization page
- * access bit can be set during all page fault flow on these arches.
- * To be differentiate with macro pte_mkyoung, this macro is used on platforms
- * where software maintains page access bit.
- */
-#ifndef pte_sw_mkyoung
-static inline pte_t pte_sw_mkyoung(pte_t pte)
-{
- return pte;
-}
-#define pte_sw_mkyoung pte_sw_mkyoung
-#endif
-
#ifndef pte_savedwrite
#define pte_savedwrite pte_write
#endif
diff --git a/mm/memory.c b/mm/memory.c
index feff48e1465a..46fab785f7b3 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2890,7 +2890,8 @@ static vm_fault_t wp_page_copy(struct vm_fault *vmf)
}
flush_cache_page(vma, vmf->address, pte_pfn(vmf->orig_pte));
entry = mk_pte(new_page, vma->vm_page_prot);
- entry = pte_sw_mkyoung(entry);
+ if (arch_faults_on_old_pte())
+ entry = pte_mkyoung(entry);
entry = maybe_mkwrite(pte_mkdirty(entry), vma);
/*
@@ -3548,7 +3549,8 @@ static vm_fault_t do_anonymous_page(struct vm_fault *vmf)
__SetPageUptodate(page);
entry = mk_pte(page, vma->vm_page_prot);
- entry = pte_sw_mkyoung(entry);
+ if (arch_faults_on_old_pte())
+ entry = pte_mkyoung(entry);
if (vma->vm_flags & VM_WRITE)
entry = pte_mkwrite(pte_mkdirty(entry));
@@ -3824,7 +3826,8 @@ vm_fault_t alloc_set_pte(struct vm_fault *vmf, struct page *page)
flush_icache_page(vma, page);
entry = mk_pte(page, vma->vm_page_prot);
- entry = pte_sw_mkyoung(entry);
+ if (arch_faults_on_old_pte())
+ entry = pte_mkyoung(entry);
if (write)
entry = maybe_mkwrite(pte_mkdirty(entry), vma);
/* copy-on-write page */
--
2.25.0
^ permalink raw reply related
* Re: [PATCH 02/13] drm: remove drm_fb_helper_modinit
From: Daniel Vetter @ 2021-02-03 10:34 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Petr Mladek, Jiri Kosina, Andrew Donnellan, linux-kbuild,
David Airlie, Masahiro Yamada, Josh Poimboeuf, Maarten Lankhorst,
linux-kernel, Maxime Ripard, live-patching, Michal Marek,
Joe Lawrence, dri-devel, Thomas Zimmermann, Jessica Yu,
Frederic Barrat, Daniel Vetter, Miroslav Benes, linuxppc-dev
In-Reply-To: <20210128181421.2279-3-hch@lst.de>
On Thu, Jan 28, 2021 at 07:14:10PM +0100, Christoph Hellwig wrote:
> drm_fb_helper_modinit has a lot of boilerplate for what is not very
> simple functionality. Just open code it in the only caller using
> IS_ENABLED and IS_MODULE, and skip the find_module check as a
> request_module is harmless if the module is already loaded (and not
> other caller has this find_module check either).
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Hm I thought I've acked this one already somewhere for merging through
your tree.
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> drivers/gpu/drm/drm_crtc_helper_internal.h | 10 ---------
> drivers/gpu/drm/drm_fb_helper.c | 21 ------------------
> drivers/gpu/drm/drm_kms_helper_common.c | 25 +++++++++++-----------
> 3 files changed, 12 insertions(+), 44 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_crtc_helper_internal.h b/drivers/gpu/drm/drm_crtc_helper_internal.h
> index 25ce42e799952c..61e09f8a8d0ff0 100644
> --- a/drivers/gpu/drm/drm_crtc_helper_internal.h
> +++ b/drivers/gpu/drm/drm_crtc_helper_internal.h
> @@ -32,16 +32,6 @@
> #include <drm/drm_encoder.h>
> #include <drm/drm_modes.h>
>
> -/* drm_fb_helper.c */
> -#ifdef CONFIG_DRM_FBDEV_EMULATION
> -int drm_fb_helper_modinit(void);
> -#else
> -static inline int drm_fb_helper_modinit(void)
> -{
> - return 0;
> -}
> -#endif
> -
> /* drm_dp_aux_dev.c */
> #ifdef CONFIG_DRM_DP_AUX_CHARDEV
> int drm_dp_aux_dev_init(void);
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index 4b81195106875d..0b9f1ae1b7864c 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -2499,24 +2499,3 @@ void drm_fbdev_generic_setup(struct drm_device *dev,
> drm_client_register(&fb_helper->client);
> }
> EXPORT_SYMBOL(drm_fbdev_generic_setup);
> -
> -/* The Kconfig DRM_KMS_HELPER selects FRAMEBUFFER_CONSOLE (if !EXPERT)
> - * but the module doesn't depend on any fb console symbols. At least
> - * attempt to load fbcon to avoid leaving the system without a usable console.
> - */
> -int __init drm_fb_helper_modinit(void)
> -{
> -#if defined(CONFIG_FRAMEBUFFER_CONSOLE_MODULE) && !defined(CONFIG_EXPERT)
> - const char name[] = "fbcon";
> - struct module *fbcon;
> -
> - mutex_lock(&module_mutex);
> - fbcon = find_module(name);
> - mutex_unlock(&module_mutex);
> -
> - if (!fbcon)
> - request_module_nowait(name);
> -#endif
> - return 0;
> -}
> -EXPORT_SYMBOL(drm_fb_helper_modinit);
> diff --git a/drivers/gpu/drm/drm_kms_helper_common.c b/drivers/gpu/drm/drm_kms_helper_common.c
> index 221a8528c9937a..f933da1656eb52 100644
> --- a/drivers/gpu/drm/drm_kms_helper_common.c
> +++ b/drivers/gpu/drm/drm_kms_helper_common.c
> @@ -64,19 +64,18 @@ MODULE_PARM_DESC(edid_firmware,
>
> static int __init drm_kms_helper_init(void)
> {
> - int ret;
> -
> - /* Call init functions from specific kms helpers here */
> - ret = drm_fb_helper_modinit();
> - if (ret < 0)
> - goto out;
> -
> - ret = drm_dp_aux_dev_init();
> - if (ret < 0)
> - goto out;
> -
> -out:
> - return ret;
> + /*
> + * The Kconfig DRM_KMS_HELPER selects FRAMEBUFFER_CONSOLE (if !EXPERT)
> + * but the module doesn't depend on any fb console symbols. At least
> + * attempt to load fbcon to avoid leaving the system without a usable
> + * console.
> + */
> + if (IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION) &&
> + IS_MODULE(CONFIG_FRAMEBUFFER_CONSOLE) &&
> + !IS_ENABLED(CONFIG_EXPERT))
> + request_module_nowait("fbcon");
> +
> + return drm_dp_aux_dev_init();
> }
>
> static void __exit drm_kms_helper_exit(void)
> --
> 2.29.2
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply
* Re: [PATCH v2 1/3] powerpc: sstep: Fix load and update emulation
From: Sandipan Das @ 2021-02-03 10:35 UTC (permalink / raw)
To: Naveen N. Rao; +Cc: ravi.bangoria, ananth, jniethe5, paulus, linuxppc-dev, dja
In-Reply-To: <20210203094909.GD210@DESKTOP-TDPLP67.localdomain>
On 03/02/21 3:19 pm, Naveen N. Rao wrote:
> [...]
>
> Wouldn't it be easier to just do the below at the end? Or, am I missing something?
>
> diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
> index ede093e9623472..a2d726d2a5e9d1 100644
> --- a/arch/powerpc/lib/sstep.c
> +++ b/arch/powerpc/lib/sstep.c
> @@ -2980,6 +2980,10 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
> }
> #endif /* CONFIG_VSX */
>
> + if (GETTYPE(op->type) == LOAD && (op->type & UPDATE) &&
> + (ra == 0 || ra == rd))
> + goto unknown_opcode;
> +
> return 0;
>
> logical_done:
>
Thanks that's much cleaner! We might need something similar for
the FP load/store and update instructions where an instruction is
invalid if RA is 0. I'll send a new revision with these changes.
- Sandipan
^ permalink raw reply
* Re: [PATCH 02/13] drm: remove drm_fb_helper_modinit
From: Christoph Hellwig @ 2021-02-03 10:49 UTC (permalink / raw)
To: Christoph Hellwig, Frederic Barrat, Andrew Donnellan,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Jessica Yu, Josh Poimboeuf, Jiri Kosina, Miroslav Benes,
Petr Mladek, Joe Lawrence, Masahiro Yamada, Michal Marek,
linux-kernel, linuxppc-dev, dri-devel, live-patching,
linux-kbuild
In-Reply-To: <YBp8ShiKbQSPCcRx@phenom.ffwll.local>
On Wed, Feb 03, 2021 at 11:34:50AM +0100, Daniel Vetter wrote:
> On Thu, Jan 28, 2021 at 07:14:10PM +0100, Christoph Hellwig wrote:
> > drm_fb_helper_modinit has a lot of boilerplate for what is not very
> > simple functionality. Just open code it in the only caller using
> > IS_ENABLED and IS_MODULE, and skip the find_module check as a
> > request_module is harmless if the module is already loaded (and not
> > other caller has this find_module check either).
> >
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
>
> Hm I thought I've acked this one already somewhere for merging through
> your tree.
>
> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
The difference is that this new version loses the find_module entirely,
while the previous one replaced it with the module_loaded helper that
didn't make it to the second version of the series.
^ permalink raw reply
* Re: [PATCH v2 1/3] powerpc: sstep: Fix load and update emulation
From: Sandipan Das @ 2021-02-03 11:37 UTC (permalink / raw)
To: Naveen N. Rao; +Cc: ravi.bangoria, ananth, jniethe5, paulus, linuxppc-dev, dja
In-Reply-To: <20210203094909.GD210@DESKTOP-TDPLP67.localdomain>
On 03/02/21 3:19 pm, Naveen N. Rao wrote:
> [...]
>
> Wouldn't it be easier to just do the below at the end? Or, am I missing something?
>
> diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
> index ede093e9623472..a2d726d2a5e9d1 100644
> --- a/arch/powerpc/lib/sstep.c
> +++ b/arch/powerpc/lib/sstep.c
> @@ -2980,6 +2980,10 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
> }
> #endif /* CONFIG_VSX */
>
> + if (GETTYPE(op->type) == LOAD && (op->type & UPDATE) &&
> + (ra == 0 || ra == rd))
> + goto unknown_opcode;
> +
> return 0;
>
> logical_done:
>
This looks good?
diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
index e96cff845ef7..a9c149bfd2f5 100644
--- a/arch/powerpc/lib/sstep.c
+++ b/arch/powerpc/lib/sstep.c
@@ -3017,6 +3017,21 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
}
+ if (op->type & UPDATE) {
+ if (ra == rd && GETTYPE(op->type) == LOAD)
+ goto unknown_opcode;
+ else if (ra == 0)
+ switch(GETTYPE(op->type)) {
+ case LOAD:
+ case STORE:
+#ifdef CONFIG_PPC_FPU
+ case LOAD_FP:
+ case STORE_FP:
+#endif
+ goto unknown_opcode;
+ }
+ }
+
#ifdef CONFIG_VSX
if ((GETTYPE(op->type) == LOAD_VSX ||
GETTYPE(op->type) == STORE_VSX) &&
- Sandipan
^ permalink raw reply related
* Re: [PATCH kernel] powerpc/iommu/debug: Add debugfs entries for IOMMU tables
From: Michael Ellerman @ 2021-02-03 11:40 UTC (permalink / raw)
To: linuxppc-dev, Alexey Kardashevskiy
In-Reply-To: <20210113102014.124452-1-aik@ozlabs.ru>
On Wed, 13 Jan 2021 21:20:14 +1100, Alexey Kardashevskiy wrote:
> This adds a folder per LIOBN under /sys/kernel/debug/iommu with IOMMU
> table parameters.
>
> This is enabled by CONFIG_IOMMU_DEBUGFS.
Applied to powerpc/next.
[1/1] powerpc/iommu/debug: Add debugfs entries for IOMMU tables
https://git.kernel.org/powerpc/c/691602aab9c3cce31d3ff9529c09b7922a5f6224
cheers
^ permalink raw reply
* Re: [PATCH] powerpc/mm/book3s64/iommu: fix some RCU-list locks
From: Michael Ellerman @ 2021-02-03 11:40 UTC (permalink / raw)
To: mpe, Qian Cai; +Cc: aik, paulus, linuxppc-dev, linux-kernel, paulmck
In-Reply-To: <20200510051559.1959-1-cai@lca.pw>
On Sun, 10 May 2020 01:15:59 -0400, Qian Cai wrote:
> It is safe to traverse mm->context.iommu_group_mem_list with either
> mem_list_mutex or the RCU read lock held. Silence a few RCU-list false
> positive warnings and fix a few missing RCU read locks.
>
> arch/powerpc/mm/book3s64/iommu_api.c:330 RCU-list traversed in non-reader section!!
>
> other info that might help us debug this:
>
> [...]
Applied to powerpc/next.
[1/1] powerpc/mm/book3s64/iommu: fix some RCU-list locks
https://git.kernel.org/powerpc/c/b5952f8125ae512420d5fc569adce591bea73bf5
cheers
^ permalink raw reply
* Re: [PATCH] powerpc/powernv/pci: fix a RCU-list lock
From: Michael Ellerman @ 2021-02-03 11:40 UTC (permalink / raw)
To: mpe, Qian Cai; +Cc: aik, paulus, linuxppc-dev, linux-kernel, paulmck
In-Reply-To: <20200510051347.1906-1-cai@lca.pw>
On Sun, 10 May 2020 01:13:47 -0400, Qian Cai wrote:
> It is unsafe to traverse tbl->it_group_list without the RCU read lock.
>
> WARNING: suspicious RCU usage
> 5.7.0-rc4-next-20200508 #1 Not tainted
> -----------------------------
> arch/powerpc/platforms/powernv/pci-ioda-tce.c:355 RCU-list traversed in non-reader section!!
>
> [...]
Applied to powerpc/next.
[1/1] powerpc/powernv/pci: fix a RCU-list lock
https://git.kernel.org/powerpc/c/c9790fb5df461c91d3fff1d864c1acb8baf5ad5c
cheers
^ permalink raw reply
* Re: [PATCH 1/2] powerpc/47x: Disable 256k page size
From: Michael Ellerman @ 2021-02-03 11:40 UTC (permalink / raw)
To: Michael Ellerman, Benjamin Herrenschmidt, Christophe Leroy,
Paul Mackerras
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <2fed79b1154c872194f98bac4422c23918325e61.1611128938.git.christophe.leroy@csgroup.eu>
On Wed, 20 Jan 2021 07:49:13 +0000 (UTC), Christophe Leroy wrote:
> PPC47x_TLBE_SIZE isn't defined for 256k pages, so
> this size of page shall not be selected for 47x.
Applied to powerpc/next.
[1/2] powerpc/47x: Disable 256k page size
https://git.kernel.org/powerpc/c/910a0cb6d259736a0c86e795d4c2f42af8d0d775
[2/2] powerpc/44x: Remove STDBINUTILS kconfig option
https://git.kernel.org/powerpc/c/4eeef098b43242ed145c83fba9989d586d707589
cheers
^ permalink raw reply
* Re: [PATCH] powerpc/47x: Disable 256k page size
From: Michael Ellerman @ 2021-02-03 11:40 UTC (permalink / raw)
To: Michael Ellerman, Paul Mackerras, Benjamin Herrenschmidt,
Christophe Leroy
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <2fed79b1154c872194f98bac4422c23918325e61.1611039590.git.christophe.leroy@csgroup.eu>
On Tue, 19 Jan 2021 07:00:00 +0000 (UTC), Christophe Leroy wrote:
> PPC47x_TLBE_SIZE isn't defined for 256k pages, so
> this size of page shall not be selected for 47x.
Applied to powerpc/next.
[1/1] powerpc/47x: Disable 256k page size
https://git.kernel.org/powerpc/c/910a0cb6d259736a0c86e795d4c2f42af8d0d775
cheers
^ permalink raw reply
* Re: [PATCH] powerpc/kvm: Force selection of CONFIG_PPC_FPU
From: Michael Ellerman @ 2021-02-03 11:40 UTC (permalink / raw)
To: Michael Ellerman, Benjamin Herrenschmidt, Christophe Leroy,
Paul Mackerras
Cc: linuxppc-dev, linux-kernel, kvm-ppc
In-Reply-To: <74461a99fa1466f361532ca794ca0753be3d9f86.1611038044.git.christophe.leroy@csgroup.eu>
On Tue, 19 Jan 2021 06:36:52 +0000 (UTC), Christophe Leroy wrote:
> book3s/32 kvm is designed with the assumption that
> an FPU is always present.
>
> Force selection of FPU support in the kernel when
> build KVM.
Applied to powerpc/next.
[1/1] powerpc/kvm: Force selection of CONFIG_PPC_FPU
https://git.kernel.org/powerpc/c/27f699579b64dbf27caf31e5c0eac567ec0aa8b8
cheers
^ permalink raw reply
* Re: [PATCH] powerpc/xmon: Enable breakpoints on 8xx
From: Michael Ellerman @ 2021-02-03 11:40 UTC (permalink / raw)
To: Michael Ellerman, Benjamin Herrenschmidt, Christophe Leroy,
Paul Mackerras
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <b0607f1113d1558e73476bb06db0ee16d31a6e5b.1608716197.git.christophe.leroy@csgroup.eu>
On Wed, 23 Dec 2020 09:38:48 +0000 (UTC), Christophe Leroy wrote:
> Since commit 4ad8622dc548 ("powerpc/8xx: Implement hw_breakpoint"),
> 8xx has breakpoints so there is no reason to opt breakpoint logic
> out of xmon for the 8xx.
Applied to powerpc/next.
[1/1] powerpc/xmon: Enable breakpoints on 8xx
https://git.kernel.org/powerpc/c/30662217885d7341161924acf1665924d7d37d64
cheers
^ permalink raw reply
* Re: [PATCH v2] powerpc/32s: Only build hash code when CONFIG_PPC_BOOK3S_604 is selected
From: Michael Ellerman @ 2021-02-03 11:40 UTC (permalink / raw)
To: Michael Ellerman, Benjamin Herrenschmidt, Christophe Leroy,
Paul Mackerras
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <62df436454ef06e104cc334a0859a2878d7888d5.1608274548.git.christophe.leroy@csgroup.eu>
On Fri, 18 Dec 2020 06:56:05 +0000 (UTC), Christophe Leroy wrote:
> It is now possible to only build book3s/32 kernel for
> CPUs without hash table.
>
> Opt out hash related code when CONFIG_PPC_BOOK3S_604 is not selected.
Applied to powerpc/next.
[1/1] powerpc/32s: Only build hash code when CONFIG_PPC_BOOK3S_604 is selected
https://git.kernel.org/powerpc/c/259149cf7c3c6195e6199e045ca988c31d081cab
cheers
^ permalink raw reply
* Re: [PATCH] powerpc/prom: Fix "ibm,arch-vec-5-platform-support" scan
From: Michael Ellerman @ 2021-02-03 11:40 UTC (permalink / raw)
To: linuxppc-dev, Cédric Le Goater; +Cc: stable
In-Reply-To: <20210122075029.797013-1-clg@kaod.org>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 940 bytes --]
On Fri, 22 Jan 2021 08:50:29 +0100, Cédric Le Goater wrote:
> The "ibm,arch-vec-5-platform-support" property is a list of pairs of
> bytes representing the options and values supported by the platform
> firmware. At boot time, Linux scans this list and activates the
> available features it recognizes : Radix and XIVE.
>
> A recent change modified the number of entries to loop on and 8 bytes,
> 4 pairs of { options, values } entries are always scanned. This is
> fine on KVM but not on PowerVM which can advertises less. As a
> consequence on this platform, Linux reads extra entries pointing to
> random data, interprets these as available features and tries to
> activate them, leading to a firmware crash in
> ibm,client-architecture-support.
>
> [...]
Applied to powerpc/next.
[1/1] powerpc/prom: Fix "ibm,arch-vec-5-platform-support" scan
https://git.kernel.org/powerpc/c/ed5b00a05c2ae95b59adc3442f45944ec632e794
cheers
^ permalink raw reply
* Re: [PATCH] powerpc/vas: Fix IRQ name allocation
From: Michael Ellerman @ 2021-02-03 11:40 UTC (permalink / raw)
To: linuxppc-dev, Cédric Le Goater; +Cc: Sukadev Bhattiprolu, Haren Myneni
In-Reply-To: <20201212142707.2102141-1-clg@kaod.org>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 385 bytes --]
On Sat, 12 Dec 2020 15:27:07 +0100, Cédric Le Goater wrote:
> The VAS device allocates a generic interrupt to handle page faults but
> the IRQ name doesn't show under /proc. This is because it's on
> stack. Allocate the name.
Applied to powerpc/next.
[1/1] powerpc/vas: Fix IRQ name allocation
https://git.kernel.org/powerpc/c/9dd31b11370380c488c8f2d347058617cd3fff99
cheers
^ permalink raw reply
* Re: [PATCH v2 00/23] powerpc: Fix W=1 compile errors
From: Michael Ellerman @ 2021-02-03 11:40 UTC (permalink / raw)
To: linuxppc-dev, Cédric Le Goater; +Cc: Christophe Leroy
In-Reply-To: <20210104143206.695198-1-clg@kaod.org>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3887 bytes --]
On Mon, 4 Jan 2021 15:31:43 +0100, Cédric Le Goater wrote:
> Here is an assorted collection of fixes for W=1.
>
> After this series, only a few errors are left, some missing declarations
> in arch/powerpc/kernel/sys_ppc32.c, panic_smp_self_stop() declaration
> and a few of these which I don't know how to fix :
>
> ./arch/powerpc/xmon/xmon.c: In function ‘xmon_print_symbol’:
> ./arch/powerpc/xmon/xmon.c:3656:14: error: variable ‘name’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered]
> 3656 | const char *name = NULL;
> | ^~~~
>
> [...]
Applied to powerpc/next.
[01/23] powerpc/mm: Include __find_linux_pte() prototype
https://git.kernel.org/powerpc/c/d25da505c3f567a8667adb0118de1400468172ac
[02/23] powerpc/pseries/ras: Remove unused variable 'status'
https://git.kernel.org/powerpc/c/aa23ea0c5f7f9a46e6aa3be0a4cfdfb80fabca6d
[03/23] powerpc/pseries/eeh: Make pseries_pcibios_bus_add_device() static
https://git.kernel.org/powerpc/c/44159329e0ad160af7cc7e84fa6d97531c8ed78f
[04/23] powerpc/pseries/ras: Make init_ras_hotplug_IRQ() static
https://git.kernel.org/powerpc/c/90db8bf24d133654032a1c7dd46aa5096627b9ff
[05/23] powerpc/pmem: Include pmem prototypes
https://git.kernel.org/powerpc/c/d03f210e6ed8f5d64b00f0f07b03db74aa5b95a1
[06/23] powerpc/setup_64: Make some routines static
https://git.kernel.org/powerpc/c/692e592895266bafb1e0d688e960b4bdd8e165a8
[07/23] powerpc/mce: Include prototypes
https://git.kernel.org/powerpc/c/1cc2fd75934454be024cd7609b6d7890de6e724b
[08/23] powerpc/smp: Include tick_broadcast() prototype
https://git.kernel.org/powerpc/c/cd7aa5d2fae11794a00ea34b10ee58434d718bc3
[09/23] powerpc/smp: Make debugger_ipi_callback() static
https://git.kernel.org/powerpc/c/157c9f409d11fe79f09c69e78bfc7f8fe7410744
[10/23] powerpc/optprobes: Remove unused routine patch_imm32_load_insns()
https://git.kernel.org/powerpc/c/d47d307f1049be545d45cf0f2332495ec9a89cc0
[11/23] powerpc/optprobes: Make patch_imm64_load_insns() static
https://git.kernel.org/powerpc/c/bb21e1b6c5352d62d866e9236ed427f632cd537b
[12/23] powerpc/mm: Declare some prototypes
https://git.kernel.org/powerpc/c/cccaf1a10abf03d91321d29ff333d6d5d4cef542
[13/23] powerpc/mm: Move hpte_insert_repeating() prototype
https://git.kernel.org/powerpc/c/11f9c1d2fb497f69f83d4fab6fb7fc8a6884eded
[14/23] powerpc/mm: Declare preload_new_slb_context() prototype
https://git.kernel.org/powerpc/c/1f55aefea3c1431f662aafa02ef9ac18d8880751
[15/23] powerpc/mm/hugetlb: Make pseries_alloc_bootmem_huge_page() static
https://git.kernel.org/powerpc/c/94b87d72fc852b6995702d74541136a65f88624a
[16/23] powerpc/mm: Declare arch_report_meminfo() prototype.
https://git.kernel.org/powerpc/c/1429ff51480fe5a21a3d17158d259a4b4b04808f
[17/23] powerpc/watchdog: Declare soft_nmi_interrupt() prototype
https://git.kernel.org/powerpc/c/9ae440fb3d7d1c91ada7d6b13e009bd9f4f00e6c
[18/23] KVM: PPC: Make the VMX instruction emulation routines static
https://git.kernel.org/powerpc/c/9236f57a9e51c72ce426ccd2e53e123de7196a0f
[19/23] KVM: PPC: Book3S HV: Include prototypes
https://git.kernel.org/powerpc/c/d834915e8ee28884f1180dc566ba77c8768ec00a
[20/23] KVM: PPC: Book3S HV: Declare some prototypes
https://git.kernel.org/powerpc/c/ce275179b6c98032361271927b7458884e9708b1
[21/23] powerpc/pseries: Make IOV setup routines static
https://git.kernel.org/powerpc/c/42c1f400d1da50dd1cd9f874df72dc827f9fe2d2
[22/23] powerpc/pcidn: Make IOV setup routines static
https://git.kernel.org/powerpc/c/53137a9b51e49e0399ad322e4a39bc5f9bf0a1de
[23/23] powerpc/pseries/eeh: Make pseries_send_allow_unfreeze() static
https://git.kernel.org/powerpc/c/22f1de2e13b066921dedf6a00d2cc414f3cbab05
cheers
^ permalink raw reply
* Re: [PATCH v5 1/2] powerpc/mce: Reduce the size of event arrays
From: Michael Ellerman @ 2021-02-03 11:40 UTC (permalink / raw)
To: linuxppc-dev, Ganesh Goudar, mpe; +Cc: mahesh, npiggin
In-Reply-To: <20210128104143.70668-1-ganeshgr@linux.ibm.com>
On Thu, 28 Jan 2021 16:11:42 +0530, Ganesh Goudar wrote:
> Maximum recursive depth of MCE is 4, Considering the maximum depth
> allowed reduce the size of event to 10 from 100. This saves us ~19kB
> of memory and has no fatal consequences.
Applied to powerpc/next.
[1/2] powerpc/mce: Reduce the size of event arrays
https://git.kernel.org/powerpc/c/17c5cf0fb993e219bda4f53aa9ec90d3cfcf92ab
[2/2] powerpc/mce: Remove per cpu variables from MCE handlers
https://git.kernel.org/powerpc/c/923b3cf00b3ffc896543bac99affc0fa8553e41a
cheers
^ permalink raw reply
* Re: [PATCH] powerpc/time: enable sched clock for irqtime
From: Michael Ellerman @ 2021-02-03 11:40 UTC (permalink / raw)
To: linuxppc-dev, Pingfan Liu; +Cc: Christophe Leroy, Nicholas Piggin
In-Reply-To: <1603349479-26185-1-git-send-email-kernelfans@gmail.com>
On Thu, 22 Oct 2020 14:51:19 +0800, Pingfan Liu wrote:
> When CONFIG_IRQ_TIME_ACCOUNTING and CONFIG_VIRT_CPU_ACCOUNTING_GEN, powerpc
> does not enable "sched_clock_irqtime" and can not utilize irq time
> accounting.
>
> Like x86, powerpc does not use the sched_clock_register() interface. So it
> needs an dedicated call to enable_sched_clock_irqtime() to enable irq time
> accounting.
Applied to powerpc/next.
[1/1] powerpc/time: Enable sched clock for irqtime
https://git.kernel.org/powerpc/c/b709e32ef570b8b91dfbcb63cffac4324c87799f
cheers
^ permalink raw reply
* Re: [PATCH v3] powerpc/perf/hv-24x7: Dont create sysfs event files for dummy events
From: Michael Ellerman @ 2021-02-03 11:40 UTC (permalink / raw)
To: linuxppc-dev, Kajol Jain, mpe; +Cc: suka, atrajeev, maddy
In-Reply-To: <20201228085204.18026-1-kjain@linux.ibm.com>
On Mon, 28 Dec 2020 14:22:04 +0530, Kajol Jain wrote:
> hv_24x7 performance monitoring unit creates list of supported events
> from the event catalog obtained via HCALL. hv_24x7 catalog could also
> contain invalid or dummy events with names like RESERVED*.
> These events does not have any hardware counters backing them.
> So patch adds a check to string compare the event names
> to filter out them.
>
> [...]
Applied to powerpc/next.
[1/1] powerpc/perf/hv-24x7: Dont create sysfs event files for dummy events
https://git.kernel.org/powerpc/c/e5f9d8858612c192a4326f39ed16c91c3a9e0893
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