Commit 994dcf70 authored by Richard Henderson's avatar Richard Henderson Committed by Matt Turner

alpha: Notice if we're being run under QEMU

When building a generic kernel, do a run-time check on the serial
number, like we do for MILO.  When building a custom kernel, make
this a configure-time check.
Signed-off-by: default avatarRichard Henderson <rth@twiddle.net>
parent a47e5bb5
...@@ -488,6 +488,20 @@ config VGA_HOSE ...@@ -488,6 +488,20 @@ config VGA_HOSE
which always have multiple hoses, and whose consoles support it. which always have multiple hoses, and whose consoles support it.
config ALPHA_QEMU
bool "Run under QEMU emulation"
depends on !ALPHA_GENERIC
---help---
Assume the presence of special features supported by QEMU PALcode
that reduce the overhead of system emulation.
Generic kernels will auto-detect QEMU. But when building a
system-specific kernel, the assumption is that we want to
elimiate as many runtime tests as possible.
If unsure, say N.
config ALPHA_SRM config ALPHA_SRM
bool "Use SRM as bootloader" if ALPHA_CABRIOLET || ALPHA_AVANTI_CH || ALPHA_EB64P || ALPHA_PC164 || ALPHA_TAKARA || ALPHA_EB164 || ALPHA_ALCOR || ALPHA_MIATA || ALPHA_LX164 || ALPHA_SX164 || ALPHA_NAUTILUS || ALPHA_NONAME bool "Use SRM as bootloader" if ALPHA_CABRIOLET || ALPHA_AVANTI_CH || ALPHA_EB64P || ALPHA_PC164 || ALPHA_TAKARA || ALPHA_EB164 || ALPHA_ALCOR || ALPHA_MIATA || ALPHA_LX164 || ALPHA_SX164 || ALPHA_NAUTILUS || ALPHA_NONAME
depends on TTY depends on TTY
......
...@@ -126,13 +126,19 @@ extern struct alpha_machine_vector alpha_mv; ...@@ -126,13 +126,19 @@ extern struct alpha_machine_vector alpha_mv;
#ifdef CONFIG_ALPHA_GENERIC #ifdef CONFIG_ALPHA_GENERIC
extern int alpha_using_srm; extern int alpha_using_srm;
extern int alpha_using_qemu;
#else #else
#ifdef CONFIG_ALPHA_SRM # ifdef CONFIG_ALPHA_SRM
#define alpha_using_srm 1 # define alpha_using_srm 1
#else # else
#define alpha_using_srm 0 # define alpha_using_srm 0
#endif # endif
# ifdef CONFIG_ALPHA_QEMU
# define alpha_using_qemu 1
# else
# define alpha_using_qemu 0
# endif
#endif /* GENERIC */ #endif /* GENERIC */
#endif #endif /* __KERNEL__ */
#endif /* __ALPHA_MACHVEC_H */ #endif /* __ALPHA_MACHVEC_H */
...@@ -115,10 +115,17 @@ unsigned long alpha_agpgart_size = DEFAULT_AGP_APER_SIZE; ...@@ -115,10 +115,17 @@ unsigned long alpha_agpgart_size = DEFAULT_AGP_APER_SIZE;
#ifdef CONFIG_ALPHA_GENERIC #ifdef CONFIG_ALPHA_GENERIC
struct alpha_machine_vector alpha_mv; struct alpha_machine_vector alpha_mv;
#endif
#ifndef alpha_using_srm
int alpha_using_srm; int alpha_using_srm;
EXPORT_SYMBOL(alpha_using_srm); EXPORT_SYMBOL(alpha_using_srm);
#endif #endif
#ifndef alpha_using_qemu
int alpha_using_qemu;
#endif
static struct alpha_machine_vector *get_sysvec(unsigned long, unsigned long, static struct alpha_machine_vector *get_sysvec(unsigned long, unsigned long,
unsigned long); unsigned long);
static struct alpha_machine_vector *get_sysvec_byname(const char *); static struct alpha_machine_vector *get_sysvec_byname(const char *);
...@@ -529,11 +536,15 @@ setup_arch(char **cmdline_p) ...@@ -529,11 +536,15 @@ setup_arch(char **cmdline_p)
atomic_notifier_chain_register(&panic_notifier_list, atomic_notifier_chain_register(&panic_notifier_list,
&alpha_panic_block); &alpha_panic_block);
#ifdef CONFIG_ALPHA_GENERIC #ifndef alpha_using_srm
/* Assume that we've booted from SRM if we haven't booted from MILO. /* Assume that we've booted from SRM if we haven't booted from MILO.
Detect the later by looking for "MILO" in the system serial nr. */ Detect the later by looking for "MILO" in the system serial nr. */
alpha_using_srm = strncmp((const char *)hwrpb->ssn, "MILO", 4) != 0; alpha_using_srm = strncmp((const char *)hwrpb->ssn, "MILO", 4) != 0;
#endif #endif
#ifndef alpha_using_qemu
/* Similarly, look for QEMU. */
alpha_using_qemu = strstr((const char *)hwrpb->ssn, "QEMU") != 0;
#endif
/* If we are using SRM, we want to allow callbacks /* If we are using SRM, we want to allow callbacks
as early as possible, so do this NOW, and then as early as possible, so do this NOW, and then
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment