aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-02-12 09:21:57 +0000
committerKeir Fraser <keir.fraser@citrix.com>2010-02-12 09:21:57 +0000
commitd652a9595460cfc81afeb66c17aef7adedfb9175 (patch)
treebcdfea3dfaa9779c0254ecdb163a1b2ecfd59156
parent98650e12c1241d6a72f6d3e6a4f8d16faaf9f9c5 (diff)
downloadxen-d652a9595460cfc81afeb66c17aef7adedfb9175.tar.gz
xen-d652a9595460cfc81afeb66c17aef7adedfb9175.tar.bz2
xen-d652a9595460cfc81afeb66c17aef7adedfb9175.zip
keyhandler: Do not serialise keyhandlers; increase scratch array size.
Although serialising keyhandlers is safer, and in particular protects access to shared heyhandler_scratch[], in debug scenarios it is probably better to 'have a go' when requested - and assume the user knows what they are doing. Meanwhile, increase scratch array size to 1024. That's enough for more than a dozen lines of 80-column text, and should be plenty in any practical situation. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
-rw-r--r--xen/common/keyhandler.c12
-rw-r--r--xen/include/xen/keyhandler.h2
2 files changed, 2 insertions, 12 deletions
diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c
index 78daf45a3d..e3e64a1953 100644
--- a/xen/common/keyhandler.c
+++ b/xen/common/keyhandler.c
@@ -20,7 +20,7 @@
static struct keyhandler *key_table[256];
static unsigned char keypress_key;
-char keyhandler_scratch[100];
+char keyhandler_scratch[1024];
static void keypress_action(unsigned long unused)
{
@@ -31,7 +31,6 @@ static DECLARE_TASKLET(keypress_tasklet, keypress_action, 0);
void handle_keypress(unsigned char key, struct cpu_user_regs *regs)
{
- static bool_t executing_handler;
struct keyhandler *h;
if ( (h = key_table[key]) == NULL )
@@ -39,18 +38,9 @@ void handle_keypress(unsigned char key, struct cpu_user_regs *regs)
if ( !in_irq() || h->irq_callback )
{
- /*
- * No concurrent handler execution: prevents garbled console and
- * protects keyhandler_scratch[].
- */
- if ( test_and_set_bool(executing_handler) )
- return;
- wmb();
console_start_log_everything();
h->irq_callback ? (*h->u.irq_fn)(key, regs) : (*h->u.fn)(key);
console_end_log_everything();
- wmb();
- executing_handler = 0;
}
else
{
diff --git a/xen/include/xen/keyhandler.h b/xen/include/xen/keyhandler.h
index 1670d7d7f9..d3ab0a90fd 100644
--- a/xen/include/xen/keyhandler.h
+++ b/xen/include/xen/keyhandler.h
@@ -53,6 +53,6 @@ extern void register_keyhandler(unsigned char key, struct keyhandler *handler);
extern void handle_keypress(unsigned char key, struct cpu_user_regs *regs);
/* Scratch space is available for use of any keyhandler. */
-extern char keyhandler_scratch[100];
+extern char keyhandler_scratch[1024];
#endif /* __XEN_KEYHANDLER_H__ */