diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2014-08-25 17:34:30 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2014-08-25 17:34:30 +0100 |
commit | 3dd359c2d34c6abf385d58da863f337b39702585 (patch) | |
tree | 2097c65507985aa466f854093a373d0653572df4 /hw | |
parent | 33886ebeec0c0ff6253a49253fae0db44c9ed0f3 (diff) | |
parent | 40a87c6c9b11ef9c14e0301f76abf0eb2582f08e (diff) | |
download | qemu-3dd359c2d34c6abf385d58da863f337b39702585.zip qemu-3dd359c2d34c6abf385d58da863f337b39702585.tar.gz qemu-3dd359c2d34c6abf385d58da863f337b39702585.tar.bz2 |
Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-2014-08-24' into staging
trivial patches for 2014-08-24
# gpg: Signature made Sun 24 Aug 2014 14:28:49 BST using RSA key ID A4C3D7DB
# gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>"
# gpg: aka "Michael Tokarev <mjt@corpit.ru>"
# gpg: aka "Michael Tokarev <mjt@debian.org>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg: There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 6EE1 95D1 886E 8FFB 810D 4324 457C E0A0 8044 65C5
# Subkey fingerprint: 6F67 E18E 7C91 C5B1 5514 66A7 BEE5 9D74 A4C3 D7DB
* remotes/mjt/tags/trivial-patches-2014-08-24:
vmxnet3: Pad short frames to minimum size (60 bytes)
libdecnumber: Fix warnings from smatch (missing static, boolean operations)
linux-user: fix file descriptor leaks
po: Fix Makefile rules for in-tree builds without configuration
slirp/misc: Use the GLib memory allocation APIs
configure: no need to mkdir QMP
dma: axidma: Variablise repeated s->streams[i] sub-expr
microblaze: ml605: Get rid of ddr_base variable
tests/bios-tables-test: check the value returned by fopen()
tcg: dump op count into qemu log
util/path: Use the GLib memory allocation routines
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/dma/xilinx_axidma.c | 10 | ||||
-rw-r--r-- | hw/microblaze/petalogix_ml605_mmu.c | 5 | ||||
-rw-r--r-- | hw/net/vmxnet3.c | 10 |
3 files changed, 18 insertions, 7 deletions
diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c index ee60d3f..d06002d 100644 --- a/hw/dma/xilinx_axidma.c +++ b/hw/dma/xilinx_axidma.c @@ -553,10 +553,12 @@ static void xilinx_axidma_realize(DeviceState *dev, Error **errp) int i; for (i = 0; i < 2; i++) { - s->streams[i].nr = i; - s->streams[i].bh = qemu_bh_new(timer_hit, &s->streams[i]); - s->streams[i].ptimer = ptimer_init(s->streams[i].bh); - ptimer_set_freq(s->streams[i].ptimer, s->freqhz); + struct Stream *st = &s->streams[i]; + + st->nr = i; + st->bh = qemu_bh_new(timer_hit, st); + st->ptimer = ptimer_init(st->bh); + ptimer_set_freq(st->ptimer, s->freqhz); } return; diff --git a/hw/microblaze/petalogix_ml605_mmu.c b/hw/microblaze/petalogix_ml605_mmu.c index aea9c5b..6843abf 100644 --- a/hw/microblaze/petalogix_ml605_mmu.c +++ b/hw/microblaze/petalogix_ml605_mmu.c @@ -89,7 +89,6 @@ petalogix_ml605_init(MachineState *machine) SysBusDevice *busdev; DriveInfo *dinfo; int i; - hwaddr ddr_base = MEMORY_BASEADDR; MemoryRegion *phys_lmb_bram = g_new(MemoryRegion, 1); MemoryRegion *phys_ram = g_new(MemoryRegion, 1); qemu_irq irq[32]; @@ -106,7 +105,7 @@ petalogix_ml605_init(MachineState *machine) memory_region_init_ram(phys_ram, NULL, "petalogix_ml605.ram", ram_size); vmstate_register_ram_global(phys_ram); - memory_region_add_subregion(address_space_mem, ddr_base, phys_ram); + memory_region_add_subregion(address_space_mem, MEMORY_BASEADDR, phys_ram); dinfo = drive_get(IF_PFLASH, 0, 0); /* 5th parameter 2 means bank-width @@ -201,7 +200,7 @@ petalogix_ml605_init(MachineState *machine) } } - microblaze_load_kernel(cpu, ddr_base, ram_size, + microblaze_load_kernel(cpu, MEMORY_BASEADDR, ram_size, machine->initrd_filename, BINARY_DEVICE_TREE_FILE, machine_cpu_reset); diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c index 791321f..f246fa1 100644 --- a/hw/net/vmxnet3.c +++ b/hw/net/vmxnet3.c @@ -34,6 +34,7 @@ #define PCI_DEVICE_ID_VMWARE_VMXNET3_REVISION 0x1 #define VMXNET3_MSIX_BAR_SIZE 0x2000 +#define MIN_BUF_SIZE 60 #define VMXNET3_BAR0_IDX (0) #define VMXNET3_BAR1_IDX (1) @@ -1871,12 +1872,21 @@ vmxnet3_receive(NetClientState *nc, const uint8_t *buf, size_t size) { VMXNET3State *s = qemu_get_nic_opaque(nc); size_t bytes_indicated; + uint8_t min_buf[MIN_BUF_SIZE]; if (!vmxnet3_can_receive(nc)) { VMW_PKPRN("Cannot receive now"); return -1; } + /* Pad to minimum Ethernet frame length */ + if (size < sizeof(min_buf)) { + memcpy(min_buf, buf, size); + memset(&min_buf[size], 0, sizeof(min_buf) - size); + buf = min_buf; + size = sizeof(min_buf); + } + if (s->peer_has_vhdr) { vmxnet_rx_pkt_set_vhdr(s->rx_pkt, (struct virtio_net_hdr *)buf); buf += sizeof(struct virtio_net_hdr); |