[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] cirrus_vga: adding sanity check for vram siz
From: |
Gonglei (Arei) |
Subject: |
Re: [Qemu-devel] [PATCH v2] cirrus_vga: adding sanity check for vram size |
Date: |
Mon, 12 May 2014 06:46:00 +0000 |
Hi,
> > diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
> > index d1afc76..399a2ef 100644
> > --- a/hw/display/cirrus_vga.c
> > +++ b/hw/display/cirrus_vga.c
> > @@ -2959,6 +2959,14 @@ static int pci_cirrus_vga_initfn(PCIDevice *dev)
> > PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(dev);
> > int16_t device_id = pc->device_id;
> >
> > + /* follow real hardware, cirrus card emulated has 4 MB video
> memory.
> > + Also accept 8 MB/16 MB for backward compatibility. */
> > + if (s->vga.vram_size_mb != 4 || s->vga.vram_size_mb != 8 ||
> > + s->vga.vram_size_mb != 16) {
>
> Apart from the logic bug mjt already pointed out, I note that this check
> is in the PCI initfn. Should the same restriction also apply for the ISA
> version of the device?
>
Yes, I have noted this issue in v1. In other mail, you gave me some advices,
thanks a lot, Andreas. I will post v3.
> > + error_report("Invalid cirrus_vga ram size '%u'\n",
> > + s->vga.vram_size_mb);
>
> Thanks for using our new error_report(). It does not require a trailing
> \n though.
>
Got it. Thanks.
Best regards,
-Gonglei