Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 232977
b: refs/heads/master
c: 57cdfdf
h: refs/heads/master
i:
  232975: c80321a
v: v3
  • Loading branch information
Anton Blanchard authored and Benjamin Herrenschmidt committed Feb 7, 2011
1 parent 833a30f commit 07fdbd0
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 429f4d8d20b91e4a6c239f951c06a56a6ac22957
refs/heads/master: 57cdfdf829a850a317425ed93c6a576c9ee6329c
37 changes: 37 additions & 0 deletions trunk/arch/powerpc/platforms/pseries/lpar.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,13 @@ EXPORT_SYMBOL(arch_free_page);
/* NB: reg/unreg are called while guarded with the tracepoints_mutex */
extern long hcall_tracepoint_refcount;

/*
* Since the tracing code might execute hcalls we need to guard against
* recursion. One example of this are spinlocks calling H_YIELD on
* shared processor partitions.
*/
static DEFINE_PER_CPU(unsigned int, hcall_trace_depth);

void hcall_tracepoint_regfunc(void)
{
hcall_tracepoint_refcount++;
Expand All @@ -725,12 +732,42 @@ void hcall_tracepoint_unregfunc(void)

void __trace_hcall_entry(unsigned long opcode, unsigned long *args)
{
unsigned long flags;
unsigned int *depth;

local_irq_save(flags);

depth = &__get_cpu_var(hcall_trace_depth);

if (*depth)
goto out;

(*depth)++;
trace_hcall_entry(opcode, args);
(*depth)--;

out:
local_irq_restore(flags);
}

void __trace_hcall_exit(long opcode, unsigned long retval,
unsigned long *retbuf)
{
unsigned long flags;
unsigned int *depth;

local_irq_save(flags);

depth = &__get_cpu_var(hcall_trace_depth);

if (*depth)
goto out;

(*depth)++;
trace_hcall_exit(opcode, retval, retbuf);
(*depth)--;

out:
local_irq_restore(flags);
}
#endif

0 comments on commit 07fdbd0

Please sign in to comment.