All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH] hw/arm/musicpal: Remove nonexistent CDTP2, CDTP3 registers
Date: Fri, 21 Feb 2014 08:15:52 +0100	[thread overview]
Message-ID: <5306FD28.8000104@web.de> (raw)
In-Reply-To: <1392737293-10073-1-git-send-email-peter.maydell@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 1871 bytes --]

On 2014-02-18 16:28, Peter Maydell wrote:
> The ethernet device in the musicpal only has two tx queues,
> but we modelled it with four CTDP registers, presumably a
> cut and paste from the rx queue registers. Since the tx_queue[]
> array is only 2 entries long this allowed a guest to overrun
> this buffer. Remove the nonexistent registers.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Acked-by: Jan Kiszka <jan.kiszka@web.de>

> ---
> There's no readily available documentation for this SoC,
> but I'm told the BSP for it indicates that there are
> indeed only two tx queues.
> 
>  hw/arm/musicpal.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c
> index 023e875..a8d0086 100644
> --- a/hw/arm/musicpal.c
> +++ b/hw/arm/musicpal.c
> @@ -92,8 +92,6 @@
>  #define MP_ETH_CRDP3            0x4AC
>  #define MP_ETH_CTDP0            0x4E0
>  #define MP_ETH_CTDP1            0x4E4
> -#define MP_ETH_CTDP2            0x4E8
> -#define MP_ETH_CTDP3            0x4EC
>  
>  /* MII PHY access */
>  #define MP_ETH_SMIR_DATA        0x0000FFFF
> @@ -308,7 +306,7 @@ static uint64_t mv88w8618_eth_read(void *opaque, hwaddr offset,
>      case MP_ETH_CRDP0 ... MP_ETH_CRDP3:
>          return s->rx_queue[(offset - MP_ETH_CRDP0)/4];
>  
> -    case MP_ETH_CTDP0 ... MP_ETH_CTDP3:
> +    case MP_ETH_CTDP0 ... MP_ETH_CTDP1:
>          return s->tx_queue[(offset - MP_ETH_CTDP0)/4];
>  
>      default:
> @@ -362,7 +360,7 @@ static void mv88w8618_eth_write(void *opaque, hwaddr offset,
>              s->cur_rx[(offset - MP_ETH_CRDP0)/4] = value;
>          break;
>  
> -    case MP_ETH_CTDP0 ... MP_ETH_CTDP3:
> +    case MP_ETH_CTDP0 ... MP_ETH_CTDP1:
>          s->tx_queue[(offset - MP_ETH_CTDP0)/4] = value;
>          break;
>      }
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

  reply	other threads:[~2014-02-21  7:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-18 15:28 [Qemu-devel] [PATCH] hw/arm/musicpal: Remove nonexistent CDTP2, CDTP3 registers Peter Maydell
2014-02-21  7:15 ` Jan Kiszka [this message]
2014-02-24 15:45   ` Peter Maydell
2014-02-24 15:55     ` Andreas Färber
2014-02-24 16:02       ` Peter Maydell
2014-02-24 18:50         ` Andreas Färber

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=5306FD28.8000104@web.de \
    --to=jan.kiszka@web.de \
    --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 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.