Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp4976868pxb; Wed, 26 Jan 2022 01:55:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJy56n5gA1jm/hmxh/KkD5d3OE/u+3XG87ebs+k4r364Q3APJlPR2QkDhcDqPno/oTOXOEKd X-Received: by 2002:a17:906:3004:: with SMTP id 4mr18719561ejz.579.1643190938550; Wed, 26 Jan 2022 01:55:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643190938; cv=none; d=google.com; s=arc-20160816; b=JcmNbz9BKg83QcwEhmJodmW1vCKVbCD5lmreGxn61gc7TZovjmiz4M7cCB/w7jn/SD j+3QM0nRNq3QYyNYYiHBk6/TYOdN5mieQhFfcFueasjR06tsjOdf0yDLCwkzJ+BjmOLB lwhi8Sf18Buc8C0bY084A6jpZ67iV17k1KO9FrGO7FPwWKsEqyVNEN6xjrekQMGWz5lG gsV3crp8GmPGmSOqGt+70cyV278GKiRyq7wpTAe6D1H2yA8cBOHmvaZIcscbvh4rcHTa AO65xaptNpkniAhiymT7UAcel4ahyZ/VAuYEgDEAQ34a7OVuJLbFOMxSm9lI6XMituQa WP5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=KWOkGwXKalirvDlhGoXrr7N1kHlpsTkkyxGyIlZUW2I=; b=IPst7sPoYOa0HM4dz928hPHEBdhzyMg5MgqTILEz7g4DVK++kbTMPpPngsnKYfyhI1 C8chNr0ZGtNKLTvyfbTKl2ngZwPpO93oc6oBhYgghQeZdKB/OkqsgxoNOAp0/lhuOUfc NYP/FyuDvoat68DaotCH/Kct/L4Yh4H0uddIsxnCVlSWOT1xr/4xhWLGU+Q19UDHa771 BhrAyjDXLokmm25jDtyQrUuNJhm2JdNNGwcAvpXzlvRdcQvmzObIpYQ+7lTggTIjfGWI lqVVEeTFvSm6NtlB0mPj8hYhFfW5T5NeQ4IpHa73e28qD0HmesePVjq2CUxreLQSKxdA 5mRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@w6rz.net header.s=default header.b=auTzbuQj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r14si7377685edw.155.2022.01.26.01.55.14; Wed, 26 Jan 2022 01:55:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@w6rz.net header.s=default header.b=auTzbuQj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232985AbiAYVLQ (ORCPT + 99 others); Tue, 25 Jan 2022 16:11:16 -0500 Received: from qproxy3-pub.mail.unifiedlayer.com ([67.222.38.20]:46754 "EHLO qproxy3-pub.mail.unifiedlayer.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233050AbiAYVLG (ORCPT ); Tue, 25 Jan 2022 16:11:06 -0500 Received: from gproxy1-pub.mail.unifiedlayer.com (gproxy1-pub.mail.unifiedlayer.com [69.89.25.95]) by qproxy3.mail.unifiedlayer.com (Postfix) with ESMTP id 5B8FA802AD0A for ; Tue, 25 Jan 2022 21:11:06 +0000 (UTC) Received: from cmgw11.mail.unifiedlayer.com (unknown [10.0.90.126]) by progateway3.mail.pro1.eigbox.com (Postfix) with ESMTP id A171F10047048 for ; Tue, 25 Jan 2022 21:11:05 +0000 (UTC) Received: from box5620.bluehost.com ([162.241.219.59]) by cmsmtp with ESMTP id CT5ln5dgywm8iCT5ln50IG; Tue, 25 Jan 2022 21:11:05 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=DpSTREz+ c=1 sm=1 tr=0 ts=61f06769 a=30941lsx5skRcbJ0JMGu9A==:117 a=30941lsx5skRcbJ0JMGu9A==:17 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10:nop_charset_1 a=DghFqjY3_ZEA:10:nop_rcvd_month_year a=-Ou01B_BuAIA:10:endurance_base64_authed_username_1 a=eFWqtd3rAAAA:8 a=tBb2bbeoAAAA:8 a=h0uksLzaAAAA:8 a=W-_n0kkjAAAA:8 a=BouTL1r6kgS_ZzKWE9cA:9 a=QEXdDO2ut3YA:10:nop_charset_2 a=OmE4rGSwGH90ucjH_eFs:22 a=Oj-tNtZlA1e06AYgeCfH:22 a=MSi_79tMYmZZG2gvAgS0:22 a=qeNa2pbTr82C0GpJEZFS:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=w6rz.net; s=default; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=KWOkGwXKalirvDlhGoXrr7N1kHlpsTkkyxGyIlZUW2I=; b=auTzbuQjEdMeBZq+n+7UshnKHn 8OJLxyeBzFQZy+YI8z2/oLmbC1X3sHbP15V/gzHdE2ZvqXMm38deynzur5qpBWfPbNX7I+W/4Z77G IhkHRFNUiQG9z3gYhKTiEhaL1; Received: from c-73-162-232-9.hsd1.ca.comcast.net ([73.162.232.9]:51656 helo=[10.0.1.23]) by box5620.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nCT5k-0049Qa-N6; Tue, 25 Jan 2022 14:11:04 -0700 Message-ID: <1200181c-9380-5405-0b37-4fbc49f6c095@w6rz.net> Date: Tue, 25 Jan 2022 13:11:02 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v3 6/6] RISC-V: Do not use cpumask data structure for hartid bitmap Content-Language: en-US To: Geert Uytterhoeven , Atish Patra Cc: Atish Patra , Linux Kernel Mailing List , Anup Patel , Albert Ou , Damien Le Moal , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Jisheng Zhang , Krzysztof Kozlowski , linux-riscv , Palmer Dabbelt , Paul Walmsley , Rob Herring , Emil Renner Berthing References: <20220120090918.2646626-1-atishp@rivosinc.com> <20220120090918.2646626-7-atishp@rivosinc.com> From: Ron Economos In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5620.bluehost.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - w6rz.net X-BWhitelist: no X-Source-IP: 73.162.232.9 X-Source-L: No X-Exim-ID: 1nCT5k-0049Qa-N6 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: c-73-162-232-9.hsd1.ca.comcast.net ([10.0.1.23]) [73.162.232.9]:51656 X-Source-Auth: re@w6rz.net X-Email-Count: 12 X-Source-Cap: d3NpeHJ6bmU7d3NpeHJ6bmU7Ym94NTYyMC5ibHVlaG9zdC5jb20= X-Local-Domain: yes Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/25/22 12:52, Geert Uytterhoeven wrote: > Hi Atish, > > On Tue, Jan 25, 2022 at 9:17 PM Atish Patra wrote: >> On Tue, Jan 25, 2022 at 12:12 PM Geert Uytterhoeven >> wrote: >>> On Thu, Jan 20, 2022 at 10:12 AM Atish Patra wrote: >>>> Currently, SBI APIs accept a hartmask that is generated from struct >>>> cpumask. Cpumask data structure can hold upto NR_CPUs value. Thus, it >>>> is not the correct data structure for hartids as it can be higher >>>> than NR_CPUs for platforms with sparse or discontguous hartids. >>>> >>>> Remove all association between hartid mask and struct cpumask. >>>> >>>> Reviewed-by: Anup Patel (For Linux RISC-V changes) >>>> Acked-by: Anup Patel (For KVM RISC-V changes) >>>> Signed-off-by: Atish Patra >>> Thanks for your patch, which is now commit 26fb751ca37846c9 ("RISC-V: >>> Do not use cpumask data structure for hartid bitmap") in v5.17-rc1. >>> >>> I am having an issue with random userspace SEGVs on Starlight Beta >>> (which needs out-of-tree patches). It doesn't always manifest >>> itself immediately, so it took a while to bisect, but I suspect the >>> above commit to be the culprit. >> I have never seen one before during my testing. How frequently do you see them? >> Does it happen while running anything or just idle user space results >> in SEGVs randomly. > Sometimes they happen during startup (lots of failures from systemd), > sometimes they happen later, during interactive work. > Sometimes while idle, and something runs in the background (e.g. mandb). > >> Do you have a trace that I can look into ? > # apt update > [ 807.499050] apt[258]: unhandled signal 11 code 0x1 at > 0xffffff8300060020 in libapt-pkg.so.6.0.0[3fa49ac000+174000] > [ 807.509548] CPU: 0 PID: 258 Comm: apt Not tainted > 5.16.0-starlight-11192-g26fb751ca378-dirty #153 > [ 807.518674] Hardware name: BeagleV Starlight Beta (DT) > [ 807.524077] epc : 0000003fa4a47a0a ra : 0000003fa4a479fc sp : > 0000003fcb4b39b0 > [ 807.531383] gp : 0000002adcef4800 tp : 0000003fa43287b0 t0 : > 0000000000000001 > [ 807.538603] t1 : 0000000000000009 t2 : 00000000000003ff s0 : > 0000000000000000 > [ 807.545887] s1 : 0000002adcf3cb60 a0 : 0000000000000003 a1 : > 0000000000000000 > [ 807.553167] a2 : 0000003fcb4b3a30 a3 : 0000000000000000 a4 : > 0000002adcf3cc1c > [ 807.560390] a5 : 0007000300060000 a6 : 0000000000000003 a7 : > 1999999999999999 > [ 807.567654] s2 : 0000003fcb4b3a28 s3 : 0000000000000002 s4 : > 0000003fcb4b3a30 > [ 807.575039] s5 : 0000003fa4baa810 s6 : 0000000000000010 s7 : > 0000002adcf19a40 > [ 807.582363] s8 : 0000003fcb4b4010 s9 : 0000003fa4baa810 s10: > 0000003fcb4b3e90 > [ 807.589606] s11: 0000003fa4b2a528 t3 : 0000000000000000 t4 : > 0000003fa47906a0 > [ 807.596891] t5 : 0000000000000005 t6 : ffffffffffffffff > [ 807.602302] status: 0000000200004020 badaddr: ffffff8300060020 > cause: 000000000000000d > > (-dirty due to Starlight DTS and driver updates) > > Gr{oetje,eeting}s, > > Geert > > -- I'm not sure if it's related, but I'm also seeing a systemd segfault on boot with the HiFive Unmatched and 5.17.0-rc1. I don't have the dmesg dump, but here's the journalctl dump. It was built before the tag, so it says 5.16.0. Jan 23 02:41:50 riscv64 systemd-udevd[551]: mmcblk0p12: Failed to wait for spawned command '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/mmcblk0p12': Invalid argument Jan 23 02:41:50 riscv64 systemd-udevd[412]: mmcblk0p12: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/mmcblk0p12' terminated by signal SEGV. Jan 23 02:41:50 riscv64 kernel: systemd-udevd[551]: unhandled signal 11 code 0x1 at 0x0000000003938700 in udevadm[3fa7eee000+b1000] Jan 23 02:41:50 riscv64 kernel: CPU: 2 PID: 551 Comm: systemd-udevd Not tainted 5.16.0 #1 Jan 23 02:41:50 riscv64 kernel: Hardware name: SiFive HiFive Unmatched A00 (DT) Jan 23 02:41:50 riscv64 kernel: epc : 0000003fa7f14104 ra : 0000003fa7f14102 sp : 0000003fe3da5320 Jan 23 02:41:50 riscv64 kernel:  gp : 0000003fa7fc3ef8 tp : 0000003fa79f8530 t0 : 0000003fe3da38f0 Jan 23 02:41:50 riscv64 kernel:  t1 : 0000003fa7f0425c t2 : 0000000000000000 s0 : 0000003fcd046d88 Jan 23 02:41:50 riscv64 kernel:  s1 : 0000003fcd046d60 a0 : ffffffffffffffff a1 : 0000003fcd0cb330 Jan 23 02:41:50 riscv64 kernel:  a2 : 0000003fcd043028 a3 : 0000000000000007 a4 : c98b6a1813e46d00 Jan 23 02:41:50 riscv64 kernel:  a5 : ffffffffffffffff a6 : fefefefefefefeff a7 : 0000000000000039 Jan 23 02:41:50 riscv64 kernel:  s2 : 0000000000000000 s3 : ffffffffffffffea s4 : 0000000000000000 Jan 23 02:41:50 riscv64 kernel:  s5 : 0000003fe3da5378 s6 : ffffffffffffffea s7 : 0000000003938700 Jan 23 02:41:50 riscv64 kernel:  s8 : 0000003fe3da53e0 s9 : 0000003fe3da53d8 s10: 0000003fa7fc200c Jan 23 02:41:50 riscv64 kernel:  s11: 0000000000081000 t3 : 0000003fa7db3822 t4 : 0000000000000000 Jan 23 02:41:50 riscv64 kernel:  t5 : 0000003fe3da38c8 t6 : 000000000000002a Jan 23 02:41:50 riscv64 kernel: status: 0000000200004020 badaddr: 0000000003938700 cause: 000000000000000d Jan 23 02:41:50 riscv64 systemd-udevd[412]: mmcblk0p12: Failed to wait for spawned command '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/mmcblk0p12': Input/output error Jan 23 02:41:50 riscv64 systemd-udevd[412]: mmcblk0p12: Failed to execute '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/mmcblk0p12', ignoring: Input/output error I'll try removing this patch. Ron