qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: Avi Kivity <avi@redhat.com>
Cc: qemu-devel@nongnu.org, Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH] pflash_cfi01/pflash_cfi02: convert to memory API
Date: Sun, 28 Aug 2011 22:37:15 +0200	[thread overview]
Message-ID: <20110828203715.GB7244@zapo> (raw)
In-Reply-To: <1314546216-26613-1-git-send-email-avi@redhat.com>

On Sun, Aug 28, 2011 at 06:43:36PM +0300, Avi Kivity wrote:
> cfi02 is annoying in that is ignores some address bits; we probably
> want explicit support in the memory API for that.
> 
> In order to get the correct opaque into the MemoryRegion object, the
> allocation scheme is changed so that the flash emulation code allocates
> memory, instead of the caller.  This clears a FIXME in the flash code.
> 
> Signed-off-by: Avi Kivity <avi@redhat.com>
> ---



> diff --git a/hw/pflash_cfi01.c b/hw/pflash_cfi01.c
> index 90e1301..b597304 100644
> --- a/hw/pflash_cfi01.c
> +++ b/hw/pflash_cfi01.c
> @@ -40,6 +40,7 @@
>  #include "flash.h"
>  #include "block.h"
>  #include "qemu-timer.h"
> +#include "exec-memory.h"
>  
>  #define PFLASH_BUG(fmt, ...) \
>  do { \
> @@ -74,8 +75,7 @@ struct pflash_t {
>      target_phys_addr_t counter;
>      unsigned int writeblock_size;
>      QEMUTimer *timer;
> -    ram_addr_t off;
> -    int fl_mem;
> +    MemoryRegion mem;
>      void *storage;
>  };
>  
> @@ -89,8 +89,7 @@ static void pflash_timer (void *opaque)
>      if (pfl->bypass) {
>          pfl->wcycle = 2;
>      } else {
> -        cpu_register_physical_memory(pfl->base, pfl->total_len,
> -                        pfl->off | IO_MEM_ROMD | pfl->fl_mem);
> +        memory_region_rom_device_set_readable(&pfl->mem, true);
>          pfl->wcycle = 0;
>      }
>      pfl->cmd = 0;
> @@ -263,7 +262,7 @@ static void pflash_write(pflash_t *pfl, target_phys_addr_t offset,
>  
>      if (!pfl->wcycle) {
>          /* Set the device in I/O access mode */
> -        cpu_register_physical_memory(pfl->base, pfl->total_len, pfl->fl_mem);
> +        memory_region_rom_device_set_readable(&pfl->mem, false);
>      }

I get the impression that this one is not biting. Reads are not reaching
the IO callbacks at times when they should..

Cheers

  parent reply	other threads:[~2011-08-28 20:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-28 15:43 [Qemu-devel] [PATCH] pflash_cfi01/pflash_cfi02: convert to memory API Avi Kivity
2011-08-28 18:14 ` Edgar E. Iglesias
2011-08-28 18:46   ` Edgar E. Iglesias
2011-08-29  5:35   ` Avi Kivity
2011-08-28 19:33 ` Edgar E. Iglesias
2011-08-29  5:36   ` Avi Kivity
2011-08-29  6:04     ` Edgar E. Iglesias
2011-08-29  6:13     ` Edgar E. Iglesias
2011-08-28 20:37 ` Edgar E. Iglesias [this message]
2011-08-29  5:38   ` Avi Kivity
2011-08-29  6:00     ` Edgar E. Iglesias
2011-08-29  6:15       ` Avi Kivity
2011-08-29  6:18         ` Edgar E. Iglesias
2011-08-29  7:21         ` Avi Kivity
2011-08-29  7:30           ` Edgar E. Iglesias
2011-08-29  8:15             ` Avi Kivity

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=20110828203715.GB7244@zapo \
    --to=edgar.iglesias@gmail.com \
    --cc=avi@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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 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).