From 0198288b1f5f296f043439bd647877effb870df7 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Mon, 10 Apr 2006 16:36:38 +0100 Subject: [PATCH 1/5] build: Clean pygrub's a.out Signed-Off-By: Magnus Damm Signed-Off-By: Horms --- tools/pygrub/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/pygrub/Makefile b/tools/pygrub/Makefile index fbe27a9bf1..197b89a1a8 100644 --- a/tools/pygrub/Makefile +++ b/tools/pygrub/Makefile @@ -15,4 +15,4 @@ install: all endif clean: - rm -rf build tmp *.pyc *.pyo *.o *.a *~ + rm -rf build tmp *.pyc *.pyo *.o *.a *~ a.out From 73004d34e4efc04bf0fc798615202361b39dd9a8 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Mon, 10 Apr 2006 17:16:25 +0100 Subject: [PATCH 2/5] If the 'cdrom=' option is specified in the definition file but media is not found in the CD drive then main() in vl.c exits and the guest appears to hang. This patch modifies vl.c slightly to check for the presents of media. If the cdrom cannot be opened then the cd entry is removed from hd_filename[] and bs_table[] allowing the guest to continue initializing. If the guest requires the CD media then the guest should report, gracefully or otherwise, that it's missing. From: Ross Maxfield Signed-off-by: Keir Fraser --- tools/ioemu/vl.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/ioemu/vl.c b/tools/ioemu/vl.c index da009dd11b..d4f305f178 100644 --- a/tools/ioemu/vl.c +++ b/tools/ioemu/vl.c @@ -3245,8 +3245,17 @@ int main(int argc, char **argv) /* we always create the cdrom drive, even if no disk is there */ bdrv_init(); if (has_cdrom) { - bs_table[2] = bdrv_new("cdrom"); - bdrv_set_type_hint(bs_table[2], BDRV_TYPE_CDROM); + int fd; + if ( (fd = open(hd_filename[2], O_RDONLY | O_BINARY)) < 0) { + hd_filename[2]=NULL; + bs_table[2]=NULL; + fprintf(logfile, "Could not open CD %s.\n", hd_filename[i]); + } + else { + close(fd); + bs_table[2] = bdrv_new("cdrom"); + bdrv_set_type_hint(bs_table[2], BDRV_TYPE_CDROM); + } } /* open the virtual block devices */ From 4f32cad22c9faaf10470b22eb117b0c06d57f909 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Mon, 10 Apr 2006 17:25:42 +0100 Subject: [PATCH 3/5] Fix push/pop usage in tools/ioemu for x86/64. Signed-off-by: Keir Fraser --- tools/ioemu/hw/vga.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/ioemu/hw/vga.c b/tools/ioemu/hw/vga.c index 11daaa27a2..c6fca32ae4 100644 --- a/tools/ioemu/hw/vga.c +++ b/tools/ioemu/hw/vga.c @@ -1369,10 +1369,16 @@ static inline unsigned int cpuid_edx(unsigned int op) { unsigned int eax, edx; - __asm__("pushl %%ebx; cpuid; popl %%ebx" +#ifdef __x86_64__ +#define __bx "rbx" +#else +#define __bx "ebx" +#endif + __asm__("push %%"__bx"; cpuid; pop %%"__bx : "=a" (eax), "=d" (edx) : "0" (op) : "cx"); +#undef __ebx return edx; } From 201c3aa978b9874d91af95c19f8f36e112b4cccb Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Mon, 10 Apr 2006 17:28:02 +0100 Subject: [PATCH 4/5] Fix a couple of typos. Signed-off-by: Keir Fraser --- tools/ioemu/hw/vga.c | 2 +- xen/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/ioemu/hw/vga.c b/tools/ioemu/hw/vga.c index c6fca32ae4..c04befca3b 100644 --- a/tools/ioemu/hw/vga.c +++ b/tools/ioemu/hw/vga.c @@ -1378,7 +1378,7 @@ static inline unsigned int cpuid_edx(unsigned int op) : "=a" (eax), "=d" (edx) : "0" (op) : "cx"); -#undef __ebx +#undef __bx return edx; } diff --git a/xen/Makefile b/xen/Makefile index 3bda17760f..631f0c791f 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -48,7 +48,7 @@ clean:: delete-unfresh-files endif -.PHONY: install +.PHONY: dist dist: install .PHONY: debug From 7ddc2369b20e6b9e4f067585d8c7389b33b00abb Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Mon, 10 Apr 2006 17:32:30 +0100 Subject: [PATCH 5/5] Fail the build if NR_hypercalls is not a power of two. Making this requirement clearer originally suggested by Muli Ben Yehuda. Signed-off-by: Keir Fraser --- xen/include/asm-x86/config.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h index 23aabeb2b9..35efb1ba63 100644 --- a/xen/include/asm-x86/config.h +++ b/xen/include/asm-x86/config.h @@ -65,8 +65,13 @@ #define barrier() __asm__ __volatile__("": : :"memory") +/* A power-of-two value greater than or equal to number of hypercalls. */ #define NR_hypercalls 32 +#if NR_hypercalls & (NR_hypercalls - 1) +#error "NR_hypercalls must be a power-of-two value" +#endif + #ifndef NDEBUG #define MEMORY_GUARD #ifdef __x86_64__