Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8585368rwb; Thu, 24 Nov 2022 01:20:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf7Y7Ccx/BKCi8N/72DNojOQ9zdVEQSliMptVcTTsTGTlmFHLcd/3NwroR/XzccR/mqMM8a0 X-Received: by 2002:a05:6402:c6:b0:468:3d69:ace0 with SMTP id i6-20020a05640200c600b004683d69ace0mr11947655edu.356.1669281608190; Thu, 24 Nov 2022 01:20:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669281608; cv=none; d=google.com; s=arc-20160816; b=s3DyPy8WnVoobzideNr/miPZ1AGTyXaxRhGOXq8gMli3nhXp8FppcQ4IiWUGMtaB6x MTbvIypTUBjUwFhPn33rdGIh0w4ptyw/hstbFUtqqjvLXFFWlqkGbgYFDv31X9ryPVMG 7wD0vb94uRskxB5fJLygZHv5t039pcTyk22EuHCd183mUm2yuVbMVDw1j7bZU8fwk/jh T3vvCLh8OPASCOsRO0cVLqGyJ9N+MtTXumVyspShpaK82gsAtYEyE/V36BGN5QarggZ7 NCEVwCzxRs5mNUZHCUdb+K7Mi7nEHBdmxLdbPHtHcg0zOpACVXfevqtTQz9ehE1SkyAA MheA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=d7AMntFoCTbaF7u0FxUzgKfkJmKiQktIj1df1EHq8pU=; b=JuIVJzU9qEkpr2nS0tBlJ/IhtqdH2CJXq/BM1LsOPA0QgQYataDAUBzz0CvP+Z/yqa OR4hZkA2iJgAFFC22E5/CxI3hzNdaLpct3jTJJaGncNxHqgVBw2AW6b8NW/gc9PpKnVB FbfGBUAsP4EgwFKMiaqyO9h1U1wIcWCP1l7ob9XoZwrdhqSHAfhYtqLIeCgM05pUBhLL gcStIgaYLl7Jt5InKSPvTpGhoLYwGXF4wfu11F6XuRlMd9UMenX8cAcZseYQwzkUFtrX NjzdVwrdJw0qKRyj49eHcGDI+SbTHNu0hymYANoz17qqeFUH+eDgrI+pNTXPxiTmsALo 7LPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=1S2l4+ow; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o14-20020a170906974e00b007ba9c086b05si567558ejy.497.2022.11.24.01.19.46; Thu, 24 Nov 2022 01:20:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=1S2l4+ow; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229662AbiKXJKW (ORCPT + 87 others); Thu, 24 Nov 2022 04:10:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229939AbiKXJKJ (ORCPT ); Thu, 24 Nov 2022 04:10:09 -0500 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43E39C4C34 for ; Thu, 24 Nov 2022 01:10:09 -0800 (PST) Received: by mail-pl1-x633.google.com with SMTP id d6so947276pll.7 for ; Thu, 24 Nov 2022 01:10:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=d7AMntFoCTbaF7u0FxUzgKfkJmKiQktIj1df1EHq8pU=; b=1S2l4+owYsD6IrHxF9YOfpJi6VcRr1zuzHv5hwjzVJx8ggKZZcYCuJfFtrBEYkJ4J9 1UAsRy1WzWayp7b4qCwbAFAzggFuBtbpP9VfjPbfyas20VgiSPDK20VjlBYKjarAUhG2 9eEzUAHlB55RHaQTSlbuJkfagGnuMQ87x98O2FIiOiaQ2jsiTY4di26D9ChmnEA8Y246 8R+gMXRQqAQ3kzV9Y93rNP0yyt4MZ+rSvhKg4qqMwBmVxChrFAR2/X9j4NYPZHlTBC/Z G6ggEPtVNmVFBULxaDTHw8fMQhGUp/V/Gxc0ffu7+6oLqFFFw/Bhztw+NugmxMLkYOdG rFBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=d7AMntFoCTbaF7u0FxUzgKfkJmKiQktIj1df1EHq8pU=; b=rXbvglPUMFlpQtru3otRWr+vU0MUqI3tXYe5WnyUD264v6cMdiTOwf/jqTgvSKNWJj 5aOGpJGILuKRWx/MxN5BEax/OrFDmACy9F8gMXwEALb1qMxQOU05ruuy+EQH1dr3AX13 p+oHAYySBxvNwTqECJC3Qk/znPJqgs1g7s9hy4csiKLJLMf67OqGGP8Sya+nYGMEo+E2 KB6NkW2zo4J77gVqjoOcRZElMEDOr1gi5T7iyeDO2XK1USurU4l1uLXmkpOYK/NYofVJ JEOBYviGuVlTei7Qyts0mHagTcQhGAS0p37bOtAVMfpGZNpmKiSG8LDVwWfO/yQ0H4I0 9Q3A== X-Gm-Message-State: ANoB5pmq4nKcP0UByiw3pZfUrVnuhrtxBD7VktXKzdo5DMPuuJMQS9wE I90p4A7uxQTlan4wbfkLSyUxVQ== X-Received: by 2002:a17:90a:5909:b0:214:291f:87b5 with SMTP id k9-20020a17090a590900b00214291f87b5mr34624200pji.115.1669281008755; Thu, 24 Nov 2022 01:10:08 -0800 (PST) Received: from debug.ba.rivosinc.com ([66.220.2.162]) by smtp.gmail.com with ESMTPSA id 22-20020a621616000000b0053e468a78a8sm672742pfw.158.2022.11.24.01.10.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Nov 2022 01:10:08 -0800 (PST) Date: Thu, 24 Nov 2022 01:10:06 -0800 From: Deepak Gupta To: Conor Dooley Cc: Guo Ren , palmer@dabbelt.com, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, paul.walmsley@sifive.com, Jisheng Zhang Subject: Re: [PATCH] riscv: VMAP_STACK overflow detection thread-safe Message-ID: <20221124091006.GC1896875@debug.ba.rivosinc.com> References: <20221124005006.1788315-1-debug@rivosinc.com> <20221124071022.GA1149630@debug.ba.rivosinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 24, 2022 at 08:59:32AM +0000, Conor Dooley wrote: >On Wed, Nov 23, 2022 at 11:10:22PM -0800, Deepak Gupta wrote: >> On Thu, Nov 24, 2022 at 02:31:25PM +0800, Guo Ren wrote: >> > On Thu, Nov 24, 2022 at 1:57 PM Deepak Gupta wrote: > >> > > On Wed, Nov 23, 2022 at 5:28 PM Guo Ren wrote: > >> > > > On Thu, Nov 24, 2022 at 8:50 AM Deepak Gupta wrote: > >> > > >> Fixes: 31da94c25aea835ceac00575a9fd206c5a833fed >> > > > >> > > > The patch gives more significant change than the Fixes, and Fixes would expand to the previous stable versions. Please don't set it as a Fixes, but an improved OVERSTACK dead path performance feature. >> > > > >> > > >> > > Not a performance feature but more like correctness. >> > > If kernel died and two CPUs raced to kernel stack overflow, >> > > death post-mortem should be straightforward. >> > We already have had a fixup, and your patch likes a feature with a >> > significant change. >> > https://lore.kernel.org/linux-riscv/20221030124517.2370-1-jszhang@kernel.org/ >> > If it is for correctness, the simple lock is enough. >> >> Sure lock is enough. It's different way to solve the problem. But I don't >> think it qualifies as significant change. > >Something to bear in mind is where in the cycle we are - there's likely >just over a week left before v6.1. >Since the lock is sufficient to fix the problem for v6.1, it's easy to >view this patch as an optimisation or improvement that should go on top >of that, smaller, patch. >Especially when you have some questions yourself about the correctness >for 32 bit! Yes I'll have to revise the patch to accomodate 32bit. >I've got no technical comment to make about the discussion here, but >looking in from the "outside", that's the easy conclusion to jump to. > > >> REG_S x31, TASK_TI_SPILL_REG(tp) >> asm_per_cpu sp, overflow_stack, x31 >> li x31, OVERFLOW_STACK_SIZE >> add sp, sp, x31 >> REG_L x31, TASK_TI_SPILL_REG(tp) > >btw, for this sort of thing, could you please use some whitespace to >align the operands? Makes things significantly more readable. > Noted. I'll do that. >Thanks, >Conor. >