All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	qemu-devel@nongnu.org, Blue Swirl <blauwirbel@gmail.com>,
	Bob Breuer <breuerr@mc.net>,
	Anthony Liguori <aliguori@amazon.com>,
	Artyom Tarasenko <atar4qemu@gmail.com>
Subject: Re: [Qemu-devel] [PATCHv3 1/2] sun4m: Add Sun CG3 framebuffer and corresponding OpenBIOS FCode ROM
Date: Thu, 08 May 2014 15:44:44 +0100	[thread overview]
Message-ID: <536B985C.9060207@ilande.co.uk> (raw)
In-Reply-To: <536A8FD0.6000401@redhat.com>

On 07/05/14 20:56, Paolo Bonzini wrote:

> Il 05/03/2014 11:05, Paolo Bonzini ha scritto:
>> Il 19/02/2014 10:05, Mark Cave-Ayland ha scritto:
>>> +#define CG3_REG_SIZE            0x20
>>> +
>>> +#define CG3_REG_FBC_CTRL        0x10
>>> +#define CG3_REG_FBC_STATUS      0x11
>>> +#define CG3_REG_FBC_CURSTART    0x12
>>> +#define CG3_REG_FBC_CUREND      0x13
>>> +#define CG3_REG_FBC_VCTRL       0x14
>>> +
>>> +typedef struct CG3State {
>> ...
>>
>>> +    uint8_t regs[16];
>>
>> ...
>>
>>> +    case CG3_REG_FBC_CURSTART ... CG3_REG_SIZE:
>>> +        val = s->regs[addr - 0x10];
>>> +        break;
>>> +    default:
>>
>> Something weird here, you can access regs[16] if addr == CG3_REG_SIZE.
>>
>> The same happens in the write path.
>
> Ping.  I cannot fix it without access to the datasheet, though I suspect
> you want CG3_REG_SIZE - 1.

Hi Paolo,

Sorry I didn't think you could access regs[16] since the MemoryRegion 
size is set to CG3_REG_SIZE too (and so I hope should only handle 
accesses from 0 to CG3_REG_SIZE - 1).

Anyway, I've quickly tried a Solaris 8 boot test replacing CG3_REG_SIZE 
with CG3_REG_SIZE - 1 for the case statements in both the read and write 
paths and everything still works, so happy for you to go ahead and fix it.


ATB,

Mark.

  reply	other threads:[~2014-05-08 14:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-19  9:05 [Qemu-devel] [PATCHv3 0/2] sun4m: Implement Sun CG3 framebuffer for QEMU Mark Cave-Ayland
2014-02-19  9:05 ` [Qemu-devel] [PATCHv3 1/2] sun4m: Add Sun CG3 framebuffer and corresponding OpenBIOS FCode ROM Mark Cave-Ayland
2014-02-19 13:35   ` Leandro Dorileo
2014-02-19 21:39     ` Mark Cave-Ayland
2014-02-20 12:23       ` Leandro Dorileo
2014-05-08 14:34       ` Andreas Färber
2014-05-19 13:03         ` Mark Cave-Ayland
2014-05-19 17:09           ` Andreas Färber
2014-03-05 10:05   ` Paolo Bonzini
2014-05-07 19:56     ` Paolo Bonzini
2014-05-08 14:44       ` Mark Cave-Ayland [this message]
2014-05-08 14:49         ` Paolo Bonzini
2014-02-19  9:05 ` [Qemu-devel] [PATCHv3 2/2] sun4m: Add Sun CG3 framebuffer initialisation function Mark Cave-Ayland
2014-02-19 13:01 ` [Qemu-devel] [PATCHv3 0/2] sun4m: Implement Sun CG3 framebuffer for QEMU Andreas Färber
2014-02-19 21:35   ` Mark Cave-Ayland
2014-02-23 17:42     ` Mark Cave-Ayland

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=536B985C.9060207@ilande.co.uk \
    --to=mark.cave-ayland@ilande.co.uk \
    --cc=aliguori@amazon.com \
    --cc=atar4qemu@gmail.com \
    --cc=blauwirbel@gmail.com \
    --cc=breuerr@mc.net \
    --cc=pbonzini@redhat.com \
    --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.