From nobody Sat Feb 7 22:01:51 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 888A2C7EE2F for ; Wed, 7 Jun 2023 01:36:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240457AbjFGBgE (ORCPT ); Tue, 6 Jun 2023 21:36:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240051AbjFGBgB (ORCPT ); Tue, 6 Jun 2023 21:36:01 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A57AC1984; Tue, 6 Jun 2023 18:36:00 -0700 (PDT) Received: by linux.microsoft.com (Postfix, from userid 1159) id 13CD120BE499; Tue, 6 Jun 2023 18:36:00 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 13CD120BE499 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1686101760; bh=lly0SJj2u+pRh0HVxmkj8xN/oGXK4TlaG54X0J3Z6HE=; h=From:To:Cc:Subject:Date:From; b=hcFpLQt8xaweFX7lTiSWlVfwW4Gk5GcMySVi/wWFvQc08LdkvrH8ByBM7jlkGv+Tv IWq2fqPUFKptd7xAZzLYv+qXNjExxzOh+88HTq45aoPmk0a7V1KMBqsGutphjChHop cXricizgrJP7e/eVua6ntgaK2hwemLbjESHTd+/M= From: Nischala Yelchuri To: linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Tyler Hicks , boqun.feng@gmail.com, "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Nischala Yelchuri , Nischala Yelchuri Subject: [PATCH] x86/hyperv: Trace hv_set_register() Date: Tue, 6 Jun 2023 18:35:57 -0700 Message-Id: <1686101757-23985-1-git-send-email-niyelchu@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add a new trace point trace_hyperv_set_register() to capture register address and its value in hv_set_register(). Signed-off-by: Nischala Yelchuri --- arch/x86/include/asm/trace/hyperv.h | 14 ++++++++++++++ arch/x86/kernel/cpu/mshyperv.c | 3 +++ 2 files changed, 17 insertions(+) diff --git a/arch/x86/include/asm/trace/hyperv.h b/arch/x86/include/asm/tra= ce/hyperv.h index a8e5a7a2b..54b2f69f5 100644 --- a/arch/x86/include/asm/trace/hyperv.h +++ b/arch/x86/include/asm/trace/hyperv.h @@ -86,6 +86,20 @@ TRACE_EVENT(hyperv_send_ipi_one, __entry->cpu, __entry->vector) ); =20 +TRACE_EVENT(hyperv_set_register, + TP_PROTO(unsigned int reg, + u64 value), + TP_ARGS(reg, value), + TP_STRUCT__entry( + __field(unsigned int, reg) + __field(u64, value) + ), + TP_fast_assign(__entry->reg =3D reg; + __entry->value =3D value; + ), + TP_printk("reg %u value %llu", + __entry->reg, __entry->value) + ); #endif /* CONFIG_HYPERV */ =20 #undef TRACE_INCLUDE_PATH diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c index c7969e806..d4ef63f4e 100644 --- a/arch/x86/kernel/cpu/mshyperv.c +++ b/arch/x86/kernel/cpu/mshyperv.c @@ -32,6 +32,7 @@ #include #include #include +#include =20 /* Is Linux running as the root partition? */ bool hv_root_partition; @@ -98,6 +99,8 @@ EXPORT_SYMBOL_GPL(hv_get_register); =20 void hv_set_register(unsigned int reg, u64 value) { + trace_hyperv_set_register(reg, value); + if (hv_nested) reg =3D hv_get_nested_reg(reg); =20 --=20 2.25.1