} else {
spin_lock_irqsave(>port.lock, flags);
cpm_uart_early_write(pinfo, s, count, true);
spin_unlock_irqrestore(>port.lock, flags);
}
Signed-off-by: Christophe Leroy
---
drivers/tty/serial/cpm_uart/cpm_uart_core.c | 13 -
1 file changed, 4 inse
Using an enum indirection to define numeric macros is
pointless. Directly use the wanted numeric value.
Signed-off-by: Christophe Leroy
---
drivers/tty/serial/cpm_uart/cpm_uart.h | 3 +--
drivers/tty/serial/cpm_uart/cpm_uart_core.c | 1 -
2 files changed, 1 insertion(+), 3 deletions
; architectures enable serial by default.
>
> Let's enable CONFIG_SERIAL_PMACZILOG and CONFIG_SERIAL_PMACZILOG_CONSOLE
> by default.
>
> Signed-off-by: Yuan Tan
Reviewed-by: Christophe Leroy
> ---
> arch/powerpc/configs/pmac32_defconfig | 3 ++-
> 1 file changed, 2 inser
Le 01/08/2023 à 03:17, Benjamin Gray a écrit :
> Syzkaller triggered a null pointer dereference in the
> arch_unregister_hw_breakpoint() hook. This is due to accessing
> the bp->ctx->task field changing to -1 while we iterate the breakpoints.
>
> This series refactors the breakpoint tracking
Le 01/08/2023 à 07:30, Randy Dunlap a écrit :
> Hi Christophe,
>
> On 7/31/23 22:21, Christophe Leroy wrote:
>>
>>
>> Le 24/07/2023 à 08:33, Randy Dunlap a écrit :
>>> Reconcile devices.txt with serial/ucc_uart.c regarding device number
>>> assi
Le 24/07/2023 à 08:33, Randy Dunlap a écrit :
> Reconcile devices.txt with serial/ucc_uart.c regarding device number
> assignments. ucc_uart.c supports 4 ports and uses minor devnums
> 46-49, so update devices.txt with that info.
> Then update ucc_uart.c's reference to the location of the
Le 17/07/2023 à 07:01, Michael Ellerman a écrit :
> Christophe Leroy writes:
>> Le 12/07/2023 à 15:45, Michael Ellerman a écrit :
>>> From: Christophe Leroy
>>>
>>> This partly reverts commit 1e688dd2a3d6759d416616ff07afc4bb836c4213.
>>>
>&g
Le 12/07/2023 à 16:23, Peter Zijlstra a écrit :
> On Tue, Jul 11, 2023 at 06:08:26PM +0200, Christophe Leroy wrote:
>> This series adds UACCESS validation for PPC32. It includes
>> a dozen of changes to objtool core.
>>
>> It applies on top of series "Clea
Le 12/07/2023 à 15:45, Michael Ellerman a écrit :
> From: Christophe Leroy
>
> This partly reverts commit 1e688dd2a3d6759d416616ff07afc4bb836c4213.
>
> That commit aimed at optimising the code around generation of
> WARN_ON/BUG_ON but this leads to a lot of dead code erron
() as global noreturn
functions, and declare __copy_tofrom_user() and __arch_clear_user()
as UACCESS safe.
Signed-off-by: Christophe Leroy
---
arch/powerpc/Kconfig | 2 +
arch/powerpc/include/asm/book3s/32/kup.h | 2 +
arch/powerpc/include/asm/nohash/32/kup-8xx.h
.
Signed-off-by: Christophe Leroy
---
tools/objtool/arch/powerpc/special.c| 3 ++-
tools/objtool/arch/x86/special.c| 3 ++-
tools/objtool/check.c | 9 +
tools/objtool/include/objtool/check.h | 6 --
tools/objtool/include/objtool/special.h | 3 ++-
5 files
tion. Mark it reachable so
that objtool knows that it is not a dead end in that case.
Also change the unreachable() annotation by __builtin_unreachable()
since objtool already knows that a BUG instruction is a dead end.
Signed-off-by: Christophe Leroy
---
arch/powerpc/include/asm/bug.h | 14
Those two functions loop over the instructions of a function.
Merge the two loops in order to ease enhancement of table end
in a following patch.
Signed-off-by: Christophe Leroy
---
tools/objtool/check.c | 22 ++
1 file changed, 6 insertions(+), 16 deletions(-)
diff --git
).
To allow that, entries[] table must be initialised at runtime. This is
easily done by moving it into its only user which is special_get_alts().
Signed-off-by: Christophe Leroy
Acked-by: Peter Zijlstra (Intel)
---
.../arch/powerpc/include/arch/special.h | 2 +-
tools/objtool/special.c
Fixes: d871f7b5a6a2 ("objtool: Refactor jump table code to support other
architectures")
Signed-off-by: Christophe Leroy
---
tools/objtool/arch/x86/special.c | 5 -
tools/objtool/check.c| 6 ++
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/tools/objt
C jump tables. Do the comparison using R_ABS32 and R_ABS64 which are
architecture agnostic.
And use correct size for 'long' instead of hard coding a size of '8'.
Signed-off-by: Christophe Leroy
---
tools/objtool/check.c | 11 ---
1 file changed, 8 insertions(+), 3 deletions(-)
dif
. And add ASM_UACCESS_BEGIN
and ASM_UACCESS_END macros to be used in inline assembly code to
annotate UACCESS enable and UACCESS disable instructions.
Signed-off-by: Christophe Leroy
---
include/linux/objtool.h | 14 ++
tools/objtool/check.c | 33 +
2
Exclude sections named
.rodata.cst2
.rodata.cst4
.rodata.cst8
.rodata.cst16
as they won't contain switch tables.
Signed-off-by: Christophe Leroy
---
tools/objtool/check.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
When walking backward to find the base address of a switch table,
also take into account conditionnal branches and dynamic jumps from
a previous switch table.
To avoid mis-routing, break when stumbling on a function return.
Signed-off-by: Christophe Leroy
---
tools/objtool/check.c | 8
t code after that conditional return is dead.
To overcome this situation, introduce INSN_RETURN_CONDITIONAL which
is taken as a confirmation that a function is not noreturn but still
sees following code as reachable.
Signed-off-by: Christophe Leroy
Acked-by: Peter Zijlstra (Intel)
---
tools/obj
noreturns.h is a mix of x86 specific functions and more generic
core functions.
In preparation of inclusion of powerpc, split x86 functions out of
noreturns.h into arch/noreturns.h
Signed-off-by: Christophe Leroy
---
.../objtool/arch/x86/include/arch/noreturns.h | 20 +++
tools
starts.
Signed-off-by: Christophe Leroy
---
tools/objtool/check.c | 62 ---
1 file changed, 46 insertions(+), 16 deletions(-)
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index be413c578588..361c832aefc8 100644
--- a/tools/objtool/check.c
+++ b
validation on ASM files.
Suggested-by: Naveen N Rao
Signed-off-by: Christophe Leroy
---
arch/Kconfig | 5 +
scripts/Makefile.build | 4
2 files changed, 9 insertions(+)
diff --git a/arch/Kconfig b/arch/Kconfig
index aff2746c8af2..3330ed761260 100644
--- a/arch/Kconfig
+++ b/arch
in WARN_ON(), including build failures, keeping that
change is not worth it allthough it is primarily a compiler bug.
Revert it for now.
Signed-off-by: Christophe Leroy
Acked-by: Naveen N Rao
---
arch/powerpc/include/asm/book3s/64/kup.h | 2 +-
arch/powerpc/include/asm/bug.h
n comments from Peter
Christophe Leroy (15):
Revert "powerpc/bug: Provide better flexibility to
WARN_ON/__WARN_FLAGS() with asm goto"
objtool: Move back misplaced comment
objtool: Allow an architecture to disable objtool on ASM files
objtool: Fix JUMP_ENTRY_SIZE for bi-arch li
() with UACCESS
enabled
This is due to some KUAP enabling/disabling functions being outline
allthough they are marked inline. Use __always_inline instead.
Signed-off-by: Christophe Leroy
---
arch/powerpc/include/asm/book3s/32/kup.h | 18 +++
arch/powerpc/include/asm/book3s/64
later when
objtool is activated on PPC64.
Signed-off-by: Christophe Leroy
---
arch/powerpc/include/asm/book3s/32/kup.h | 46
arch/powerpc/include/asm/kup.h | 45 +++
arch/powerpc/include/asm/nohash/32/kup-8xx.h | 30 +
arch/powerpc
In order to reuse MMU_FTR_BOOK3S_KUAP for other targets than BOOK3S,
rename it MMU_FTR_KUAP.
Signed-off-by: Christophe Leroy
---
arch/powerpc/include/asm/book3s/64/hash-pkey.h | 2 +-
arch/powerpc/include/asm/book3s/64/kup.h | 18 +-
arch/powerpc/include/asm/mmu.h
is crossing a
segment boundary. That would definitely require at least having
userspace access enabled on the two segments. To avoid complicating
the likely case for a so unlikely happening, handle such situation
like an alignment exception and emulate the store.
Signed-off-by: Christophe Leroy
All but book3s/64 use a static branch key for disabling kuap.
book3s/64 uses an mmu feature.
Refactor all targets to use MMU_FTR_KUAP like book3s/64.
For PPC32 that implies updating mmu features fixups once KUAP
has been initialised.
Signed-off-by: Christophe Leroy
---
arch/powerpc/include
BOOKE.
Signed-off-by: Christophe Leroy
---
arch/powerpc/include/asm/nohash/32/kup-8xx.h | 8 ++--
arch/powerpc/include/asm/nohash/kup-booke.h | 6 ++
2 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/arch/powerpc/include/asm/nohash/32/kup-8xx.h
b/arch/powerpc/include/asm/noh
. The function is passed a
mask with the features that can be updated.
Signed-off-by: Christophe Leroy
---
arch/powerpc/include/asm/feature-fixups.h | 1 +
arch/powerpc/lib/feature-fixups.c | 31 ---
2 files changed, 28 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc
e same with __kuap_save_and_lock() and
__kuap_get_and_assert_locked().
Signed-off-by: Christophe Leroy
Reviewed-by: Nicholas Piggin
---
v2: Add back comment about __kupa_lock() not needed on 64s
---
arch/powerpc/include/asm/book3s/32/kup.h | 6 ++--
arch/powerpc/include/asm/book3s/64/kup.h | 10 ++
_new_context() which is its only user.
Signed-off-by: Christophe Leroy
---
arch/powerpc/include/asm/book3s/32/kup.h | 5 -
arch/powerpc/mm/book3s32/mmu_context.c | 2 +-
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/arch/powerpc/include/asm/book3s/32/kup.h
b/arch/powerpc/i
validation, but
even before they are worth it, especially the simplification on 32s.
Changes in v3:
- Rearranged book3s/32 simplification in order to ease objtool UACCESS
check implementation (patches 7 and 9)
Christophe Leroy (9):
powerpc/kuap: Avoid unnecessary reads of MD_AP
powerpc/kuap: Avoid
poport (IBM)
> Cc: Michael Ellerman
> Cc: Nicholas Piggin
> Cc: Christophe Leroy
> Cc: linuxppc-dev@lists.ozlabs.org
Reviewed-by: Christophe Leroy
> ---
> arch/powerpc/include/asm/book3s/32/pgtable.h | 5 --
> arch/powerpc/include/asm/book3s/64/pgtable.h | 6 +--
>
Le 10/07/2023 à 22:24, Matthew Wilcox a écrit :
> On Sat, Mar 18, 2023 at 09:19:04AM +0000, Christophe Leroy wrote:
>> void set_ptes(struct mm_struct *mm, unsigned long addr, pte_t *ptep,
>> pte_t pte, unsigned int nr)
>> {
>> pgprot_t prot
Le 10/07/2023 à 18:08, Aneesh Kumar K.V a écrit :
> A follow-up patch will add a pud variant for this same event.
> Using event class makes that addition simpler.
>
> No functional change in this patch.
>
> Signed-off-by: Aneesh Kumar K.V
Reviewed-by: Christophe Lero
EPAGE is set
>
> Signed-off-by: Aneesh Kumar K.V
Reviewed-by: Christophe Leroy
> ---
> include/linux/pgtable.h | 2 ++
> mm/mremap.c | 2 +-
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
>
Le 10/07/2023 à 18:08, Aneesh Kumar K.V a écrit :
> This helps architectures to override pmd_same and pud_same independently.
>
> Signed-off-by: Aneesh Kumar K.V
Reviewed-by: Christophe Leroy
Shouldn't you do it the modern way and use #ifndef pud_same instead of a
new __HAVE_ARCH
Le 10/07/2023 à 18:08, Aneesh Kumar K.V a écrit :
> Architectures like powerpc will like to use different page table allocators
> and mapping mechanisms to implement vmemmap optimization. Similar to
> vmemmap_populate allow architectures to implement
> vmemap_populate_compound_pages
>
>
werpc also want to enable vmemmap optimization
> conditionally (only with radix MMU translation). Hence allow architecture
> override.
>
> Signed-off-by: Aneesh Kumar K.V
Reviewed-by: Christophe Leroy
Why renaming vmemmap_can_optimize() to __vmemmap_can_optimize() and keep
it when
-off-by: Aneesh Kumar K.V
Reviewed-by: Christophe Leroy
> ---
> include/linux/pgtable.h | 4 ++--
> mm/debug_vm_pgtable.c | 2 +-
> mm/huge_memory.c| 2 +-
> 3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/include/linux/pgtable.h b/include/linu
neesh Kumar K.V
Reviewed-by: Christophe Leroy
> ---
> drivers/nvdimm/pfn_devs.c | 2 +-
> include/linux/pgtable.h | 3 +++
> 2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c
> index af7d9301520c.
Le 07/07/2023 à 00:20, Eric DeVolder a écrit :
> The kexec and crash kernel options are provided in the common
> kernel/Kconfig.kexec. Utilize the common options and provide
> the ARCH_SUPPORTS_ and ARCH_SELECTS_ entries to recreate the
> equivalent set of KEXEC and CRASH options.
Why do you
Le 07/07/2023 à 04:20, Benjamin Gray a écrit :
> The inclusion of kasan_early_init() is conditional on CONFIG_KASAN, so
>
>if(IS_ENABLED(CONFIG_KASAN))
>kasan_early_init();
>
> wouldn't work.
See my comment on the main patch, just do like kasan_init() and others
in
Le 07/07/2023 à 03:31, Benjamin Gray a écrit :
> The KCOV handler __sanitizer_cov_trace_pc() uses the PACA, so initialise
> the PACA first. This fixes a hang during boot when KASAN and KCOV are
> both enabled, where the coverage tracer in kasan_early_init() tries to
> access a field of the
Le 24/11/2022 à 15:33, Yang Yingliang a écrit :
> The of node returned by of_find_compatible_node() with refcount
> decremented, of_node_put() need be called after using it to avoid
> refcount leak.
Is that patch still required ? If yes, please rebase and resend.
Thanks
Christophe
>
> Fixes:
Le 21/11/2022 à 04:51, Zhouyi Zhou a écrit :
> During CPU-hotplug torture (CONFIG_NO_HZ_FULL=y), if we try to
> offline tick_do_timer_cpu, the operation will fail because in
> function tick_nohz_cpu_down:
> ```
> if (tick_nohz_full_running && tick_do_timer_cpu == cpu)
>return -EBUSY;
>
Le 06/07/2023 à 08:14, Benjamin Gray a écrit :
> On Thu, 2023-07-06 at 05:13 +0000, Christophe Leroy wrote:
>>
>>
>> Le 05/07/2023 à 02:30, Benjamin Gray a écrit :
>>> The drivers/rtc/rtc-ds1307.c driver has a direct dependency on
>>> struct regmap_config
Le 05/07/2023 à 02:30, Benjamin Gray a écrit :
> The drivers/rtc/rtc-ds1307.c driver has a direct dependency on
> struct regmap_config, which is guarded behind CONFIG_REGMAP.
>
> Commit 70a640c0efa7 ("regmap: REGMAP_KUNIT should not select REGMAP")
> exposed this by disabling the default pick
e a maple tree for interrupt descriptor management").
> It's not clear to me why this causes it to surface.
>
> Signed-off-by: Benjamin Gray
Reviewed-by: Christophe Leroy
> ---
> arch/powerpc/platforms/powermac/time.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 d
All but book3s/64 use a static branch key for disabling kuap.
book3s/64 uses an mmu feature.
Refactor all targets to use MMU_FTR_KUAP like book3s/64.
For PPC32 that implies updating mmu features fixups once KUAP
has been initialised.
Signed-off-by: Christophe Leroy
---
arch/powerpc/include
() with UACCESS
enabled
This is due to some KUAP enabling/disabling functions being outline
allthough they are marked inline. Use __always_inline instead.
Signed-off-by: Christophe Leroy
---
arch/powerpc/include/asm/book3s/32/kup.h | 18 +++
arch/powerpc/include/asm/book3s/64
. The function is passed a
mask with the features that can be updated.
Signed-off-by: Christophe Leroy
---
arch/powerpc/include/asm/feature-fixups.h | 1 +
arch/powerpc/lib/feature-fixups.c | 31 ---
2 files changed, 28 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc
_new_context() which is its only user.
Signed-off-by: Christophe Leroy
---
arch/powerpc/include/asm/book3s/32/kup.h | 5 -
arch/powerpc/mm/book3s32/mmu_context.c | 2 +-
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/arch/powerpc/include/asm/book3s/32/kup.h
b/arch/powerpc/i
In order to reuse MMU_FTR_BOOK3S_KUAP for other targets than BOOK3S,
rename it MMU_FTR_KUAP.
Signed-off-by: Christophe Leroy
---
arch/powerpc/include/asm/book3s/64/hash-pkey.h | 2 +-
arch/powerpc/include/asm/book3s/64/kup.h | 18 +-
arch/powerpc/include/asm/mmu.h
is crossing a
segment boundary. That would definitely require at least having
userspace access enabled on the two segments. To avoid complicating
the likely case for a so unlikely happening, handle such situation
like an alignment exception and emulate the store.
Signed-off-by: Christophe Leroy
e same with __kuap_save_and_lock() and
__kuap_get_and_assert_locked().
Signed-off-by: Christophe Leroy
Reviewed-by: Nicholas Piggin
---
v2: Add back comment about __kupa_lock() not needed on 64s
---
arch/powerpc/include/asm/book3s/32/kup.h | 6 ++--
arch/powerpc/include/asm/book3s/64/kup.h | 10 ++
BOOKE.
Signed-off-by: Christophe Leroy
---
arch/powerpc/include/asm/nohash/32/kup-8xx.h | 8 ++--
arch/powerpc/include/asm/nohash/kup-booke.h | 6 ++
2 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/arch/powerpc/include/asm/nohash/32/kup-8xx.h
b/arch/powerpc/include/asm/noh
later when
objtool is activated on PPC64.
Signed-off-by: Christophe Leroy
---
arch/powerpc/include/asm/book3s/32/kup.h | 34 +++
arch/powerpc/include/asm/kup.h | 45 +++-
arch/powerpc/include/asm/nohash/32/kup-8xx.h | 30 +
arch/powerpc
validation, but
even before they are worth it, especially the simplification on 32s.
Christophe Leroy (9):
powerpc/kuap: Avoid unnecessary reads of MD_AP
powerpc/kuap: Avoid useless jump_label on empty function
powerpc/kuap: Fold kuep_is_disabled() into its only user
powerpc/features: Add
allowing PPC_EARLY_DEBUG_CPM only when
> SERIAL_CPM=y.
>
> Fixes: c374e00e17f1 ("[POWERPC] Add early debug console for CPM serial
> ports.")
> Signed-off-by: Randy Dunlap
> Cc: Kumar Gala
> Cc: "Pali Rohár"
> Cc: Michael Ellerman
> Cc: Nicholas Pig
y when
>>>> SERIAL_CPM=y.
>>>>
>>>> Fixes: c374e00e17f1 ("[POWERPC] Add early debug console for CPM serial
>>>> ports.")
>>>> Signed-off-by: Randy Dunlap
>>>> Cc: Scott Wood
>>>> Cc: Kumar Gala
>>>>
Le 28/06/2023 à 23:10, Leo Li a écrit :
>
>
>> -Original Message-----
>> From: Christophe Leroy
>> Sent: Wednesday, June 28, 2023 2:40 PM
>> To: Leo Li ; Ma Ke
>> Cc: gre...@linuxfoundation.org; linux-...@vger.kernel.org; linuxppc-
>> d...@list
Le 28/06/2023 à 19:04, Leo Li a écrit :
>
>
>> -Original Message-
>> From: Ma Ke
>> Sent: Wednesday, June 28, 2023 3:15 AM
>> To: Leo Li
>> Cc: gre...@linuxfoundation.org; linux-...@vger.kernel.org; linuxppc-
>> d...@lists.ozlabs.org; linux-ker...@vger.kernel.org; Ma Ke
>>
>>
Hello Josh and Peter,
As mentionned in the cover letter of my series "powerpc/objtool: uaccess
validation for PPC32 (v3)" [1], a few switch table lookup fail, and it
would help if you had ideas on how to handle them.
First one is as follows. First switch is properly detected, second is not.
Le 22/06/2023 à 08:31, Josh Poimboeuf a écrit :
> On Wed, Jun 21, 2023 at 05:20:31PM +0200, Christophe Leroy wrote:
>> Most of the time objtool warnings are useless without the
>> absolute address within the section.
>>
>> Today there is --sec-address option to get it
tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>
> url:
> https://github.com/intel-lab-lkp/linux/commits/Christophe-Leroy/objtool-Make-sec-address-alway
).
To allow that, entries[] table must be initialised at runtime. This is
easily done by moving it into its only user which is special_get_alts().
Signed-off-by: Christophe Leroy
Acked-by: Peter Zijlstra (Intel)
---
.../arch/powerpc/include/arch/special.h | 2 +-
tools/objtool/special.c
() with UACCESS
enabled
This is due to some KUAP enabling/disabling functions being outline
allthough they are marked inline. Use __always_inline instead.
Signed-off-by: Christophe Leroy
---
arch/powerpc/include/asm/book3s/32/kup.h | 26 ++--
arch/powerpc/include/asm/book3s
noreturn
functions, and declare __copy_tofrom_user() and __arch_clear_user()
as UACCESS safe.
Signed-off-by: Christophe Leroy
---
arch/powerpc/Kconfig | 2 +
arch/powerpc/include/asm/kup.h| 12 +++
arch/powerpc/include/asm/nohash/32/kup-8xx.h | 8
' in WARN_ON(), including build failures, keeping that
change is not worth it allthough it is primarily a compiler bug.
So revert it for now.
Signed-off-by: Christophe Leroy
Acked-by: Naveen N Rao
---
v2: Do not remove tools/testing/selftests/powerpc/primitives/asm/extable.h and
leave EX_TABLE in asm
All but book3s/64 use a static branch key for disabling kuap.
book3s/64 uses a memory feature.
Refactor all targets except book3s/64.
Signed-off-by: Christophe Leroy
---
arch/powerpc/include/asm/book3s/32/kup.h | 7 ---
arch/powerpc/include/asm/book3s/64/kup.h | 1 +
arch/powerpc
validation on ASM files.
Suggested-by: Naveen N Rao
Signed-off-by: Christophe Leroy
---
arch/Kconfig | 5 +
scripts/Makefile.build | 4
2 files changed, 9 insertions(+)
diff --git a/arch/Kconfig b/arch/Kconfig
index 205fd23e0cad..dd66b884bcfb 100644
--- a/arch/Kconfig
+++ b/arch
. And add ASM_UACCESS_BEGIN
and ASM_UACCESS_END macros to be used in inline assembly code to
annotate UACCESS enable and UACCESS disable instructions.
Signed-off-by: Christophe Leroy
---
include/linux/objtool.h | 14 ++
tools/objtool/check.c | 33 +
2
tion. Mark it reachable so
that objtool knows that it is not a dead end in that case.
Also change the unreachable() annotation by __builtin_unreachable()
since objtool already knows that a BUG instruction is a dead end.
Signed-off-by: Christophe Leroy
---
arch/powerpc/include/asm/bug.h | 14
C jump tables. Do the comparison using R_ABS32 and R_ABS64 which are
architecture agnostic.
And use correct size for 'long' instead of hard coding a size of '8'.
Signed-off-by: Christophe Leroy
---
tools/objtool/check.c | 11 ---
1 file changed, 8 insertions(+), 3 deletions(-)
dif
here
find_jump_table() contains a constraint that stops the backsearch
of the table address loading when a jump is found in-between.
Remove that constraint.
Signed-off-by: Christophe Leroy
---
tools/objtool/check.c | 7 ---
1 file changed, 7 deletions(-)
diff --git a/tools/objtool
t code after that conditional return is dead.
To overcome this situation, introduce INSN_RETURN_CONDITIONAL which
is taken as a confirmation that a function is not noreturn but still
sees following code as reachable.
Signed-off-by: Christophe Leroy
Acked-by: Peter Zijlstra (Intel)
---
tools/obj
ive when selected in kernel config.
In the future it may be re-implemented by noping the instructions
instead of using static branches.
Signed-off-by: Christophe Leroy
---
arch/powerpc/include/asm/kup.h | 4 +---
arch/powerpc/mm/book3s32/kuap.c | 15 ++-
arch/powerpc/mm/init-commo
noreturns.h is a mix of x86 specific functions and more generic
core functions.
In preparation of inclusion of powerpc, split x86 functions out of
noreturns.h into arch/noreturns.h
Signed-off-by: Christophe Leroy
---
.../objtool/arch/x86/include/arch/noreturns.h | 20 +++
tools
/core tree
- Simplified support for relative switch tables based on relocation type
- Taken comments from Peter
Christophe Leroy (15):
powerpc/kuap: Avoid unnecessary reads of MD_AP
powerpc/kuap: Avoid useless jump_label on empty function
powerpc/kuap: Refactor static branch for disabling
e same with __kuap_save_and_lock() and
__kuap_get_and_assert_locked().
Signed-off-by: Christophe Leroy
Reviewed-by: Nicholas Piggin
---
v2: Add back comment about __kupa_lock() not needed on 64s
---
arch/powerpc/include/asm/book3s/32/kup.h | 6 ++---
arch/powerpc/include/asm/book3s/64/kup.h | 10 ++--
BOOKE.
Signed-off-by: Christophe Leroy
---
arch/powerpc/include/asm/nohash/32/kup-8xx.h | 8 ++--
arch/powerpc/include/asm/nohash/kup-booke.h | 6 ++
2 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/arch/powerpc/include/asm/nohash/32/kup-8xx.h
b/arch/powerpc/include/asm/noh
Le 22/06/2023 à 13:56, Peter Zijlstra a écrit :
> On Thu, Jun 22, 2023 at 12:54:36PM +0200, Christophe Leroy wrote:
>
>> diff --git a/tools/objtool/check.c b/tools/objtool/check.c
>> index f850ab892ad5..8ac5711a055f 100644
>> --- a/tools/objtool/check.c
>&g
Le 22/06/2023 à 13:48, Peter Zijlstra a écrit :
> On Thu, Jun 22, 2023 at 12:54:32PM +0200, Christophe Leroy wrote:
>> On powerpc, switch tables are relative, than means the address of the
>> table is added to the value of the entry in order to get the pointed
>> addre
/0x350
> 16) 416 416 system_call_common+0x160/0x2c4
>
> This results in two additional stores in the ftrace entry code, but
> produces reliable backtraces. Note that this change now aligns with
> other architectures (arm64, s390, x86).
>
> Signed-off-by: Naveen N Ra
itional store was removed in later
> compiler versions for performance reasons. The same reasons apply for
> ppc32 so we only patch in a 'mflr r0'.
>
> Signed-off-by: Naveen N Rao
Reviewed-by: Christophe Leroy
Nit below
> ---
> arch/powerpc/Kconfig
> Signed-off-by: Naveen N Rao
Reviewed-by: Christophe Leroy
> ---
> arch/powerpc/kernel/trace/ftrace.c | 173 -
> 1 file changed, 96 insertions(+), 77 deletions(-)
>
> diff --git a/arch/powerpc/kernel/trace/ftrace.c
> b/arch/powerpc/kernel/tr
Le 19/06/2023 à 11:47, Naveen N Rao a écrit :
> ftrace_create_branch_inst() is clearer about its intent than
> ftrace_call_replace().
>
> Signed-off-by: Naveen N Rao
Reviewed-by: Christophe Leroy
> ---
> arch/powerpc/kernel/trace/ftrace.c | 17 ++---
>
cation. Note that we continue to ensure we
> have the expected branch instruction at the ftrace location before
> patching it with the updated branch destination.
>
> Signed-off-by: Naveen N Rao
Reviewed-by: Christophe Leroy
> ---
> arch/power
we continue to ensure that we have a nop at the ftrace
> location before patching it.
>
> Signed-off-by: Naveen N Rao
Reviewed-by: Christophe Leroy
> ---
> arch/powerpc/kernel/trace/ftrace.c | 187 +
> 1 file changed, 31 insertions(+), 156 deletions(-)
we continue to ensure that we have a bl to
> ftrace_[regs_]caller at the ftrace location before nop-ing it out.
>
> Signed-off-by: Naveen N Rao
Reviewed-by: Christophe Leroy
> ---
> arch/powerpc/kernel/trace/ftrace.c | 220 +
> 1 file changed, 3
simply patch the necessary instructions during
> enabling/disabling ftrace.
>
> Signed-off-by: Naveen N Rao
Reviewed-by: Christophe Leroy
> ---
> arch/powerpc/include/asm/ftrace.h | 6 +++
> arch/powerpc/kernel/trace/ftrace.c | 71 ++
> 2 files ch
sons to support ftrace on
> kernels beyond 64MB, we can consider adding support by using
> -fpatchable-function-entry.
>
> Signed-off-by: Naveen N Rao
Reviewed-by: Christophe Leroy
> ---
> arch/powerpc/kernel/trace/ftrace.c | 110 +
> 1 file chan
Le 19/06/2023 à 11:47, Naveen N Rao a écrit :
> Split up ftrace_modify_code() into a few helpers for future use. Also
> update error messages accordingly.
>
> Signed-off-by: Naveen N Rao
Reviewed-by: Christophe Leroy
> ---
> arch/powerpc/kernel/t
c is renamed to ftrace_64_pg.c
> - ftrace_64_pg.S is rename to ftrace_64_pg_entry.S
The stats from git do not match., it says {ftrace_low.S =>
ftrace_64_pg_entry.S
>
> Signed-off-by: Naveen N Rao
Reviewed-by: Christophe Leroy
> ---
> arch/powerpc/kernel/trace/Makefile
is cast to 'long long' to prevent
> errors on ppc32.
>
Reviewed-by: Christophe Leroy
> Signed-off-by: Naveen N Rao
> ---
> arch/powerpc/include/asm/ftrace.h | 10 +--
> arch/powerpc/include/asm/sections.h| 2 ++
> arch/powerpc/kernel/trace/ftrace.c
Le 19/06/2023 à 11:47, Naveen N Rao a écrit :
> Instead of keying off DYNAMIC_FTRACE_WITH_REGS, use FTRACE_REGS_ADDR to
> identify the proper ftrace trampoline address to use.
>
> Signed-off-by: Naveen N Rao
Reviewed-by: Christophe Leroy
> ---
> arch/powerpc/kernel/
601 - 700 of 9579 matches
Mail list logo