qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: stefano.stabellini@eu.citrix.com
Cc: xen-devel@lists.xensource.com, qemu-devel@nongnu.org, agraf@suse.de
Subject: Re: [Qemu-devel] [PATCH] qemu_ram_ptr_length: take ram_addr_t as arguments
Date: Fri, 24 Jun 2011 17:37:15 +0100	[thread overview]
Message-ID: <BANLkTinMxO=w3hmxKVxnf+X+sC8qwvqnPw@mail.gmail.com> (raw)
In-Reply-To: <1308913718-7201-1-git-send-email-stefano.stabellini@eu.citrix.com>

On 24 June 2011 12:08,  <stefano.stabellini@eu.citrix.com> wrote:
> From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>
> qemu_ram_ptr_length should take ram_addr_t as argument rather than
> target_phys_addr_t because is doing comparisons with RAMBlock addresses.
>
> cpu_physical_memory_map should create a ram_addr_t address to pass to
> qemu_ram_ptr_length from PhysPageDesc phys_offset.
>
> Remove code after abort() in qemu_ram_ptr_length.

This does fix vexpress. However I think we're still doing the wrong
thing if the bounce buffer is already in use and addr points at an
IO page. In the old code, we would break out of the loop on the
if (done || bounce.buffer) condition, set *plen to 0 [because done==0
since this is the first page] and return. Now we break out of the
loop but will fall into the call to qemu_ram_ptr_length() with a
bogus addr1 and probably abort().

You probably want to only call qemu_ram_ptr_length() if (todo).
(I don't know if anybody ever calls this routine with a zero input
length, but that would handle that case too.)
It would also be better to either (a) not initialise addr1, if
the compiler is smart enough to know it can't get to the use
without it being initialised or (b) initialise it to an obviously
bogus value if we have to do so to shut the compiler up.

(Also 'addr1' is not a fantastic variable name :-))

-- PMM

  reply	other threads:[~2011-06-24 16:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-24 11:08 [Qemu-devel] [PATCH] qemu_ram_ptr_length: take ram_addr_t as arguments stefano.stabellini
2011-06-24 16:37 ` Peter Maydell [this message]
2011-06-27 13:34   ` Stefano Stabellini
2011-06-27 17:00     ` Peter Maydell
2011-06-27 17:19       ` Stefano Stabellini

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='BANLkTinMxO=w3hmxKVxnf+X+sC8qwvqnPw@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=agraf@suse.de \
    --cc=qemu-devel@nongnu.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /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).