All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Qemu-devel] How address_space_rw works?
@ 2015-04-10  7:47 Kaiyuan
  2015-04-10  8:14 ` Paolo Bonzini
  0 siblings, 1 reply; 7+ messages in thread
From: Kaiyuan @ 2015-04-10  7:47 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Peter Maydell, qemu-devel, Kaiyuan

[-- Attachment #1: Type: text/plain, Size: 1269 bytes --]

> > Where is the code location that I can set breakpoint to observe the fast path for R/W requests to RAM?
> 
> Nowhere really, because the fast path is done directly in assembly code
> that TCG generates at run-time.
> 
> > Whether dose Qemu provide method to disable fast path so that I can set one breakpoint to catch all requests both MMIO and RAM?
> 
> You can modify the backends (e.g. tcg/i386/tcg-target.c) to do this, but
> chances are that there is a better way to do it.The request address I get from backends is host virtual address. But, only guest physical address is useful to me.> 
> What are you trying to do?Thanks for your answer. I need to implement a checker that locates logically between bus and memory.  This checker will catch all access requests, check if the address of requests are in a table I maintain. If address is in table, checker will forwards request to memory. If address is not in table, request will be discarded. You can think it as a firewall for addresses of R/W access requests.C code should be simple, a if black can do it. But difficulty for me is to find a location in source where can catch requests and get address of R/W to put code. Could you provide any suggestions? Thank you very much.-Kaiyuan Liang
 



[-- Attachment #2: Type: text/html, Size: 1423 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread
* [Qemu-devel] How address_space_rw works?
@ 2015-04-09  8:34 Kaiyuan
  2015-04-09  8:57 ` Peter Maydell
  0 siblings, 1 reply; 7+ messages in thread
From: Kaiyuan @ 2015-04-09  8:34 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 994 bytes --]

Hello, guys


In my understanding, function exec.c:address_space_rw is used to handle read and write access requests to address space. In order to check my opinion, I write guest code and debug Qemu to see the path of code execution.


If I read or write with address of MMIO like UART,  it will hit function address_space_rw.


*UART_ADDR = 'c';  //hit address_space_rw


However, if I read from or write to RAM address, it does NOT hit address_space_rw. Consider below code:


char str[] = {'h', 'e', 'l', 'l', 'o', '\0'};   //This array should locate in RAM virtualized by Qemu
char temp = str[2]; //Read char from RAM, NO hit to address_space_rw
str[3] = 'k';  //Write char to RAM, NO hit to address_space_rw


For address_space_rw, why access requests to MMIO and RAM address have different results? Are there any other functions that are used to handle R/W request to virtual RAM in Qemu?


Could you give me some idea? Any suggestions will be helpful. Thanks a lot.




-Kaiyuan 






[-- Attachment #2: Type: text/html, Size: 1753 bytes --]

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

end of thread, other threads:[~2015-04-13  3:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-10  7:47 [Qemu-devel] How address_space_rw works? Kaiyuan
2015-04-10  8:14 ` Paolo Bonzini
2015-04-13  3:41   ` Kaiyuan
  -- strict thread matches above, loose matches on Subject: below --
2015-04-09  8:34 Kaiyuan
2015-04-09  8:57 ` Peter Maydell
2015-04-10  4:47   ` Kaiyuan
2015-04-10  6:34     ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.