Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bd4352ca authored by David S. Miller's avatar David S. Miller
Browse files

sparc64: Fix bootup with mcount in some configs.



Functions invoked early when booting up a cpu can't use
tracing because mcount requires a valid 'current_thread_info()'
and TLB mappings to be setup.

The code path of sun4v_register_mondo_queues --> register_one_mondo
is one such case.  sun4v_register_mondo_queues already has the
necessary 'notrace' annotation, but register_one_mondo does not.

Normally register_one_mondo is inlined so the bug doesn't trigger,
but with some config/compiler combinations, it won't be so we
must properly mark it notrace.

While we're here, add 'notrace' annoations to prom_printf and
prom_halt so that early error handling won't have the same problem.

Reported-by: default avatarAlexander Beregalov <a.beregalov@gmail.com>
Reported-by: default avatarLeif Sawyer <lsawyer@gci.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e6617c6e
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -886,7 +886,7 @@ void notrace init_irqwork_curcpu(void)
 * Therefore you cannot make any OBP calls, not even prom_printf,
 * Therefore you cannot make any OBP calls, not even prom_printf,
 * from these two routines.
 * from these two routines.
 */
 */
static void __cpuinit register_one_mondo(unsigned long paddr, unsigned long type, unsigned long qmask)
static void __cpuinit notrace register_one_mondo(unsigned long paddr, unsigned long type, unsigned long qmask)
{
{
	unsigned long num_entries = (qmask + 1) / 64;
	unsigned long num_entries = (qmask + 1) / 64;
	unsigned long status;
	unsigned long status;
+1 −1
Original line number Original line Diff line number Diff line
@@ -88,7 +88,7 @@ void prom_cmdline(void)
/* Drop into the prom, but completely terminate the program.
/* Drop into the prom, but completely terminate the program.
 * No chance of continuing.
 * No chance of continuing.
 */
 */
void prom_halt(void)
void notrace prom_halt(void)
{
{
#ifdef CONFIG_SUN_LDOMS
#ifdef CONFIG_SUN_LDOMS
	if (ldom_domaining_enabled)
	if (ldom_domaining_enabled)
+3 −4
Original line number Original line Diff line number Diff line
@@ -14,14 +14,14 @@
 */
 */


#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/compiler.h>


#include <asm/openprom.h>
#include <asm/openprom.h>
#include <asm/oplib.h>
#include <asm/oplib.h>


static char ppbuf[1024];
static char ppbuf[1024];


void
void notrace prom_write(const char *buf, unsigned int n)
prom_write(const char *buf, unsigned int n)
{
{
	char ch;
	char ch;


@@ -33,8 +33,7 @@ prom_write(const char *buf, unsigned int n)
	}
	}
}
}


void
void notrace prom_printf(const char *fmt, ...)
prom_printf(const char *fmt, ...)
{
{
	va_list args;
	va_list args;
	int i;
	int i;