qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] PPC: Add non-kvm stub file
@ 2013-06-28 11:54 Alexander Graf
  2013-06-28 11:56 ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Graf @ 2013-06-28 11:54 UTC (permalink / raw)
  To: qemu-ppc; +Cc: Paolo Bonzini, qemu-devel, Peter Maydell

There are cases where a kvm provided function is called from generic
hw code that doesn't know whether kvm is available or not. Provide
a stub file which can provide simple replacement functions for those
cases.

Signed-off-by: Alexander Graf <agraf@suse.de>

diff --git a/target-ppc/Makefile.objs b/target-ppc/Makefile.objs
index 2c43c34..6e78cb3 100644
--- a/target-ppc/Makefile.objs
+++ b/target-ppc/Makefile.objs
@@ -5,6 +5,7 @@ obj-y += machine.o mmu_helper.o mmu-hash32.o
 obj-$(TARGET_PPC64) += mmu-hash64.o
 endif
 obj-$(CONFIG_KVM) += kvm.o kvm_ppc.o
+obj-$(CONFIG_NO_KVM) += kvm-stub.o
 obj-y += excp_helper.o
 obj-y += fpu_helper.o
 obj-y += int_helper.o
diff --git a/target-ppc/kvm-stub.c b/target-ppc/kvm-stub.c
new file mode 100644
index 0000000..0f5c27d
--- /dev/null
+++ b/target-ppc/kvm-stub.c
@@ -0,0 +1,12 @@
+/*
+ * QEMU KVM PPC specific function stubs
+ *
+ * Copyright Freescale Inc. 2013
+ *
+ * Author: Alexander Graf <agraf@suse.de>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ */
+#include "qemu-common.h"

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

* Re: [Qemu-devel] [Qemu-ppc] [PATCH] PPC: Add non-kvm stub file
  2013-06-28 11:54 [Qemu-devel] [PATCH] PPC: Add non-kvm stub file Alexander Graf
@ 2013-06-28 11:56 ` Alexander Graf
  2013-06-28 12:12   ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Graf @ 2013-06-28 11:56 UTC (permalink / raw)
  To: qemu-ppc; +Cc: Paolo Bonzini, qemu-devel, Peter Maydell


On 28.06.2013, at 13:54, Alexander Graf wrote:

> There are cases where a kvm provided function is called from generic
> hw code that doesn't know whether kvm is available or not. Provide
> a stub file which can provide simple replacement functions for those
> cases.
> 
> Signed-off-by: Alexander Graf <agraf@suse.de>

This by itself looks quite meager. I want to prepend this to the openpic kvm patch and squash the following chunk into that one to fix broken compilation on non-ppc systems:


diff --git a/target-ppc/kvm-stub.c b/target-ppc/kvm-stub.c
index 0f5c27d..ee3f5d2 100644
--- a/target-ppc/kvm-stub.c
+++ b/target-ppc/kvm-stub.c
@@ -10,3 +10,9 @@
  *
  */
 #include "qemu-common.h"
+#include "hw/ppc/openpic.h"
+
+int kvm_openpic_connect_vcpu(DeviceState *d, CPUState *cs)
+{
+    return -EINVAL;
+}

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

* Re: [Qemu-devel] [Qemu-ppc] [PATCH] PPC: Add non-kvm stub file
  2013-06-28 11:56 ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
@ 2013-06-28 12:12   ` Paolo Bonzini
  0 siblings, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2013-06-28 12:12 UTC (permalink / raw)
  To: Alexander Graf; +Cc: Peter Maydell, qemu-ppc, qemu-devel

Il 28/06/2013 13:56, Alexander Graf ha scritto:
> 
> On 28.06.2013, at 13:54, Alexander Graf wrote:
> 
>> There are cases where a kvm provided function is called from generic
>> hw code that doesn't know whether kvm is available or not. Provide
>> a stub file which can provide simple replacement functions for those
>> cases.
>>
>> Signed-off-by: Alexander Graf <agraf@suse.de>
> 
> This by itself looks quite meager. I want to prepend this to the openpic kvm patch and squash the following chunk into that one to fix broken compilation on non-ppc systems:
> 
> 
> diff --git a/target-ppc/kvm-stub.c b/target-ppc/kvm-stub.c
> index 0f5c27d..ee3f5d2 100644
> --- a/target-ppc/kvm-stub.c
> +++ b/target-ppc/kvm-stub.c
> @@ -10,3 +10,9 @@
>   *
>   */
>  #include "qemu-common.h"
> +#include "hw/ppc/openpic.h"
> +
> +int kvm_openpic_connect_vcpu(DeviceState *d, CPUState *cs)
> +{
> +    return -EINVAL;
> +}
> 

Yup,

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

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

end of thread, other threads:[~2013-06-28 12:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-28 11:54 [Qemu-devel] [PATCH] PPC: Add non-kvm stub file Alexander Graf
2013-06-28 11:56 ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
2013-06-28 12:12   ` Paolo Bonzini

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).