* [PATCH 0/3] kvm-userspace: ppc: userspace fixes for powerpc
@ 2008-10-28 9:08 ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8
2008-10-28 9:08 ` [PATCH 1/5] user: ppc: fix threading bugs in main-ppc.c ehrhardt
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8 @ 2008-10-28 9:08 UTC (permalink / raw)
To: kvm-ppc-u79uwXL29TY76Z2rM5mHXA, kvm-u79uwXL29TY76Z2rM5mHXA,
avi-atKUWr5tajBWk0Htik3J/w
Cc: hollisb-r/Jw6+rmf7HQT0dZR+AlfA,
ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8
From: Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
This is a set of fixes for the powerpc tests kvm-userspace/user.
Patch 1&2 fix main-ppc.c while patch 3 introduces libcflat for powerpc.
Further on patch 4 provides a timebase accessor for the ppc testcases (not
used yet) and patch 5 finally adds a stub nmi handler to main-ppc.c.
[patches in series]
[PATCH 1/5] user: ppc: fix threading bugs in main-ppc.c
[PATCH 2/5] user: ppc: better error reporting in load_file
[PATCH 3/5] user: ppc: implement PowerPC 44x libcflat
[PATCH 4/5] libcflat: ppc: add timebase accessor
[PATCH 5/5] user: ppc: add stub nmi handler
---
[diffstat]
b/user/config-powerpc-44x.mak | 14 +++++++++
b/user/config-powerpc.mak | 46 ++++++++++++++++++++---------
b/user/main-ppc.c | 32 +++++++-------------
b/user/test/lib/powerpc/44x/map.c | 51 +++++++++++++++++++++++++++++++++
b/user/test/lib/powerpc/44x/timebase.S | 28 ++++++++++++++++++
b/user/test/lib/powerpc/44x/timebase.h | 25 ++++++++++++++++
b/user/test/lib/powerpc/44x/tlbwe.S | 29 ++++++++++++++++++
b/user/test/lib/powerpc/io.c | 35 ++++++++++++++++++++++
b/user/test/powerpc/cstart.S | 38 ++++++++++++++++++++++++
b/user/test/powerpc/exit.c | 23 ++++++++++++++
user/config-powerpc-44x.mak | 3 +
user/main-ppc.c | 9 +++++
12 files changed, 296 insertions(+), 37 deletions(-)
--
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 [flat|nested] 7+ messages in thread
* [PATCH 1/5] user: ppc: fix threading bugs in main-ppc.c
2008-10-28 9:08 [PATCH 0/3] kvm-userspace: ppc: userspace fixes for powerpc ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8
@ 2008-10-28 9:08 ` ehrhardt
2008-10-28 9:08 ` [PATCH 2/5] user: ppc: better error reporting in load_file ehrhardt
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: ehrhardt @ 2008-10-28 9:08 UTC (permalink / raw)
To: kvm-ppc, kvm, avi; +Cc: hollisb, ehrhardt
From: Hollis Blanchard <hollisb@us.ibm.com>
- call io_table_register() before any vcpus have started
- wait for all vcpus to exit before exiting the parent thread
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
---
[diffstat]
main-ppc.c | 32 ++++++++++++--------------------
1 file changed, 12 insertions(+), 20 deletions(-)
[diff]
diff --git a/user/main-ppc.c b/user/main-ppc.c
--- a/user/main-ppc.c
+++ b/user/main-ppc.c
@@ -51,7 +51,7 @@ struct io_table mmio_table;
struct io_table mmio_table;
static int ncpus = 1;
-static sem_t init_sem;
+static sem_t exited_sem;
static __thread int vcpu;
static sigset_t kernel_sigmask;
static sigset_t ipi_sigmask;
@@ -220,16 +220,8 @@ void sync_caches(void *mem, unsigned lon
asm volatile ("sync; isync");
}
-static void init_vcpu(int n, unsigned long entry)
+static void init_vcpu(int n)
{
- /* XXX must set initial TLB state and stack
- struct kvm_regs regs = {
- .pc = entry,
- };
-
- kvm_set_regs(kvm, 0, ®s);
- */
-
sigemptyset(&ipi_sigmask);
sigaddset(&ipi_sigmask, IPI_SIGNAL);
sigprocmask(SIG_UNBLOCK, &ipi_sigmask, NULL);
@@ -237,7 +229,6 @@ static void init_vcpu(int n, unsigned lo
vcpus[n].tid = gettid();
vcpu = n;
kvm_set_signal_mask(kvm, n, &kernel_sigmask);
- sem_post(&init_sem);
}
static void *do_create_vcpu(void *_n)
@@ -245,8 +236,9 @@ static void *do_create_vcpu(void *_n)
int n = (long)_n;
kvm_create_vcpu(kvm, n);
- init_vcpu(n, 0x0);
+ init_vcpu(n);
kvm_run(kvm, n);
+ sem_post(&exited_sem);
return NULL;
}
@@ -368,14 +360,14 @@ int main(int argc, char **argv)
len = load_file(vm_mem, argv[optind], 1);
sync_caches(vm_mem, len);
- sem_init(&init_sem, 0, 0);
- init_vcpu(0, 0x0);
- for (i = 1; i < ncpus; ++i)
- start_vcpu(i);
- for (i = 0; i < ncpus; ++i)
- sem_wait(&init_sem);
-
io_table_register(&mmio_table, 0xf0000000, 64, mmio_handler, NULL);
- return kvm_run(kvm, 0);
+ sem_init(&exited_sem, 0, 0);
+ for (i = 0; i < ncpus; ++i)
+ start_vcpu(i);
+ /* Wait for all vcpus to exit. */
+ for (i = 0; i < ncpus; ++i)
+ sem_wait(&exited_sem);
+
+ return 0;
}
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/5] user: ppc: better error reporting in load_file
2008-10-28 9:08 [PATCH 0/3] kvm-userspace: ppc: userspace fixes for powerpc ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8
2008-10-28 9:08 ` [PATCH 1/5] user: ppc: fix threading bugs in main-ppc.c ehrhardt
@ 2008-10-28 9:08 ` ehrhardt
[not found] ` <1225184902-25769-1-git-send-email-ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2008-10-28 9:08 ` [PATCH 4/5] libcflat: ppc: add timebase accessor ehrhardt
3 siblings, 0 replies; 7+ messages in thread
From: ehrhardt @ 2008-10-28 9:08 UTC (permalink / raw)
To: kvm-ppc, kvm, avi; +Cc: hollisb, ehrhardt
From: Hollis Blanchard <hollisb@us.ibm.com>
Fancy description.
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
---
[diffstat]
main-ppc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[diff]
diff --git a/user/main-ppc.c b/user/main-ppc.c
--- a/user/main-ppc.c
+++ b/user/main-ppc.c
@@ -183,7 +183,7 @@ static struct kvm_callbacks test_callbac
static unsigned long load_file(void *mem, const char *fname, int inval_icache)
{
- int r;
+ ssize_t r;
int fd;
unsigned long bytes = 0;
@@ -200,6 +200,7 @@ static unsigned long load_file(void *mem
if (r == -1) {
perror("read");
+ printf("read %d bytes\n", bytes);
exit(1);
}
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/5] user: ppc: implement PowerPC 44x libcflat
[not found] ` <1225184902-25769-1-git-send-email-ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
@ 2008-10-28 9:08 ` ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8
2008-10-28 9:08 ` [PATCH 5/5] user: ppc: add stub nmi handler ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8
2008-10-28 9:25 ` [PATCH 0/3] kvm-userspace: ppc: userspace fixes for powerpc Christian Ehrhardt
2 siblings, 0 replies; 7+ messages in thread
From: ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8 @ 2008-10-28 9:08 UTC (permalink / raw)
To: kvm-ppc-u79uwXL29TY76Z2rM5mHXA, kvm-u79uwXL29TY76Z2rM5mHXA,
avi-atKUWr5tajBWk0Htik3J/w
Cc: hollisb-r/Jw6+rmf7HQT0dZR+AlfA,
ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8
From: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
- Create a 44x-specific makefile.
- Reorganize PowerPC makefiles to separate "simple" tests from those which
link with libcflat.
- Create a minimal libcflat testcase (which just exits).
Signed-off-by: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
---
[diffstat]
config-powerpc-44x.mak | 14 +++++++++++
config-powerpc.mak | 46 ++++++++++++++++++++++++++------------
test/lib/powerpc/44x/map.c | 51 +++++++++++++++++++++++++++++++++++++++++++
test/lib/powerpc/44x/tlbwe.S | 29 ++++++++++++++++++++++++
test/lib/powerpc/io.c | 35 +++++++++++++++++++++++++++++
test/powerpc/cstart.S | 38 ++++++++++++++++++++++++++++++++
test/powerpc/exit.c | 23 +++++++++++++++++++
7 files changed, 221 insertions(+), 15 deletions(-)
[diff]
diff --git a/user/config-powerpc-44x.mak b/user/config-powerpc-44x.mak
new file mode 100644
--- /dev/null
+++ b/user/config-powerpc-44x.mak
@@ -0,0 +1,14 @@
+
+
+# for some reason binutils hates tlbsx unless we say we're 405 :(
+CFLAGS += -Wa,-m405 -I test/lib/powerpc/44x
+
+cflatobjs += \
+ test/lib/powerpc/44x/map.o \
+ test/lib/powerpc/44x/tlbwe.o
+
+simpletests += \
+ test/powerpc/44x/tlbsx.bin \
+ test/powerpc/44x/tlbwe_16KB.bin \
+ test/powerpc/44x/tlbwe_hole.bin \
+ test/powerpc/44x/tlbwe.bin
diff --git a/user/config-powerpc.mak b/user/config-powerpc.mak
--- a/user/config-powerpc.mak
+++ b/user/config-powerpc.mak
@@ -1,26 +1,42 @@
+platform := 44x
+
CFLAGS += -m32
CFLAGS += -D__powerpc__
CFLAGS += -I $(KERNELDIR)/include
-# for some reaons binutils hates tlbsx unless we say we're 405 :(
-CFLAGS += -Wa,-mregnames,-m405
+CFLAGS += -Wa,-mregnames -I test/lib
-%.bin: %.o
- $(OBJCOPY) -O binary $^ $@
+cstart := test/powerpc/cstart.o
-testobjs := \
- io.bin \
- spin.bin \
- sprg.bin \
- 44x/tlbsx.bin \
- 44x/tlbwe_16KB.bin \
- 44x/tlbwe_hole.bin \
- 44x/tlbwe.bin
+cflatobjs += \
+ test/lib/powerpc/io.o
-tests := $(addprefix test/powerpc/, $(testobjs))
+$(libcflat): LDFLAGS += -nostdlib
+$(libcflat): CFLAGS += -ffreestanding
-all: kvmtrace kvmctl $(tests)
+# these tests do not use libcflat
+simpletests := \
+ test/powerpc/spin.bin \
+ test/powerpc/io.bin \
+ test/powerpc/sprg.bin
+
+# theses tests use cstart.o, libcflat, and libgcc
+tests := \
+ test/powerpc/exit.bin
+
+include config-powerpc-$(platform).mak
+
+
+all: kvmtrace kvmctl $(libcflat) $(simpletests) $(tests)
+
+$(simpletests): %.bin: %.o
+ $(CC) -nostdlib $^ -Wl,-T,flat.lds -o $@
+
+$(tests): %.bin: $(cstart) %.o $(libcflat)
+ $(CC) -nostdlib $^ $(libgcc) -Wl,-T,flat.lds -o $@
kvmctl_objs = main-ppc.o iotable.o ../libkvm/libkvm.a
arch_clean:
- rm -f $(tests)
+ $(RM) $(simpletests) $(tests) $(cstart)
+ $(RM) $(patsubst %.bin, %.elf, $(simpletests) $(tests))
+ $(RM) $(patsubst %.bin, %.o, $(simpletests) $(tests))
diff --git a/user/test/lib/powerpc/44x/map.c b/user/test/lib/powerpc/44x/map.c
new file mode 100644
--- /dev/null
+++ b/user/test/lib/powerpc/44x/map.c
@@ -0,0 +1,51 @@
+/*
+ * 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: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
+ */
+
+#include "libcflat.h"
+
+#define TLB_SIZE 64
+
+extern void tlbwe(unsigned int index,
+ unsigned char tid,
+ unsigned int word0,
+ unsigned int word1,
+ unsigned int word2);
+
+unsigned int next_free_index;
+
+#define PAGE_SHIFT 12
+#define PAGE_MASK (~((1<<PAGE_SHIFT)-1))
+
+#define V (1<<9)
+
+void map(unsigned long vaddr, unsigned long paddr)
+{
+ unsigned int w0, w1, w2;
+
+ /* We don't install exception handlers, so we can't handle TLB misses,
+ * so we can't loop around and overwrite entry 0. */
+ if (next_free_index++ >= TLB_SIZE)
+ panic("TLB overflow");
+
+ w0 = (vaddr & PAGE_MASK) | V;
+ w1 = paddr & PAGE_MASK;
+ w2 = 0x3;
+
+ tlbwe(next_free_index, 0, w0, w1, w2);
+}
diff --git a/user/test/lib/powerpc/44x/tlbwe.S b/user/test/lib/powerpc/44x/tlbwe.S
new file mode 100644
--- /dev/null
+++ b/user/test/lib/powerpc/44x/tlbwe.S
@@ -0,0 +1,29 @@
+/*
+ * 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: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
+ */
+
+#define SPRN_MMUCR 0x3b2
+
+/* tlbwe(uint index, uint8_t tid, uint word0, uint word1, uint word2) */
+.global tlbwe
+tlbwe:
+ mtspr SPRN_MMUCR, r4
+ tlbwe r5, r3, 0
+ tlbwe r6, r3, 1
+ tlbwe r7, r3, 2
+ blr
diff --git a/user/test/lib/powerpc/io.c b/user/test/lib/powerpc/io.c
new file mode 100644
--- /dev/null
+++ b/user/test/lib/powerpc/io.c
@@ -0,0 +1,35 @@
+/*
+ * 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: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
+ */
+
+#include "libcflat.h"
+
+#define BASE 0xf0000000
+#define _putc ((volatile char *)(BASE))
+#define _exit ((volatile char *)(BASE+1))
+
+void puts(const char *s)
+{
+ while (*s != '\0')
+ *_putc = *s++;
+}
+
+void exit(int code)
+{
+ *_exit = code;
+}
diff --git a/user/test/powerpc/cstart.S b/user/test/powerpc/cstart.S
new file mode 100644
--- /dev/null
+++ b/user/test/powerpc/cstart.S
@@ -0,0 +1,38 @@
+/*
+ * 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: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
+ */
+
+#define OUTPUT_VADDR 0xf0000000
+#define OUTPUT_PADDR 0xf0000000
+
+.globl _start
+_start:
+ /* In the future we might need to assign a stack and zero BSS here. */
+
+ /* Map the debug page 1:1. */
+ lis r3, OUTPUT_VADDR@h
+ ori r3, r3, OUTPUT_VADDR@l
+ lis r4, OUTPUT_PADDR@h
+ ori r4, r4, OUTPUT_PADDR@l
+ bl map
+
+ /* Call main() and pass return code to exit(). */
+ bl main
+ bl exit
+
+ b .
diff --git a/user/test/powerpc/exit.c b/user/test/powerpc/exit.c
new file mode 100644
--- /dev/null
+++ b/user/test/powerpc/exit.c
@@ -0,0 +1,23 @@
+/*
+ * 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: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
+ */
+
+int main(void)
+{
+ return 1;
+}
--
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 [flat|nested] 7+ messages in thread
* [PATCH 4/5] libcflat: ppc: add timebase accessor
2008-10-28 9:08 [PATCH 0/3] kvm-userspace: ppc: userspace fixes for powerpc ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8
` (2 preceding siblings ...)
[not found] ` <1225184902-25769-1-git-send-email-ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
@ 2008-10-28 9:08 ` ehrhardt
3 siblings, 0 replies; 7+ messages in thread
From: ehrhardt @ 2008-10-28 9:08 UTC (permalink / raw)
To: kvm-ppc, kvm, avi; +Cc: hollisb, ehrhardt
Provide a timebase accessor for ppc testcases.
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
[diffstat]
config-powerpc-44x.mak | 3 ++-
test/lib/powerpc/44x/timebase.S | 28 ++++++++++++++++++++++++++++
test/lib/powerpc/44x/timebase.h | 25 +++++++++++++++++++++++++
3 files changed, 55 insertions(+), 1 deletion(-)
[diff]
diff --git a/user/config-powerpc-44x.mak b/user/config-powerpc-44x.mak
--- a/user/config-powerpc-44x.mak
+++ b/user/config-powerpc-44x.mak
@@ -5,7 +5,8 @@
cflatobjs += \
test/lib/powerpc/44x/map.o \
- test/lib/powerpc/44x/tlbwe.o
+ test/lib/powerpc/44x/tlbwe.o \
+ test/lib/powerpc/44x/timebase.o
simpletests += \
test/powerpc/44x/tlbsx.bin \
diff --git a/user/test/lib/powerpc/44x/timebase.S b/user/test/lib/powerpc/44x/timebase.S
new file mode 100644
--- /dev/null
+++ b/user/test/lib/powerpc/44x/timebase.S
@@ -0,0 +1,28 @@
+/*
+ * 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: Hollis Blanchard <hollisb@us.ibm.com>
+ */
+
+/* unsigned long long mftb(void); */
+.global mftb
+mftb:
+ mftbu r5
+ mftbl r4
+ mftbu r3
+ cmpw r3, r5
+ bne mftb
+ blr
diff --git a/user/test/lib/powerpc/44x/timebase.h b/user/test/lib/powerpc/44x/timebase.h
new file mode 100644
--- /dev/null
+++ b/user/test/lib/powerpc/44x/timebase.h
@@ -0,0 +1,25 @@
+/*
+ * 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: Hollis Blanchard <hollisb@us.ibm.com>
+ */
+
+#ifndef __TIMEBASE_H__
+#define __TIMEBASE_H__
+
+unsigned long long mftb(void);
+
+#endif /* __TIMEBASE_H__ */
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 5/5] user: ppc: add stub nmi handler
[not found] ` <1225184902-25769-1-git-send-email-ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2008-10-28 9:08 ` [PATCH 3/5] user: ppc: implement PowerPC 44x libcflat ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8
@ 2008-10-28 9:08 ` ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8
2008-10-28 9:25 ` [PATCH 0/3] kvm-userspace: ppc: userspace fixes for powerpc Christian Ehrhardt
2 siblings, 0 replies; 7+ messages in thread
From: ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8 @ 2008-10-28 9:08 UTC (permalink / raw)
To: kvm-ppc-u79uwXL29TY76Z2rM5mHXA, kvm-u79uwXL29TY76Z2rM5mHXA,
avi-atKUWr5tajBWk0Htik3J/w
Cc: hollisb-r/Jw6+rmf7HQT0dZR+AlfA,
ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8
From: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Adding a nmi stub handler for user/main-ppc.c. We already pushed a stub
for qemu but not for the test suite in the user dir.
Signed-off-by: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
---
[diffstat]
main-ppc.c | 6 ++++++
1 file changed, 6 insertions(+)
[diff]
diff --git a/user/main-ppc.c b/user/main-ppc.c
--- a/user/main-ppc.c
+++ b/user/main-ppc.c
@@ -83,6 +83,11 @@ static int test_io_window(void *opaque)
}
static int test_try_push_interrupts(void *opaque)
+{
+ return 0;
+}
+
+static int test_try_push_nmi(void *opaque)
{
return 0;
}
@@ -175,6 +180,7 @@ static struct kvm_callbacks test_callbac
.halt = test_halt,
.io_window = test_io_window,
.try_push_interrupts = test_try_push_interrupts,
+ .try_push_nmi = test_try_push_nmi,
.post_kvm_run = test_post_kvm_run,
.pre_kvm_run = test_pre_kvm_run,
.powerpc_dcr_read = test_dcr_read,
--
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 [flat|nested] 7+ messages in thread
* Re: [PATCH 0/3] kvm-userspace: ppc: userspace fixes for powerpc
[not found] ` <1225184902-25769-1-git-send-email-ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2008-10-28 9:08 ` [PATCH 3/5] user: ppc: implement PowerPC 44x libcflat ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8
2008-10-28 9:08 ` [PATCH 5/5] user: ppc: add stub nmi handler ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8
@ 2008-10-28 9:25 ` Christian Ehrhardt
2 siblings, 0 replies; 7+ messages in thread
From: Christian Ehrhardt @ 2008-10-28 9:25 UTC (permalink / raw)
To: kvm-ppc-u79uwXL29TY76Z2rM5mHXA, kvm-u79uwXL29TY76Z2rM5mHXA,
avi-atKUWr5tajBWk0Htik3J/w
Cc: hollisb-r/Jw6+rmf7HQT0dZR+AlfA
Ok I should have send these two series with some minutes in between to
not intermix them :-/
Additionally I have the wrong header in this one it should be [0/5] :-/++
Overall it is a patch series of three patches for powerpc kvm-userspace,
a five patch series for kvm-suerspace/user/ and a single patch I just
submitted while cleaning our userspace repo to get the missing things
upstream.
Avi, let me know if I confused you and I'll send them once again with
some time in between to order them easier.
ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org wrote:
> From: Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
>
> This is a set of fixes for the powerpc tests kvm-userspace/user.
>
> Patch 1&2 fix main-ppc.c while patch 3 introduces libcflat for powerpc.
> Further on patch 4 provides a timebase accessor for the ppc testcases (not
> used yet) and patch 5 finally adds a stub nmi handler to main-ppc.c.
>
> [patches in series]
> [PATCH 1/5] user: ppc: fix threading bugs in main-ppc.c
> [PATCH 2/5] user: ppc: better error reporting in load_file
> [PATCH 3/5] user: ppc: implement PowerPC 44x libcflat
> [PATCH 4/5] libcflat: ppc: add timebase accessor
> [PATCH 5/5] user: ppc: add stub nmi handler
>
> ---
> [diffstat]
> b/user/config-powerpc-44x.mak | 14 +++++++++
> b/user/config-powerpc.mak | 46 ++++++++++++++++++++---------
> b/user/main-ppc.c | 32 +++++++-------------
> b/user/test/lib/powerpc/44x/map.c | 51 +++++++++++++++++++++++++++++++++
> b/user/test/lib/powerpc/44x/timebase.S | 28 ++++++++++++++++++
> b/user/test/lib/powerpc/44x/timebase.h | 25 ++++++++++++++++
> b/user/test/lib/powerpc/44x/tlbwe.S | 29 ++++++++++++++++++
> b/user/test/lib/powerpc/io.c | 35 ++++++++++++++++++++++
> b/user/test/powerpc/cstart.S | 38 ++++++++++++++++++++++++
> b/user/test/powerpc/exit.c | 23 ++++++++++++++
> user/config-powerpc-44x.mak | 3 +
> user/main-ppc.c | 9 +++++
> 12 files changed, 296 insertions(+), 37 deletions(-)
> --
> 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
>
--
Grüsse / regards,
Christian Ehrhardt
IBM Linux Technology Center, Open Virtualization
--
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 [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-10-28 9:25 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-28 9:08 [PATCH 0/3] kvm-userspace: ppc: userspace fixes for powerpc ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8
2008-10-28 9:08 ` [PATCH 1/5] user: ppc: fix threading bugs in main-ppc.c ehrhardt
2008-10-28 9:08 ` [PATCH 2/5] user: ppc: better error reporting in load_file ehrhardt
[not found] ` <1225184902-25769-1-git-send-email-ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2008-10-28 9:08 ` [PATCH 3/5] user: ppc: implement PowerPC 44x libcflat ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8
2008-10-28 9:08 ` [PATCH 5/5] user: ppc: add stub nmi handler ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8
2008-10-28 9:25 ` [PATCH 0/3] kvm-userspace: ppc: userspace fixes for powerpc Christian Ehrhardt
2008-10-28 9:08 ` [PATCH 4/5] libcflat: ppc: add timebase accessor ehrhardt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox