qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH] hw/omap_gpio: Fix infinite recursion when doing 8/16 bit reads
Date: Tue, 15 Nov 2011 09:04:05 -0600	[thread overview]
Message-ID: <4EC27F65.4010304@codemonkey.ws> (raw)
In-Reply-To: <1320672345-5776-1-git-send-email-peter.maydell@linaro.org>

On 11/07/2011 07:25 AM, Peter Maydell wrote:
> Fix a long-standing bug which meant that any attempt to do an
> 8 or 16 bit read from the OMAP GPIO module would cause qemu to
> crash due to an infinite recursion.
>
> Signed-off-by: Peter Maydell<peter.maydell@linaro.org>

Applied.  Thanks.

Regards,

Anthony Liguori

> ---
> This has actually been in the code since the original OMAP2 support
> was added in 2008; we've never noticed before because the kernel happened
> to always do 32 bit accesses...
> Long term we should fix this by conversion to MemoryRegion; this is
> the minimally invasive fix for 1.0.
>
>   hw/omap_gpio.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/hw/omap_gpio.c b/hw/omap_gpio.c
> index d775df6..d630748 100644
> --- a/hw/omap_gpio.c
> +++ b/hw/omap_gpio.c
> @@ -510,7 +510,7 @@ static void omap2_gpio_module_write(void *opaque, target_phys_addr_t addr,
>
>   static uint32_t omap2_gpio_module_readp(void *opaque, target_phys_addr_t addr)
>   {
> -    return omap2_gpio_module_readp(opaque, addr)>>  ((addr&  3)<<  3);
> +    return omap2_gpio_module_read(opaque, addr&  ~3)>>  ((addr&  3)<<  3);
>   }
>
>   static void omap2_gpio_module_writep(void *opaque, target_phys_addr_t addr,

      parent reply	other threads:[~2011-11-15 15:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-07 13:25 [Qemu-devel] [PATCH] hw/omap_gpio: Fix infinite recursion when doing 8/16 bit reads Peter Maydell
2011-11-12  0:38 ` Peter Maydell
2011-11-12  2:57   ` Anthony Liguori
2011-11-15 15:04 ` Anthony Liguori [this message]

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=4EC27F65.4010304@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --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 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).