* [Qemu-devel] CPU Cache simulation
@ 2015-11-18 8:04 Hao Bai
2015-11-18 15:15 ` Eduardo Habkost
0 siblings, 1 reply; 7+ messages in thread
From: Hao Bai @ 2015-11-18 8:04 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 122 bytes --]
Hi all,
I read from an earlier thread in 2009 that QEMU did not simulate CPU
caches. Is this still the case now?
Cheers
[-- Attachment #2: Type: text/html, Size: 181 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] CPU Cache simulation
2015-11-18 8:04 [Qemu-devel] CPU Cache simulation Hao Bai
@ 2015-11-18 15:15 ` Eduardo Habkost
2015-11-18 16:48 ` Hao Bai
0 siblings, 1 reply; 7+ messages in thread
From: Eduardo Habkost @ 2015-11-18 15:15 UTC (permalink / raw)
To: Hao Bai; +Cc: qemu-devel
On Wed, Nov 18, 2015 at 03:04:09AM -0500, Hao Bai wrote:
> Hi all,
>
> I read from an earlier thread in 2009 that QEMU did not simulate CPU
> caches. Is this still the case now?
Could you clarify what you need? In which architecture? What
exactly you mean by "simulating CPU caches"? Do you just want the
guest to think the machine has a specific cache topology, or do
you want to emulate other cache behavior? Do you need support to
specific cache control instructions?
Do you have a pointer to the 2009 thread?
--
Eduardo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] CPU Cache simulation
2015-11-18 15:15 ` Eduardo Habkost
@ 2015-11-18 16:48 ` Hao Bai
2015-11-18 17:56 ` Pranith Kumar
0 siblings, 1 reply; 7+ messages in thread
From: Hao Bai @ 2015-11-18 16:48 UTC (permalink / raw)
To: Eduardo Habkost; +Cc: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1109 bytes --]
Sorry about the ambiguity.
I am using x86-64 architecture in user mode. Basically, I am trying to log
all the cache activities when I run a guest program with QEMU. That's why I
asked whether QEMU simulated CPU caches. I was assuming if QEMU did not
simulate CPU caches then there would be no way to do this (Correct me if I
am wrong). Is there a way to do this?
Pointer to the 2009 thread:
https://lists.nongnu.org/archive/html/qemu-devel/2009-06/msg01353.html
Cheers
On Wed, Nov 18, 2015 at 10:15 AM, Eduardo Habkost <ehabkost@redhat.com>
wrote:
> On Wed, Nov 18, 2015 at 03:04:09AM -0500, Hao Bai wrote:
> > Hi all,
> >
> > I read from an earlier thread in 2009 that QEMU did not simulate CPU
> > caches. Is this still the case now?
>
> Could you clarify what you need? In which architecture? What
> exactly you mean by "simulating CPU caches"? Do you just want the
> guest to think the machine has a specific cache topology, or do
> you want to emulate other cache behavior? Do you need support to
> specific cache control instructions?
>
> Do you have a pointer to the 2009 thread?
>
> --
> Eduardo
>
[-- Attachment #2: Type: text/html, Size: 1692 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] CPU Cache simulation
2015-11-18 16:48 ` Hao Bai
@ 2015-11-18 17:56 ` Pranith Kumar
2015-11-18 18:06 ` Eduardo Habkost
0 siblings, 1 reply; 7+ messages in thread
From: Pranith Kumar @ 2015-11-18 17:56 UTC (permalink / raw)
To: Hao Bai; +Cc: Eduardo Habkost, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 716 bytes --]
Hi,
On Wed, Nov 18, 2015 at 11:48 AM, Hao Bai <hb4vf@virginia.edu> wrote:
> Sorry about the ambiguity.
> I am using x86-64 architecture in user mode. Basically, I am trying to log
> all the cache activities when I run a guest program with QEMU. That's why I
> asked whether QEMU simulated CPU caches. I was assuming if QEMU did not
> simulate CPU caches then there would be no way to do this (Correct me if I
> am wrong). Is there a way to do this?
>
>
<Shameless plug>
You can try qsim: https://github.com/gtcasl/qsim
In particular look at the cache simulator:
https://github.com/gtcasl/qsim/blob/master/examples/x86/cachesim.cpp
Setup instructions: https://github.com/pranith/qsim-setup
</Plug>
--
Pranith
[-- Attachment #2: Type: text/html, Size: 1426 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] CPU Cache simulation
2015-11-18 17:56 ` Pranith Kumar
@ 2015-11-18 18:06 ` Eduardo Habkost
2015-11-18 18:14 ` Pranith Kumar
0 siblings, 1 reply; 7+ messages in thread
From: Eduardo Habkost @ 2015-11-18 18:06 UTC (permalink / raw)
To: Pranith Kumar; +Cc: qemu-devel, Hao Bai
On Wed, Nov 18, 2015 at 12:56:28PM -0500, Pranith Kumar wrote:
> Hi,
>
> On Wed, Nov 18, 2015 at 11:48 AM, Hao Bai <hb4vf@virginia.edu> wrote:
>
> > Sorry about the ambiguity.
> > I am using x86-64 architecture in user mode. Basically, I am trying to log
> > all the cache activities when I run a guest program with QEMU. That's why I
> > asked whether QEMU simulated CPU caches. I was assuming if QEMU did not
> > simulate CPU caches then there would be no way to do this (Correct me if I
> > am wrong). Is there a way to do this?
> >
> >
> <Shameless plug>
>
> You can try qsim: https://github.com/gtcasl/qsim
>
> In particular look at the cache simulator:
> https://github.com/gtcasl/qsim/blob/master/examples/x86/cachesim.cpp
>
> Setup instructions: https://github.com/pranith/qsim-setup
Interesting. How much did you change QEMU to make this work? Have
you been rebasing this to recent QEMU versions often?
--
Eduardo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] CPU Cache simulation
2015-11-18 18:06 ` Eduardo Habkost
@ 2015-11-18 18:14 ` Pranith Kumar
2015-11-20 20:47 ` Lluís Vilanova
0 siblings, 1 reply; 7+ messages in thread
From: Pranith Kumar @ 2015-11-18 18:14 UTC (permalink / raw)
To: Eduardo Habkost; +Cc: qemu-devel, Hao Bai
On Wed, Nov 18, 2015 at 1:06 PM, Eduardo Habkost <ehabkost@redhat.com> wrote:
>
>
> Interesting. How much did you change QEMU to make this work? Have
> you been rebasing this to recent QEMU versions often?
The core of qemu is not changed except for one TCG issue I didn't know
how to fix. Rest is just annotating the code to generate appropriate
callbacks. You find the patches here:
https://github.com/pranith/qemu/commits/aaa8b521187e4ecd1d35914e9b119f9d6eaa8633
I try to rebase once a release comes out. The current version is based
on 2.4, so it is pretty current. I will rebase onto 2.5 in the near
future since the rc0 is out.
--
Pranith
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] CPU Cache simulation
2015-11-18 18:14 ` Pranith Kumar
@ 2015-11-20 20:47 ` Lluís Vilanova
0 siblings, 0 replies; 7+ messages in thread
From: Lluís Vilanova @ 2015-11-20 20:47 UTC (permalink / raw)
To: Pranith Kumar; +Cc: Hao Bai, Eduardo Habkost, qemu-devel
Pranith Kumar writes:
> On Wed, Nov 18, 2015 at 1:06 PM, Eduardo Habkost <ehabkost@redhat.com> wrote:
>>
>>
>> Interesting. How much did you change QEMU to make this work? Have
>> you been rebasing this to recent QEMU versions often?
> The core of qemu is not changed except for one TCG issue I didn't know
> how to fix. Rest is just annotating the code to generate appropriate
> callbacks. You find the patches here:
> https://github.com/pranith/qemu/commits/aaa8b521187e4ecd1d35914e9b119f9d6eaa8633
> I try to rebase once a release comes out. The current version is based
> on 2.4, so it is pretty current. I will rebase onto 2.5 in the near
> future since the rc0 is out.
Interesting. I have a similar thing that was discussed some time ago in this
list [1]. It is more of an infrastructure to hook your own code whenever QEMU
executes guest instructions, so it looks more like a generalization of the core
infrastructure that hooks the arch simulator with QEMU as an emulator.
The final consensus was that some of the added bits would result in largely
untested API functions, but that a lot of it could be merged into QEMU in the
form of trace points for guest code.
My plan from there was to add an out-of-tree tracing backend that allows hooking
into these points (it's included in the repo). I haven't had time to synchronize
the public repo, but I've internally updated some of its changes to send them
for integration.
[1] https://projects.gso.ac.upc.edu/projects/qemu-dbi
Cheers,
Lluis
--
"And it's much the same thing with knowledge, for whenever you learn
something new, the whole world becomes that much richer."
-- The Princess of Pure Reason, as told by Norton Juster in The Phantom
Tollbooth
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-11-20 20:48 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-18 8:04 [Qemu-devel] CPU Cache simulation Hao Bai
2015-11-18 15:15 ` Eduardo Habkost
2015-11-18 16:48 ` Hao Bai
2015-11-18 17:56 ` Pranith Kumar
2015-11-18 18:06 ` Eduardo Habkost
2015-11-18 18:14 ` Pranith Kumar
2015-11-20 20:47 ` Lluís Vilanova
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).