qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] hw/omap_gpio: Fix infinite recursion when doing


From: Anthony Liguori
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
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.21) Gecko/20110831 Lightning/1.0b2 Thunderbird/3.1.13

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<address@hidden>

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,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]