Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp153747rdd; Mon, 8 Jan 2024 22:52:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IHs/QOkCucbgGXA0q8KtJ2ea9jkfa7YUfxyjp1oT12+JladQdzTAHb8ndr6YPrQu2lgIWv7 X-Received: by 2002:a05:6512:47b:b0:50e:3ed6:1c28 with SMTP id x27-20020a056512047b00b0050e3ed61c28mr1830091lfd.130.1704783141569; Mon, 08 Jan 2024 22:52:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704783141; cv=none; d=google.com; s=arc-20160816; b=TF1rzvRHO7VWfCTqsrpnD3adsFSDCKmP7eYWgj26kvtYQTeS5IPK1TevEM1D/1k6IJ J6CKHH42SMfAqv+lYrp5rcAcHQ6VGzBSldKVauXy1MWH8vEEcCoHhbhyAP8Qtt6BX1Uw P2AEXKH1s5h7kXGVaAchdbLDbfJNqc2ulFwKnnbSllTjOSV4701lc3+2T5dcINJAT4q7 wXK04M8wUerCQcZnxAV9UztCJu2iyBB9oGarJatfRfWLVO9fQ6Cq188caZwi1qgCjjig afSKKh1YlMoSbBwxLCfTyFhxDwnlfrepKWVVGdv21VcMje/zPZbYWjtoSQqDb2l5kDSR vobA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=5mzqKG0DL8XcT8u2MkMghd7ma48jcj9iRrNlw8gPa+o=; fh=5n5HGKyJVypQMHCUUV1E1JO2+hGvlJQKoWt5R60ja8s=; b=B5i/YDyGs7ySsmLVads4aLN8t+2KF0jQ3AEmu1TFa5yVapX8+Iv1ZCbRCRBAo38Q8v CVWGzIAHsoMlMe/E+GlWoZodx6fKNxEeggwEg0n4G6KBOWZmMWBHqxT3NtundMXxr4se q0rdb3+3XT6Ng+s0KUoJck+JaIeu2spTTqIyDPz/6FI6EBmzs9GgEy8d8Z85MdZoCy4k wQY10749R5spXArDPdKJfAXdWikX2d70sys/0YB//JMFBA6Std4f4vXHkSbHdtAJNI02 o9FBHnFWhsMvE2WUOqDrbU9Ry0an+rC/+rln8JGxAIFVwR9pwpVUby/RfBruv8N9QpGK R6TQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-20436-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20436-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id q19-20020a170906145300b00a26aaf93de6si537507ejc.108.2024.01.08.22.52.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 22:52:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-20436-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-20436-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20436-linux.lists.archive=gmail.com@vger.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 473EA1F2458B for ; Tue, 9 Jan 2024 06:52:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2AE1A8F52; Tue, 9 Jan 2024 06:52:15 +0000 (UTC) Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B2BB079E4 for ; Tue, 9 Jan 2024 06:52:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8AxCuoT7Zxl32IDAA--.6697S3; Tue, 09 Jan 2024 14:52:03 +0800 (CST) Received: from linux.localdomain (unknown [113.200.148.30]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Bxut0S7ZxlkI0IAA--.22849S2; Tue, 09 Jan 2024 14:52:02 +0800 (CST) From: Tiezhu Yang To: Huacai Chen Cc: loongarch@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH] LoongArch: Fix definition of ftrace_regs_set_instruction_pointer() Date: Tue, 9 Jan 2024 14:52:01 +0800 Message-ID: <20240109065201.11800-1-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.42.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:AQAAf8Bxut0S7ZxlkI0IAA--.22849S2 X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBj93XoWrZr17Jr18KrWrtr1fZw4rtFc_yoW8JF13pF ZrC3WkJFWUGFs7uF1jgF4rur1fJ395Cry09r1Ikw1ayrnxXw1q9FykKryqyFy5Jay8C342 g3WakwnIvFn8ZwcCm3ZEXasCq-sJn29KB7ZKAUJUUUU8529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUkFb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1Y6r17M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r106r15McIj6I8E87Iv 67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2 Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s02 6x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1Y6r17MIIYrxkI7VAKI48JMIIF0x vE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE 42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6x kF7I0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x07jUsqXUUUUU= The current definition of ftrace_regs_set_instruction_pointer() is wrong, obviously, this function is used to set instruction pointer, so it should call instruction_pointer_set() instead of regs_set_return_value(). There is no side effect by now because it is used for kernel livepatching which is not supported, fix it to avoid failure when testing livepatch in the future. Fixes: 6fbff14a6382 ("LoongArch: ftrace: Abstract DYNAMIC_FTRACE_WITH_ARGS accesses") Signed-off-by: Tiezhu Yang --- arch/loongarch/include/asm/ftrace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/loongarch/include/asm/ftrace.h b/arch/loongarch/include/asm/ftrace.h index a11996eb5892..de891c2c83d4 100644 --- a/arch/loongarch/include/asm/ftrace.h +++ b/arch/loongarch/include/asm/ftrace.h @@ -63,7 +63,7 @@ ftrace_regs_get_instruction_pointer(struct ftrace_regs *fregs) static __always_inline void ftrace_regs_set_instruction_pointer(struct ftrace_regs *fregs, unsigned long ip) { - regs_set_return_value(&fregs->regs, ip); + instruction_pointer_set(&fregs->regs, ip); } #define ftrace_regs_get_argument(fregs, n) \ -- 2.42.0