Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp359454iog; Wed, 15 Jun 2022 03:52:27 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sMpiXGadDMHVwwyKoawLPjf/f8SWYui/2JcM5xOhWve2LaWUyrdZtdlKBN2jKVlFez89G/ X-Received: by 2002:a17:902:a704:b0:168:f037:98cd with SMTP id w4-20020a170902a70400b00168f03798cdmr6324416plq.87.1655290347425; Wed, 15 Jun 2022 03:52:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655290347; cv=none; d=google.com; s=arc-20160816; b=SWhxKvzxPI5+ZJRGohTwf29ZfT8hkEH5t5f2O7HQWtqkqJ+rMKqESZYToy9E62x56z MG33BefBpEbn1Bro6BtzTwMZ+K77jq8TF8afXn3P2D0+vrt1XYQtbzs4RgHojJHiIKL3 xtsmEC9rZiAXqPKerGehhxcoOsMKD1PSYlqUnrtsbpP5+/J1Mt5rtE/XHQaoBHdjGPTF vX1CXQwYGexBSGHYYtk68qqUWuXxsiuauc+C94Ul17XZYw/Q3qRS3OI3y1wvrlmhcN7r HlOkSSSn9grQD66CRzamhCG5JmPkbKOXkx5/8aECT6YoD76FpWwLQm9g0gb2Xm0yZycz z74g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=pRwx9+EmzPQUQmqgCk5xRKcoyDR23NWrUBfKcLtGYds=; b=k9dowk8AxjRAnbbheXuvSEOsoAUxGrChDHksSYrsciMxYeHsnW9xYtxXWZYVonW5g4 jNqy3DP883rCrjz2zqnQNyeqICigBG/uEJEuDUHn5z54t8+hdjidCCMLJSPKYxsenEdh LWuhK/2b4eAxylykWioDabQvsmJ1roNBmCd9slcc06H8lEQDfN72nFg78VNPVd0qyYlj vRwj6tQIBODfFCs12MDdp8gVneC9RcH819x90NKkeecnzf4CdPofyGHVJdQ3moSbz+E2 AFHB+xpsvySRUKVgzjCtx7nDmGpCFncRmMJBzdet/dsdC3uWaXjNHFqEXJbHSd7zVA6k oa0Q== ARC-Authentication-Results: i=1; mx.google.com; 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 fu2-20020a17090ad18200b001e3080992c2si1914659pjb.52.2022.06.15.03.52.15; Wed, 15 Jun 2022 03:52:27 -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; 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 S1347673AbiFOKaZ (ORCPT + 99 others); Wed, 15 Jun 2022 06:30:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347675AbiFOK3j (ORCPT ); Wed, 15 Jun 2022 06:29:39 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3FE4D4B87F for ; Wed, 15 Jun 2022 03:29:37 -0700 (PDT) Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Dxr9+NtKliy5VDAA--.20939S3; Wed, 15 Jun 2022 18:29:35 +0800 (CST) From: Tiezhu Yang To: Huacai Chen , WANG Xuerui Cc: Xuefeng Li , Jianmin Lv , Jun Yi , Rui Wang , linux-kernel@vger.kernel.org Subject: [RFC PATCH v3 1/3] LoongArch: Add TI_SYSCALL in output_thread_info_defines() Date: Wed, 15 Jun 2022 18:29:31 +0800 Message-Id: <1655288973-6066-2-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1655288973-6066-1-git-send-email-yangtiezhu@loongson.cn> References: <1655288973-6066-1-git-send-email-yangtiezhu@loongson.cn> X-CM-TRANSID: AQAAf9Dxr9+NtKliy5VDAA--.20939S3 X-Coremail-Antispam: 1UD129KBjvdXoW7Wr48Ww17Wr4fKr43tr4fKrg_yoWkWwc_Xr nrGwn8GFW8JrWIq3Wqyw4fXr4jya4vkFyrXFZ7CrWxt3WDtry5Jr4rZ348CrykKrWkGrs8 C3ykW3Wkur1jkjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbSkFF20E14v26r4j6ryUM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28IrcIa0xkI8VA2jI8067AKxVWUGwA2048vs2IY02 0Ec7CjxVAFwI0_JFI_Gr1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVW5JVW7JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVWxJVW8Jr1l84 ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I2 62IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcV AFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r4j6F4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG 0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lc2xSY4AK67AK6r4DMxAIw28Icx kI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2Iq xVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42 IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY 6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aV CY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7VUjq-eDUUUUU== X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, 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: X-Mailing-List: linux-kernel@vger.kernel.org The initial idea was to store the syscall number in PT_R11, and then we can get the syscall number from PT_R11 to check before SAVE and RESTORE in handle_syscall, but PT_R11 may be overwritten by the signal handler and the syscall number is lost. Add TI_SYSCALL in output_thread_info_defines(), then we can store the syscall number in TI_SYSCALL. This is preparation for later patch. Signed-off-by: Tiezhu Yang --- arch/loongarch/kernel/asm-offsets.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/loongarch/kernel/asm-offsets.c b/arch/loongarch/kernel/asm-offsets.c index bfb65eb..4757ebe 100644 --- a/arch/loongarch/kernel/asm-offsets.c +++ b/arch/loongarch/kernel/asm-offsets.c @@ -81,6 +81,7 @@ void output_thread_info_defines(void) OFFSET(TI_CPU, thread_info, cpu); OFFSET(TI_PRE_COUNT, thread_info, preempt_count); OFFSET(TI_REGS, thread_info, regs); + OFFSET(TI_SYSCALL, thread_info, syscall); DEFINE(_THREAD_SIZE, THREAD_SIZE); DEFINE(_THREAD_MASK, THREAD_MASK); DEFINE(_IRQ_STACK_SIZE, IRQ_STACK_SIZE); -- 2.1.0