Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2684926iof; Wed, 8 Jun 2022 09:53:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlNpnUK+tTcEbgsZZc/dS4W6/+X7bwtkWDjROxYg32VYMqCFMbB/TwNUZIwbe3Axj4cJtI X-Received: by 2002:a17:90b:3b4c:b0:1e8:5e4d:ed83 with SMTP id ot12-20020a17090b3b4c00b001e85e4ded83mr119567pjb.19.1654707185880; Wed, 08 Jun 2022 09:53:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654707185; cv=none; d=google.com; s=arc-20160816; b=BP4YqUJkSOjA4owmVxBeEJXfY9coc5n4ZhqnFwzYreLQ117SjkbA+OBU0we/Bft1G3 Uo9PgfW1TVyGTJqs77LRXYqgiuKDqewjH2CZw52zDjWbMgEyv6CJcZzV6mBl0MNWdsWc p2z8K3XSzUuVckM/a8WnPjiT9Rkj4o5VpnDimGViqjb+Y+q+AXRcU5zLYgaNyso+PpNf wJL4ighFOhVkGVue9IFX3HmcaH7PJHaJ2I6U8jWXdrixsHRXnZv0jtp3YA53wnSNxMUQ ZGyipz50A46FsrZUbzbx67eyCKYFZl4agc2MgtchQ2/FDDw1iL20cQroC9m48qRZCbP0 ZMdQ== 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:dkim-filter; bh=5IubNmv2NULJZ2ZnKWCXIaqVZ3j/e0L6iFydn2hpb6Y=; b=1HUOFloTfBzRXzz60EyYigPrUKYCfzwmrytFHqLHSnekwLStOTMScaABToH8HcHfyk QYIu2oeawiKi0w7TKp5Nr8t2JNKvcfxkdwN+Cn45drZyQC7Liy+qOPo19s7NVjbl9e0z 7h4QMv3RSBG/C7rSGUoSQeek01U1/OvjNOtSH/zqaZzyKLjgzskG6/k31jzqHln74RwR xvkv0yGkfLNRsdFNmOrnNXISUI3lCLA/D3pwkyfshdhTjk35vbH/zCg9/NSf6KTGha9X Z/lWQvRONYamePhkouAHS4NaNB1FediHDqgA6jkYw4kqeFV/fHTmJ9yYE/M/Dmqs/0K9 sdmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=pDNkcnRs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id ca11-20020a056a00418b00b0051b98c3d62asi151355pfb.233.2022.06.08.09.52.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 09:53:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=pDNkcnRs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2E6771F5E18; Wed, 8 Jun 2022 09:25:37 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245412AbiFHQZZ (ORCPT + 99 others); Wed, 8 Jun 2022 12:25:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245441AbiFHQZV (ORCPT ); Wed, 8 Jun 2022 12:25:21 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 33C9E1D30D9; Wed, 8 Jun 2022 09:25:13 -0700 (PDT) Received: from pwmachine.home (154.pool92-186-13.dynamic.orange.es [92.186.13.154]) by linux.microsoft.com (Postfix) with ESMTPSA id 4ECC120BE646; Wed, 8 Jun 2022 09:25:09 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 4ECC120BE646 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1654705512; bh=5IubNmv2NULJZ2ZnKWCXIaqVZ3j/e0L6iFydn2hpb6Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pDNkcnRsjTZYtoKoHS3vnsqKz/PHyBxHlf1KrDBckmo+aYFG4R0QBmFchkXwwESap OzVZPluc99tUgKQ3xE4H4zqSvDucir5wUoBUcYm7rOHCTeM9R7mUWwOPEYQFH9eSs4 /yaLTgJX0tfjvDASBT0mFjGNqgJNP67BqTudSwLg= From: Francis Laniel To: linux-trace-devel@vger.kernel.org Cc: James Morse , Daniel Kiss , Francis Laniel , Catalin Marinas , Will Deacon , Mark Brown , Peter Collingbourne , Kees Cook , Mark Rutland , Christophe Leroy , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/1] arm64: Do not forget syscall when starting a new thread. Date: Wed, 8 Jun 2022 17:24:46 +0100 Message-Id: <20220608162447.666494-2-flaniel@linux.microsoft.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220608162447.666494-1-flaniel@linux.microsoft.com> References: <20220608162447.666494-1-flaniel@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no 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 This patch enables exeve*() to be traced with syscalls:sys_exit_execve tracepoint. Previous to it, by calling forget_syscall(), this tracepoint would not print its information as syscall is -1. So, this patch removes call to forget_syscall() and set regs->syscallno to its previous value. Signed-off-by: Francis Laniel --- arch/arm64/include/asm/processor.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h index 9e58749db21d..86eb0bfe3b38 100644 --- a/arch/arm64/include/asm/processor.h +++ b/arch/arm64/include/asm/processor.h @@ -272,8 +272,9 @@ void tls_preserve_current_state(void); static inline void start_thread_common(struct pt_regs *regs, unsigned long pc) { + s32 previous_syscall = regs->syscallno; memset(regs, 0, sizeof(*regs)); - forget_syscall(regs); + regs->syscallno = previous_syscall; regs->pc = pc; if (system_uses_irq_prio_masking()) -- 2.25.1