diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-11-05 13:58:07 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-11-05 13:58:07 -0500 |
| commit | 9a6fc8d0f8c3ee3d42417e8315fc8c8fae1d3213 (patch) | |
| tree | b4bd15742d56e488592203e1d0a0d07a0684410d | |
| parent | d4116f820496ae3af5225d09450edc7791df0045 (diff) | |
| parent | 82d6469916c6fcfa345636a49004c9d1753905d1 (diff) | |
Merge branch 'bugfix' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen
* 'bugfix' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen:
xen: mask extended topology info in cpuid
xen/hvc: make sure console output is always emitted, with explicit polling
| -rw-r--r-- | arch/x86/xen/enlighten.c | 11 | ||||
| -rw-r--r-- | drivers/char/hvc_xen.c | 25 |
2 files changed, 34 insertions, 2 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 23a4d80fb39e..dfbf70e65860 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
| @@ -178,6 +178,7 @@ static __read_mostly unsigned int cpuid_leaf1_ecx_mask = ~0; | |||
| 178 | static void xen_cpuid(unsigned int *ax, unsigned int *bx, | 178 | static void xen_cpuid(unsigned int *ax, unsigned int *bx, |
| 179 | unsigned int *cx, unsigned int *dx) | 179 | unsigned int *cx, unsigned int *dx) |
| 180 | { | 180 | { |
| 181 | unsigned maskebx = ~0; | ||
| 181 | unsigned maskecx = ~0; | 182 | unsigned maskecx = ~0; |
| 182 | unsigned maskedx = ~0; | 183 | unsigned maskedx = ~0; |
| 183 | 184 | ||
| @@ -185,9 +186,16 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx, | |||
| 185 | * Mask out inconvenient features, to try and disable as many | 186 | * Mask out inconvenient features, to try and disable as many |
| 186 | * unsupported kernel subsystems as possible. | 187 | * unsupported kernel subsystems as possible. |
| 187 | */ | 188 | */ |
| 188 | if (*ax == 1) { | 189 | switch (*ax) { |
| 190 | case 1: | ||
| 189 | maskecx = cpuid_leaf1_ecx_mask; | 191 | maskecx = cpuid_leaf1_ecx_mask; |
| 190 | maskedx = cpuid_leaf1_edx_mask; | 192 | maskedx = cpuid_leaf1_edx_mask; |
| 193 | break; | ||
| 194 | |||
| 195 | case 0xb: | ||
| 196 | /* Suppress extended topology stuff */ | ||
| 197 | maskebx = 0; | ||
| 198 | break; | ||
| 191 | } | 199 | } |
| 192 | 200 | ||
| 193 | asm(XEN_EMULATE_PREFIX "cpuid" | 201 | asm(XEN_EMULATE_PREFIX "cpuid" |
| @@ -197,6 +205,7 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx, | |||
| 197 | "=d" (*dx) | 205 | "=d" (*dx) |
| 198 | : "0" (*ax), "2" (*cx)); | 206 | : "0" (*ax), "2" (*cx)); |
| 199 | 207 | ||
| 208 | *bx &= maskebx; | ||
| 200 | *cx &= maskecx; | 209 | *cx &= maskecx; |
| 201 | *dx &= maskedx; | 210 | *dx &= maskedx; |
| 202 | } | 211 | } |
diff --git a/drivers/char/hvc_xen.c b/drivers/char/hvc_xen.c index eba999f8598d..a6ee32b599a8 100644 --- a/drivers/char/hvc_xen.c +++ b/drivers/char/hvc_xen.c | |||
| @@ -55,7 +55,7 @@ static inline void notify_daemon(void) | |||
| 55 | notify_remote_via_evtchn(xen_start_info->console.domU.evtchn); | 55 | notify_remote_via_evtchn(xen_start_info->console.domU.evtchn); |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | static int write_console(uint32_t vtermno, const char *data, int len) | 58 | static int __write_console(const char *data, int len) |
| 59 | { | 59 | { |
| 60 | struct xencons_interface *intf = xencons_interface(); | 60 | struct xencons_interface *intf = xencons_interface(); |
| 61 | XENCONS_RING_IDX cons, prod; | 61 | XENCONS_RING_IDX cons, prod; |
| @@ -76,6 +76,29 @@ static int write_console(uint32_t vtermno, const char *data, int len) | |||
| 76 | return sent; | 76 | return sent; |
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | static int write_console(uint32_t vtermno, const char *data, int len) | ||
| 80 | { | ||
| 81 | int ret = len; | ||
| 82 | |||
| 83 | /* | ||
| 84 | * Make sure the whole buffer is emitted, polling if | ||
| 85 | * necessary. We don't ever want to rely on the hvc daemon | ||
| 86 | * because the most interesting console output is when the | ||
| 87 | * kernel is crippled. | ||
| 88 | */ | ||
| 89 | while (len) { | ||
| 90 | int sent = __write_console(data, len); | ||
| 91 | |||
| 92 | data += sent; | ||
| 93 | len -= sent; | ||
| 94 | |||
| 95 | if (unlikely(len)) | ||
| 96 | HYPERVISOR_sched_op(SCHEDOP_yield, NULL); | ||
| 97 | } | ||
| 98 | |||
| 99 | return ret; | ||
| 100 | } | ||
| 101 | |||
| 79 | static int read_console(uint32_t vtermno, char *buf, int len) | 102 | static int read_console(uint32_t vtermno, char *buf, int len) |
| 80 | { | 103 | { |
| 81 | struct xencons_interface *intf = xencons_interface(); | 104 | struct xencons_interface *intf = xencons_interface(); |
