Re: qemu-kvm.git now live

2009-05-01 Thread Hollis Blanchard
On Wed, 2009-04-29 at 11:31 +0300, Avi Kivity wrote:
 Hollis Blanchard wrote:
  Since PPC is now supported in upstream QEMU, does it really matter if it 
  works in qemu-kvm.git?
  
 
  I was going to take that position too, except Avi asked me specifically
  if some of the code inside TARGET_I386 ifdefs in qemu-kvm.c works for
  other architectures.
 
 In that case it's sufficient to have the build system use the upstream 
 kvm integration (CONFIG_KVM) rather than the qemu-kvm integration (USE_KVM).

OK, I give up... how is this supposed to work? Nobody ever sets
CONFIG_KVM or KVM_UPSTREAM, but there are a couple tests for it. Glauber
once sent a patch related to that, but I don't see how it helps.

For reference, the actual error is about a hundred instances of e.g.
/home/hollisb/source/qemu-kvm.git/vl.c:3393: undefined reference
to `kvm_allowed'

-- 
Hollis Blanchard
IBM Linux Technology Center

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


[PATCH 1/5] [libkvm] Rename config-powerpc to config-ppc

2009-05-01 Thread Hollis Blanchard
Apparently $(ARCH) now holds the qemu meaning, rather than the KVM meaning.

Signed-off-by: Hollis Blanchard holl...@us.ibm.com
---
 kvm/libkvm/config-powerpc.mak |4 
 kvm/libkvm/config-ppc.mak |4 
 2 files changed, 4 insertions(+), 4 deletions(-)
 delete mode 100644 kvm/libkvm/config-powerpc.mak
 create mode 100644 kvm/libkvm/config-ppc.mak

diff --git a/kvm/libkvm/config-powerpc.mak b/kvm/libkvm/config-powerpc.mak
deleted file mode 100644
index 091da37..000
--- a/kvm/libkvm/config-powerpc.mak
+++ /dev/null
@@ -1,4 +0,0 @@
-
-LIBDIR := /lib
-
-libkvm-$(ARCH)-objs := libkvm-powerpc.o
diff --git a/kvm/libkvm/config-ppc.mak b/kvm/libkvm/config-ppc.mak
new file mode 100644
index 000..091da37
--- /dev/null
+++ b/kvm/libkvm/config-ppc.mak
@@ -0,0 +1,4 @@
+
+LIBDIR := /lib
+
+libkvm-$(ARCH)-objs := libkvm-powerpc.o
-- 
1.6.0.6

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


[PATCH 2/5] [qemu-kvm] Fix warning when__ia64__ is not defined.

2009-05-01 Thread Hollis Blanchard
Signed-off-by: Hollis Blanchard holl...@us.ibm.com
---
 kvm/libkvm/kvm-common.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kvm/libkvm/kvm-common.h b/kvm/libkvm/kvm-common.h
index 96361e8..591fb53 100644
--- a/kvm/libkvm/kvm-common.h
+++ b/kvm/libkvm/kvm-common.h
@@ -22,7 +22,7 @@
 #define KVM_MAX_NUM_MEM_REGIONS 1u
 #define MAX_VCPUS 64
 #define LIBKVM_S390_ORIGIN (0UL)
-#elif __ia64__
+#elif defined(__ia64__)
 #define KVM_MAX_NUM_MEM_REGIONS 32u
 #define MAX_VCPUS 256
 #else
-- 
1.6.0.6

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


[PATCH 3/5] [qemu-kvm] Fix missing prototype warning.

2009-05-01 Thread Hollis Blanchard
As far as I can see, kvm_destroy_memory_region_works() has nothing to do with
KVM_CAP_DEVICE_ASSIGNMENT, so move the prototype outside that ifdef block.

Signed-off-by: Hollis Blanchard holl...@us.ibm.com
---
 kvm/libkvm/libkvm.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kvm/libkvm/libkvm.h b/kvm/libkvm/libkvm.h
index ce6f054..c23d37b 100644
--- a/kvm/libkvm/libkvm.h
+++ b/kvm/libkvm/libkvm.h
@@ -739,6 +739,7 @@ int kvm_assign_irq(kvm_context_t kvm,
 int kvm_deassign_irq(kvm_context_t kvm,
struct kvm_assigned_irq *assigned_irq);
 #endif
+#endif
 
 /*!
  * \brief Determines whether destroying memory regions is allowed
@@ -748,7 +749,6 @@ int kvm_deassign_irq(kvm_context_t kvm,
  * \param kvm Pointer to the current kvm_context
  */
 int kvm_destroy_memory_region_works(kvm_context_t kvm);
-#endif
 
 #ifdef KVM_CAP_DEVICE_DEASSIGNMENT
 /*!
-- 
1.6.0.6

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


[PATCH 4/5] [qemu-kvm] Use CAP_IRQ_ROUTING in kvm_get_irq_route_gsi()

2009-05-01 Thread Hollis Blanchard
This fixes a build break when KVM_IOAPIC_NUM_PINS is not defined.

Signed-off-by: Hollis Blanchard holl...@us.ibm.com
---
 kvm/libkvm/libkvm.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/kvm/libkvm/libkvm.c b/kvm/libkvm/libkvm.c
index 0610e3f..ba0a5d1 100644
--- a/kvm/libkvm/libkvm.c
+++ b/kvm/libkvm/libkvm.c
@@ -1406,6 +1406,7 @@ int kvm_commit_irq_routes(kvm_context_t kvm)
 
 int kvm_get_irq_route_gsi(kvm_context_t kvm)
 {
+#ifdef KVM_CAP_IRQ_ROUTING
if (kvm-max_used_gsi = KVM_IOAPIC_NUM_PINS)  {
if (kvm-max_used_gsi = kvm_get_gsi_count(kvm))
 return kvm-max_used_gsi + 1;
@@ -1413,6 +1414,9 @@ int kvm_get_irq_route_gsi(kvm_context_t kvm)
 return -ENOSPC;
 } else
 return KVM_IOAPIC_NUM_PINS;
+#else
+   return -ENOSYS;
+#endif
 }
 
 #ifdef KVM_CAP_DEVICE_MSIX
-- 
1.6.0.6

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


[PATCH 5/5] patch add_powerpc_kvm_headers.diff

2009-05-01 Thread Hollis Blanchard
---
 kvm/kernel/arch/powerpc/include/asm/kvm.h  |  102 +++
 kvm/kernel/arch/powerpc/include/asm/kvm_44x.h  |  108 +++
 kvm/kernel/arch/powerpc/include/asm/kvm_asm.h  |  100 ++
 kvm/kernel/arch/powerpc/include/asm/kvm_e500.h |  107 +++
 kvm/kernel/arch/powerpc/include/asm/kvm_host.h |  232 
 kvm/kernel/arch/powerpc/include/asm/kvm_para.h |   77 
 kvm/kernel/arch/powerpc/include/asm/kvm_ppc.h  |  137 ++
 7 files changed, 863 insertions(+), 0 deletions(-)
 create mode 100644 kvm/kernel/arch/powerpc/include/asm/kvm.h
 create mode 100644 kvm/kernel/arch/powerpc/include/asm/kvm_44x.h
 create mode 100644 kvm/kernel/arch/powerpc/include/asm/kvm_asm.h
 create mode 100644 kvm/kernel/arch/powerpc/include/asm/kvm_e500.h
 create mode 100644 kvm/kernel/arch/powerpc/include/asm/kvm_host.h
 create mode 100644 kvm/kernel/arch/powerpc/include/asm/kvm_para.h
 create mode 100644 kvm/kernel/arch/powerpc/include/asm/kvm_ppc.h

diff --git a/kvm/kernel/arch/powerpc/include/asm/kvm.h 
b/kvm/kernel/arch/powerpc/include/asm/kvm.h
new file mode 100644
index 000..c4f1ed1
--- /dev/null
+++ b/kvm/kernel/arch/powerpc/include/asm/kvm.h
@@ -0,0 +1,102 @@
+#ifndef KVM_UNIFDEF_H
+#define KVM_UNIFDEF_H
+
+#ifdef __i386__
+#ifndef CONFIG_X86_32
+#define CONFIG_X86_32 1
+#endif
+#endif
+
+#ifdef __x86_64__
+#ifndef CONFIG_X86_64
+#define CONFIG_X86_64 1
+#endif
+#endif
+
+#if defined(__i386__) || defined (__x86_64__)
+#ifndef CONFIG_X86
+#define CONFIG_X86 1
+#endif
+#endif
+
+#ifdef __ia64__
+#ifndef CONFIG_IA64
+#define CONFIG_IA64 1
+#endif
+#endif
+
+#ifdef __PPC__
+#ifndef CONFIG_PPC
+#define CONFIG_PPC 1
+#endif
+#endif
+
+#ifdef __s390__
+#ifndef CONFIG_S390
+#define CONFIG_S390 1
+#endif
+#endif
+
+#endif
+/*
+ * 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. 2007
+ *
+ * Authors: Hollis Blanchard holl...@us.ibm.com
+ */
+
+#ifndef __LINUX_KVM_POWERPC_H
+#define __LINUX_KVM_POWERPC_H
+
+#include linux/types.h
+
+struct kvm_regs {
+   __u64 pc;
+   __u64 cr;
+   __u64 ctr;
+   __u64 lr;
+   __u64 xer;
+   __u64 msr;
+   __u64 srr0;
+   __u64 srr1;
+   __u64 pid;
+
+   __u64 sprg0;
+   __u64 sprg1;
+   __u64 sprg2;
+   __u64 sprg3;
+   __u64 sprg4;
+   __u64 sprg5;
+   __u64 sprg6;
+   __u64 sprg7;
+
+   __u64 gpr[32];
+};
+
+struct kvm_sregs {
+};
+
+struct kvm_fpu {
+   __u64 fpr[32];
+};
+
+struct kvm_debug_exit_arch {
+};
+
+/* for KVM_SET_GUEST_DEBUG */
+struct kvm_guest_debug_arch {
+};
+
+#endif /* __LINUX_KVM_POWERPC_H */
diff --git a/kvm/kernel/arch/powerpc/include/asm/kvm_44x.h 
b/kvm/kernel/arch/powerpc/include/asm/kvm_44x.h
new file mode 100644
index 000..956f252
--- /dev/null
+++ b/kvm/kernel/arch/powerpc/include/asm/kvm_44x.h
@@ -0,0 +1,108 @@
+#ifndef KVM_UNIFDEF_H
+#define KVM_UNIFDEF_H
+
+#ifdef __i386__
+#ifndef CONFIG_X86_32
+#define CONFIG_X86_32 1
+#endif
+#endif
+
+#ifdef __x86_64__
+#ifndef CONFIG_X86_64
+#define CONFIG_X86_64 1
+#endif
+#endif
+
+#if defined(__i386__) || defined (__x86_64__)
+#ifndef CONFIG_X86
+#define CONFIG_X86 1
+#endif
+#endif
+
+#ifdef __ia64__
+#ifndef CONFIG_IA64
+#define CONFIG_IA64 1
+#endif
+#endif
+
+#ifdef __PPC__
+#ifndef CONFIG_PPC
+#define CONFIG_PPC 1
+#endif
+#endif
+
+#ifdef __s390__
+#ifndef CONFIG_S390
+#define CONFIG_S390 1
+#endif
+#endif
+
+#endif
+/*
+ * 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 holl...@us.ibm.com
+ */
+
+#ifndef __ASM_44X_H__
+#define __ASM_44X_H__
+
+#include linux/kvm_host.h
+
+#define PPC44x_TLB_SIZE 64
+
+/* If the guest is expecting it, this can be as large as we like; we'd just
+ * need to 

Re: qemu-kvm.git now live

2009-05-01 Thread Anthony Liguori

Hollis Blanchard wrote:

On Wed, 2009-04-29 at 11:29 +0300, Avi Kivity wrote:
  


  * configure completely ignores --kerneldir and only uses
kvm/kernel headers instead.
  
  

That's intentional.



Huh? If --kerneldir does nothing, why does it exist?
  


BTW Avi, if you intend on carrying the KVM kernel headers in qemu-kvm, I 
see no strong reason not to do the same in QEMU.


I'd like to move them from kvm/kernel/include to kvm/include.  I'm open 
to suggestion actually.


How often do you intend on updating the headers?

Regards,

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