All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kaiyuan <kaiyuanl@tju.edu.cn>
To: qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] How address_space_rw works?
Date: Thu, 9 Apr 2015 16:34:03 +0800 (GMT+08:00)	[thread overview]
Message-ID: <AD6AEABlAIMLAUW3VeRWUaqt.1.1428568443879.Hmail.2014218038@tju.edu.cn> (raw)

[-- 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 --]

             reply	other threads:[~2015-04-09  8:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-09  8:34 Kaiyuan [this message]
2015-04-09  8:57 ` [Qemu-devel] How address_space_rw works? Peter Maydell
2015-04-10  4:47   ` Kaiyuan
2015-04-10  6:34     ` Paolo Bonzini
2015-04-10  7:47 Kaiyuan
2015-04-10  8:14 ` Paolo Bonzini
2015-04-13  3:41   ` Kaiyuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AD6AEABlAIMLAUW3VeRWUaqt.1.1428568443879.Hmail.2014218038@tju.edu.cn \
    --to=kaiyuanl@tju.edu.cn \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.