From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EA121241139 for ; Sat, 8 Feb 2025 18:20:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=93.17.235.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739038806; cv=none; b=jOcUc2wkFsObE4JJulFKEQcQxWnRJweq80iXr8vh1bbrcq6dD8ZDQfzp1rweYtIAP3Vtm1u6EfZrvVVI2rqy3COXiYabY1BkwmZ6GuW/y+OFgiwgZK00q2brX91/AcvuKJNqH1T7b8z01eY5O1MMkEqWtHkQ5qV/HGzGHN9qZzQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739038806; c=relaxed/simple; bh=gMaAMVjZl8rtQdUE/8Mp0fRwYUJ5Kc88FYpJ0AFahzU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=NyhhF+X51hkGquPjkgIeIuLimMxRpTgBtrWSbIQw1dN7ECoPFtB5Y+1OaFMFJWE2wolm62Ubrw19iqoD2r9npCNvMxgfpi+4wuq15eBnad36Gflye4JrlgJ0HvWQoUNw2vZriI6wXs/aj4RekkLU/RawWPBsHMRZkGgqdKQSSZQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=csgroup.eu; spf=pass smtp.mailfrom=csgroup.eu; arc=none smtp.client-ip=93.17.235.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=csgroup.eu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=csgroup.eu Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4Yqz654D1kz9sPd; Sat, 8 Feb 2025 18:55:57 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2kbV93WVjU2T; Sat, 8 Feb 2025 18:55:57 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4Yqz6539yJz9rvV; Sat, 8 Feb 2025 18:55:57 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 624F28B79C; Sat, 8 Feb 2025 18:55:57 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id ViW2ux6gv5_3; Sat, 8 Feb 2025 18:55:57 +0100 (CET) Received: from [192.168.235.99] (unknown [192.168.235.99]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 6213F8B763; Sat, 8 Feb 2025 18:55:56 +0100 (CET) Message-ID: <0f05c020-47e4-444d-90ab-9eb8414f4ef8@csgroup.eu> Date: Sat, 8 Feb 2025 18:55:54 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 5/9] powerpc: Use preempt_model_str(). To: Shrikanth Hegde , Sebastian Andrzej Siewior Cc: linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev, Ben Segall , Catalin Marinas , Dietmar Eggemann , Ingo Molnar , Juri Lelli , Mel Gorman , Peter Zijlstra , Steven Rostedt , Thomas Gleixner , Valentin Schneider , Vincent Guittot , Will Deacon , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Naveen N Rao , linuxppc-dev@lists.ozlabs.org References: <20250203141632.440554-1-bigeasy@linutronix.de> <20250203141632.440554-6-bigeasy@linutronix.de> <65c6f60d-bb52-48bd-a02c-87ffd2a915d4@csgroup.eu> <20250203160103.9DikC9FJ@linutronix.de> <51999b8e-61c0-48b7-b744-c83d39e7f311@csgroup.eu> <20250204082223.6iNyq_KR@linutronix.de> <7b51f7de-8e4b-4766-85ca-dee24832c693@linux.ibm.com> <93833119-9406-4d30-aa7b-4521adb3a573@csgroup.eu> <936f0451-a4ee-4e14-9ce9-9cd9613fc55c@linux.ibm.com> Content-Language: fr-FR From: Christophe Leroy In-Reply-To: <936f0451-a4ee-4e14-9ce9-9cd9613fc55c@linux.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 08/02/2025 à 14:42, Shrikanth Hegde a écrit : > > > On 2/8/25 18:25, Christophe Leroy wrote: >> >> >> Le 08/02/2025 à 08:35, Shrikanth Hegde a écrit : >>> >>> >>> On 2/4/25 13:52, Sebastian Andrzej Siewior wrote: >>>> Use preempt_model_str() instead of manually conducting the preemption >>>> model. Use pr_emerg() instead of printk() to pass a loglevel. >>> >>> even on powerpc, i see __die ends up calling show_regs_print_info(). >>> Why print it twice? >> >> I don't understand what you mean, what is printed twice ? >> >> I can't see show_regs_print_info() printing the preemption model, am I >> missing something ? >> > > Patch 2/9 add preemption string in dump_stack_print_info. > > __die -> show_regs() _> show_regs_print_info() -> > dump_stack_print_info() -> init_utsname()->version, preempt_model_str(), > BUILD_ID_VAL); > > Wont we end up in this path? Indeed I missed that. You are right, we now get the information twice: [ 440.068216] BUG: Unable to handle kernel data access on write at 0xc09036fc [ 440.075051] Faulting instruction address: 0xc045ddf8 [ 440.080032] Oops: Kernel access of bad area, sig: 11 [#1] [ 440.085438] BE PAGE_SIZE=16K PREEMPT CMPC885 [ 440.089872] SAF3000 DIE NOTIFICATION [ 440.093391] CPU: 0 UID: 0 PID: 472 Comm: sh Not tainted 6.13.0-s3k-dev-01384-g54680e2fbfb0 #1379 PREEMPT [ 440.102977] Hardware name: MIAE 8xx 0x500000 CMPC885 [ 440.107951] NIP: c045ddf8 LR: c045dde8 CTR: 00000000 [ 440.113015] REGS: c9bf3d60 TRAP: 0300 Not tainted (6.13.0-s3k-dev-01384-g54680e2fbfb0) [ 440.121215] MSR: 00009032 CR: 35009393 XER: 80003100 [ 440.128198] DAR: c09036fc DSISR: 82000000 [ 440.128198] GPR00: c045c59c c9bf3e20 c27e7700 0000002e c108575c 00000001 c1085850 00009032 [ 440.128198] GPR08: 00000027 0198b861 00000001 3ffff000 55009393 100d815e 7fcf5e20 100d0000 [ 440.128198] GPR16: 100d0000 00000000 113e447c 113e4480 00000000 00000001 00000000 00000000 [ 440.128198] GPR24: 113e4464 00000000 c1828000 c9bf3ef8 c1136eac c9bf3ef8 c2888000 c0900000 [ 440.168081] NIP [c045ddf8] lkdtm_WRITE_RO+0x34/0x50 [ 440.172969] LR [c045dde8] lkdtm_WRITE_RO+0x24/0x50 [ 440.177771] Call Trace: Christophe > >> Christophe >> >>> >>>> >>>> Cc: Madhavan Srinivasan >>>> Cc: Michael Ellerman >>>> Cc: Nicholas Piggin >>>> Cc: Christophe Leroy >>>> Cc: Naveen N Rao >>>> Cc: linuxppc-dev@lists.ozlabs.org >>>> Signed-off-by: Sebastian Andrzej Siewior >>>> --- >>>> v2…v3: >>>>    - Use printk() instead of pr_emerg() to remain consistent with the >>>>      other invocations in terms of printing context. >>>> >>>>   arch/powerpc/kernel/traps.c | 4 ++-- >>>>   1 file changed, 2 insertions(+), 2 deletions(-) >>>> >>>> diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c >>>> index edf5cabe5dfdb..d6d77d92b3358 100644 >>>> --- a/arch/powerpc/kernel/traps.c >>>> +++ b/arch/powerpc/kernel/traps.c >>>> @@ -263,10 +263,10 @@ static int __die(const char *str, struct >>>> pt_regs *regs, long err) >>>>   { >>>>       printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter); >>>> -    printk("%s PAGE_SIZE=%luK%s%s%s%s%s%s %s\n", >>>> +    printk("%s PAGE_SIZE=%luK%s %s %s%s%s%s %s\n", >>>>              IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN) ? "LE" : "BE", >>>>              PAGE_SIZE / 1024, get_mmu_str(), >>>> -           IS_ENABLED(CONFIG_PREEMPT) ? " PREEMPT" : "", >>>> +           preempt_model_str(), >>>>              IS_ENABLED(CONFIG_SMP) ? " SMP" : "", >>>>              IS_ENABLED(CONFIG_SMP) ? (" NR_CPUS=" >>>> __stringify(NR_CPUS)) : "", >>>>              debug_pagealloc_enabled() ? " DEBUG_PAGEALLOC" : "", >>> >> >