* [PATCH] fill kvm_callback with arch specific dcr_read/dcr_write callbacks v2
@ 2008-01-11 12:12 Christian Ehrhardt
[not found] ` <12000535753569-git-send-email-ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Christian Ehrhardt @ 2008-01-11 12:12 UTC (permalink / raw)
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Cc: Christian Ehrhardt,
Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>; Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>; Jerone Young
Subject: [PATCH] fill kvm_callback with arch specific dcr_read/dcr_write callbacks v2
From: Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
This Patch adds the callback assignment and handlers for powerpc_dcr_read
and ppc_dcr_write which are called from libkvm.
This is the part of the patch that changes already submitted code.
Changes in v2:
The function arguments of powerpc_dcr_read/write changed. Since main-ppc.c
is not yet upstream when you check out from kvm-userspace.git I didn't see it.
But Avi replied with "Applied all, thanks." to the three patches from
01/09/2008 bringing main-ppc.c into kvm-userspace this v2 patch includes the
needed code for that file too.
Signed-off-by: Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
libkvm/libkvm-powerpc.c | 8 ++++----
libkvm/libkvm.h | 4 ++--
qemu/qemu-kvm.c | 4 ++++
qemu/qemu-kvm.h | 5 +++++
user/main-ppc.c | 4 ++--
5 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/libkvm/libkvm-powerpc.c b/libkvm/libkvm-powerpc.c
--- a/libkvm/libkvm-powerpc.c
+++ b/libkvm/libkvm-powerpc.c
@@ -31,11 +31,11 @@ int handle_dcr(struct kvm_run *run, kvm
int ret = 0;
if (run->dcr.is_write)
- ret = kvm->callbacks->powerpc_dcr_write(kvm,
- run->dcr.dcrn,run->dcr.data);
+ ret = kvm->callbacks->powerpc_dcr_write(run->dcr.dcrn,
+ run->dcr.data);
else
- ret = kvm->callbacks->powerpc_dcr_read(kvm,
- run->dcr.dcrn, &(run->dcr.data));
+ ret = kvm->callbacks->powerpc_dcr_read(run->dcr.dcrn,
+ &(run->dcr.data));
return ret;
}
diff --git a/libkvm/libkvm.h b/libkvm/libkvm.h
--- a/libkvm/libkvm.h
+++ b/libkvm/libkvm.h
@@ -66,8 +66,8 @@ struct kvm_callbacks {
int (*pre_kvm_run)(void *opaque, int vcpu);
int (*tpr_access)(void *opaque, int vcpu, uint64_t rip, int is_write);
#if defined(__powerpc__)
- int (*powerpc_dcr_read)(kvm_context_t kvm, uint32_t dcrn, uint32_t *data);
- int (*powerpc_dcr_write)(kvm_context_t kvm, uint32_t dcrn, uint32_t data);
+ int (*powerpc_dcr_read)(uint32_t dcrn, uint32_t *data);
+ int (*powerpc_dcr_write)(uint32_t dcrn, uint32_t data);
#endif
};
diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
--- a/qemu/qemu-kvm.c
+++ b/qemu/qemu-kvm.c
@@ -533,6 +533,10 @@ static struct kvm_callbacks qemu_kvm_ops
#ifdef TARGET_I386
.tpr_access = handle_tpr_access,
#endif
+#ifdef TARGET_PPC
+ .powerpc_dcr_read = handle_powerpc_dcr_read,
+ .powerpc_dcr_write = handle_powerpc_dcr_write,
+#endif
};
int kvm_qemu_init()
diff --git a/qemu/qemu-kvm.h b/qemu/qemu-kvm.h
--- a/qemu/qemu-kvm.h
+++ b/qemu/qemu-kvm.h
@@ -48,6 +48,11 @@ int handle_tpr_access(void *opaque, int
int handle_tpr_access(void *opaque, int vcpu,
uint64_t rip, int is_write);
+#ifdef TARGET_PPC
+int handle_powerpc_dcr_read(uint32_t dcrn, uint32_t *data);
+int handle_powerpc_dcr_write(uint32_t dcrn, uint32_t data);
+#endif
+
#define ALIGN(x, y) (((x)+(y)-1) & ~((y)-1))
#define BITMAP_SIZE(m) (ALIGN(((m)>>TARGET_PAGE_BITS), HOST_LONG_BITS) / 8)
diff --git a/user/main-ppc.c b/user/main-ppc.c
--- a/user/main-ppc.c
+++ b/user/main-ppc.c
@@ -106,14 +106,14 @@ static int test_mem_write(void *opaque,
return 0;
}
-static int test_dcr_read(kvm_context_t kvm, uint32_t dcrn, uint32_t *data)
+static int test_dcr_read(uint32_t dcrn, uint32_t *data)
{
printf("%s: dcrn %04X\n", __func__, dcrn);
*data = 0;
return 0;
}
-static int test_dcr_write(kvm_context_t kvm, uint32_t dcrn, uint32_t data)
+static int test_dcr_write(uint32_t dcrn, uint32_t data)
{
printf("%s: dcrn %04X data %04X\n", __func__, dcrn, data);
return 0;
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] fill kvm_callback with arch specific dcr_read/dcr_write callbacks v2
[not found] ` <12000535753569-git-send-email-ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
@ 2008-01-13 9:22 ` Avi Kivity
[not found] ` <4789D855.2090600-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Avi Kivity @ 2008-01-13 9:22 UTC (permalink / raw)
To: Christian Ehrhardt
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>; Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>; Jerone Young
Christian Ehrhardt wrote:
> Subject: [PATCH] fill kvm_callback with arch specific dcr_read/dcr_write callbacks v2
> From: Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
>
> This Patch adds the callback assignment and handlers for powerpc_dcr_read
> and ppc_dcr_write which are called from libkvm.
> This is the part of the patch that changes already submitted code.
> Changes in v2:
> The function arguments of powerpc_dcr_read/write changed. Since main-ppc.c
> is not yet upstream when you check out from kvm-userspace.git I didn't see it.
> But Avi replied with "Applied all, thanks." to the three patches from
> 01/09/2008 bringing main-ppc.c into kvm-userspace this v2 patch includes the
> needed code for that file too.
>
Sorry, I forgot to push after applying. I'll apply this incrementally.
--
error compiling committee.c: too many arguments to function
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] fill kvm_callback with arch specific dcr_read/dcr_write callbacks v2
[not found] ` <4789D855.2090600-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2008-01-13 9:24 ` Avi Kivity
[not found] ` <4789D8BF.6060604-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Avi Kivity @ 2008-01-13 9:24 UTC (permalink / raw)
To: Christian Ehrhardt
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>; Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>; Jerone Young
Avi Kivity wrote:
> Christian Ehrhardt wrote:
>> Subject: [PATCH] fill kvm_callback with arch specific
>> dcr_read/dcr_write callbacks v2
>> From: Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
>>
>> This Patch adds the callback assignment and handlers for
>> powerpc_dcr_read
>> and ppc_dcr_write which are called from libkvm.
>> This is the part of the patch that changes already submitted code.
>> Changes in v2:
>> The function arguments of powerpc_dcr_read/write changed. Since
>> main-ppc.c
>> is not yet upstream when you check out from kvm-userspace.git I
>> didn't see it.
>> But Avi replied with "Applied all, thanks." to the three patches from
>> 01/09/2008 bringing main-ppc.c into kvm-userspace this v2 patch
>> includes the
>> needed code for that file too.
>>
>
> Sorry, I forgot to push after applying. I'll apply this incrementally.
>
Or rather, please send a new patch. I'd rather not risk mucking with
code I can't compile.
--
error compiling committee.c: too many arguments to function
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] fill kvm_callback with arch specific dcr_read/dcr_write callbacks v2
[not found] ` <4789D8BF.6060604-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2008-01-14 8:55 ` Christian Ehrhardt
0 siblings, 0 replies; 4+ messages in thread
From: Christian Ehrhardt @ 2008-01-14 8:55 UTC (permalink / raw)
To: Avi Kivity
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>; Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>; Jerone Young
Avi Kivity wrote:
> Avi Kivity wrote:
>> Christian Ehrhardt wrote:
>>> Subject: [PATCH] fill kvm_callback with arch specific
>>> dcr_read/dcr_write callbacks v2
>>> From: Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
>>>
>>> This Patch adds the callback assignment and handlers for
>>> powerpc_dcr_read
>>> and ppc_dcr_write which are called from libkvm.
>>> This is the part of the patch that changes already submitted code.
>>> Changes in v2:
>>> The function arguments of powerpc_dcr_read/write changed. Since
>>> main-ppc.c
>>> is not yet upstream when you check out from kvm-userspace.git I
>>> didn't see it.
>>> But Avi replied with "Applied all, thanks." to the three patches from
>>> 01/09/2008 bringing main-ppc.c into kvm-userspace this v2 patch
>>> includes the
>>> needed code for that file too.
>>>
>> Sorry, I forgot to push after applying. I'll apply this incrementally.
>>
>
> Or rather, please send a new patch. I'd rather not risk mucking with
> code I can't compile.
I wrote it a bit misleading, this patch is already the merge of both, so because version 1 is not in the repository you can just add this one which patches all referred issues at once.
I tested it - it still works and matches todays head of kvm-userspace.git.
To be sure I'll resubmit it so you don't need to go through your old mails.
--
Grüsse / regards,
Christian Ehrhardt
IBM Linux Technology Center, Open Virtualization
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-01-14 8:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-11 12:12 [PATCH] fill kvm_callback with arch specific dcr_read/dcr_write callbacks v2 Christian Ehrhardt
[not found] ` <12000535753569-git-send-email-ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2008-01-13 9:22 ` Avi Kivity
[not found] ` <4789D855.2090600-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-13 9:24 ` Avi Kivity
[not found] ` <4789D8BF.6060604-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-14 8:55 ` Christian Ehrhardt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox