* [Qemu-devel] Re: [kvm-devel] [PATCH][UPDATE] kvm-userspace: sync icache for morearchitectures
[not found] ` <42DFA526FC41B1429CE7279EF83C6BDCAD01E3@pdsmsx415.ccr.corp.intel.com>
@ 2007-12-14 9:07 ` Christian Ehrhardt
2007-12-14 10:18 ` [Qemu-devel] " Zhang, Xiantao
2007-12-18 1:56 ` [Qemu-devel] " Hollis Blanchard
0 siblings, 2 replies; 4+ messages in thread
From: Christian Ehrhardt @ 2007-12-14 9:07 UTC (permalink / raw)
To: Zhang, Xiantao; +Cc: kvm-devel, kvm-ppc-devel, hollisb, qemu-devel
Zhang, Xiantao wrote:
>Christian Ehrhardt wrote:
<[...]
>> @@ -2600,8 +2601,8 @@ void cpu_physical_memory_rw(target_phys_addr_t
>> addr, uint8_t *buf, phys_ram_dirty[addr1 >>
>> TARGET_PAGE_BITS] |= (0xff &
>> ~CODE_DIRTY_FLAG); }
>> -#ifdef __ia64__
>> - kvm_sync_icache((unsigned long)ptr, l);
>> +#ifdef USE_KVM
>> + flush_icache_range((unsigned long)ptr, ((unsigned
> long)ptr)+l);
>
> Are you sure ia64 implement this function for applications ? I didn't
> find it at my side, so I write it.
What do you mean with "implement it for applications" ?
Take a look at dyngen.h - it starts with the comment "dyngen helpers"
and contains a lot of static functions to use them where you need.
I don't see anything obvious that would prevent these functions from
being built and the file has no own include statements which may
change that. Therefor the include "dyngen.h" in the USE_KVM case
should be enough to have this function available for
cpu_physical_memory_rw in exec.c where we need it.
[...]
> Xiantao
---
Hollis Blanchard wrote:
> A comment to explain why the icache needs flushing only in the KVM case
> would be useful. Other than that I'm fine with it.
>
> Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
AFAIK Plain qemu does not directly execute guest code on the processor,
so the icache is not an issue for it.
Qemu itself has the flush_icache_range function only as helper for the
dynamic code generation.
But we may now write executable guest code with our intercepted mmio
handling that is directly executed when switching back to the guest
context, therefore we need that invalidation in the kvm case.
For the case that I'm overlooking something in plain qemu, so that it
might need it too I add qemu-devel@nongnu.org for comments from there,
but currently I think to have it in #ifdef USE_KVM is the right way.
P.S. Hollis did you mean you would like to see a comment in the code
where that call takes place?
--
Grüsse / regards,
Christian Ehrhardt
IBM Linux Technology Center, Open Virtualization
+49 7031/16-3385
Ehrhardt@linux.vnet.ibm.com
Ehrhardt@de.ibm.com
IBM Deutschland Entwicklung GmbH
Vorsitzender des Aufsichtsrats: Johann Weihen
Geschäftsführung: Herbert Kircher
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] RE: [kvm-devel] [PATCH][UPDATE] kvm-userspace: sync icache for morearchitectures
2007-12-14 9:07 ` [Qemu-devel] Re: [kvm-devel] [PATCH][UPDATE] kvm-userspace: sync icache for morearchitectures Christian Ehrhardt
@ 2007-12-14 10:18 ` Zhang, Xiantao
2007-12-18 1:56 ` [Qemu-devel] " Hollis Blanchard
1 sibling, 0 replies; 4+ messages in thread
From: Zhang, Xiantao @ 2007-12-14 10:18 UTC (permalink / raw)
To: Christian Ehrhardt; +Cc: kvm-devel, kvm-ppc-devel, hollisb, qemu-devel
Christian Ehrhardt wrote:
> Zhang, Xiantao wrote:
>> Christian Ehrhardt wrote:
> <[...]
>>> @@ -2600,8 +2601,8 @@ void cpu_physical_memory_rw(target_phys_addr_t
>>> addr, uint8_t *buf, phys_ram_dirty[addr1 >>
>>> TARGET_PAGE_BITS] |= (0xff &
>>> ~CODE_DIRTY_FLAG); }
>>> -#ifdef __ia64__
>>> - kvm_sync_icache((unsigned long)ptr, l);
>>> +#ifdef USE_KVM
>>> + flush_icache_range((unsigned long)ptr, ((unsigned
long)ptr)+l);
>>
>> Are you sure ia64 implement this function for applications ? I didn't
>> find it at my side, so I write it.
> What do you mean with "implement it for applications" ?
> Take a look at dyngen.h - it starts with the comment "dyngen helpers"
> and contains a lot of static functions to use them where you need.
> I don't see anything obvious that would prevent these functions from
> being built and the file has no own include statements which may
> change that. Therefor the include "dyngen.h" in the USE_KVM case
> should be enough to have this function available for
> cpu_physical_memory_rw in exec.c where we need it.
Good! I didn't notice this definition. Originally, I think you mean it
is a library functions. :)
>
> Hollis Blanchard wrote:
>> A comment to explain why the icache needs flushing only in the KVM
>> case would be useful. Other than that I'm fine with it.
>>
>> Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
> AFAIK Plain qemu does not directly execute guest code on the
> processor, so the icache is not an issue for it.
> Qemu itself has the flush_icache_range function only as helper for the
> dynamic code generation.
> But we may now write executable guest code with our intercepted mmio
> handling that is directly executed when switching back to the guest
> context, therefore we need that invalidation in the kvm case.
>
> For the case that I'm overlooking something in plain qemu, so that it
> might need it too I add qemu-devel@nongnu.org for comments from there,
> but currently I think to have it in #ifdef USE_KVM is the right way.
>
>
> P.S. Hollis did you mean you would like to see a comment in the code
> where that call takes place?
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] Re: [kvm-devel] [PATCH][UPDATE] kvm-userspace: sync icache for morearchitectures
2007-12-14 9:07 ` [Qemu-devel] Re: [kvm-devel] [PATCH][UPDATE] kvm-userspace: sync icache for morearchitectures Christian Ehrhardt
2007-12-14 10:18 ` [Qemu-devel] " Zhang, Xiantao
@ 2007-12-18 1:56 ` Hollis Blanchard
2007-12-18 12:58 ` Christian Ehrhardt
1 sibling, 1 reply; 4+ messages in thread
From: Hollis Blanchard @ 2007-12-18 1:56 UTC (permalink / raw)
To: Christian Ehrhardt; +Cc: kvm-devel, kvm-ppc-devel, qemu-devel
On Fri, 2007-12-14 at 10:07 +0100, Christian Ehrhardt wrote:
>
> Hollis Blanchard wrote:
> > A comment to explain why the icache needs flushing only in the KVM
> case
> > would be useful. Other than that I'm fine with it.
> >
> > Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
> AFAIK Plain qemu does not directly execute guest code on the
> processor,
> so the icache is not an issue for it.
> Qemu itself has the flush_icache_range function only as helper for the
> dynamic code generation.
> But we may now write executable guest code with our intercepted mmio
> handling that is directly executed when switching back to the guest
> context, therefore we need that invalidation in the kvm case.
>
> For the case that I'm overlooking something in plain qemu, so that it
> might need it too I add qemu-devel@nongnu.org for comments from there,
> but currently I think to have it in #ifdef USE_KVM is the right way.
>
>
> P.S. Hollis did you mean you would like to see a comment in the code
> where that call takes place?
Yes! Hopefully much shorter than this email... :-P
--
Hollis Blanchard
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] Re: [kvm-devel] [PATCH][UPDATE] kvm-userspace: sync icache for morearchitectures
2007-12-18 1:56 ` [Qemu-devel] " Hollis Blanchard
@ 2007-12-18 12:58 ` Christian Ehrhardt
0 siblings, 0 replies; 4+ messages in thread
From: Christian Ehrhardt @ 2007-12-18 12:58 UTC (permalink / raw)
To: Hollis Blanchard; +Cc: kvm-devel, kvm-ppc-devel, qemu-devel
Hollis Blanchard wrote:
> On Fri, 2007-12-14 at 10:07 +0100, Christian Ehrhardt wrote:
>> Hollis Blanchard wrote:
>>> A comment to explain why the icache needs flushing only in the KVM
>> case
>>> would be useful. Other than that I'm fine with it.
>>>
>>> Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
>> AFAIK Plain qemu does not directly execute guest code on the
>> processor,
>> so the icache is not an issue for it.
>> Qemu itself has the flush_icache_range function only as helper for the
>> dynamic code generation.
>> But we may now write executable guest code with our intercepted mmio
>> handling that is directly executed when switching back to the guest
>> context, therefore we need that invalidation in the kvm case.
>>
>> For the case that I'm overlooking something in plain qemu, so that it
>> might need it too I add qemu-devel@nongnu.org for comments from there,
>> but currently I think to have it in #ifdef USE_KVM is the right way.
>>
>>
>> P.S. Hollis did you mean you would like to see a comment in the code
>> where that call takes place?
>
> Yes! Hopefully much shorter than this email... :-P
>
comment added, rebased and resent together with a updated mmio
callback simplification patch - I hope I didn't overlook a response
to the mmio callback thread again this time ;-)
--
Grüsse / regards,
Christian Ehrhardt
IBM Linux Technology Center, Open Virtualization
+49 7031/16-3385
Ehrhardt@linux.vnet.ibm.com
Ehrhardt@de.ibm.com
IBM Deutschland Entwicklung GmbH
Vorsitzender des Aufsichtsrats: Johann Weihen
Geschäftsführung: Herbert Kircher
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-12-18 12:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <11975745782686-git-send-email-ehrhardt@linux.vnet.ibm.com>
[not found] ` <42DFA526FC41B1429CE7279EF83C6BDCAD01E3@pdsmsx415.ccr.corp.intel.com>
2007-12-14 9:07 ` [Qemu-devel] Re: [kvm-devel] [PATCH][UPDATE] kvm-userspace: sync icache for morearchitectures Christian Ehrhardt
2007-12-14 10:18 ` [Qemu-devel] " Zhang, Xiantao
2007-12-18 1:56 ` [Qemu-devel] " Hollis Blanchard
2007-12-18 12:58 ` Christian Ehrhardt
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).