public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 0/5] kvm tools: A few fixes
@ 2011-06-07 19:41 Cyrill Gorcunov
  2011-06-07 19:41 ` [patch 1/5] kvm tools: Options parser to handle hex numbers Cyrill Gorcunov
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Cyrill Gorcunov @ 2011-06-07 19:41 UTC (permalink / raw)
  To: penberg; +Cc: asias.hejun, mingo, levinsasha928, prasadjoshi124, kvm

Nothing serious, please review. Thanks.

Cyrill

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [patch 1/5] kvm tools: Options parser to handle hex numbers
  2011-06-07 19:41 [patch 0/5] kvm tools: A few fixes Cyrill Gorcunov
@ 2011-06-07 19:41 ` Cyrill Gorcunov
  2011-06-07 19:41 ` [patch 2/5] kvm tools: Introduce vidmode parmeter Cyrill Gorcunov
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Cyrill Gorcunov @ 2011-06-07 19:41 UTC (permalink / raw)
  To: penberg
  Cc: asias.hejun, mingo, levinsasha928, prasadjoshi124, kvm,
	Cyrill Gorcunov

[-- Attachment #1: kvm-tools-hex-opts --]
[-- Type: text/plain, Size: 3658 bytes --]

Some kernel parameters are convenient if passed in
hex form so our options parser should handle even
such form of input.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 tools/kvm/util/parse-options.c |  102 ++++++++++++++++++++++++++++++++---------
 1 file changed, 82 insertions(+), 20 deletions(-)

Index: linux-2.6.git/tools/kvm/util/parse-options.c
===================================================================
--- linux-2.6.git.orig/tools/kvm/util/parse-options.c
+++ linux-2.6.git/tools/kvm/util/parse-options.c
@@ -39,6 +39,84 @@ static int get_arg(struct parse_opt_ctx_
 	return 0;
 }
 
+#define numvalue(c)					\
+	((c) >= 'a' ? (c) - 'a' + 10 :			\
+	 (c) >= 'A' ? (c) - 'A' + 10 : (c) - '0')
+
+static u64 readhex(const char *str, bool *error)
+{
+	char *pos = strchr(str, 'x') + 1;
+	u64 res = 0;
+
+	while (*pos) {
+		unsigned int v = numvalue(*pos);
+		if (v > 16) {
+			*error = true;
+			return 0;
+		}
+
+		res = (res * 16) + v;
+		pos++;
+	}
+
+	*error = false;
+	return res;
+}
+
+static int readnum(const struct option *opt, int flags,
+		   const char *str, char **end)
+{
+	if (strchr(str, 'x')) {
+		bool error;
+		u64 value;
+
+		value = readhex(str, &error);
+		if (error)
+			goto enotnum;
+
+		switch (opt->type) {
+		case OPTION_INTEGER:
+			*(int *)opt->value = value;
+			break;
+		case OPTION_UINTEGER:
+			*(unsigned int *)opt->value = value;
+			break;
+		case OPTION_LONG:
+			*(long *)opt->value = value;
+			break;
+		case OPTION_U64:
+			*(u64 *)opt->value = value;
+			break;
+		default:
+			goto invcall;
+		}
+	} else {
+		switch (opt->type) {
+		case OPTION_INTEGER:
+			*(int *)opt->value = strtol(str, end, 10);
+			break;
+		case OPTION_UINTEGER:
+			*(unsigned int *)opt->value = strtol(str, end, 10);
+			break;
+		case OPTION_LONG:
+			*(long *)opt->value = strtol(str, end, 10);
+			break;
+		case OPTION_U64:
+			*(u64 *)opt->value = strtoull(str, end, 10);
+			break;
+		default:
+			goto invcall;
+		}
+	}
+
+	return 0;
+
+enotnum:
+	return opterror(opt, "expects a numerical value", flags);
+invcall:
+	return opterror(opt, "invalid numeric conversion", flags);
+}
+
 static int get_value(struct parse_opt_ctx_t *p,
 		const struct option *opt, int flags)
 {
@@ -131,11 +209,7 @@ static int get_value(struct parse_opt_ct
 		}
 		if (get_arg(p, opt, flags, &arg))
 			return -1;
-		*(int *)opt->value = strtol(arg, (char **)&s, 10);
-		if (*s)
-			return opterror(opt, "expects a numerical value",
-					flags);
-		return 0;
+		return readnum(opt, flags, arg, (char **)&s);
 
 	case OPTION_UINTEGER:
 		if (unset) {
@@ -148,11 +222,7 @@ static int get_value(struct parse_opt_ct
 		}
 		if (get_arg(p, opt, flags, &arg))
 			return -1;
-		*(unsigned int *)opt->value = strtol(arg, (char **)&s, 10);
-		if (*s)
-			return opterror(opt,
-					"expects a numerical value", flags);
-		return 0;
+		return readnum(opt, flags, arg, (char **)&s);
 
 	case OPTION_LONG:
 		if (unset) {
@@ -165,11 +235,7 @@ static int get_value(struct parse_opt_ct
 		}
 		if (get_arg(p, opt, flags, &arg))
 			return -1;
-		*(long *)opt->value = strtol(arg, (char **)&s, 10);
-		if (*s)
-			return opterror(opt,
-					"expects a numerical value", flags);
-		return 0;
+		return readnum(opt, flags, arg, (char **)&s);
 
 	case OPTION_U64:
 		if (unset) {
@@ -182,11 +248,7 @@ static int get_value(struct parse_opt_ct
 		}
 		if (get_arg(p, opt, flags, &arg))
 			return -1;
-		*(u64 *)opt->value = strtoull(arg, (char **)&s, 10);
-		if (*s)
-			return opterror(opt,
-					"expects a numerical value", flags);
-		return 0;
+		return readnum(opt, flags, arg, (char **)&s);
 
 	case OPTION_END:
 	case OPTION_ARGUMENT:


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [patch 2/5] kvm tools: Introduce vidmode parmeter
  2011-06-07 19:41 [patch 0/5] kvm tools: A few fixes Cyrill Gorcunov
  2011-06-07 19:41 ` [patch 1/5] kvm tools: Options parser to handle hex numbers Cyrill Gorcunov
@ 2011-06-07 19:41 ` Cyrill Gorcunov
  2011-06-07 19:53   ` Pekka Enberg
  2011-06-07 19:41 ` [patch 3/5] kvm tools: Delete dangling cursor from int10 Cyrill Gorcunov
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Cyrill Gorcunov @ 2011-06-07 19:41 UTC (permalink / raw)
  To: penberg
  Cc: asias.hejun, mingo, levinsasha928, prasadjoshi124, kvm,
	Cyrill Gorcunov

[-- Attachment #1: kvm-tools-vidmode --]
[-- Type: text/plain, Size: 1719 bytes --]

Usually this might be set by loader but since
we're the loader lets allow to specify vesa
mode as well.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 tools/kvm/kvm-run.c |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

Index: linux-2.6.git/tools/kvm/kvm-run.c
===================================================================
--- linux-2.6.git.orig/tools/kvm/kvm-run.c
+++ linux-2.6.git/tools/kvm/kvm-run.c
@@ -80,6 +80,7 @@ extern int  active_console;
 bool do_debug_print = false;
 
 static int nrcpus;
+static int vidmode = 0x312;
 
 static const char * const run_usage[] = {
 	"kvm run [<options>] [<kernel image>]",
@@ -139,6 +140,10 @@ static const struct option options[] = {
 	OPT_STRING('\0', "tapscript", &script, "Script path",
 			 "Assign a script to process created tap device"),
 
+	OPT_GROUP("BIOS options:"),
+	OPT_INTEGER('\0', "vidmode", &vidmode,
+		    "Video mode"),
+
 	OPT_GROUP("Debug options:"),
 	OPT_BOOLEAN('\0', "debug", &do_debug_print,
 			"Enable debug messages"),
@@ -434,7 +439,6 @@ int kvm_cmd_run(int argc, const char **a
 	struct framebuffer *fb = NULL;
 	unsigned int nr_online_cpus;
 	int exit_code = 0;
-	u16 vidmode = 0;
 	int max_cpus;
 	char *hi;
 	int i;
@@ -541,12 +545,10 @@ int kvm_cmd_run(int argc, const char **a
 
 	memset(real_cmdline, 0, sizeof(real_cmdline));
 	strcpy(real_cmdline, "notsc noapic noacpi pci=conf1");
-	if (vnc || sdl) {
+	if (vnc || sdl)
 		strcat(real_cmdline, " video=vesafb console=tty0");
-		vidmode = 0x312;
-	} else {
+	else
 		strcat(real_cmdline, " console=ttyS0 earlyprintk=serial");
-	}
 	strcat(real_cmdline, " ");
 	if (kernel_cmdline)
 		strlcat(real_cmdline, kernel_cmdline, sizeof(real_cmdline));


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [patch 3/5] kvm tools: Delete dangling cursor from int10
  2011-06-07 19:41 [patch 0/5] kvm tools: A few fixes Cyrill Gorcunov
  2011-06-07 19:41 ` [patch 1/5] kvm tools: Options parser to handle hex numbers Cyrill Gorcunov
  2011-06-07 19:41 ` [patch 2/5] kvm tools: Introduce vidmode parmeter Cyrill Gorcunov
@ 2011-06-07 19:41 ` Cyrill Gorcunov
  2011-06-07 19:41 ` [patch 4/5] kvm tools: Get rid of spaces in ld script Cyrill Gorcunov
  2011-06-07 19:41 ` [patch 5/5] kvm tools: Reform bios make fules Cyrill Gorcunov
  4 siblings, 0 replies; 10+ messages in thread
From: Cyrill Gorcunov @ 2011-06-07 19:41 UTC (permalink / raw)
  To: penberg
  Cc: asias.hejun, mingo, levinsasha928, prasadjoshi124, kvm,
	Cyrill Gorcunov

[-- Attachment #1: kvm-tools-del-cursor --]
[-- Type: text/plain, Size: 976 bytes --]

Noone use it anymore. Also cleanup comment on
int10 as well, int10_handler routine do all
the hard work.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 tools/kvm/bios/bios-rom.S |   14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

Index: linux-2.6.git/tools/kvm/bios/bios-rom.S
===================================================================
--- linux-2.6.git.orig/tools/kvm/bios/bios-rom.S
+++ linux-2.6.git/tools/kvm/bios/bios-rom.S
@@ -18,13 +18,7 @@ ENTRY(bios_intfake)
 ENTRY_END(bios_intfake)
 
 /*
- * int 10 - video - write character and advance cursor (tty write)
- *	ah = 0eh
- *	al = character
- *	bh = display page (alpha modes)
- *	bl = foreground color (graphics modes)
- *
- * We ignore bx settings
+ * int 10 - video - service
  */
 ENTRY(bios_int10)
 	pushw	%fs
@@ -55,12 +49,6 @@ ENTRY(bios_int10)
 	popw	%fs
 
 	IRET
-
-
-/*
- * private IRQ data
- */
-cursor:		.long 0
 ENTRY_END(bios_int10)
 
 #define EFLAGS_CF	(1 << 0)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [patch 4/5] kvm tools: Get rid of spaces in ld script
  2011-06-07 19:41 [patch 0/5] kvm tools: A few fixes Cyrill Gorcunov
                   ` (2 preceding siblings ...)
  2011-06-07 19:41 ` [patch 3/5] kvm tools: Delete dangling cursor from int10 Cyrill Gorcunov
@ 2011-06-07 19:41 ` Cyrill Gorcunov
  2011-06-07 19:41 ` [patch 5/5] kvm tools: Reform bios make fules Cyrill Gorcunov
  4 siblings, 0 replies; 10+ messages in thread
From: Cyrill Gorcunov @ 2011-06-07 19:41 UTC (permalink / raw)
  To: penberg
  Cc: asias.hejun, mingo, levinsasha928, prasadjoshi124, kvm,
	Cyrill Gorcunov

[-- Attachment #1: kvm-tools-del-spaces --]
[-- Type: text/plain, Size: 500 bytes --]

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 tools/kvm/bios/rom.ld.S |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6.git/tools/kvm/bios/rom.ld.S
===================================================================
--- linux-2.6.git.orig/tools/kvm/bios/rom.ld.S
+++ linux-2.6.git/tools/kvm/bios/rom.ld.S
@@ -11,7 +11,7 @@ PHDRS {
 }
 
 SECTIONS {
-       . = 0;
-       .text : { *(.text) } :text = 0x9090
+	. = 0;
+	.text : { *(.text) } :text = 0x9090
 }
 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [patch 5/5] kvm tools: Reform bios make fules
  2011-06-07 19:41 [patch 0/5] kvm tools: A few fixes Cyrill Gorcunov
                   ` (3 preceding siblings ...)
  2011-06-07 19:41 ` [patch 4/5] kvm tools: Get rid of spaces in ld script Cyrill Gorcunov
@ 2011-06-07 19:41 ` Cyrill Gorcunov
  4 siblings, 0 replies; 10+ messages in thread
From: Cyrill Gorcunov @ 2011-06-07 19:41 UTC (permalink / raw)
  To: penberg
  Cc: asias.hejun, mingo, levinsasha928, prasadjoshi124, kvm,
	Cyrill Gorcunov

[-- Attachment #1: kvm-tools-bios-rename --]
[-- Type: text/plain, Size: 6076 bytes --]

Put bios code into bios.s and adjust makefile
rules accordingly. It's more natural than bios-rom.S
(which is now simply a container over real bios code).

Also improve bios deps in Makefile.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 tools/kvm/Makefile            |   29 +++++++-----
 tools/kvm/bios/bios-rom.S     |   95 +++---------------------------------------
 tools/kvm/bios/bios.S         |   95 ++++++++++++++++++++++++++++++++++++++----
 tools/kvm/bios/gen-offsets.sh |    3 -
 4 files changed, 115 insertions(+), 107 deletions(-)

Index: linux-2.6.git/tools/kvm/Makefile
===================================================================
--- linux-2.6.git.orig/tools/kvm/Makefile
+++ linux-2.6.git/tools/kvm/Makefile
@@ -82,7 +82,7 @@ DEPS	:= $(patsubst %.o,%.d,$(OBJS))
 
 # Exclude BIOS object files from header dependencies.
 OBJS	+= bios.o
-OBJS	+= bios/bios.o
+OBJS	+= bios/bios-rom.o
 
 LIBS	+= -lrt
 LIBS	+= -lpthread
@@ -165,20 +165,27 @@ BIOS_CFLAGS += -m32
 BIOS_CFLAGS += -march=i386
 BIOS_CFLAGS += -mregparm=3
 
-bios.o: bios/bios-rom.bin
-bios/bios.o: bios/bios.S bios/bios-rom.bin
-	$(E) "  CC      " $@
-	$(Q) $(CC) -c $(CFLAGS) bios/bios.S -o bios/bios.o
-	
-bios/bios-rom.bin: bios/bios-rom.S bios/e820.c
-	$(E) "  CC      " $@
+bios.o: bios/bios.bin bios/bios-rom.h
+
+bios/bios.bin.elf: bios/bios.S bios/e820.c bios/int10.c bios/rom.ld.S
+	$(E) "  CC       bios/e820.o"
 	$(Q) $(CC) -include code16gcc.h $(CFLAGS) $(BIOS_CFLAGS) -c -s bios/e820.c -o bios/e820.o
+	$(E) "  CC       bios/int10.o"
 	$(Q) $(CC) -include code16gcc.h $(CFLAGS) $(BIOS_CFLAGS) -c -s bios/int10.c -o bios/int10.o
-	$(Q) $(CC) $(CFLAGS) $(BIOS_CFLAGS) -c -s bios/bios-rom.S -o bios/bios-rom.o
+	$(E) "  CC       bios/bios.o"
+	$(Q) $(CC) $(CFLAGS) $(BIOS_CFLAGS) -c -s bios/bios.S -o bios/bios.o
 	$(E) "  LD      " $@
-	$(Q) ld -T bios/rom.ld.S -o bios/bios-rom.bin.elf bios/bios-rom.o bios/e820.o bios/int10.o
+	$(Q) ld -T bios/rom.ld.S -o bios/bios.bin.elf bios/bios.o bios/e820.o bios/int10.o
+
+bios/bios.bin: bios/bios.bin.elf
 	$(E) "  OBJCOPY " $@
-	$(Q) objcopy -O binary -j .text bios/bios-rom.bin.elf bios/bios-rom.bin
+	$(Q) objcopy -O binary -j .text bios/bios.bin.elf bios/bios.bin
+
+bios/bios-rom.o: bios/bios-rom.S bios/bios.bin bios/bios-rom.h
+	$(E) "  CC      " $@
+	$(Q) $(CC) -c $(CFLAGS) bios/bios-rom.S -o bios/bios-rom.o
+
+bios/bios-rom.h: bios/bios.bin.elf
 	$(E) "  NM      " $@
 	$(Q) cd bios && sh gen-offsets.sh > bios-rom.h && cd ..
 
Index: linux-2.6.git/tools/kvm/bios/bios-rom.S
===================================================================
--- linux-2.6.git.orig/tools/kvm/bios/bios-rom.S
+++ linux-2.6.git/tools/kvm/bios/bios-rom.S
@@ -1,89 +1,12 @@
-/*
- * Our pretty trivial BIOS emulation
- */
-
-#include <kvm/bios.h>
 #include <kvm/assembly.h>
 
 	.org 0
-	.code16gcc
-
-#include "macro.S"
-
-/*
- * fake interrupt handler, nothing can be faster ever
- */
-ENTRY(bios_intfake)
-	IRET
-ENTRY_END(bios_intfake)
-
-/*
- * int 10 - video - service
- */
-ENTRY(bios_int10)
-	pushw	%fs
-	pushl	%es
-	pushl	%edi
-	pushl	%esi
-	pushl	%ebp
-	pushl	%esp
-	pushl	%edx
-	pushl	%ecx
-	pushl	%ebx
-	pushl	%eax
-
-	movl		%esp, %eax
-	/* this is way easier than doing it in assembly */
-	/* just push all the regs and jump to a C handler */
-	call	int10_handler
-
-	popl	%eax
-	popl	%ebx
-	popl	%ecx
-	popl	%edx
-	popl	%esp
-	popl	%ebp
-	popl	%esi
-	popl	%edi
-	popl	%es
-	popw	%fs
-
-	IRET
-ENTRY_END(bios_int10)
-
-#define EFLAGS_CF	(1 << 0)
-
-ENTRY(bios_int15)
-	cmp $0xE820, %eax
-	jne 1f
-
-	pushw	%fs
-
-	pushl	%edx
-	pushl	%ecx
-	pushl	%edi
-	pushl	%ebx
-	pushl	%eax
-
-	movl	%esp, %eax	# it's bioscall case
-	call	e820_query_map
-
-	popl	%eax
-	popl	%ebx
-	popl	%edi
-	popl	%ecx
-	popl	%edx
-
-	popw	%fs
-
-	/* Clear CF */
-	andl	$~EFLAGS_CF, 0x4(%esp)
-1:
-	IRET
-ENTRY_END(bios_int15)
-
-GLOBAL(__locals)
-
-#include "local.S"
-
-END(__locals)
+#ifdef CONFIG_X86_64
+	.code64
+#else
+	.code32
+#endif
+
+GLOBAL(bios_rom)
+	.incbin "bios/bios.bin"
+END(bios_rom)
Index: linux-2.6.git/tools/kvm/bios/bios.S
===================================================================
--- linux-2.6.git.orig/tools/kvm/bios/bios.S
+++ linux-2.6.git/tools/kvm/bios/bios.S
@@ -1,12 +1,89 @@
+/*
+ * Our pretty trivial BIOS emulation
+ */
+
+#include <kvm/bios.h>
 #include <kvm/assembly.h>
 
 	.org 0
-#ifdef CONFIG_X86_64
-	.code64
-#else
-	.code32
-#endif
-
-GLOBAL(bios_rom)
-	.incbin "bios/bios-rom.bin"
-END(bios_rom)
+	.code16gcc
+
+#include "macro.S"
+
+/*
+ * fake interrupt handler, nothing can be faster ever
+ */
+ENTRY(bios_intfake)
+	IRET
+ENTRY_END(bios_intfake)
+
+/*
+ * int 10 - video - service
+ */
+ENTRY(bios_int10)
+	pushw	%fs
+	pushl	%es
+	pushl	%edi
+	pushl	%esi
+	pushl	%ebp
+	pushl	%esp
+	pushl	%edx
+	pushl	%ecx
+	pushl	%ebx
+	pushl	%eax
+
+	movl		%esp, %eax
+	/* this is way easier than doing it in assembly */
+	/* just push all the regs and jump to a C handler */
+	call	int10_handler
+
+	popl	%eax
+	popl	%ebx
+	popl	%ecx
+	popl	%edx
+	popl	%esp
+	popl	%ebp
+	popl	%esi
+	popl	%edi
+	popl	%es
+	popw	%fs
+
+	IRET
+ENTRY_END(bios_int10)
+
+#define EFLAGS_CF	(1 << 0)
+
+ENTRY(bios_int15)
+	cmp $0xE820, %eax
+	jne 1f
+
+	pushw	%fs
+
+	pushl	%edx
+	pushl	%ecx
+	pushl	%edi
+	pushl	%ebx
+	pushl	%eax
+
+	movl	%esp, %eax	# it's bioscall case
+	call	e820_query_map
+
+	popl	%eax
+	popl	%ebx
+	popl	%edi
+	popl	%ecx
+	popl	%edx
+
+	popw	%fs
+
+	/* Clear CF */
+	andl	$~EFLAGS_CF, 0x4(%esp)
+1:
+	IRET
+ENTRY_END(bios_int15)
+
+GLOBAL(__locals)
+
+#include "local.S"
+
+END(__locals)
Index: linux-2.6.git/tools/kvm/bios/gen-offsets.sh
===================================================================
--- linux-2.6.git.orig/tools/kvm/bios/gen-offsets.sh
+++ linux-2.6.git/tools/kvm/bios/gen-offsets.sh
@@ -8,6 +8,7 @@ echo ""
 echo "#define BIOS_ENTRY_SIZE(name) (name##_end - name)"
 echo ""
 
-nm bios-rom.bin.elf | grep ' [Tt] ' | awk '{ print "#define BIOS_OFFSET__" $3 " 0x" $1; }'
+nm bios.bin.elf | grep ' [Tt] ' | awk '{ print "#define BIOS_OFFSET__" $3 " 0x" $1; }'
 
+echo ""
 echo "#endif"


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [patch 2/5] kvm tools: Introduce vidmode parmeter
  2011-06-07 19:41 ` [patch 2/5] kvm tools: Introduce vidmode parmeter Cyrill Gorcunov
@ 2011-06-07 19:53   ` Pekka Enberg
  2011-06-07 20:03     ` Cyrill Gorcunov
  2011-06-07 20:10     ` Cyrill Gorcunov
  0 siblings, 2 replies; 10+ messages in thread
From: Pekka Enberg @ 2011-06-07 19:53 UTC (permalink / raw)
  To: Cyrill Gorcunov; +Cc: asias.hejun, mingo, levinsasha928, prasadjoshi124, kvm

On Tue, 7 Jun 2011, Cyrill Gorcunov wrote:
> Usually this might be set by loader but since
> we're the loader lets allow to specify vesa
> mode as well.
>
> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>

This patch causes 'make check' to go crazy and print out bunch of these:

Warning: Ignoring MMIO write at 00000000d0031f40 (length 4)
Warning: Ignoring MMIO write at 00000000d0031f44 (length 4)
Warning: Ignoring MMIO write at 00000000d0031f48 (length 4)
Warning: Ignoring MMIO write at 00000000d0031f4c (length 4)
Warning: Ignoring MMIO write at 00000000d0031f50 (length 4)
Warning: Ignoring MMIO write at 00000000d0031f54 (length 4)
Warning: Ignoring MMIO write at 00000000d0031f58 (length 4)
Warning: Ignoring MMIO write at 00000000d0031f5c (length 4)
Warning: Ignoring MMIO write at 00000000d0031f60 (length 4)
Warning: Ignoring MMIO write at 00000000d0031f64 (length 4)
Warning: Ignoring MMIO write at 00000000d0031f68 (length 4)
Warning: Ignoring MMIO write at 00000000d0031f6c (length 4)
Warning: Ignoring MMIO write at 00000000d0031f70 (length 4)
Warning: Ignoring MMIO write at 00000000d0031f74 (length 4)
Warning: Ignoring MMIO write at 00000000d0031f78 (length 4)
Warning: Ignoring MMIO write at 00000000d0031f7c (length 4)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [patch 2/5] kvm tools: Introduce vidmode parmeter
  2011-06-07 19:53   ` Pekka Enberg
@ 2011-06-07 20:03     ` Cyrill Gorcunov
  2011-06-07 20:10     ` Cyrill Gorcunov
  1 sibling, 0 replies; 10+ messages in thread
From: Cyrill Gorcunov @ 2011-06-07 20:03 UTC (permalink / raw)
  To: Pekka Enberg; +Cc: asias.hejun, mingo, levinsasha928, prasadjoshi124, kvm

On Tue, Jun 07, 2011 at 10:53:28PM +0300, Pekka Enberg wrote:
> On Tue, 7 Jun 2011, Cyrill Gorcunov wrote:
> >Usually this might be set by loader but since
> >we're the loader lets allow to specify vesa
> >mode as well.
> >
> >Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
> 
> This patch causes 'make check' to go crazy and print out bunch of these:
> 
> Warning: Ignoring MMIO write at 00000000d0031f40 (length 4)
> 

Hmm, weird...

	Cyrill

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [patch 2/5] kvm tools: Introduce vidmode parmeter
  2011-06-07 19:53   ` Pekka Enberg
  2011-06-07 20:03     ` Cyrill Gorcunov
@ 2011-06-07 20:10     ` Cyrill Gorcunov
  2011-06-07 20:22       ` Cyrill Gorcunov
  1 sibling, 1 reply; 10+ messages in thread
From: Cyrill Gorcunov @ 2011-06-07 20:10 UTC (permalink / raw)
  To: Pekka Enberg; +Cc: asias.hejun, mingo, levinsasha928, prasadjoshi124, kvm

On Tue, Jun 07, 2011 at 10:53:28PM +0300, Pekka Enberg wrote:
> On Tue, 7 Jun 2011, Cyrill Gorcunov wrote:
> >Usually this might be set by loader but since
> >we're the loader lets allow to specify vesa
> >mode as well.
> >
> >Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
> 
> This patch causes 'make check' to go crazy and print out bunch of these:
>

Pekka, are you sure it's because of _this_ particular patch?

	Cyrill

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [patch 2/5] kvm tools: Introduce vidmode parmeter
  2011-06-07 20:10     ` Cyrill Gorcunov
@ 2011-06-07 20:22       ` Cyrill Gorcunov
  0 siblings, 0 replies; 10+ messages in thread
From: Cyrill Gorcunov @ 2011-06-07 20:22 UTC (permalink / raw)
  To: Pekka Enberg; +Cc: asias.hejun, mingo, levinsasha928, prasadjoshi124, kvm

On Wed, Jun 08, 2011 at 12:10:30AM +0400, Cyrill Gorcunov wrote:
> On Tue, Jun 07, 2011 at 10:53:28PM +0300, Pekka Enberg wrote:
> > On Tue, 7 Jun 2011, Cyrill Gorcunov wrote:
> > >Usually this might be set by loader but since
> > >we're the loader lets allow to specify vesa
> > >mode as well.
> > >
> > >Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
> > 
> > This patch causes 'make check' to go crazy and print out bunch of these:
> >
> 
> Pekka, are you sure it's because of _this_ particular patch?
> 
> 	Cyrill

This one should do the trick, cant say I like it, we probably need some
default values from options parser, ie to extend it.

	Cyrill
---
kvm tools: Introduce vidmode parmeter v2

Usually this might be set by loader but since
we're the loader lets allow to specify vesa
mode as well.

v2: Pekka spotted the default value was being compromised,
    so revert it back and set only if specified.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 tools/kvm/kvm-run.c |   20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

Index: linux-2.6.git/tools/kvm/kvm-run.c
===================================================================
--- linux-2.6.git.orig/tools/kvm/kvm-run.c
+++ linux-2.6.git/tools/kvm/kvm-run.c
@@ -80,6 +80,7 @@ extern int  active_console;
 bool do_debug_print = false;
 
 static int nrcpus;
+static int vidmode = -1;
 
 static const char * const run_usage[] = {
 	"kvm run [<options>] [<kernel image>]",
@@ -139,6 +140,10 @@ static const struct option options[] = {
 	OPT_STRING('\0', "tapscript", &script, "Script path",
 			 "Assign a script to process created tap device"),
 
+	OPT_GROUP("BIOS options:"),
+	OPT_INTEGER('\0', "vidmode", &vidmode,
+		    "Video mode"),
+
 	OPT_GROUP("Debug options:"),
 	OPT_BOOLEAN('\0', "debug", &do_debug_print,
 			"Enable debug messages"),
@@ -434,7 +439,6 @@ int kvm_cmd_run(int argc, const char **a
 	struct framebuffer *fb = NULL;
 	unsigned int nr_online_cpus;
 	int exit_code = 0;
-	u16 vidmode = 0;
 	int max_cpus;
 	char *hi;
 	int i;
@@ -539,14 +543,22 @@ int kvm_cmd_run(int argc, const char **a
 
 	kvm->nrcpus = nrcpus;
 
+	/*
+	 * vidmode should be either specified
+	 * either set by default
+	 */
+	if (vnc || sdl) {
+		if (vidmode == -1)
+			vidmode = 0x312;
+	} else
+		vidmode = 0;
+
 	memset(real_cmdline, 0, sizeof(real_cmdline));
 	strcpy(real_cmdline, "notsc noapic noacpi pci=conf1");
 	if (vnc || sdl) {
 		strcat(real_cmdline, " video=vesafb console=tty0");
-		vidmode = 0x312;
-	} else {
+	} else
 		strcat(real_cmdline, " console=ttyS0 earlyprintk=serial");
-	}
 	strcat(real_cmdline, " ");
 	if (kernel_cmdline)
 		strlcat(real_cmdline, kernel_cmdline, sizeof(real_cmdline));

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-06-07 20:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-07 19:41 [patch 0/5] kvm tools: A few fixes Cyrill Gorcunov
2011-06-07 19:41 ` [patch 1/5] kvm tools: Options parser to handle hex numbers Cyrill Gorcunov
2011-06-07 19:41 ` [patch 2/5] kvm tools: Introduce vidmode parmeter Cyrill Gorcunov
2011-06-07 19:53   ` Pekka Enberg
2011-06-07 20:03     ` Cyrill Gorcunov
2011-06-07 20:10     ` Cyrill Gorcunov
2011-06-07 20:22       ` Cyrill Gorcunov
2011-06-07 19:41 ` [patch 3/5] kvm tools: Delete dangling cursor from int10 Cyrill Gorcunov
2011-06-07 19:41 ` [patch 4/5] kvm tools: Get rid of spaces in ld script Cyrill Gorcunov
2011-06-07 19:41 ` [patch 5/5] kvm tools: Reform bios make fules Cyrill Gorcunov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox