Message ID | 20230715134552.3437933-3-guoren@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp190761vqt; Sat, 15 Jul 2023 07:14:01 -0700 (PDT) X-Google-Smtp-Source: APBJJlEmhVGCcLQILi6xRD5g/TxRU2elUGZCzi+ybOY/+rFL0Dp2vFLS8eCvAkmSqzFz2/nESktw X-Received: by 2002:aa7:ca52:0:b0:51d:d48b:9978 with SMTP id j18-20020aa7ca52000000b0051dd48b9978mr6768001edt.8.1689430441584; Sat, 15 Jul 2023 07:14:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689430441; cv=none; d=google.com; s=arc-20160816; b=gJn7Hn5zCoDyL3ySD+7uXiekPmw/huD796DL0wala9cO+mAToCtSOpYfZ2V5AuNAEn F/vwf/S2o1ihtM9dHueuc/3Iscj5F/GpP22T+63vKWI/dDOvNT/DVHrhBkXiABycG6ee +awtLzfCAfiqBU0RPhZc+yfnMaR/9Ld7EQNpzw/RHab9KiUnHjRmYD3/wpIU6rNeU8zS sR4l5CevJIyHSpxn/vQAcmcGZoPgRMNXvQIrI7Zn7ddXbzti9D3Bm7unfjHGCypZcJ5G mqeYvjxLePZsu0xeEQtlESOv4uas86y4t1UPir/3VoNVdKKIYZvlDPkMfz5PQ4bGbtA1 J2yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mkw/sWUCTUeVqIiGeF9dtQ+N2gFHsEtDYBtcLVzZgRg=; fh=uKQNkDNGEjgoOgJohgoIcWSeHNL9bR/V2EX+gA7xVIA=; b=RTn5Nu1Yq5Qg5yKvEJBIRaVQNYlZV5rxSLk3qmbE5KMEcQ+z1PLkVM0nIh2DIq7yzG x156bwdqXnPphV2qCyjj3eAa5P0eUEV+xBkhgYI2qBJG1GQ1ZJxmZZtUDIhGXxPO2uZR N8AfDVrpOkeZeHxD14rJiLV38MrHGO1WUUFMV1vgERdhpyjqbpbCR9U0nyqfSh9RdWXv Dzeg5jdUByB71AJom7xG3EExfe3mwPJszye3LsBJiKAgGj86NZPil8/e4yKkmSoaZGi9 l7LDDoMTleuL6QxQKnpzpMiunpgXOTnPkrCJGvpUt8n1ymuxJzwRt+zMxLB0D9oJciQs A/jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Fm0oc6lW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r21-20020aa7d155000000b0051a53f2684fsi9799748edo.576.2023.07.15.07.13.38; Sat, 15 Jul 2023 07:14:01 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=Fm0oc6lW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229579AbjGONqL (ORCPT <rfc822;hadasmailinglist@gmail.com> + 99 others); Sat, 15 Jul 2023 09:46:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230085AbjGONqI (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 15 Jul 2023 09:46:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8494F272E; Sat, 15 Jul 2023 06:46:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 22FDE60B90; Sat, 15 Jul 2023 13:46:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 599C9C433C8; Sat, 15 Jul 2023 13:46:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689428766; bh=5Cj0j9UWyUaETtgL5LyQbqXPc4UA8/eObpiQ76X05+8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fm0oc6lWCT5MelpphlfjhdZRrCN5+d4LlZp1oQisAglJQ/GOzE3y3raTn0CObGvUv PM3P+w8GGiGg+RJjCdzEOAaeIdBFTgVBt0Q2lZHq4PRBZcujhOrs1Kviq+oj28H0Bm 9V3uKgTVL4HLQCzsw+gqYCrWuzcGBZkDwiFDT/KzBQ/xF+v8KHgY5kPA0IRqmsY2r0 VSzTS9t3ov/D1UxzyinJKA0sXCkzilbu78Y1f8Jzsu+9LEvwblOHzIOh/n59pkZkv0 EpvGrThNK/ZRus8wqr5XBY+XfSm6vH87T90iWmP6wYi28RFqP6UUmpGc7RNxaqN53D LMYS+cM6p6hUQ== From: guoren@kernel.org To: guoren@kernel.org, palmer@rivosinc.com, paul.walmsley@sifive.com, falcon@tinylab.org, bjorn@kernel.org, conor.dooley@microchip.com Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, stable@vger.kernel.org, Guo Ren <guoren@linux.alibaba.com> Subject: [PATCH 2/2] riscv: stack: Fixup independent softirq stack for CONFIG_FRAME_POINTER=n Date: Sat, 15 Jul 2023 09:45:52 -0400 Message-Id: <20230715134552.3437933-3-guoren@kernel.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20230715134552.3437933-1-guoren@kernel.org> References: <20230715134552.3437933-1-guoren@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771496214929186777 X-GMAIL-MSGID: 1771496214929186777 |
Series |
riscv: stack: Fixup independent softirq/irq stack for CONFIG_FRAME_POINTER=n
|
|
Commit Message
Guo Ren
July 15, 2023, 1:45 p.m. UTC
From: Guo Ren <guoren@linux.alibaba.com> The independent softirq stack uses s0 to save & restore sp, but s0 would be corrupted when CONFIG_FRAME_POINTER=n. So add s0 in the clobber list to fix the problem. Fixes: dd69d07a5a6c ("riscv: stack: Support HAVE_SOFTIRQ_ON_OWN_STACK") Reported-by: Zhangjin Wu <falcon@tinylab.org> Signed-off-by: Guo Ren <guoren@linux.alibaba.com> Signed-off-by: Guo Ren <guoren@kernel.org> --- arch/riscv/kernel/irq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Sat, Jul 15, 2023 at 09:45:52AM -0400, guoren@kernel.org wrote: > From: Guo Ren <guoren@linux.alibaba.com> > > The independent softirq stack uses s0 to save & restore sp, but s0 would > be corrupted when CONFIG_FRAME_POINTER=n. So add s0 in the clobber list > to fix the problem. > > Fixes: dd69d07a5a6c ("riscv: stack: Support HAVE_SOFTIRQ_ON_OWN_STACK") > Reported-by: Zhangjin Wu <falcon@tinylab.org> > Signed-off-by: Guo Ren <guoren@linux.alibaba.com> > Signed-off-by: Guo Ren <guoren@kernel.org> > --- > arch/riscv/kernel/irq.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/riscv/kernel/irq.c b/arch/riscv/kernel/irq.c > index d0577cc6a081..0b58720109db 100644 > --- a/arch/riscv/kernel/irq.c > +++ b/arch/riscv/kernel/irq.c > @@ -83,7 +83,7 @@ void do_softirq_own_stack(void) > : > : [sp] "r" (sp) > : "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", > - "t0", "t1", "t2", "t3", "t4", "t5", "t6", > + "t0", "t1", "t2", "t3", "t4", "t5", "t6", "s0", > "memory"); > } else > #endif > -- > 2.36.1 > <formletter> This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read: https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html for how to do this properly. </formletter>
diff --git a/arch/riscv/kernel/irq.c b/arch/riscv/kernel/irq.c index d0577cc6a081..0b58720109db 100644 --- a/arch/riscv/kernel/irq.c +++ b/arch/riscv/kernel/irq.c @@ -83,7 +83,7 @@ void do_softirq_own_stack(void) : : [sp] "r" (sp) : "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", - "t0", "t1", "t2", "t3", "t4", "t5", "t6", + "t0", "t1", "t2", "t3", "t4", "t5", "t6", "s0", "memory"); } else #endif