cirrus: fix blit region check

Issues:
 * Doesn't check pitches correctly in case it is negative.
 * Doesn't check width at all.

Turn macro into functions while being at it, also factor out the check
for one region which we then can simply call twice for src + dst.

This is CVE-2014-8106.

Reported-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
cirrus: don't overflow CirrusVGAState->cirrus_bltbuf

This is CVE-2014-8106.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Merge remote-tracking branch 'remotes/kraxel/tags/pull-cve-2014-8106-20141204-1' into staging

cirrus: fix blit region check

# gpg: Signature made Thu 04 Dec 2014 11:54:57 GMT using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-cve-2014-8106-20141204-1:
  cirrus: don't overflow CirrusVGAState->cirrus_bltbuf
  cirrus: fix blit region check

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Update version for v2.2.0-rc5 release

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Update version for v2.2.0 release

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Open 2.3 development tree

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Create the Netduino Plus 2 Machine

This patch adds the Netduino Plus 2 Machine to QEMU. It inits the CPU, Flash,
SRAM and loads the ELF image. There are changes that must be made to the
complilation of the ELF images, these will be documented later on the Wiki

Signed-off-by: Alistair Francis <alistair23@gmail.com>
Add basic UART support

This patch adds very basic oneway UART support for the Netduino Plus 2 board.
For this to work the ENABLE_DEBUG_UART macro must be defined in the
netduinoplus2.h file

Signed-off-by: Alistair Francis <alistair23@gmail.com>
Add Netduino GPIO

This has only been very lightly tested and is just a small extension to the
included pl061 GPIO device.

Signed-off-by: Alistair Francis <alistair23@gmail.com>
Update UART to actually work

UART is now a lot more reliable and doesn't just use printf to output the
text. I really need a datasheet to figure out some of the more advanced
features of the UART controller

Signed-off-by: Alistair Francis <alistair23@gmail.com>
Update the GPIO Peripheral

The first two pracs can now be completed in QEMU

Signed-off-by: Alistair Francis <alistair23@gmail.com>
Netduino_UART: Add Debug statements to the Netduino UART

Add debug statements to be used later

Signed-off-by: Alistair Francis <alistair23@gmail.com>
Netduino: Update the CPU_Reset function

This is based on what Peter C sent to the mailing list

Signed-off-by: Alistair Francis <alistair23@gmail.com>
Netduino: Fix the memory allocations

With this patch there are no changes required to the linker
configuration

Credit to Peter C for the CPU Reset address change

Signed-off-by: Alistair Francis <alistair23@gmail.com>
Netduino_GPIO: Update Netduino GPIO

Small changes to the Netduino GPIO code

Signed-off-by: Alistair Francis <alistair23@gmail.com>
HACK: Trigger Interrupts

This hack triggers GPIO interrupts when being read. This is
only used to test the GPIO interrupts at the moment

They are working :)

Signed-off-by: Alistair Francis <alistair23@gmail.com>
Netduino: Update the number of NVIC Interrupt Lines

Update the number of interrupt lines to 96

Signed-off-by: Alistair Francis <alistair23@gmail.com>
Netduino UART: Small internal changes to Netduino UART

This should allow 2-way communitcation using UART (at least
it starts to implement it)

It also tidies up the general code

Signed-off-by: Alistair Francis <alistair23@gmail.com>
Netduino USART: Add Netduino USART support

This adds 2-way USART support for Netduino. This allows example
9 to be tested in QEMU

Signed-off-by: Alistair Francis <alistair23@gmail.com>
Netduino: Code tidy up

Signed-off-by: Alistair Francis <alistair23@gmail.com>