kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* kvm-userspace ppc fixes
@ 2008-12-03 19:07 Hollis Blanchard
       [not found] ` <1228331251-7109-1-git-send-email-hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
  2008-12-05 17:30 ` kvm-userspace ppc fixes Avi Kivity
  0 siblings, 2 replies; 7+ messages in thread
From: Hollis Blanchard @ 2008-12-03 19:07 UTC (permalink / raw)
  To: avi; +Cc: kvm-ppc, kvm

Hi Avi, among these patches are fixes for a number of bugs in kvm-userspace,
including the qemu build break and bugs in the "user" directory. Please apply.

-Hollis



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

* [PATCH 1/5] qemu: add dyngen dependency from upstream
       [not found] ` <1228331251-7109-1-git-send-email-hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
@ 2008-12-03 19:07   ` Hollis Blanchard
  2008-12-03 19:07     ` [PATCH 5/5] user: ppc: Add "hello world" test for libcflat Hollis Blanchard
       [not found]   ` <a3f0c46b2455645569aed89e4d43b43b66d3bc87.1228330895.git.hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
  1 sibling, 1 reply; 7+ messages in thread
From: Hollis Blanchard @ 2008-12-03 19:07 UTC (permalink / raw)
  To: avi-H+wXaHxf7aLQT0dZR+AlfA
  Cc: kvm-ppc-u79uwXL29TY76Z2rM5mHXA, kvm-u79uwXL29TY76Z2rM5mHXA,
	Hollis Blanchard

Fixes PowerPC kvm-userspace build.

Signed-off-by: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
 qemu/Makefile.target |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/qemu/Makefile.target b/qemu/Makefile.target
index 05ace8e..bb24cc0 100644
--- a/qemu/Makefile.target
+++ b/qemu/Makefile.target
@@ -205,6 +205,7 @@ else
 LIBOBJS+= translate-all.o translate.o
 endif
 ifdef CONFIG_DYNGEN_OP
+exec.o: dyngen-opc.h
 LIBOBJS+=op.o
 endif
 # TCG code generator
-- 
1.5.6.5

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 2/5] user: ppc: fix build break caused by changes to kvm_callbacks
       [not found]   ` <a3f0c46b2455645569aed89e4d43b43b66d3bc87.1228330895.git.hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
@ 2008-12-03 19:07     ` Hollis Blanchard
  2008-12-03 19:07     ` [PATCH 3/5] user: ppc: Fix guest load address Hollis Blanchard
  2008-12-03 19:07     ` [PATCH 4/5] user: ppc: Move -ffreestanding to the right location Hollis Blanchard
  2 siblings, 0 replies; 7+ messages in thread
From: Hollis Blanchard @ 2008-12-03 19:07 UTC (permalink / raw)
  To: avi-H+wXaHxf7aLQT0dZR+AlfA
  Cc: kvm-ppc-u79uwXL29TY76Z2rM5mHXA, kvm-u79uwXL29TY76Z2rM5mHXA,
	Hollis Blanchard

Signed-off-by: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
 user/main-ppc.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/user/main-ppc.c b/user/main-ppc.c
index c4ddcef..5fdf28e 100644
--- a/user/main-ppc.c
+++ b/user/main-ppc.c
@@ -69,7 +69,7 @@ static int test_debug(void *opaque, void *vcpu)
 	return 0;
 }
 
-static int test_halt(void *opaque, void *vcpu)
+static int test_halt(void *opaque, int vcpu)
 {
 	int n;
 
@@ -87,9 +87,8 @@ static int test_try_push_interrupts(void *opaque)
 	return 0;
 }
 
-static int test_try_push_nmi(void *opaque)
+static void test_push_nmi(void *opaque)
 {
-	return 0;
 }
 
 static void test_post_kvm_run(void *opaque, void *vcpu)
@@ -160,14 +159,14 @@ static int test_mem_write(void *opaque, uint64_t addr, uint8_t *data, int len)
 	                      (uint64_t *)data);
 }
 
-static int test_dcr_read(uint32_t dcrn, uint32_t *data)
+static int test_dcr_read(int vcpu, uint32_t dcrn, uint32_t *data)
 {
 	printf("%s: dcrn %04X\n", __func__, dcrn);
 	*data = 0;
 	return 0;
 }
 
-static int test_dcr_write(uint32_t dcrn, uint32_t data)
+static int test_dcr_write(int vcpu, uint32_t dcrn, uint32_t data)
 {
 	printf("%s: dcrn %04X data %04X\n", __func__, dcrn, data);
 	return 0;
@@ -180,7 +179,7 @@ static struct kvm_callbacks test_callbacks = {
 	.halt        = test_halt,
 	.io_window = test_io_window,
 	.try_push_interrupts = test_try_push_interrupts,
-	.try_push_nmi = test_try_push_nmi,
+	.push_nmi = test_push_nmi,
 	.post_kvm_run = test_post_kvm_run,
 	.pre_kvm_run = test_pre_kvm_run,
 	.powerpc_dcr_read = test_dcr_read,
-- 
1.5.6.5

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 3/5] user: ppc: Fix guest load address
       [not found]   ` <a3f0c46b2455645569aed89e4d43b43b66d3bc87.1228330895.git.hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
  2008-12-03 19:07     ` [PATCH 2/5] user: ppc: fix build break caused by changes to kvm_callbacks Hollis Blanchard
@ 2008-12-03 19:07     ` Hollis Blanchard
  2008-12-03 19:07     ` [PATCH 4/5] user: ppc: Move -ffreestanding to the right location Hollis Blanchard
  2 siblings, 0 replies; 7+ messages in thread
From: Hollis Blanchard @ 2008-12-03 19:07 UTC (permalink / raw)
  To: avi-H+wXaHxf7aLQT0dZR+AlfA
  Cc: kvm-ppc-u79uwXL29TY76Z2rM5mHXA, kvm-u79uwXL29TY76Z2rM5mHXA,
	Deepa Srinivasan

From: Deepa Srinivasan <deepas-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>

Test cases must be loaded at 1 MB, their link address.

Signed-off-by: Deepa Srinivasan <deepas-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
 user/main-ppc.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/user/main-ppc.c b/user/main-ppc.c
index 5fdf28e..71afc9e 100644
--- a/user/main-ppc.c
+++ b/user/main-ppc.c
@@ -63,6 +63,9 @@ struct vcpu_info {
 
 struct vcpu_info *vcpus;
 
+/* Must match flat.lds linker script */
+#define VM_TEST_LOAD_ADDRESS 0x100000
+
 static int test_debug(void *opaque, void *vcpu)
 {
 	printf("test_debug\n");
@@ -239,10 +242,16 @@ static void init_vcpu(int n)
 
 static void *do_create_vcpu(void *_n)
 {
+	struct kvm_regs regs;
 	int n = (long)_n;
 
 	kvm_create_vcpu(kvm, n);
 	init_vcpu(n);
+
+	kvm_get_regs(kvm, n, &regs);
+	regs.pc = VM_TEST_LOAD_ADDRESS;
+	kvm_set_regs(kvm, n, &regs);
+
 	kvm_run(kvm, n, &vcpus[n]);
 	sem_post(&exited_sem);
 	return NULL;
@@ -363,8 +372,8 @@ int main(int argc, char **argv)
 
 	vm_mem = kvm_create_phys_mem(kvm, 0, memory_size, 0, 1);
 
-	len = load_file(vm_mem, argv[optind], 1);
-	sync_caches(vm_mem, len);
+	len = load_file(vm_mem + VM_TEST_LOAD_ADDRESS, argv[optind], 1);
+	sync_caches(vm_mem + VM_TEST_LOAD_ADDRESS, len);
 
 	io_table_register(&mmio_table, 0xf0000000, 64, mmio_handler, NULL);
 
-- 
1.5.6.5

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 4/5] user: ppc: Move -ffreestanding to the right location
       [not found]   ` <a3f0c46b2455645569aed89e4d43b43b66d3bc87.1228330895.git.hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
  2008-12-03 19:07     ` [PATCH 2/5] user: ppc: fix build break caused by changes to kvm_callbacks Hollis Blanchard
  2008-12-03 19:07     ` [PATCH 3/5] user: ppc: Fix guest load address Hollis Blanchard
@ 2008-12-03 19:07     ` Hollis Blanchard
  2 siblings, 0 replies; 7+ messages in thread
From: Hollis Blanchard @ 2008-12-03 19:07 UTC (permalink / raw)
  To: avi-H+wXaHxf7aLQT0dZR+AlfA
  Cc: kvm-ppc-u79uwXL29TY76Z2rM5mHXA, kvm-u79uwXL29TY76Z2rM5mHXA,
	Deepa Srinivasan

From: Deepa Srinivasan <deepas-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>

Move the "-ffreestanding" compiler option (to avoid built-in functions) to the
correct place in the Makefile.

Signed-off-by: Deepa Srinivasan <deepas-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
 user/config-powerpc.mak |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/user/config-powerpc.mak b/user/config-powerpc.mak
index 297bce4..79af245 100644
--- a/user/config-powerpc.mak
+++ b/user/config-powerpc.mak
@@ -1,5 +1,6 @@
 CFLAGS += -I $(KERNELDIR)/include
 CFLAGS += -Wa,-mregnames -I test/lib
+CFLAGS += -ffreestanding
 
 cstart := test/powerpc/cstart.o
 
@@ -7,7 +8,6 @@ cflatobjs += \
 	test/lib/powerpc/io.o
 
 $(libcflat): LDFLAGS += -nostdlib
-$(libcflat): CFLAGS += -ffreestanding
 
 # these tests do not use libcflat
 simpletests := \
-- 
1.5.6.5

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 5/5] user: ppc: Add "hello world" test for libcflat
  2008-12-03 19:07   ` [PATCH 1/5] qemu: add dyngen dependency from upstream Hollis Blanchard
@ 2008-12-03 19:07     ` Hollis Blanchard
  0 siblings, 0 replies; 7+ messages in thread
From: Hollis Blanchard @ 2008-12-03 19:07 UTC (permalink / raw)
  To: avi; +Cc: kvm-ppc, kvm, Deepa Srinivasan

From: Deepa Srinivasan <deepas@us.ibm.com>

Add a test program ("hello world") to exercise printf() in libcflat.

Signed-off-by: Deepa Srinivasan <deepas@us.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
---
 user/config-powerpc.mak        |    3 ++-
 user/test/powerpc/helloworld.c |   27 +++++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 1 deletions(-)
 create mode 100644 user/test/powerpc/helloworld.c

diff --git a/user/config-powerpc.mak b/user/config-powerpc.mak
index 79af245..dd7ef54 100644
--- a/user/config-powerpc.mak
+++ b/user/config-powerpc.mak
@@ -17,7 +17,8 @@ simpletests := \
 
 # theses tests use cstart.o, libcflat, and libgcc
 tests := \
-	test/powerpc/exit.bin
+	test/powerpc/exit.bin \
+	test/powerpc/helloworld.bin
 
 include config-powerpc-$(PROCESSOR).mak
 
diff --git a/user/test/powerpc/helloworld.c b/user/test/powerpc/helloworld.c
new file mode 100644
index 0000000..f8630f7
--- /dev/null
+++ b/user/test/powerpc/helloworld.c
@@ -0,0 +1,27 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, version 2, as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ * Copyright IBM Corp. 2008
+ *
+ * Authors: Deepa Srinivasan <deepas@us.ibm.com>
+ */
+
+#include "libcflat.h"
+
+int main()
+{
+	printf("Hello World\n");
+
+	return 1;
+}
-- 
1.5.6.5


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

* Re: kvm-userspace ppc fixes
  2008-12-03 19:07 kvm-userspace ppc fixes Hollis Blanchard
       [not found] ` <1228331251-7109-1-git-send-email-hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
@ 2008-12-05 17:30 ` Avi Kivity
  1 sibling, 0 replies; 7+ messages in thread
From: Avi Kivity @ 2008-12-05 17:30 UTC (permalink / raw)
  To: Hollis Blanchard; +Cc: kvm-ppc, kvm

Hollis Blanchard wrote:
> Hi Avi, among these patches are fixes for a number of bugs in kvm-userspace,
> including the qemu build break and bugs in the "user" directory. Please apply.
>
>   

All applied, thanks.

-- 
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.


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

end of thread, other threads:[~2008-12-05 17:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-03 19:07 kvm-userspace ppc fixes Hollis Blanchard
     [not found] ` <1228331251-7109-1-git-send-email-hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-12-03 19:07   ` [PATCH 1/5] qemu: add dyngen dependency from upstream Hollis Blanchard
2008-12-03 19:07     ` [PATCH 5/5] user: ppc: Add "hello world" test for libcflat Hollis Blanchard
     [not found]   ` <a3f0c46b2455645569aed89e4d43b43b66d3bc87.1228330895.git.hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-12-03 19:07     ` [PATCH 2/5] user: ppc: fix build break caused by changes to kvm_callbacks Hollis Blanchard
2008-12-03 19:07     ` [PATCH 3/5] user: ppc: Fix guest load address Hollis Blanchard
2008-12-03 19:07     ` [PATCH 4/5] user: ppc: Move -ffreestanding to the right location Hollis Blanchard
2008-12-05 17:30 ` kvm-userspace ppc fixes Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).