LKML Archive on lore.kernel.org
 help / Atom feed
* [PATCH] x86/vmware: Do not trace vmware_sched_clock()
@ 2018-11-09 20:22 Steven Rostedt
  2018-11-09 20:48 ` [tip:x86/urgent] x86/cpu/vmware: " tip-bot for Steven Rostedt (VMware)
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2018-11-09 20:22 UTC (permalink / raw)
  To: LKML
  Cc: Alok Kataria, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	H. Peter Anvin, x86, virtualization, GwanYeong Kim

From: Steven Rostedt (VMware) <rostedt@goodmis.org>

When running function tracing on a Linux guest running on VMware
Workstation, the guest would crash. This is due to tracing of the
sched_clock internal call of the VMware vmware_sched_clock(), which
causes an infinite recursion within the tracing code (clock calls must
not be traced).

Make vmware_sched_clock() not traced by ftrace.

Cc: stable@vger.kernel.org
Fixes: 80e9a4f21fd7c ("x86/vmware: Add paravirt sched clock")
Reported-by: GwanYeong Kim <gy741.kim@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index d9ab49bed8af..0eda91f8eeac 100644
--- a/arch/x86/kernel/cpu/vmware.c
+++ b/arch/x86/kernel/cpu/vmware.c
@@ -77,7 +77,7 @@ static __init int setup_vmw_sched_clock(char *s)
 }
 early_param("no-vmw-sched-clock", setup_vmw_sched_clock);
 
-static unsigned long long vmware_sched_clock(void)
+static unsigned long long notrace vmware_sched_clock(void)
 {
 	unsigned long long ns;
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [tip:x86/urgent] x86/cpu/vmware: Do not trace vmware_sched_clock()
  2018-11-09 20:22 [PATCH] x86/vmware: Do not trace vmware_sched_clock() Steven Rostedt
@ 2018-11-09 20:48 ` " tip-bot for Steven Rostedt (VMware)
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Steven Rostedt (VMware) @ 2018-11-09 20:48 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: mingo, bp, tglx, x86, akataria, hpa, gy741.kim, linux-kernel, rostedt

Commit-ID:  15035388439f892017d38b05214d3cda6578af64
Gitweb:     https://git.kernel.org/tip/15035388439f892017d38b05214d3cda6578af64
Author:     Steven Rostedt (VMware) <rostedt@goodmis.org>
AuthorDate: Fri, 9 Nov 2018 15:22:07 -0500
Committer:  Borislav Petkov <bp@suse.de>
CommitDate: Fri, 9 Nov 2018 21:39:14 +0100

x86/cpu/vmware: Do not trace vmware_sched_clock()

When running function tracing on a Linux guest running on VMware
Workstation, the guest would crash. This is due to tracing of the
sched_clock internal call of the VMware vmware_sched_clock(), which
causes an infinite recursion within the tracing code (clock calls must
not be traced).

Make vmware_sched_clock() not traced by ftrace.

Fixes: 80e9a4f21fd7c ("x86/vmware: Add paravirt sched clock")
Reported-by: GwanYeong Kim <gy741.kim@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
CC: Alok Kataria <akataria@vmware.com>
CC: GwanYeong Kim <gy741.kim@gmail.com>
CC: "H. Peter Anvin" <hpa@zytor.com>
CC: Ingo Molnar <mingo@kernel.org>
Cc: stable@vger.kernel.org
CC: Thomas Gleixner <tglx@linutronix.de>
CC: virtualization@lists.linux-foundation.org
CC: x86-ml <x86@kernel.org>
Link: http://lkml.kernel.org/r/20181109152207.4d3e7d70@gandalf.local.home
---
 arch/x86/kernel/cpu/vmware.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index d9ab49bed8af..0eda91f8eeac 100644
--- a/arch/x86/kernel/cpu/vmware.c
+++ b/arch/x86/kernel/cpu/vmware.c
@@ -77,7 +77,7 @@ static __init int setup_vmw_sched_clock(char *s)
 }
 early_param("no-vmw-sched-clock", setup_vmw_sched_clock);
 
-static unsigned long long vmware_sched_clock(void)
+static unsigned long long notrace vmware_sched_clock(void)
 {
 	unsigned long long ns;
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-09 20:22 [PATCH] x86/vmware: Do not trace vmware_sched_clock() Steven Rostedt
2018-11-09 20:48 ` [tip:x86/urgent] x86/cpu/vmware: " tip-bot for Steven Rostedt (VMware)

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org linux-kernel@archiver.kernel.org
	public-inbox-index lkml


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox