Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3C1E6C6FD1F for ; Tue, 14 Mar 2023 22:35:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Db5cG52br7mfokxs4Z+J71mpwEOb7qtDOrj9NtBQ9Ec=; b=pAKiwMZTE6j9Vi fmfaP4iZGFFXpyswOzGMy3dM4S8ZrK8CqrTgdCrqrgOU8LRDMeU7rkIr7IUIMQN4DaRApDgwCGyl7 JyEkeOuxDpS4Ei1/iwyDvObBvqdHVyyV2i55YQqoruZ1d0PInkQUtK0oxre3BuUAd3VpGiVhQxwNj QJbxMiDGx8DTZxz7VgXVqOnTOryKtDgth5nNKyMd8RosjJDeP3LKutf2MBq1+L7J2Y3gn12xKwhUK ZVkwPTxDgLDdI0B5L7hqZ/9Dk2ne2XbRKoKV8V1aleGsfzoz90b2iJUV1embhpA3hFtxrD7Nm4F0l LzrXOL/Pdd8UMXwHvvmQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pcDDt-00BhZt-2p; Tue, 14 Mar 2023 22:34:25 +0000 Received: from mail-il1-x129.google.com ([2607:f8b0:4864:20::129]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pcDDq-00BhYX-2A for linux-arm-kernel@lists.infradead.org; Tue, 14 Mar 2023 22:34:24 +0000 Received: by mail-il1-x129.google.com with SMTP id j6so4961027ilr.7 for ; Tue, 14 Mar 2023 15:34:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678833261; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=374APNrRzFfoX24IjvUj5K66ZZh+E1fIGDfFaDat7Mg=; b=Y6HjZaWuWCZ1Xud/vUNpBMLm8YzUqzLy5bcasUImhnK+H8/CsyTtb6m1OxS/45wAe2 7Dxd6lR10INLOUmSIZJHHCbG/44BPWSs2lz75pS6AmKn7WiTNa/fxMwe6o2tztGOUDJH 3thZqlWS9qCFGxRtPBSYRx3gmp3A2yxpRh/J8fdAvgb8FNIwaXR32Kl364C5nVK8CA/l 51YxzBlhmDZizjoPuhiSPCK+aWju/Oj0ggHqkyUDydc9rQE0OJ4T+/umz7PDNVFhTrX8 EcIS+wsVs3vQT/IBlKgawBlW6WYf4wjU1lMIG665/hF1CD6D5nFVzq0A3LRjq+J8qqXP 76+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678833261; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=374APNrRzFfoX24IjvUj5K66ZZh+E1fIGDfFaDat7Mg=; b=3+WmvX0a4j4j0dhlM/IXbU4VZrffJ3FOpekqbKeVhOAS7D6ZN4ELf52HaU7SHMw64g vtqTbFoose9PzUV/eri8Vu1/1ZW8EGbrtFG9hbLzRVYcyO+VeB3tggGd/iCXV3p/qb83 /Vkvyk5VirAu/YBXBkzREAqIQd/bTjgc8EH8VTkTsy+KW1k4CFLpSGp8Hrwi89R+WyQ6 KPmd2qx0t+3pb3TdA2ixX48o5I9tDPIUO5ZoL5ELt5t41fyXEo+82QN3lFr5hsC9vACF wX/HKZDhnpJ1st9wzyGK7jBkIB+WYk71B8x1p+yVcNsD5xTm0SuGuPHkZE1IQGiyJpuq /4zA== X-Gm-Message-State: AO0yUKXca6En0osAFhkNzvP/n9v32X6kpm3sf8o91kvnNDlkZYz68qYF msmeAcAZ120m5EnqBQbHsqE= X-Google-Smtp-Source: AK7set/qUmMHzQ39EW8/Zf1BNbs29pBjtQG016MwuLcl4nBw2n24S/G4G9US6bvViREfkMl2Gshjng== X-Received: by 2002:a05:6e02:551:b0:316:f71f:fa9b with SMTP id i17-20020a056e02055100b00316f71ffa9bmr3516873ils.16.1678833261072; Tue, 14 Mar 2023 15:34:21 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id p7-20020a92d287000000b00317954c39ddsm1130244ilp.84.2023.03.14.15.34.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Mar 2023 15:34:20 -0700 (PDT) Date: Tue, 14 Mar 2023 15:34:18 -0700 From: Guenter Roeck To: Ard Biesheuvel Cc: linux-arm-kernel@lists.infradead.org, linux@armlinux.org.uk, Frederic Weisbecker , Peter Zijlstra , Linus Walleij Subject: Re: [PATCH v2 0/3] ARM: vfp: Switch to C API to en/disable softirqs Message-ID: <12219d00-e11e-4995-b32c-e5359676c3e3@roeck-us.net> References: <20230314192756.217966-1-ardb@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230314192756.217966-1-ardb@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230314_153422_730883_BBBAF109 X-CRM114-Status: GOOD ( 19.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Mar 14, 2023 at 08:27:53PM +0100, Ard Biesheuvel wrote: > As it turns out, enabling or disabling softirqs from asm code is more > tricky than it looks. Simply bumping the associated bit in preempt_count > does the trick for uninstrumented kernels, but with lockdep or preempt > debug enabled, we really need to call the C versions, as replicating > their behavior in asm fully is intractible. > > So let's rework the existing code a little bit so we can interpose a > little C helper 'vfp_entry()' that disables softirqs before calling the > existing vfpstate handling code in asm. Re-enabling softirqs from asm > code is more straight-forward, as we can simply perform a tail call via > a C routine that is guaranteed to be callable as a function. > > Cc: Frederic Weisbecker > Cc: Guenter Roeck > Cc: Peter Zijlstra > Cc: Linus Walleij > Link: https://lore.kernel.org/all/ZBBYCSZUJOWBg1s8@localhost.localdomain/ > For the series: Tested-by: Guenter Roeck Series applied on top of v6.3-rc2. Tested with 300+ boot tests on all arm qemu machines in my test bed. Cross-check: Without this series, a warning backtrace is observed roughly once per ~20 boot attempts. Thanks, Guenter > Ard Biesheuvel (3): > ARM: vfp: Pass thread_info pointer to vfp_support_entry > ARM: vfp: Pass successful return address via register R3 > ARM: vfp: Fix broken softirq handling with instrumentation enabled > > arch/arm/include/asm/assembler.h | 13 --------- > arch/arm/vfp/entry.S | 17 ++--------- > arch/arm/vfp/vfphw.S | 30 +++++++++++--------- > arch/arm/vfp/vfpmodule.c | 27 ++++++++++++++---- > 4 files changed, 42 insertions(+), 45 deletions(-) > > -- > 2.39.2 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel