All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
To: Thomas Huth <th.huth@posteo.de>,
	qemu-devel@nongnu.org, kwolf@redhat.com, famz@redhat.com,
	qemu-block@nongnu.org, jasowang@redhat.com, dgilbert@redhat.com,
	mreitz@redhat.com, hpoussin@reactos.org, kraxel@redhat.com,
	pbonzini@redhat.com, yongbok.kim@mips.com, afaerber@suse.de,
	aurelien@aurel32.net, laurent@vivier.eu
Subject: Re: [Qemu-devel] [PATCH v4 07/11] hw/m68k: add Nubus support
Date: Thu, 25 Oct 2018 21:30:39 +0100	[thread overview]
Message-ID: <23718185-791d-ce03-4b2b-7aa4348cbac8@ilande.co.uk> (raw)
In-Reply-To: <82a4a209-3fba-ab45-3d27-c9f2e6585608@posteo.de>

On 23/10/2018 08:36, Thomas Huth wrote:

> On 2018-10-18 19:28, Mark Cave-Ayland wrote:
>> From: Laurent Vivier <laurent@vivier.eu>
>>
>> Co-developed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
>> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
>> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
>> ---
> [...]
>> +static void nubus_register_format_block(NubusDevice *dev)
>> +{
>> +    char fblock_name[27];
>> +
>> +    sprintf(fblock_name, "nubus-slot-%d-format-block", dev->slot_nb);
> 
> Latest GCC (version 8) got very picky about possible buffer overflows
> during sprintf() ... not sure, but it might be necessary to either use a
> bigger array here, or assert(dev->slot_nb < NUBUS_SLOT_NB), or even
> better use g_strdup_printf() instead (with g_free() at the end of the
> function) instead.

Good point. I've gone for replacing sprintf() with g_strdup_printf() whenever it
occurs in this file.

>> +    hwaddr fblock_offset = memory_region_size(&dev->slot_mem) - FBLOCK_SIZE;
>> +    memory_region_init_io(&dev->fblock_io, NULL, &nubus_format_block_ops,
>> +                          dev, fblock_name, FBLOCK_SIZE);
>> +    memory_region_add_subregion(&dev->slot_mem, fblock_offset,
>> +                                &dev->fblock_io);
>> +}
> [...]
>> diff --git a/include/hw/display/macfb.h b/include/hw/display/macfb.h
>> index 70ea5480fe..3059f2f36a 100644
>> --- a/include/hw/display/macfb.h
>> +++ b/include/hw/display/macfb.h
>> @@ -39,4 +39,25 @@ typedef struct {
>>      MacfbState macfb;
>>  } MacfbSysBusState;
>>  
>> +#define MACFB_NUBUS_DEVICE_CLASS(class) \
>> +    OBJECT_CLASS_CHECK(MacfbNubusDeviceClass, (class), TYPE_NUBUS_MACFB)
>> +#define MACFB_NUBUS_GET_CLASS(obj) \
>> +    OBJECT_GET_CLASS(MacfbNubusDeviceClass, (obj), TYPE_NUBUS_MACFB)
>> +
>> +typedef struct MacfbNubusDeviceClass {
>> +    DeviceClass parent_class;
>> +
>> +    DeviceRealize parent_realize;> +} MacfbNubusDeviceClass;
>>
>> +#define TYPE_NUBUS_MACFB "nubus-macfb"
>> +#define NUBUS_MACFB(obj) \
>> +    OBJECT_CHECK(MacfbNubusState, (obj), TYPE_NUBUS_MACFB)
>> +
>> +typedef struct {
>> +    NubusDevice busdev;
>> +
>> +    MacfbState macfb;
>> +} MacfbNubusState;
>> +
>>  #endif
> 
> I think this should rather be part of the next patch instead?

Ooops yes. I've fixed in the latest version of the patch series.


ATB,

Mark.

  reply	other threads:[~2018-10-25 20:35 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-18 18:28 [Qemu-devel] [PATCH v4 00/11] hw/m68k: add Apple Machintosh Quadra 800 machine Mark Cave-Ayland
2018-10-18 18:28 ` [Qemu-devel] [PATCH v4 01/11] hw/m68k: add via support Mark Cave-Ayland
2018-10-23  6:22   ` Thomas Huth
2018-10-25 20:19     ` Mark Cave-Ayland
2018-10-18 18:28 ` [Qemu-devel] [PATCH v4 02/11] hw/m68k: implement ADB bus support for via Mark Cave-Ayland
2018-10-23  6:49   ` Thomas Huth
2018-10-25 20:20     ` Mark Cave-Ayland
2018-10-18 18:28 ` [Qemu-devel] [PATCH v4 03/11] escc: introduce a selector for the register bit Mark Cave-Ayland
2018-10-18 18:28 ` [Qemu-devel] [PATCH v4 04/11] hw/m68k: add macfb video card Mark Cave-Ayland
2018-10-23  7:13   ` Thomas Huth
2018-10-25 20:27     ` Mark Cave-Ayland
2018-10-18 18:28 ` [Qemu-devel] [PATCH v4 05/11] hw/m68k: Apple Sound Chip (ASC) emulation Mark Cave-Ayland
2018-10-23  7:18   ` Thomas Huth
2018-10-25 20:29     ` Mark Cave-Ayland
2018-10-18 18:28 ` [Qemu-devel] [PATCH v4 06/11] ESP: add pseudo-DMA as used by Macintosh Mark Cave-Ayland
2018-10-18 18:28 ` [Qemu-devel] [PATCH v4 07/11] hw/m68k: add Nubus support Mark Cave-Ayland
2018-10-23  7:36   ` Thomas Huth
2018-10-25 20:30     ` Mark Cave-Ayland [this message]
2018-10-18 18:28 ` [Qemu-devel] [PATCH v4 08/11] hw/m68k: add Nubus support for macfb video card Mark Cave-Ayland
2018-10-18 18:28 ` [Qemu-devel] [PATCH v4 09/11] hw/m68k: add a dummy SWIM floppy controller Mark Cave-Ayland
2018-10-18 18:28 ` [Qemu-devel] [PATCH v4 10/11] dp8393x: manage big endian bus Mark Cave-Ayland
2018-10-23  0:02   ` Philippe Mathieu-Daudé
2018-10-18 18:28 ` [Qemu-devel] [PATCH v4 11/11] hw/m68k: define Macintosh Quadra 800 Mark Cave-Ayland
2018-10-23 11:20   ` Thomas Huth
2018-10-25 20:36     ` Mark Cave-Ayland
2018-10-23 13:16   ` Philippe Mathieu-Daudé
2018-10-25 20:39     ` Mark Cave-Ayland
2018-10-18 18:49 ` [Qemu-devel] [PATCH v4 00/11] hw/m68k: add Apple Machintosh Quadra 800 machine Laurent Vivier

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=23718185-791d-ce03-4b2b-7aa4348cbac8@ilande.co.uk \
    --to=mark.cave-ayland@ilande.co.uk \
    --cc=afaerber@suse.de \
    --cc=aurelien@aurel32.net \
    --cc=dgilbert@redhat.com \
    --cc=famz@redhat.com \
    --cc=hpoussin@reactos.org \
    --cc=jasowang@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=laurent@vivier.eu \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=th.huth@posteo.de \
    --cc=yongbok.kim@mips.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 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.