From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C6CD3B14DF for ; Tue, 11 Aug 2026 06:59:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786431576; cv=none; b=g7AraWlbY+CULCfAR949Db3mgFEqERUXzs6S56sYt4InK6AjgkI7MrMTYwr79wwfkmbtIKf5BYK4SCy9GGUcIX0RRj/r3XKicVVBJ9sHOyPWLwUd1FwtLqYqv3GO0RFdy94h/ZUzoti60vqauI0rGdfavsUbiSVsbdycNOLYp60= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786431576; c=relaxed/simple; bh=09F84nm6VrA788U3J3dKsoVjl0CHbnYuxWMbxBF1wG4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=k0PW/qppN+NpP9q8MS9om3rBmPImlV3nzYO8y4Xrw/gct1CHA5a8GGAPiAPY7pJ1yQr+FNSRqFZCpI4bnVc9G+WB9dWgazYvXUovrpjvSNAQO1XsIIRkQx4cWN2Rl4QzsHfzysFICz8xF6/X9fWe5iRhxxm+3AAfma3tFKxx2LE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ZAf8PIMO; arc=none smtp.client-ip=209.85.221.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZAf8PIMO" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-480033bdcf4so1531895f8f.2 for ; Mon, 10 Aug 2026 23:59:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786431573; x=1787036373; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=7CGZZWuF5gk+XdnSsb1yoIVgT0uOaJBdpMM5wtHERfw=; b=ZAf8PIMOoNhe6OGENMzjZ6QHaPGgXEo4vO6eZLxIxOsK/g3rom72JcTNpZoTSEHGKB 6bw0N9UTGcLoUpy+hoOTSpXWrPkZBOFAtPGRmJI+pG2JMs1aeHIP6Y3p2qTfHEQFv8BP DyVpoX633cr4z92ESwrxO9xqpkJKSiiX/OOvEPuFN8oZvXaj1CV97WKTlZ6gBJybPw/t D5q/+1c7p8kPIn6xAOfyIHH+0G+uEQopNHQWrnl5pTKDdLnfYY4bvGHFUVi9+/HtXhB/ RfkVI/z4pqMmpmH9Jdfbiai+vOy1Ell6/B/NaNSoLr6R5m1fmuRwTnhqnYr3KTazvBIC P7bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786431573; x=1787036373; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=7CGZZWuF5gk+XdnSsb1yoIVgT0uOaJBdpMM5wtHERfw=; b=T2iEvSfQPS9UEUqX/GgBXbuhQfNtTNlmec8X8XEZADY4lmOjtss7rmvC+H5svE+sev ecxtiETe/klqOSCnkBhhYce8C8JUj4d4p5npfvSGDo/44Mau7kovffushCFe1sxG6oC0 RGe5I+E+a9XxOtEEADFlXYuuZlygjqX7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11+8YdAHWsUkOiMvmukT8baOO6E= X-Received: by 2002:a05:6000:25e8:b0:47f:91e3:3cbf with SMTP id ffacd0b85a97d-4814adb1f0dmr1920243f8f.19.1786431572901; Mon, 10 Aug 2026 23:59:32 -0700 (PDT) Received: from unknown748F3CBA5068 (dynamic-2a02-3100-a133-e401-bc8e-d36c-2d08-c5e0.310.pool.telefonica.de. [2a02:3100:a133:e401:bc8e:d36c:2d08:c5e0]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4814a72cdb8sm1789573f8f.35.2026.08.10.23.59.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Aug 2026 23:59:32 -0700 (PDT) Date: Tue, 11 Aug 2026 08:59:30 +0200 From: Karl Mehltretter To: Andy Chiu Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Yong-Xuan Wang , Greentime Hu , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] riscv: vector: preserve state when scheduling at nonzero depth Message-ID: References: <20260806193241.10552-1-kmehltretter@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Aug 11, 2026 at 01:15:05PM +0100, Andy Chiu wrote: > > Since the problem only appears in the v4 series of the kvm fix, > triggering this bug on the current upstream may indicate that there are > some unclosed path that leads to the error. So it would be valuable if > you could provide the exact reproducer and base for us to investagate. Hi Andy, I first saw the warning during a syzkaller run while testing my KCOV series [1]. The exact test branch is: https://github.com/kmehltretter82/linux/tree/kcov-pause-v2 The following branch is based on clean v7.2-rc6. It has the stress source, syzkaller config/log, and warning report: https://github.com/kmehltretter82/linux/tree/riscv-vector-warning-repro The warning also happens on clean v7.2-rc6, so KCOV is not needed. I don't know if KCOV changes how often it happens. The syzkaller job had reproduce=false, so it did not save a minimized program or C reproducer. It got the warning after about 110k executions (116236 at the end of that cycle), with QEMU 2 CPUs and procs=4. On clean v7.2-rc6 (b9b3e33b70b7), the standalone stress test got 18 warnings with -smp 1 -icount shift=7. At normal TCG timing it got none. I did not see data corruption; all byte tests completed without mismatches. Your v5 patch 1 looks better for the switch-out change. Please consider my posted patch withdrawn. I am testing v5 with the same stress and syzkaller setups now. I also tried this possible switch-in guard. It got zero warnings in two stress runs, I am still testing it: @@ -392,6 +392,7 @@ static inline void __switch_to_vector(struct task_struct *prev, next->thread.riscv_v_flags &= ~RISCV_PREEMPT_V_IN_SCHEDULE; riscv_v_enable(); } else { + riscv_v_disable(); riscv_preempt_v_set_restore(next); } } else { [1] The KCOV pause series is five patches on v7.2-rc5: https://lore.kernel.org/r/20260724192122.73080-1-kmehltretter@gmail.com/ Thanks, Karl