From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED6C844C646 for ; Thu, 17 Sep 2026 10:29:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789640958; cv=none; b=VCO6Dj6R9IIK9lXCRWislhtqabqBxXT0QkvKq6VPSpauRzfe0U9A4b4ofzr1Jp6HMM6YEX8QGNis7eiTwowqdHKVrVnP+4Ie5/tu6alaKAIh8tnziV1EqI/ovWMQeiNL2IwuWWm5ycQXC8WAfzCcg8wwNDXWiAhFfDtja9K3EXo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789640958; c=relaxed/simple; bh=c1hPVLhZPEcPgF9BP/8oNypu34vkCB0wIMVqfDwLYH0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=H25jkqnjV6IBtrEqw+VfvQBx68h4PKERMtUbdxNOXfup5mLhagIEuKMaEHTA/0aVDdEcB8S4Dwe7HC/Y8kM7Hy7Brb4nF+jbDTuoBUap9GEqzb/nTdkGMSKKYtrbu6Vzsez8sAFjLBflGn1MJyb+ijMtBXt01+xwpFeVc/6YUjk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=BRILXYYE; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="BRILXYYE" Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68HA1fGZ1032192; Thu, 17 Sep 2026 10:28:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pp1; bh=+LbJ8s b8tbczMZi2OZuBLEjEt/vDZC7a90/SRYbu4dQ=; b=BRILXYYE5yzV5ngclOAXCH sg7UxiF6fvAy47sKLn9AXdzpTTkn8aV3cM2v+k5XkihzCd1DHWunWMRNHoh73vNv fBbH8ha5BVMK+JCMSyaXx5kEFsFgtXqhpuicZxfjTO5hMF8qVXEHZ94FdBrL+J1b 01PgZF555fmIQclaV1g4dLNTCzlyquwQQMMkSRAp7p4tkalsz8RvSqYE9yKYq4TJ PUuVlLHGTekiOtiJjQGEM1054XRrI7H2PVNrTLMyjgWWCHiUa0g9N70i2w2u2ITH HXxD5TYEVIbHe2uw3tpnN80eYI4HZgR49QsOmjR2x0/n/wOlR1ZHPB1o55v+u/nQ == Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4gmw5e9dc1-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 17 Sep 2026 10:28:51 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 68H9aSxr2900089; Thu, 17 Sep 2026 10:28:50 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4gr5fjhxdd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 17 Sep 2026 10:28:50 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 68HASk7f48365876 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 17 Sep 2026 10:28:46 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A04202004B; Thu, 17 Sep 2026 10:28:46 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EB05120040; Thu, 17 Sep 2026 10:28:42 +0000 (GMT) Received: from [9.123.5.233] (unknown [9.123.5.233]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 17 Sep 2026 10:28:42 +0000 (GMT) Message-ID: Date: Thu, 17 Sep 2026 15:58:42 +0530 Precedence: bulk X-Mailing-List: kvm-ppc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [Linux PPC] Disable PREEMPT To: =?UTF-8?Q?Michal_Such=C3=A1nek?= Cc: "Christophe Leroy (CS GROUP)" , Michael Ellerman , harshpb@linux.ibm.com, Gautam Menghani , amachhiw@linux.ibm.com, Christian Zigotzky , linuxppc-dev , "kvm-ppc@vger.kernel.org" , Madhavan Srinivasan , Peter Zijlstra , "R.T.Dickinson" , hypexed@yahoo.com.au, mad skateman , Christian Zigotzky , Samir M , Venkat Rao Bagalkote , Narayana Murty N , Hari Bathini References: <393117bc-094e-4c47-b061-f255f5bff937@linux.ibm.com> <25cf64ab-2a32-4d4c-a0c7-2e9007c276d4@linux.ibm.com> <9b58bd58-d0e4-463e-bff9-e33b153b2987@linux.ibm.com> Content-Language: en-US From: Shrikanth Hegde In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE3MDEzOCBTYWx0ZWRfX622FybRPC7qu bq3870ojMzGRwA2hAPYJ2Wr0jEdSUre/xdnSki1fbu+rs9iL5E18Kc8Xq6JaRjRm3kpH1S6AATd Z6u6tZQqqaYtEQWPrOZRUYWt01iDiRzt52teWaytTfP3pHZn4KKMdOmDtHTmovlPFMW8XYS6I2s tewI0PfeNykn922bnSH5CTYkPV2QPqGsdu2onb4f/kdbOugWnkjT/cehucUJPuiJNE6KdEVHUcb cFP5gxdRDo+4/aUZ/oaClyKJNnaS4yemoZXvC2CmNKgmVdCRKXZSb+F3a84Bi+UNoxwarXHAqqu p5jagbXaJ/03omXLeraWxx2vggqsy+xZSfU6n6z/8d3hRxkVxHWG4B19fyv3OqFs+YnrkE7xO62 coHcxKdZpZaftPeHvAD0J3L0vnXIQX3GkprBatbQdF4EC15+5zZavmcoVs2iI+cDs7QAR4S1VeG ZX9uvnxm51ImRZxKnzw== X-Authority-Analysis: v=2.4 cv=E/NYNqdl c=1 sm=1 tr=0 ts=6aabc0e3 cx=c_pps a=5BHTudwdYE3Te8bg5FgnPg==:117 a=5BHTudwdYE3Te8bg5FgnPg==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=V8glGbnc2Ofi9Qvn3v5h:22 a=vMVXlJkmbgminkodvmwA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 X-Proofpoint-ORIG-GUID: N2FW1pmmq0irOBOdc7YhXFFzROEZ95ur X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE3MDEzOCBTYWx0ZWRfX0zdO5ls3csNt HF7wnOd2/cy5gSGoufTqJP1ELQMSpVvV7iLwcuqC5l7o97HSXM4Uc4Uke9nZcRaPfDeNkKkQfxu D2e81hTTfjckp/gsZ225XV25egpI7D4= X-Proofpoint-GUID: NBmd7lCXUg7_uguVmnXgR3X5wrX43E4i X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-17_02,2026-09-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 adultscore=0 clxscore=1015 bulkscore=0 malwarescore=0 suspectscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609170138 Hi Michal, On 9/17/26 3:44 PM, Michal Suchánek wrote: > Hello, > > On Wed, Sep 16, 2026 at 11:41:38PM +0530, Shrikanth Hegde wrote: >> Hi Michal, >> >>> >>> It seems easy to re-create. >>> The key is running bcc/bpf program in parallel to kernel build. >>> >>> For example, these two in parallal, leads to stack corruption panic. >>> Stacktrace does differ sometimes. >>> >>> ./funccount  rcu* -d 100 >>> make -j 32 >>> >>> Boom. Will try to debug this further. >> >> A bit more debugging. >> >> 1. A few functions seems to crash, specially ones that call schedule. >> So picked schedule itself for tracing >> 2. Used plain ftrace. No crash. >> 3. Used kprobes. Boom. Crash appears. But this helped to avoid BPF JIT, or BCC part of it. >> 4. Did some preempt count validation with annotations. Seems to be holding fine. >> 5. Since unlock can call schedule while tracing schedule, there is possible looping. >> Need to see further why it happens to be crashing there. Maybe regs or paca >> handling needs a closer look. >> >> For now, below patch helps to keep the system stable under kprobes, bcc tools. >> I will look further into see why exactly it is crashing and below one is going to >> be the proper fix or not. >> >> Feel free to give it a try. > > thanks for the patch. > > While it is mangled by the e-mail client in different way compared to > the previous patch it does seem to mitigate the issue. Thanks for trying. > > As it is unlikely the board where KVM lockup was originally observed is > running kpbobes it will probably not address the original problem. > Give it a try. I am suspecting both lockup, stack corruptions are secondary symptoms here. While recreate, I have different type of traces. > Thanks > > Michal > >> >> --- >> arch/powerpc/kernel/kprobes-ftrace.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/arch/powerpc/kernel/kprobes-ftrace.c b/arch/powerpc/kernel/kprobes-ftrace.c >> index f8208c027148..bcb1e8a8995d 100644 >> --- a/arch/powerpc/kernel/kprobes-ftrace.c >> +++ b/arch/powerpc/kernel/kprobes-ftrace.c >> @@ -63,7 +63,9 @@ void kprobe_ftrace_handler(unsigned long nip, unsigned long parent_nip, >> __this_cpu_write(current_kprobe, NULL); >> } >> out: >> + preempt_disable_notrace(); >> ftrace_test_recursion_unlock(bit); >> + preempt_enable_no_resched_notrace(); >> } >> NOKPROBE_SYMBOL(kprobe_ftrace_handler); >> -- >> 2.52.0