Received: by 2002:a05:7412:8d23:b0:f7:29d7:fb05 with SMTP id bj35csp162833rdb; Sat, 16 Dec 2023 04:15:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IF9645kp03c42pUI/gBxJV7bw48/GJiKpcYTx1MHYGuvrNg/KMwh+BZK3WbDwi5fAtAkL+D X-Received: by 2002:a05:6358:8a1:b0:170:c921:bf85 with SMTP id m33-20020a05635808a100b00170c921bf85mr14130478rwj.27.1702728927345; Sat, 16 Dec 2023 04:15:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702728927; cv=none; d=google.com; s=arc-20160816; b=UD6HhnwD++3PjfJPJG0zyZ6nI5bsGw/MTfp//osPd0yxCDdxXRFWSEXFHvVp5R0TiS TCinX6MmBScSbnEls68/c/krCW6DQmcnIGXKW0k/cYcacmzQGTOYO3zgWCfHrm7x6dBZ 6SSXc4skOzyWAqrn6/lMMHaWT+LGQLXreazP7bgst+kQePUMMsfu1bjCeaHfhh/WUY/y UOwcVrmnML9tib+igMLRUx+EOiYz2uT4St7GlC4RMlxpccrv3hn/NDjvouDCqGynqQhs LDV4uWaU67ChZ9SG4c0T/E0b7NhafqDPvYpzgxEugBF1ZKnD2qQcReuwkmxt2zDpO7PJ n/BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=MBhcItKpk1R5z8ORzCTOj2DBjbXW8czGaiUqgKj0uzM=; fh=Z9GEUkHmB3/zCnp9Skk9C9zhndt5rnIoDirsr6DiUbQ=; b=f3VENWXTsmPEwM5y3p8tut1JIILsZNEupaRjV8vNWgJiH8+F9FSFPL3gdL6Mbu7eg0 Pmke3kNIKqa5C2Y0DXPvNq6HMgVCj0/KVkiohX/RlBsyz3bxneTJkYt3oaeR0LlGVkZR BQnTARvgjwEJ1izMuynFWFNO8oimSON2zd6cuxCisCJS3UKWyw0APV3+XZlRAmG4z7aB KUsxirbwKI4Q8SL5Id8SlyYDCjTzMr/EUdQJmwc/aC6f2kTCxjyGeUpHWPxwXwa5hinR F6zwBpJ70jix/jPhlVb3DAHf0Fxwl0vWIe4xCIS2okp1Vo/AgROJ66/HJxaTJe93HnsI +y2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KXyXb0D3; spf=pass (google.com: domain of linux-kernel+bounces-2171-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2171-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id ci5-20020a17090afc8500b00286a2b05cb6si4530758pjb.145.2023.12.16.04.15.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 04:15:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2171-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KXyXb0D3; spf=pass (google.com: domain of linux-kernel+bounces-2171-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2171-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id EC9F7285095 for ; Sat, 16 Dec 2023 12:15:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7719B2375B; Sat, 16 Dec 2023 12:15:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KXyXb0D3" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB4C8219E6 for ; Sat, 16 Dec 2023 12:15:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2956AC433CA for ; Sat, 16 Dec 2023 12:15:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702728920; bh=sUJVttjrqMGG9GOfiJGUCFG16DGITEYxiE+dbAV/C5Y=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=KXyXb0D3HhTGd85YYa6TrddgdSi8TZOvYAHS8TbsA4kJGo1pKEbjqJxCo99Pbo/6V ogFlEg8oErZfA0De0+NUvMhAY36nosKo7vNOgvwaMqkpdATQdj867kYBVnYJjAMhLq 1O6kLtSmM7/hcc7p1TgaDAFf+LxvGbzrCZ7dFsmqMM6uHw+NKPkcEojYwvuacKD0lK T4dXiyNVB+1Rl8cZWtfmwI+qb4cclaZbTtCYv8/VysQo+HQpcNZAgZG1vSiJaEhXb3 dbdoOPC7FwsfOb7Gv4c43M0PALU0atuIOVszANrQcYLhKz5786Rd4I3nL3wpxvu/wY lwqGYGc3dKEfQ== Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-a1e35c2807fso176582466b.3 for ; Sat, 16 Dec 2023 04:15:20 -0800 (PST) X-Gm-Message-State: AOJu0YzIsB6X0a6nQ0heVQAeFJHSicw6yrHlByPvOXqF7efS5XYLTQVM zq3KOrZQWTZvFF0JHO9GEKTMHSgYJc2HWw0z/yM= X-Received: by 2002:a17:906:dfd0:b0:a19:a1ba:da41 with SMTP id jt16-20020a170906dfd000b00a19a1bada41mr7126350ejc.104.1702728918592; Sat, 16 Dec 2023 04:15:18 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: In-Reply-To: From: Huacai Chen Date: Sat, 16 Dec 2023 20:15:06 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] checkstack: Add loongarch support for scripts/checkstack.pl To: Youling Tang Cc: John Paul Adrian Glaubitz , Andrew Morton , linux-kernel@vger.kernel.org, Youling Tang Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Acked-by: Huacai Chen On Sat, Dec 16, 2023 at 2:48=E2=80=AFPM Youling Tang wrote: > > From: Youling Tang > > scripts/checkstack.pl lacks support for the loongarch architecture. Add > support to detect "addi.{w,d} $sp, $sp, -FRAME_SIZE" stack frame generati= on > instruction. > > Signed-off-by: Youling Tang > --- > scripts/checkstack.pl | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl > index f27d552aec43..e9d01b999b74 100755 > --- a/scripts/checkstack.pl > +++ b/scripts/checkstack.pl > @@ -16,6 +16,7 @@ > # sparc port by Martin Habets > # ppc64le port by Breno Leitao > # riscv port by Wadim Mueller > +# loongarch port by Youling Tang > # > # Usage: > # objdump -d vmlinux | scripts/checkstack.pl [arch] > @@ -104,6 +105,9 @@ my (@stack, $re, $dre, $sub, $x, $xs, $funcre, $min_s= tack); > } elsif ($arch =3D~ /^riscv(64)?$/) { > #ffffffff8036e868: c2010113 addi s= p,sp,-992 > $re =3D qr/.*addi.*sp,sp,-(([0-9]{2}|[3-9])[0-9]{2})/o; > + } elsif ($arch =3D~ /^loongarch(32|64)?$/) { > + #9000000000224708: 02ff4063 addi.d $= sp, $sp, -48(0xfd0) > + $re =3D qr/.*addi\..*sp, .*sp, -([0-9]{1,8}).*/o; > } else { > print("wrong or unknown architecture \"$arch\"\n"); > exit > -- > 2.40.0 >