* Re: [PATCH 2/8] CMDLINE: drivers: of: ifdef out cmdline section
From: Daniel Walker @ 2021-03-30 23:17 UTC (permalink / raw)
To: Rob Herring
Cc: devicetree, Ruslan Ruslichenko, Daniel Gimpelevich, Frank Rowand,
linuxppc-dev, X86 ML, open list:MIPS,
linux-kernel@vger.kernel.org, xe-linux-external, Andrew Morton,
Will Deacon
In-Reply-To: <CAL_Jsq+_gF9Cy7H6ic2q8dxnPf4+FsBa5pFYYRydJsEmDhnNhA@mail.gmail.com>
On Tue, Mar 30, 2021 at 02:49:13PM -0500, Rob Herring wrote:
> On Tue, Mar 30, 2021 at 12:57 PM Daniel Walker <danielwa@cisco.com> wrote:
> >
> > It looks like there's some seepage of cmdline stuff into
> > the generic device tree code. This conflicts with the
> > generic cmdline implementation so I remove it in the case
> > when that's enabled.
> >
> > Cc: xe-linux-external@cisco.com
> > Signed-off-by: Ruslan Ruslichenko <rruslich@cisco.com>
> > Signed-off-by: Daniel Walker <danielwa@cisco.com>
> > ---
> > drivers/of/fdt.c | 14 ++++++++++++++
> > 1 file changed, 14 insertions(+)
> >
> > diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> > index dcc1dd96911a..d8805cd9717a 100644
> > --- a/drivers/of/fdt.c
> > +++ b/drivers/of/fdt.c
> > @@ -25,6 +25,7 @@
> > #include <linux/serial_core.h>
> > #include <linux/sysfs.h>
> > #include <linux/random.h>
> > +#include <linux/cmdline.h>
> >
> > #include <asm/setup.h> /* for COMMAND_LINE_SIZE */
> > #include <asm/page.h>
> > @@ -1050,6 +1051,18 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
> >
> > /* Retrieve command line */
> > p = of_get_flat_dt_prop(node, "bootargs", &l);
> > +
> > +#if defined(CONFIG_GENERIC_CMDLINE) && defined(CONFIG_GENERIC_CMDLINE_OF)
>
> Moving in the wrong direction... This code already has too many
> #ifdef's. I like Christophe's version as it gets rid of all the code
> here.
It's temporary .. Notice CONFIG_GENERIC_CMDLINE_OF is only used on PowerPC. I
experienced doubling on arm64 when this was used (i.e. the append and prepend
was added twice).
I don't think there are any other users which can't be moved outside the device
tree code, but powerpc uses this function three times during boot up plus the
prom_init user. It's possible to use the generic command line in all four places,
but it become space inefficient.
So the plan would be make the other architectures call the generic cmdline
directly without this code, then powerpc would need to be reworked to call the
generic commandline in it's own code hopefully just once.
The end results would be this section would reduce down to one string copy and
no command line stuff.
Maybe you would rather I just use the generic command line in those three place
and reduce this at the space code of powerpc ?
Daniel
^ permalink raw reply
* Re: [PATCH v2 3/7] powerpc: convert config files to generic cmdline
From: Daniel Walker @ 2021-03-30 23:31 UTC (permalink / raw)
To: Rob Herring
Cc: Daniel Gimpelevich, linuxppc-dev, X86 ML, open list:MIPS,
linux-kernel@vger.kernel.org, Paul Mackerras, xe-linux-external,
Andrew Morton, Will Deacon
In-Reply-To: <CAL_JsqJKBeAgaHQJwOL9G2qLbQSh32L5LtN+cSUgn5sV_P8How@mail.gmail.com>
On Tue, Mar 30, 2021 at 03:13:04PM -0500, Rob Herring wrote:
> On Tue, Mar 30, 2021 at 12:33 PM Daniel Walker <danielwa@cisco.com> wrote:
> >
> > On Thu, Mar 25, 2021 at 05:29:44PM -0600, Rob Herring wrote:
> > > On Thu, Mar 25, 2021 at 2:00 PM Daniel Walker <danielwa@cisco.com> wrote:
> > > >
> > > > On Thu, Mar 25, 2021 at 01:03:55PM +0100, Christophe Leroy wrote:
> > > > >
> > > > > Ok, so you agree we don't need to provide two CMDLINE, one to be appended and one to be prepended.
> > > > >
> > > > > Let's only provide once CMDLINE as of today, and ask the user to select
> > > > > whether he wants it appended or prepended or replacee. Then no need to
> > > > > change all existing config to rename CONFIG_CMDLINE into either of the new
> > > > > ones.
> > > > >
> > > > > That's the main difference between my series and Daniel's series. So I'll
> > > > > finish taking Will's comment into account and we'll send out a v3 soon.
> > > >
> > > > It doesn't solve the needs of Cisco, I've stated many times your changes have
> > > > little value. Please stop submitting them.
> > >
> > > Can you please outline what those needs are which aren't met?
> >
> > append AND prepend at the same time on all architectures. Christophe doesn't
> > understand the need, and hence tries to minimize the feature set which is
> > incompatible with Cisco needs and all the other out of tree users.
>
> Okay, but that's never been a feature in upstream. For upstream, we
> refactor first and add features 2nd. In this case, the difference is
> largely the kconfig and it would be better to not change the options
> twice, but that's not a blocker for taking the refactoring. You won't
> find a maintainer that's going to take adding a feature over cleanups
> and unification.
It kind of is a feature in upstream, it's a matter of opinion. Some platform
used append and some use prepend, and it's likely because the maintainers needed
one or the other for development.
I'm not sure why you think I can't add the features in one go. It would be
horrid to take Christophe's changes, then have to do basically all the same work
a second time which is what Christophe's changes would force me to do.
Say for example I implement this change only on one architecture. In that case
the maintainer would be accepting a feature enhancement , but there would be no
stopping it. I shouldn't have to go two strokes on one architecture, but each
change I'm making is essentially a single architecture. They can go in all
together or one at a time.
Daniel
^ permalink raw reply
* [PATCH v2 3/6] powerpc/64s: Use htab_convert_pte_flags() in hash__mark_rodata_ro()
From: Michael Ellerman @ 2021-03-31 0:38 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20210331003845.216246-1-mpe@ellerman.id.au>
In hash__mark_rodata_ro() we pass the raw PP_RXXX value to
hash__change_memory_range(). That has the effect of setting the key to
zero, because PP_RXXX contains no key value.
Fix it by using htab_convert_pte_flags(), which knows how to convert a
pgprot into a pp value, including the key.
Fixes: d94b827e89dc ("powerpc/book3s64/kuap: Use Key 3 for kernel mapping with hash translation")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Daniel Axtens <dja@axtens.net>
---
arch/powerpc/mm/book3s64/hash_pgtable.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
v2: Unchanged.
diff --git a/arch/powerpc/mm/book3s64/hash_pgtable.c b/arch/powerpc/mm/book3s64/hash_pgtable.c
index 567e0c6b3978..03819c259f0a 100644
--- a/arch/powerpc/mm/book3s64/hash_pgtable.c
+++ b/arch/powerpc/mm/book3s64/hash_pgtable.c
@@ -428,12 +428,14 @@ static bool hash__change_memory_range(unsigned long start, unsigned long end,
void hash__mark_rodata_ro(void)
{
- unsigned long start, end;
+ unsigned long start, end, pp;
start = (unsigned long)_stext;
end = (unsigned long)__init_begin;
- WARN_ON(!hash__change_memory_range(start, end, PP_RXXX));
+ pp = htab_convert_pte_flags(pgprot_val(PAGE_KERNEL_ROX), HPTE_USE_KERNEL_KEY);
+
+ WARN_ON(!hash__change_memory_range(start, end, pp));
}
void hash__mark_initmem_nx(void)
--
2.25.1
^ permalink raw reply related
* [PATCH v2 5/6] powerpc/mm/64s/hash: Add real-mode change_memory_range() for hash LPAR
From: Michael Ellerman @ 2021-03-31 0:38 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20210331003845.216246-1-mpe@ellerman.id.au>
When we enabled STRICT_KERNEL_RWX we received some reports of boot
failures when using the Hash MMU and running under phyp. The crashes
are intermittent, and often exhibit as a completely unresponsive
system, or possibly an oops.
One example, which was caught in xmon:
[ 14.068327][ T1] devtmpfs: mounted
[ 14.069302][ T1] Freeing unused kernel memory: 5568K
[ 14.142060][ T347] BUG: Unable to handle kernel instruction fetch
[ 14.142063][ T1] Run /sbin/init as init process
[ 14.142074][ T347] Faulting instruction address: 0xc000000000004400
cpu 0x2: Vector: 400 (Instruction Access) at [c00000000c7475e0]
pc: c000000000004400: exc_virt_0x4400_instruction_access+0x0/0x80
lr: c0000000001862d4: update_rq_clock+0x44/0x110
sp: c00000000c747880
msr: 8000000040001031
current = 0xc00000000c60d380
paca = 0xc00000001ec9de80 irqmask: 0x03 irq_happened: 0x01
pid = 347, comm = kworker/2:1
...
enter ? for help
[c00000000c747880] c0000000001862d4 update_rq_clock+0x44/0x110 (unreliable)
[c00000000c7478f0] c000000000198794 update_blocked_averages+0xb4/0x6d0
[c00000000c7479f0] c000000000198e40 update_nohz_stats+0x90/0xd0
[c00000000c747a20] c0000000001a13b4 _nohz_idle_balance+0x164/0x390
[c00000000c747b10] c0000000001a1af8 newidle_balance+0x478/0x610
[c00000000c747be0] c0000000001a1d48 pick_next_task_fair+0x58/0x480
[c00000000c747c40] c000000000eaab5c __schedule+0x12c/0x950
[c00000000c747cd0] c000000000eab3e8 schedule+0x68/0x120
[c00000000c747d00] c00000000016b730 worker_thread+0x130/0x640
[c00000000c747da0] c000000000174d50 kthread+0x1a0/0x1b0
[c00000000c747e10] c00000000000e0f0 ret_from_kernel_thread+0x5c/0x6c
This shows that CPU 2, which was idle, woke up and then appears to
randomly take an instruction fault on a completely valid area of
kernel text.
The cause turns out to be the call to hash__mark_rodata_ro(), late in
boot. Due to the way we layout text and rodata, that function actually
changes the permissions for all of text and rodata to read-only plus
execute.
To do the permission change we use a hypervisor call, H_PROTECT. On
phyp that appears to be implemented by briefly removing the mapping of
the kernel text, before putting it back with the updated permissions.
If any other CPU is executing during that window, it will see spurious
faults on the kernel text and/or data, leading to crashes.
To fix it we use stop machine to collect all other CPUs, and then have
them drop into real mode (MMU off), while we change the mapping. That
way they are unaffected by the mapping temporarily disappearing.
We don't see this bug on KVM because KVM always use VPM=1, where
faults are directed to the hypervisor, and the fault will be
serialised vs the h_protect() by HPTE_V_HVLOCK.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/mm/book3s64/hash_pgtable.c | 105 +++++++++++++++++++++++-
1 file changed, 104 insertions(+), 1 deletion(-)
v2: Add mention of why we don't see the issue on KVM.
Use hard_irq_disable() not __hard_EE_RI_disable() as noticed by Nick.
diff --git a/arch/powerpc/mm/book3s64/hash_pgtable.c b/arch/powerpc/mm/book3s64/hash_pgtable.c
index 3663d3cdffac..ad5eff097d31 100644
--- a/arch/powerpc/mm/book3s64/hash_pgtable.c
+++ b/arch/powerpc/mm/book3s64/hash_pgtable.c
@@ -8,6 +8,7 @@
#include <linux/sched.h>
#include <linux/mm_types.h>
#include <linux/mm.h>
+#include <linux/stop_machine.h>
#include <asm/sections.h>
#include <asm/mmu.h>
@@ -400,6 +401,19 @@ EXPORT_SYMBOL_GPL(hash__has_transparent_hugepage);
#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
#ifdef CONFIG_STRICT_KERNEL_RWX
+
+struct change_memory_parms {
+ unsigned long start, end, newpp;
+ unsigned int step, nr_cpus, master_cpu;
+ atomic_t cpu_counter;
+};
+
+// We'd rather this was on the stack but it has to be in the RMO
+static struct change_memory_parms chmem_parms;
+
+// And therefore we need a lock to protect it from concurrent use
+static DEFINE_MUTEX(chmem_lock);
+
static void change_memory_range(unsigned long start, unsigned long end,
unsigned int step, unsigned long newpp)
{
@@ -414,6 +428,73 @@ static void change_memory_range(unsigned long start, unsigned long end,
mmu_kernel_ssize);
}
+static int notrace chmem_secondary_loop(struct change_memory_parms *parms)
+{
+ unsigned long msr, tmp, flags;
+ int *p;
+
+ p = &parms->cpu_counter.counter;
+
+ local_irq_save(flags);
+ hard_irq_disable();
+
+ asm volatile (
+ // Switch to real mode and leave interrupts off
+ "mfmsr %[msr] ;"
+ "li %[tmp], %[MSR_IR_DR] ;"
+ "andc %[tmp], %[msr], %[tmp] ;"
+ "mtmsrd %[tmp] ;"
+
+ // Tell the master we are in real mode
+ "1: "
+ "lwarx %[tmp], 0, %[p] ;"
+ "addic %[tmp], %[tmp], -1 ;"
+ "stwcx. %[tmp], 0, %[p] ;"
+ "bne- 1b ;"
+
+ // Spin until the counter goes to zero
+ "2: ;"
+ "lwz %[tmp], 0(%[p]) ;"
+ "cmpwi %[tmp], 0 ;"
+ "bne- 2b ;"
+
+ // Switch back to virtual mode
+ "mtmsrd %[msr] ;"
+
+ : // outputs
+ [msr] "=&r" (msr), [tmp] "=&b" (tmp), "+m" (*p)
+ : // inputs
+ [p] "b" (p), [MSR_IR_DR] "i" (MSR_IR | MSR_DR)
+ : // clobbers
+ "cc", "xer"
+ );
+
+ local_irq_restore(flags);
+
+ return 0;
+}
+
+static int change_memory_range_fn(void *data)
+{
+ struct change_memory_parms *parms = data;
+
+ if (parms->master_cpu != smp_processor_id())
+ return chmem_secondary_loop(parms);
+
+ // Wait for all but one CPU (this one) to call-in
+ while (atomic_read(&parms->cpu_counter) > 1)
+ barrier();
+
+ change_memory_range(parms->start, parms->end, parms->step, parms->newpp);
+
+ mb();
+
+ // Signal the other CPUs that we're done
+ atomic_dec(&parms->cpu_counter);
+
+ return 0;
+}
+
static bool hash__change_memory_range(unsigned long start, unsigned long end,
unsigned long newpp)
{
@@ -428,7 +509,29 @@ static bool hash__change_memory_range(unsigned long start, unsigned long end,
if (start >= end)
return false;
- change_memory_range(start, end, step, newpp);
+ if (firmware_has_feature(FW_FEATURE_LPAR)) {
+ mutex_lock(&chmem_lock);
+
+ chmem_parms.start = start;
+ chmem_parms.end = end;
+ chmem_parms.step = step;
+ chmem_parms.newpp = newpp;
+ chmem_parms.master_cpu = smp_processor_id();
+
+ cpus_read_lock();
+
+ atomic_set(&chmem_parms.cpu_counter, num_online_cpus());
+
+ // Ensure state is consistent before we call the other CPUs
+ mb();
+
+ stop_machine_cpuslocked(change_memory_range_fn, &chmem_parms,
+ cpu_online_mask);
+
+ cpus_read_unlock();
+ mutex_unlock(&chmem_lock);
+ } else
+ change_memory_range(start, end, step, newpp);
return true;
}
--
2.25.1
^ permalink raw reply related
* [PATCH v2 6/6] powerpc/mm/64s: Allow STRICT_KERNEL_RWX again
From: Michael Ellerman @ 2021-03-31 0:38 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20210331003845.216246-1-mpe@ellerman.id.au>
We have now fixed the known bugs in STRICT_KERNEL_RWX for Book3S
64-bit Hash and Radix MMUs, see preceding commits, so allow the
option to be selected again.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
v2: Unchanged.
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index c1344c05226c..2a99ca409117 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -135,7 +135,7 @@ config PPC
select ARCH_HAS_MEMBARRIER_CALLBACKS
select ARCH_HAS_MEMBARRIER_SYNC_CORE
select ARCH_HAS_SCALED_CPUTIME if VIRT_CPU_ACCOUNTING_NATIVE && PPC_BOOK3S_64
- select ARCH_HAS_STRICT_KERNEL_RWX if (PPC32 && !HIBERNATION)
+ select ARCH_HAS_STRICT_KERNEL_RWX if ((PPC_BOOK3S_64 || PPC32) && !HIBERNATION)
select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
select ARCH_HAS_UACCESS_FLUSHCACHE
select ARCH_HAS_COPY_MC if PPC64
--
2.25.1
^ permalink raw reply related
* [PATCH v2 4/6] powerpc/mm/64s/hash: Factor out change_memory_range()
From: Michael Ellerman @ 2021-03-31 0:38 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20210331003845.216246-1-mpe@ellerman.id.au>
Pull the loop calling hpte_updateboltedpp() out of
hash__change_memory_range() into a helper function. We need it to be a
separate function for the next patch.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/mm/book3s64/hash_pgtable.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
v2: Unchanged.
diff --git a/arch/powerpc/mm/book3s64/hash_pgtable.c b/arch/powerpc/mm/book3s64/hash_pgtable.c
index 03819c259f0a..3663d3cdffac 100644
--- a/arch/powerpc/mm/book3s64/hash_pgtable.c
+++ b/arch/powerpc/mm/book3s64/hash_pgtable.c
@@ -400,10 +400,23 @@ EXPORT_SYMBOL_GPL(hash__has_transparent_hugepage);
#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
#ifdef CONFIG_STRICT_KERNEL_RWX
+static void change_memory_range(unsigned long start, unsigned long end,
+ unsigned int step, unsigned long newpp)
+{
+ unsigned long idx;
+
+ pr_debug("Changing page protection on range 0x%lx-0x%lx, to 0x%lx, step 0x%x\n",
+ start, end, newpp, step);
+
+ for (idx = start; idx < end; idx += step)
+ /* Not sure if we can do much with the return value */
+ mmu_hash_ops.hpte_updateboltedpp(newpp, idx, mmu_linear_psize,
+ mmu_kernel_ssize);
+}
+
static bool hash__change_memory_range(unsigned long start, unsigned long end,
unsigned long newpp)
{
- unsigned long idx;
unsigned int step, shift;
shift = mmu_psize_defs[mmu_linear_psize].shift;
@@ -415,13 +428,7 @@ static bool hash__change_memory_range(unsigned long start, unsigned long end,
if (start >= end)
return false;
- pr_debug("Changing page protection on range 0x%lx-0x%lx, to 0x%lx, step 0x%x\n",
- start, end, newpp, step);
-
- for (idx = start; idx < end; idx += step)
- /* Not sure if we can do much with the return value */
- mmu_hash_ops.hpte_updateboltedpp(newpp, idx, mmu_linear_psize,
- mmu_kernel_ssize);
+ change_memory_range(start, end, step, newpp);
return true;
}
--
2.25.1
^ permalink raw reply related
* [PATCH v2 1/6] powerpc/mm/64s: Add _PAGE_KERNEL_ROX
From: Michael Ellerman @ 2021-03-31 0:38 UTC (permalink / raw)
To: linuxppc-dev
In the past we had a fallback definition for _PAGE_KERNEL_ROX, but we
removed that in commit d82fd29c5a8c ("powerpc/mm: Distribute platform
specific PAGE and PMD flags and definitions") and added definitions
for each MMU family.
However we missed adding a definition for 64s, which was not really a
bug because it's currently not used.
But we'd like to use PAGE_KERNEL_ROX in a future patch so add a
definition now.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/include/asm/book3s/64/pgtable.h | 1 +
1 file changed, 1 insertion(+)
v2: Unchanged.
diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h
index 058601efbc8a..0c89977ec10b 100644
--- a/arch/powerpc/include/asm/book3s/64/pgtable.h
+++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
@@ -116,6 +116,7 @@
*/
#define _PAGE_KERNEL_RW (_PAGE_PRIVILEGED | _PAGE_RW | _PAGE_DIRTY)
#define _PAGE_KERNEL_RO (_PAGE_PRIVILEGED | _PAGE_READ)
+#define _PAGE_KERNEL_ROX (_PAGE_PRIVILEGED | _PAGE_READ | _PAGE_EXEC)
#define _PAGE_KERNEL_RWX (_PAGE_PRIVILEGED | _PAGE_DIRTY | \
_PAGE_RW | _PAGE_EXEC)
/*
--
2.25.1
^ permalink raw reply related
* [PATCH v2 2/6] powerpc/pseries: Add key to flags in pSeries_lpar_hpte_updateboltedpp()
From: Michael Ellerman @ 2021-03-31 0:38 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20210331003845.216246-1-mpe@ellerman.id.au>
The flags argument to plpar_pte_protect() (aka. H_PROTECT), includes
the key in bits 9-13, but currently we always set those bits to zero.
In the past that hasn't been a problem because we always used key 0
for the kernel, and updateboltedpp() is only used for kernel mappings.
However since commit d94b827e89dc ("powerpc/book3s64/kuap: Use Key 3
for kernel mapping with hash translation") we are now inadvertently
changing the key (to zero) when we call plpar_pte_protect().
That hasn't broken anything because updateboltedpp() is only used for
STRICT_KERNEL_RWX, which is currently disabled on 64s due to other
bugs.
But we want to fix that, so first we need to pass the key correctly to
plpar_pte_protect(). We can't pass our newpp value directly in, we
have to convert it into the form expected by the hcall.
The hcall we're using here is H_PROTECT, which is specified in section
14.5.4.1.6 of LoPAPR v1.1.
It takes a `flags` parameter, and the description for flags says:
* flags: AVPN, pp0, pp1, pp2, key0-key4, n, and for the CMO
option: CMO Option flags as defined in Table 189‚
If you then go to the start of the parent section, 14.5.4.1, on page
405, it says:
Register Linkage (For hcall() tokens 0x04 - 0x18)
* On Call
* R3 function call token
* R4 flags (see Table 178‚ “Page Frame Table Access flags field
definition‚” on page 401)
Then you have to go to section 14.5.3, and on page 394 there is a list
of hcalls and their tokens (table 176), and there you can see that
H_PROTECT == 0x18.
Finally you can look at table 178, on page 401, where it specifies the
layout of the bits for the key:
Bit Function
-----------------
50-54 | key0-key4
Those are big-endian bit numbers, converting to normal bit numbers you
get bits 9-13, or 0x3e00.
In the kernel we have:
#define HPTE_R_KEY_HI ASM_CONST(0x3000000000000000)
#define HPTE_R_KEY_LO ASM_CONST(0x0000000000000e00)
So the LO bits of newpp are already in the right place, and the HI
bits need to be shifted down by 48.
Fixes: d94b827e89dc ("powerpc/book3s64/kuap: Use Key 3 for kernel mapping with hash translation")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/platforms/pseries/lpar.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
v2: Expand change log with explanation of where the format of the
flags parameter comes from, prompted by dja.
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 764170fdb0f7..8bbbddff7226 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -976,11 +976,13 @@ static void pSeries_lpar_hpte_updateboltedpp(unsigned long newpp,
slot = pSeries_lpar_hpte_find(vpn, psize, ssize);
BUG_ON(slot == -1);
- flags = newpp & 7;
+ flags = newpp & (HPTE_R_PP | HPTE_R_N);
if (mmu_has_feature(MMU_FTR_KERNEL_RO))
/* Move pp0 into bit 8 (IBM 55) */
flags |= (newpp & HPTE_R_PP0) >> 55;
+ flags |= ((newpp & HPTE_R_KEY_HI) >> 48) | (newpp & HPTE_R_KEY_LO);
+
lpar_rc = plpar_pte_protect(flags, slot, 0);
BUG_ON(lpar_rc != H_SUCCESS);
--
2.25.1
^ permalink raw reply related
* Re: [PATCH] powerpc/book3s64/kuap: Move Kconfig varriables to BOOK3S_64
From: Michael Ellerman @ 2021-03-31 1:09 UTC (permalink / raw)
To: mpe, linuxppc-dev, Aneesh Kumar K.V
In-Reply-To: <20210318034829.72255-1-aneesh.kumar@linux.ibm.com>
On Thu, 18 Mar 2021 09:18:29 +0530, Aneesh Kumar K.V wrote:
> With below two commits:
> commit c91435d95c49 ("powerpc/book3s64/hash/kuep: Enable KUEP on hash")
> commit b2ff33a10c8b ("powerpc/book3s64/hash/kuap: Enable kuap on hash")
> the kernel now supports kuap/kuep with hash translation. Hence select the
> Kconfig even when radix is disabled.
Applied to powerpc/next.
[1/1] powerpc/book3s64/kuap: Move Kconfig varriables to BOOK3S_64
https://git.kernel.org/powerpc/c/8b8adeb3007f67076141f547f0b2f62b299a383c
cheers
^ permalink raw reply
* Re: [PATCH] powerpc/mm: Move the linear_mapping_mutex to the ifdef where it is used
From: Michael Ellerman @ 2021-03-31 1:09 UTC (permalink / raw)
To: linuxppc-dev, Sebastian Andrzej Siewior; +Cc: Thomas Gleixner, Paul Mackerras
In-Reply-To: <20210219165648.2505482-1-bigeasy@linutronix.de>
On Fri, 19 Feb 2021 17:56:48 +0100, Sebastian Andrzej Siewior wrote:
> The mutex linear_mapping_mutex is defined at the of the file while its
> only two user are within the CONFIG_MEMORY_HOTPLUG block.
> A compile without CONFIG_MEMORY_HOTPLUG set fails on PREEMPT_RT because
> its mutex implementation is smart enough to realize that it is unused.
>
> Move the definition of linear_mapping_mutex to ifdef block where it is
> used.
Applied to powerpc/next.
[1/1] powerpc/mm: Move the linear_mapping_mutex to the ifdef where it is used
https://git.kernel.org/powerpc/c/9be77e11dade414d2fa63750aa5c754fac49d619
cheers
^ permalink raw reply
* Re: [PATCH] powerpc: Fix HAVE_HARDLOCKUP_DETECTOR_ARCH build configuration
From: Michael Ellerman @ 2021-03-31 1:09 UTC (permalink / raw)
To: Michael Ellerman, Chen Huang, Paul Mackerras,
Benjamin Herrenschmidt
Cc: Don Zickus, linux-kernel, Nicholas Piggin, Hulk Robot,
Andrew Morton, linuxppc-dev
In-Reply-To: <20210327094900.938555-1-chenhuang5@huawei.com>
On Sat, 27 Mar 2021 09:49:00 +0000, Chen Huang wrote:
> When compiling the powerpc with the SMP disabled, it shows the issue:
>
> arch/powerpc/kernel/watchdog.c: In function ‘watchdog_smp_panic’:
> arch/powerpc/kernel/watchdog.c:177:4: error: implicit declaration of function ‘smp_send_nmi_ipi’; did you mean ‘smp_send_stop’? [-Werror=implicit-function-declaration]
> 177 | smp_send_nmi_ipi(c, wd_lockup_ipi, 1000000);
> | ^~~~~~~~~~~~~~~~
> | smp_send_stop
> cc1: all warnings being treated as errors
> make[2]: *** [scripts/Makefile.build:273: arch/powerpc/kernel/watchdog.o] Error 1
> make[1]: *** [scripts/Makefile.build:534: arch/powerpc/kernel] Error 2
> make: *** [Makefile:1980: arch/powerpc] Error 2
> make: *** Waiting for unfinished jobs....
>
> [...]
Applied to powerpc/next.
[1/1] powerpc: Fix HAVE_HARDLOCKUP_DETECTOR_ARCH build configuration
https://git.kernel.org/powerpc/c/4fe529449d85e78972fa327999961ecc83a0b6db
cheers
^ permalink raw reply
* Re: [PATCH v2] powerpc: Fix HAVE_HARDLOCKUP_DETECTOR_ARCH build configuration
From: Michael Ellerman @ 2021-03-31 1:09 UTC (permalink / raw)
To: Michael Ellerman, Paul Mackerras, Chen Huang, Christophe Leroy,
Benjamin Herrenschmidt
Cc: Don Zickus, linux-kernel, Nicholas Piggin, Hulk Robot,
Andrew Morton, linuxppc-dev
In-Reply-To: <4b8f8335-0a29-93fc-7943-b4dc16efb908@huawei.com>
On Mon, 29 Mar 2021 10:27:00 +0800, Chen Huang wrote:
> When compiling the powerpc with the SMP disabled, it shows the issue:
>
> arch/powerpc/kernel/watchdog.c: In function ‘watchdog_smp_panic’:
> arch/powerpc/kernel/watchdog.c:177:4: error: implicit declaration of function ‘smp_send_nmi_ipi’; did you mean ‘smp_send_stop’? [-Werror=implicit-function-declaration]
> 177 | smp_send_nmi_ipi(c, wd_lockup_ipi, 1000000);
> | ^~~~~~~~~~~~~~~~
> | smp_send_stop
> cc1: all warnings being treated as errors
> make[2]: *** [scripts/Makefile.build:273: arch/powerpc/kernel/watchdog.o] Error 1
> make[1]: *** [scripts/Makefile.build:534: arch/powerpc/kernel] Error 2
> make: *** [Makefile:1980: arch/powerpc] Error 2
> make: *** Waiting for unfinished jobs....
>
> [...]
Applied to powerpc/next.
[1/1] powerpc: Fix HAVE_HARDLOCKUP_DETECTOR_ARCH build configuration
https://git.kernel.org/powerpc/c/4fe529449d85e78972fa327999961ecc83a0b6db
cheers
^ permalink raw reply
* Re: [PATCH] powerpc/asm-offsets: GPR14 is not needed either
From: Michael Ellerman @ 2021-03-31 1:09 UTC (permalink / raw)
To: Michael Ellerman, Paul Mackerras, rashmicy, Christophe Leroy,
Benjamin Herrenschmidt
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <9881c68fbca004f9ea18fc9473f630e11ccd6417.1615806071.git.christophe.leroy@csgroup.eu>
On Mon, 15 Mar 2021 11:01:26 +0000 (UTC), Christophe Leroy wrote:
> Commit aac6a91fea93 ("powerpc/asm: Remove unused symbols in
> asm-offsets.c") removed GPR15 to GPR31 but kept GPR14,
> probably because it pops up in a couple of comments when doing
> a grep.
>
> However, it was never used either, so remove it as well.
Applied to powerpc/next.
[1/1] powerpc/asm-offsets: GPR14 is not needed either
https://git.kernel.org/powerpc/c/6eeca7a11379e9dd05493bbdba57515b36a2e3cf
cheers
^ permalink raw reply
* Re: [PATCH] powerpc/embedded6xx: Remove CONFIG_MV64X60
From: Michael Ellerman @ 2021-03-31 1:09 UTC (permalink / raw)
To: Michael Ellerman, Paul Mackerras, Christophe Leroy,
Benjamin Herrenschmidt, Wolfram Sang
Cc: linuxppc-dev, linux-kernel, linux-i2c
In-Reply-To: <19e57d16692dcd1ca67ba880d7273a57fab416aa.1616085654.git.christophe.leroy@csgroup.eu>
On Thu, 18 Mar 2021 17:25:07 +0000 (UTC), Christophe Leroy wrote:
> Commit 92c8c16f3457 ("powerpc/embedded6xx: Remove C2K board support")
> moved the last selector of CONFIG_MV64X60.
>
> As it is not a user selectable config, it can be removed.
Applied to powerpc/next.
[1/1] powerpc/embedded6xx: Remove CONFIG_MV64X60
https://git.kernel.org/powerpc/c/a329ddd472fa2af0c19a73b8658898ae7fd658ad
cheers
^ permalink raw reply
* Re: [PATCH] powerpc/Makefile: Remove workaround for gcc versions below 4.9
From: Michael Ellerman @ 2021-03-31 1:09 UTC (permalink / raw)
To: Michael Ellerman, Paul Mackerras, Benjamin Herrenschmidt,
Christophe Leroy
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <a1e552006b8c51f23edd2f6cabdd9a986c631146.1615380184.git.christophe.leroy@csgroup.eu>
On Wed, 10 Mar 2021 12:43:12 +0000 (UTC), Christophe Leroy wrote:
> Commit 6ec4476ac825 ("Raise gcc version requirement to 4.9")
> made it impossible to build with gcc 4.8 and under.
>
> Remove related workaround.
Applied to powerpc/next.
[1/1] powerpc/Makefile: Remove workaround for gcc versions below 4.9
https://git.kernel.org/powerpc/c/802b5560393423166e436c7914b565f3cda9e6b9
cheers
^ permalink raw reply
* Re: [PATCH] powerpc/math: Fix missing __user qualifier for get_user() and other sparse warnings
From: Michael Ellerman @ 2021-03-31 1:09 UTC (permalink / raw)
To: Michael Ellerman, Paul Mackerras, Benjamin Herrenschmidt,
Christophe Leroy
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <e4d1aae7604d89c98a52dfd8ce8443462e595670.1615809591.git.christophe.leroy@csgroup.eu>
On Mon, 15 Mar 2021 12:00:09 +0000 (UTC), Christophe Leroy wrote:
> Sparse reports the following problems:
>
> arch/powerpc/math-emu/math.c:228:21: warning: Using plain integer as NULL pointer
> arch/powerpc/math-emu/math.c:228:31: warning: Using plain integer as NULL pointer
> arch/powerpc/math-emu/math.c:228:41: warning: Using plain integer as NULL pointer
> arch/powerpc/math-emu/math.c:228:51: warning: Using plain integer as NULL pointer
> arch/powerpc/math-emu/math.c:237:13: warning: incorrect type in initializer (different address spaces)
> arch/powerpc/math-emu/math.c:237:13: expected unsigned int [noderef] __user *_gu_addr
> arch/powerpc/math-emu/math.c:237:13: got unsigned int [usertype] *
> arch/powerpc/math-emu/math.c:226:1: warning: symbol 'do_mathemu' was not declared. Should it be static?
>
> [...]
Applied to powerpc/next.
[1/1] powerpc/math: Fix missing __user qualifier for get_user() and other sparse warnings
https://git.kernel.org/powerpc/c/e448e1e774dc0ca307c17e961daf7ede2e635c57
cheers
^ permalink raw reply
* Re: [PATCH] powerpc/mm: Remove unneeded #ifdef CONFIG_PPC_MEM_KEYS
From: Michael Ellerman @ 2021-03-31 1:09 UTC (permalink / raw)
To: Michael Ellerman, Paul Mackerras, Benjamin Herrenschmidt,
Christophe Leroy
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <8038392f38d81f2ad169347efac29146f553b238.1615819955.git.christophe.leroy@csgroup.eu>
On Mon, 15 Mar 2021 14:52:51 +0000 (UTC), Christophe Leroy wrote:
> In fault.c, #ifdef CONFIG_PPC_MEM_KEYS is not needed because all
> functions are always defined, and arch_vma_access_permitted()
> always returns true when CONFIG_PPC_MEM_KEYS is not defined so
> access_pkey_error() will return false so bad_access_pkey()
> will never be called.
>
> Include linux/pkeys.h to get a definition of vma_pkeys() for
> bad_access_pkey().
Applied to powerpc/next.
[1/1] powerpc/mm: Remove unneeded #ifdef CONFIG_PPC_MEM_KEYS
https://git.kernel.org/powerpc/c/98c26a72751ecb2ed247cdfd6cb2385f37195707
cheers
^ permalink raw reply
* Re: [PATCH v1 0/8] Miscellaneous user access improvement
From: Michael Ellerman @ 2021-03-31 1:09 UTC (permalink / raw)
To: Michael Ellerman, Paul Mackerras, Benjamin Herrenschmidt,
Christophe Leroy
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <cover.1615398498.git.christophe.leroy@csgroup.eu>
On Wed, 10 Mar 2021 17:56:59 +0000 (UTC), Christophe Leroy wrote:
> Patches 1-3 are cleaning parts of uaccess.h not related
> to put_user/get_user
> Patch 4 removes some usage of consecutives __get_user
> Patches 5 rewrite __patch_instruction to not use uaccess.h internals.
> Patches 6-8 switch some parts of code to user_access_begin/end blocks
>
> All patches are independant.
>
> [...]
Applied to powerpc/next.
[1/8] powerpc/uaccess: Also perform 64 bits copies in unsafe_copy_to_user() on ppc32
https://git.kernel.org/powerpc/c/c6adc835c68b713360f918d21372c2f34fc228e2
[2/8] powerpc/uaccess: Swap clear_user() and __clear_user()
https://git.kernel.org/powerpc/c/7472199a6eda6a79f9e3b126f52f67f9ce3e1f77
[3/8] powerpc/uaccess: Move copy_mc_xxx() functions down
https://git.kernel.org/powerpc/c/4b8cda58812c1e1bf79d37f2ddff3cf03b7025da
[4/8] powerpc/syscalls: Use sys_old_select() in ppc_select()
https://git.kernel.org/powerpc/c/fd69d544b0e785b11699675154bdfe01a04538cd
[5/8] powerpc/lib: Don't use __put_user_asm_goto() outside of uaccess.h
https://git.kernel.org/powerpc/c/e63ceebdad82f85e48b018abfc6af4ed6958179e
[6/8] powerpc/net: Switch csum_and_copy_{to/from}_user to user_access block
https://git.kernel.org/powerpc/c/164dc6ce368fa23b0aae0e5d12883fff9bf80458
[7/8] powerpc/futex: Switch to user_access block
https://git.kernel.org/powerpc/c/870779f40e99c795ddfafa0dfc43318e51f15127
[8/8] powerpc/ptrace: Convert gpr32_set_common() to user access block
https://git.kernel.org/powerpc/c/93c043e393af7fa218c928d8c62396ba28f1bb84
cheers
^ permalink raw reply
* Re: [PATCH v1 1/4] powerpc: Activate HAVE_RELIABLE_STACKTRACE for all
From: Michael Ellerman @ 2021-03-31 1:09 UTC (permalink / raw)
To: Michael Ellerman, Paul Mackerras, Benjamin Herrenschmidt,
Christophe Leroy
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <955248c6423cb068c5965923121ba31d4dd2fdde.1615881400.git.christophe.leroy@csgroup.eu>
On Tue, 16 Mar 2021 07:57:13 +0000 (UTC), Christophe Leroy wrote:
> CONFIG_HAVE_RELIABLE_STACKTRACE is applicable to all, no
> reason to limit it to book3s/64le
Applied to powerpc/next.
[1/4] powerpc: Activate HAVE_RELIABLE_STACKTRACE for all
https://git.kernel.org/powerpc/c/accdd093f260bc8c8a8f580ee48e49ad5c5f91b2
[2/4] powerpc: Rename 'tsk' parameter into 'task'
https://git.kernel.org/powerpc/c/826a307b0a11e605b4be0b2727550b510c4a88cd
[3/4] powerpc: Convert stacktrace to generic ARCH_STACKWALK
https://git.kernel.org/powerpc/c/a1cdef04f22dd5ad9e1ccf5d05a549c697b7f52d
[4/4] powerpc: Fix arch_stack_walk() to have running function as first entry
https://git.kernel.org/powerpc/c/a2308836880bf1501ff9373c611dc2970247d42b
cheers
^ permalink raw reply
* Re: [PATCH v2 1/4] powerpc: Enable KFENCE for PPC32
From: Michael Ellerman @ 2021-03-31 1:09 UTC (permalink / raw)
To: Michael Ellerman, Paul Mackerras, Dmitry Vyukov,
Alexander Potapenko, Marco Elver, Christophe Leroy,
Benjamin Herrenschmidt
Cc: linuxppc-dev, linux-kernel, kasan-dev
In-Reply-To: <8dfe1bd2abde26337c1d8c1ad0acfcc82185e0d5.1614868445.git.christophe.leroy@csgroup.eu>
On Thu, 4 Mar 2021 14:35:09 +0000 (UTC), Christophe Leroy wrote:
> Add architecture specific implementation details for KFENCE and enable
> KFENCE for the ppc32 architecture. In particular, this implements the
> required interface in <asm/kfence.h>.
>
> KFENCE requires that attributes for pages from its memory pool can
> individually be set. Therefore, force the Read/Write linear map to be
> mapped at page granularity.
Patch 1 applied to powerpc/next.
[1/4] powerpc: Enable KFENCE for PPC32
https://git.kernel.org/powerpc/c/90cbac0e995dd92f7bcf82f74aa50250bf194a4a
cheers
^ permalink raw reply
* Re: [PATCH v3 00/41] powerpc/32: Switch to interrupt entry/exit in C
From: Michael Ellerman @ 2021-03-31 1:09 UTC (permalink / raw)
To: Michael Ellerman, npiggin, Paul Mackerras, Christophe Leroy,
Benjamin Herrenschmidt
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <cover.1615552866.git.christophe.leroy@csgroup.eu>
On Fri, 12 Mar 2021 12:50:09 +0000 (UTC), Christophe Leroy wrote:
> This series aims at porting interrupt entry/exit in C on PPC32, using
> the work already merged for PPC64.
>
> First patch is an optimisation around unrecoverable_exception() function.
>
> Six following patches do minimal changes in 40x in order to be able to enable MMU
> earlier in exception entry.
>
> [...]
Applied to powerpc/next.
[01/41] powerpc/traps: Declare unrecoverable_exception() as __noreturn
https://git.kernel.org/powerpc/c/a58cbed68315111c663f35603a42547f72acd6f8
[02/41] powerpc/40x: Don't use SPRN_SPRG_SCRATCH0/1 in TLB miss handlers
https://git.kernel.org/powerpc/c/52ae92cc290f0506eef9ad5466bb453ce4a9e80e
[03/41] powerpc/40x: Change CRITICAL_EXCEPTION_PROLOG macro to a gas macro
https://git.kernel.org/powerpc/c/9d3c18a11a930afe65d33527300a42e0872c744d
[04/41] powerpc/40x: Save SRR0/SRR1 and r10/r11 earlier in critical exception
https://git.kernel.org/powerpc/c/fcd4b43c36c69aa41e79a511edbb06c7020a6061
[05/41] powerpc/40x: Reorder a few instructions in critical exception prolog
https://git.kernel.org/powerpc/c/26c468860c32022ffe9caf16691764b77fb8eead
[06/41] powerpc/40x: Prepare for enabling MMU in critical exception prolog
https://git.kernel.org/powerpc/c/0fc1e93481f67a49f67c9168b71842eeb0998b25
[07/41] powerpc/40x: Prepare normal exception handler for enabling MMU early
https://git.kernel.org/powerpc/c/0512aadd750acf72b8906973c34e7092642d4323
[08/41] powerpc/32: Reconcile interrupts in C
https://git.kernel.org/powerpc/c/be39e10506830a2e654fb799a48025999f89a6ff
[09/41] powerpc/32: Entry cpu time accounting in C
https://git.kernel.org/powerpc/c/f93d866e14b746112fb29d69197dd83075bbd28c
[10/41] powerpc/32: Handle bookE debugging in C in exception entry
https://git.kernel.org/powerpc/c/79f4bb17f18162dd95d6aeb6dc3b7da54d6139aa
[11/41] powerpc/32: Use fast instruction to set MSR RI in exception prolog on 8xx
https://git.kernel.org/powerpc/c/e464d92b292cc61f8f0791cf87d3646204bbb208
[12/41] powerpc/32: Remove ksp_limit
https://git.kernel.org/powerpc/c/5747230645562921b5bc19f6409f7af08fe17c6d
[13/41] powerpc/32: Always enable data translation in exception prolog
https://git.kernel.org/powerpc/c/7aa8dd67f15731f659390018b5c9fd95f5975b3d
[14/41] powerpc/32: Tag DAR in EXCEPTION_PROLOG_2 for the 8xx
https://git.kernel.org/powerpc/c/5b1c9a0d7f3bcac591767fa1aad1323564673b26
[15/41] powerpc/32: Enable instruction translation at the same time as data translation
https://git.kernel.org/powerpc/c/9b6150fb8942d92e0991b9a4b02fa2e6f6b03238
[16/41] powerpc/32: Statically initialise first emergency context
https://git.kernel.org/powerpc/c/a4719f5bb6d7dc220bffdc1b9f5ce5eaa5543581
[17/41] powerpc/32: Add vmap_stack_overflow label inside the macro
https://git.kernel.org/powerpc/c/5b5e5bc53def654c2dc437dd327f7a47c48d81d3
[18/41] powerpc/32: Use START_EXCEPTION() as much as possible
https://git.kernel.org/powerpc/c/7bf1d7e1abab0d9f47ebce144deadb4409d0d631
[19/41] powerpc/32: Move exception prolog code into .text once MMU is back on
https://git.kernel.org/powerpc/c/dc13b889b586f499cc87eb2b0b7e901778b3b5cf
[20/41] powerpc/32: Provide a name to exception prolog continuation in virtual mode
https://git.kernel.org/powerpc/c/8f844c06f460687b028c675c3fa68f8e735aeb8c
[21/41] powerpc/32: Refactor booke critical registers saving
https://git.kernel.org/powerpc/c/32d2ca0e969a3620f71dff166a95ebf3f735b72e
[22/41] powerpc/32: Perform normal function call in exception entry
https://git.kernel.org/powerpc/c/0f2793e33db2e2f062968f2ca789b6826972b05b
[23/41] powerpc/32: Always save non volatile registers on exception entry
https://git.kernel.org/powerpc/c/e9f99704aafcdbd90ba20b81db2dae8526d8b8e5
[24/41] powerpc/32: Replace ASM exception exit by C exception exit from ppc64
https://git.kernel.org/powerpc/c/b96bae3ae2cb6337c0a1ad160f4cbb0666e5e38b
[25/41] powerpc/32: Don't save thread.regs on interrupt entry
https://git.kernel.org/powerpc/c/db297c3b07af7856fb7c666fbc9792d8e37556be
[26/41] powerpc/32: Set regs parameter in r3 in transfer_to_handler
https://git.kernel.org/powerpc/c/e72915560b15f58c2ffe08144d9a7163daa18db4
[27/41] powerpc/32: Call bad_page_fault() from do_page_fault()
https://git.kernel.org/powerpc/c/af6f2ce84b2f666762f75f085a7e5d6514743a84
[28/41] powerpc/32: Save trap number on stack in exception prolog
https://git.kernel.org/powerpc/c/719e7e212c7e637a795f130dbdd5db6c291e463f
[29/41] powerpc/32: Add a prepare_transfer_to_handler macro for exception prologs
https://git.kernel.org/powerpc/c/bce4c26a4e324cb096a3768cdc3aad4e2552c3d0
[30/41] powerpc/32: Only restore non volatile registers when required
https://git.kernel.org/powerpc/c/8f6ff5bd9b73a7912356f378adfb85e9a4e7ce65
[31/41] powerpc/32: Dismantle EXC_XFER_STD/LITE/TEMPLATE
https://git.kernel.org/powerpc/c/4c0104a83fc3990a76a01a2f4e504251fa9814c4
[32/41] powerpc/32: Remove the xfer parameter in EXCEPTION() macro
https://git.kernel.org/powerpc/c/acc142b6230eb2d9cec9b9e3baac1bc074df8ba3
[33/41] powerpc/32: Refactor saving of volatile registers in exception prologs
https://git.kernel.org/powerpc/c/a305597850c96e2f2d349533cf3b514fa4b7b9f8
[34/41] powerpc/32: Save remaining registers in exception prolog
https://git.kernel.org/powerpc/c/16db54369df614bf386aa31a6730c5bdb1bf4ffd
[35/41] powerpc/32: Return directly from power_save_ppc32_restore()
https://git.kernel.org/powerpc/c/a5d33be0512b4565808a3aed05567cb56c0e6ad0
[36/41] powerpc/32: Only use prepare_transfer_to_handler function on book3s/32 and e500
https://git.kernel.org/powerpc/c/a2b3e09ae41c71d27d9b8da9baf31e0d9a97b864
[37/41] powerpc/32s: Move KUEP locking/unlocking in C
https://git.kernel.org/powerpc/c/b5efec00b671c5d7e9cb9e73a1d4925dd6ce8dcd
[38/41] powerpc/64s: Make kuap_check_amr() and kuap_get_and_check_amr() generic
https://git.kernel.org/powerpc/c/ad2d2344771dabc5f0f14d85d5e7d2ddc613f385
[39/41] powerpc/32s: Create C version of kuap save/restore/check helpers
https://git.kernel.org/powerpc/c/21eb58ae4fce559d4e025df042db2bc0bb100f93
[40/41] powerpc/8xx: Create C version of kuap save/restore/check helpers
https://git.kernel.org/powerpc/c/0b45359aa2df7b761817a9664cfb53ea3070c390
[41/41] powerpc/32: Manage KUAP in C
https://git.kernel.org/powerpc/c/c16728835eec45fa82f4744a52940717ac828f6d
cheers
^ permalink raw reply
* Re: [PATCH v7 00/10] Improve signal performance on PPC64 with KUAP
From: Michael Ellerman @ 2021-03-31 1:09 UTC (permalink / raw)
To: linuxppc-dev, Christopher M. Riedl
In-Reply-To: <20210227011259.11992-1-cmr@codefail.de>
On Fri, 26 Feb 2021 19:12:49 -0600, Christopher M. Riedl wrote:
> As reported by Anton, there is a large penalty to signal handling
> performance on radix systems using KUAP. The signal handling code
> performs many user access operations, each of which needs to switch the
> KUAP permissions bit to open and then close user access. This involves a
> costly 'mtspr' operation [0].
>
> There is existing work done on x86 and by Christophe Leroy for PPC32 to
> instead open up user access in "blocks" using user_*_access_{begin,end}.
> We can do the same in PPC64 to bring performance back up on KUAP-enabled
> radix and now also hash MMU systems [1].
>
> [...]
Applied to powerpc/next.
[01/10] powerpc/uaccess: Add unsafe_copy_from_user()
https://git.kernel.org/powerpc/c/9466c1799fa2acb68e505a264dcdf53779101ac6
[02/10] powerpc/signal: Add unsafe_copy_{vsx, fpr}_from_user()
https://git.kernel.org/powerpc/c/609355dfc88e2921bfcbd879300d482a9a33378e
[03/10] powerpc/signal64: Remove non-inline calls from setup_sigcontext()
https://git.kernel.org/powerpc/c/c6c9645e37483444ec5182373455b2f22e4b1535
[04/10] powerpc: Reference parameter in MSR_TM_ACTIVE() macro
https://git.kernel.org/powerpc/c/1a130b67c682be9842f188f593c2080786de4204
[05/10] powerpc/signal64: Remove TM ifdefery in middle of if/else block
https://git.kernel.org/powerpc/c/2d19630e20fe5fbd5813f73fd5b1c81ddec61369
[06/10] powerpc/signal64: Replace setup_sigcontext() w/ unsafe_setup_sigcontext()
https://git.kernel.org/powerpc/c/7bb081c8f043ab166f8c6f26fca744821217dad7
[07/10] powerpc/signal64: Replace restore_sigcontext() w/ unsafe_restore_sigcontext()
https://git.kernel.org/powerpc/c/193323e1009437c0885240e75ca71f7963e4a006
[08/10] powerpc/signal64: Rewrite handle_rt_signal64() to minimise uaccess switches
https://git.kernel.org/powerpc/c/96d7a4e06fab9fbc4f67c563af65b073902f3e61
[09/10] powerpc/signal64: Rewrite rt_sigreturn() to minimise uaccess switches
https://git.kernel.org/powerpc/c/0f92433b8f9f76608528101e7a81cd3bfd00e236
[10/10] powerpc/signal: Use __get_user() to copy sigset_t
https://git.kernel.org/powerpc/c/d3ccc9781560af051554017c702631560bdc0811
cheers
^ permalink raw reply
* Re: [PATCH v2 0/1] show 'last online CPU' error in dlpar_cpu_offline()
From: Michael Ellerman @ 2021-03-31 1:09 UTC (permalink / raw)
To: linuxppc-dev, Daniel Henrique Barboza
In-Reply-To: <20210323205056.52768-1-danielhb413@gmail.com>
On Tue, 23 Mar 2021 17:50:55 -0300, Daniel Henrique Barboza wrote:
> changes in v2 after Michael Ellerman review:
> - moved the verification code from dlpar_cpu_remove() to
> dlpar_cpu_offline(), while holding cpu_add_remove_lock
> - reworded the commit message and code comment
> v1 link:
> https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20210305173845.451158-1-danielhb413@gmail.com/
>
> [...]
Applied to powerpc/next.
[1/1] hotplug-cpu.c: show 'last online CPU' error in dlpar_cpu_offline()
https://git.kernel.org/powerpc/c/d19b3ad02c2d1a9a697b7059e32fa2d97a420b15
cheers
^ permalink raw reply
* Re: [PATCH 0/3] powerpc/qspinlock: Some tuning updates
From: Michael Ellerman @ 2021-03-31 1:09 UTC (permalink / raw)
To: npiggin, Davidlohr Bueso
Cc: peterz, will, linux-kernel, mingo, paulus, longman, linuxppc-dev
In-Reply-To: <20210309015950.27688-1-dave@stgolabs.net>
On Mon, 8 Mar 2021 17:59:47 -0800, Davidlohr Bueso wrote:
> A few updates while going through the powerpc port of the qspinlock.
>
> Patches 1 and 2 are straightforward, while patch 3 can be considered
> more of an rfc as I've only tested on a single machine, and there
> could be an alternative way if it doesn't end up being nearly a
> universal performance win.
>
> [...]
Applied to powerpc/next.
[1/3] powerpc/spinlock: Define smp_mb__after_spinlock only once
https://git.kernel.org/powerpc/c/2bf3604c415c9d75311141b8eb6ac8780ef74420
[2/3] powerpc/spinlock: Unserialize spin_is_locked
https://git.kernel.org/powerpc/c/66f60522138c2e0d8a3518edd4979df11a2d7525
[3/3] powerpc/qspinlock: Use generic smp_cond_load_relaxed
https://git.kernel.org/powerpc/c/deb9b13eb2571fbde164ae012c77985fd14f2f02
cheers
^ permalink raw reply
* Re: [PATCH] powerpc: powernv: Remove unneeded variable: "rc"
From: Michael Ellerman @ 2021-03-31 1:09 UTC (permalink / raw)
To: dingsenjie, mpe, paulus, benh; +Cc: dingsenjie, linuxppc-dev, linux-kernel
In-Reply-To: <20210326115356.12444-1-dingsenjie@163.com>
On Fri, 26 Mar 2021 19:53:56 +0800, dingsenjie@163.com wrote:
> Remove unneeded variable: "rc".
Applied to powerpc/next.
[1/1] powerpc: powernv: Remove unneeded variable: "rc"
https://git.kernel.org/powerpc/c/69931cc387cca289e0415c79ce5389119670066d
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