Compare commits

...

9 Commits

Author SHA1 Message Date
Anthony Liguori
371386fb60 Update version for 1.5.0 release.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-20 08:20:08 -05:00
Hervé Poussineau
da4c1a7a85 osdep: fix qemu_anon_ram_free trace (+ fix compilation on 32 bit hosts)
Commit e7a09b92b7 added a trace at each
memory freeing, but unfortunately inverted size and pointer when printing
them. Fix trace.

This also led to a compilation error on 32 bit hosts:
In file included from include/trace.h:4:0,
                 from trace/generated-events.c:3:
./trace/generated-tracers.h: In function ‘trace_qemu_anon_ram_free’:
./trace/generated-tracers.h:64:9: error: format ‘%zu’ expects argument of type
‘size_t’, but argument 3 has type ‘void *’ [-Werror=format]
./trace/generated-tracers.h:64:9: error: format ‘%p’ expects argument of type
‘void *’, but argument 4 has type ‘size_t’ [-Werror=format]

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Message-id: 1369045989-14016-1-git-send-email-hpoussin@reactos.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-20 08:20:08 -05:00
Ed Maste
3568ac2a6e Rename hexdump to avoid FreeBSD libutil conflict
On FreeBSD libutil is used for openpty(), but it also provides a hexdump()
which conflicts with QEMU's.

Signed-off-by: Ed Maste <emaste@freebsd.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1368718348-15199-1-git-send-email-emaste@freebsd.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-20 08:20:08 -05:00
Hu Tao
fd2a2e1c55 vl: new runstate transition: RUN_STATE_GUEST_PANICKED -> RUN_STATE_FINISH_MIGRATE
This fixes a problem that after guest panic happens, virsh dump without
--memory-only fails:

ERROR: invalid runstate transition: 'guest-panicked' -> 'finish-migrate'

Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1369046780-17498-1-git-send-email-pbonzini@redhat.com
Cc: qemu-stable@nongnu.org
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-20 08:20:07 -05:00
Lei Li
08d0ab3fe6 chardev: Make consistent with udp device for new qapi backend
When register and open a chardev udp, the backend name should be udp
not dgram, and we do not have backend dgram in the chardev list. This
patch makes the new qapi udp backend consistent with the original
udp device.

Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
Message-id: 1369032665-18159-2-git-send-email-lilei@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-20 08:20:07 -05:00
Aurelien Jarno
b9b5df6f0c ide/macio: fix wrong opaque with TRIM support
Commit 215e47b9 enabled TRIM by default, which revealed a bug in TRIM
support for the IDE macio emulation driver, introduced in d353fb72.

The call to dma_bdrv_io() is using a wrong opaque of type IDEState
instead of DBDMA_io. This patch fixes that.

Fixes LP#1179104

Reported-by: Michael Tokarev <mjt@tls.msk.ru>
Tested-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2013-05-20 01:54:14 +02:00
Petar Jovanovic
118d1e4f59 target-mips: set carry bit correctly in DSPControl register
First we need to clear the bit and then we set the given value.
Instruction ADDSC sets the bit and instruction ADDWC uses this bit.

Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2013-05-19 15:16:20 +02:00
Petar Jovanovic
0ba365f4a9 target-mips: fix EXTPDP and setting up pos field in the DSPControl reg
This change makes sure that modifications of pos field in the DSPControl
register do not trash other bits in the register. This bug can be triggered
with the additional test case in mips32-dsp/extpdp.c in this commit.

In addition to this, this change corrects incorrect calculation of the mask
for EXTPDP.

Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2013-05-19 15:10:51 +02:00
Petar Jovanovic
489ed4bbae target-mips: fix incorrect behaviour for EXTP
The mask for EXTP instruction when size=31 has not been correctly
calculated.

The test (mips32-dsp/extp.c) has been extended to include the case that
triggers the issue.

Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2013-05-17 19:29:40 +02:00
13 changed files with 64 additions and 27 deletions

View File

@@ -1 +1 @@
1.4.93 1.5.0

View File

@@ -1157,7 +1157,7 @@ static int pl330_exec_cycle(PL330Chan *channel)
if (PL330_ERR_DEBUG > 1) { if (PL330_ERR_DEBUG > 1) {
DB_PRINT("PL330 read from memory @%08x (size = %08x):\n", DB_PRINT("PL330 read from memory @%08x (size = %08x):\n",
q->addr, len); q->addr, len);
hexdump((char *)buf, stderr, "", len); qemu_hexdump((char *)buf, stderr, "", len);
} }
fifo_res = pl330_fifo_push(&s->fifo, buf, len, q->tag); fifo_res = pl330_fifo_push(&s->fifo, buf, len, q->tag);
if (fifo_res == PL330_FIFO_OK) { if (fifo_res == PL330_FIFO_OK) {
@@ -1189,7 +1189,7 @@ static int pl330_exec_cycle(PL330Chan *channel)
if (PL330_ERR_DEBUG > 1) { if (PL330_ERR_DEBUG > 1) {
DB_PRINT("PL330 read from memory @%08x (size = %08x):\n", DB_PRINT("PL330 read from memory @%08x (size = %08x):\n",
q->addr, len); q->addr, len);
hexdump((char *)buf, stderr, "", len); qemu_hexdump((char *)buf, stderr, "", len);
} }
if (q->inc) { if (q->inc) {
q->addr += len; q->addr += len;

View File

@@ -144,7 +144,7 @@ static void pmac_ide_transfer_cb(void *opaque, int ret)
break; break;
case IDE_DMA_TRIM: case IDE_DMA_TRIM:
m->aiocb = dma_bdrv_io(s->bs, &s->sg, sector_num, m->aiocb = dma_bdrv_io(s->bs, &s->sg, sector_num,
ide_issue_trim, pmac_ide_transfer_cb, s, ide_issue_trim, pmac_ide_transfer_cb, io,
DMA_DIRECTION_TO_DEVICE); DMA_DIRECTION_TO_DEVICE);
break; break;
} }

View File

@@ -443,7 +443,7 @@ int mod_utf8_codepoint(const char *s, size_t n, char **end);
* Hexdump a buffer to a file. An optional string prefix is added to every line * Hexdump a buffer to a file. An optional string prefix is added to every line
*/ */
void hexdump(const char *buf, FILE *fp, const char *prefix, size_t size); void qemu_hexdump(const char *buf, FILE *fp, const char *prefix, size_t size);
/* vector definitions */ /* vector definitions */
#ifdef __ALTIVEC__ #ifdef __ALTIVEC__

View File

@@ -3210,7 +3210,7 @@
'*telnet' : 'bool' } } '*telnet' : 'bool' } }
## ##
# @ChardevDgram: # @ChardevUdp:
# #
# Configuration info for datagram socket chardevs. # Configuration info for datagram socket chardevs.
# #
@@ -3219,8 +3219,8 @@
# #
# Since: 1.5 # Since: 1.5
## ##
{ 'type': 'ChardevDgram', 'data': { 'remote' : 'SocketAddress', { 'type': 'ChardevUdp', 'data': { 'remote' : 'SocketAddress',
'*local' : 'SocketAddress' } } '*local' : 'SocketAddress' } }
## ##
# @ChardevMux: # @ChardevMux:
@@ -3310,7 +3310,7 @@
'parallel': 'ChardevHostdev', 'parallel': 'ChardevHostdev',
'pipe' : 'ChardevHostdev', 'pipe' : 'ChardevHostdev',
'socket' : 'ChardevSocket', 'socket' : 'ChardevSocket',
'dgram' : 'ChardevDgram', 'udp' : 'ChardevUdp',
'pty' : 'ChardevDummy', 'pty' : 'ChardevDummy',
'null' : 'ChardevDummy', 'null' : 'ChardevDummy',
'mux' : 'ChardevMux', 'mux' : 'ChardevMux',

View File

@@ -3698,12 +3698,12 @@ static CharDriverState *qmp_chardev_open_socket(ChardevSocket *sock,
is_telnet, is_waitconnect, errp); is_telnet, is_waitconnect, errp);
} }
static CharDriverState *qmp_chardev_open_dgram(ChardevDgram *dgram, static CharDriverState *qmp_chardev_open_udp(ChardevUdp *udp,
Error **errp) Error **errp)
{ {
int fd; int fd;
fd = socket_dgram(dgram->remote, dgram->local, errp); fd = socket_dgram(udp->remote, udp->local, errp);
if (error_is_set(errp)) { if (error_is_set(errp)) {
return NULL; return NULL;
} }
@@ -3739,8 +3739,8 @@ ChardevReturn *qmp_chardev_add(const char *id, ChardevBackend *backend,
case CHARDEV_BACKEND_KIND_SOCKET: case CHARDEV_BACKEND_KIND_SOCKET:
chr = qmp_chardev_open_socket(backend->socket, errp); chr = qmp_chardev_open_socket(backend->socket, errp);
break; break;
case CHARDEV_BACKEND_KIND_DGRAM: case CHARDEV_BACKEND_KIND_UDP:
chr = qmp_chardev_open_dgram(backend->dgram, errp); chr = qmp_chardev_open_udp(backend->udp, errp);
break; break;
#ifdef HAVE_CHARDEV_TTY #ifdef HAVE_CHARDEV_TTY
case CHARDEV_BACKEND_KIND_PTY: case CHARDEV_BACKEND_KIND_PTY:

View File

@@ -19,6 +19,7 @@
#include "cpu.h" #include "cpu.h"
#include "helper.h" #include "helper.h"
#include "qemu/bitops.h"
/* As the byte ordering doesn't matter, i.e. all columns are treated /* As the byte ordering doesn't matter, i.e. all columns are treated
identically, these unions can be used directly. */ identically, these unions can be used directly. */
@@ -53,9 +54,10 @@ static inline void set_DSPControl_overflow_flag(uint32_t flag, int position,
env->active_tc.DSPControl |= (target_ulong)flag << position; env->active_tc.DSPControl |= (target_ulong)flag << position;
} }
static inline void set_DSPControl_carryflag(uint32_t flag, CPUMIPSState *env) static inline void set_DSPControl_carryflag(bool flag, CPUMIPSState *env)
{ {
env->active_tc.DSPControl |= (target_ulong)flag << 13; env->active_tc.DSPControl &= ~(1 << 13);
env->active_tc.DSPControl |= flag << 13;
} }
static inline uint32_t get_DSPControl_carryflag(CPUMIPSState *env) static inline uint32_t get_DSPControl_carryflag(CPUMIPSState *env)
@@ -90,10 +92,10 @@ static inline void set_DSPControl_pos(uint32_t pos, CPUMIPSState *env)
dspc = env->active_tc.DSPControl; dspc = env->active_tc.DSPControl;
#ifndef TARGET_MIPS64 #ifndef TARGET_MIPS64
dspc = dspc & 0xFFFFFFC0; dspc = dspc & 0xFFFFFFC0;
dspc |= pos; dspc |= (pos & 0x3F);
#else #else
dspc = dspc & 0xFFFFFF80; dspc = dspc & 0xFFFFFF80;
dspc |= pos; dspc |= (pos & 0x7F);
#endif #endif
env->active_tc.DSPControl = dspc; env->active_tc.DSPControl = dspc;
} }
@@ -1266,7 +1268,7 @@ SUBUH_QB(subuh_r, 1);
target_ulong helper_addsc(target_ulong rs, target_ulong rt, CPUMIPSState *env) target_ulong helper_addsc(target_ulong rs, target_ulong rt, CPUMIPSState *env)
{ {
uint64_t temp, tempRs, tempRt; uint64_t temp, tempRs, tempRt;
int32_t flag; bool flag;
tempRs = (uint64_t)rs & MIPSDSP_LLO; tempRs = (uint64_t)rs & MIPSDSP_LLO;
tempRt = (uint64_t)rt & MIPSDSP_LLO; tempRt = (uint64_t)rt & MIPSDSP_LLO;
@@ -3415,8 +3417,7 @@ target_ulong helper_extp(target_ulong ac, target_ulong size, CPUMIPSState *env)
if (sub >= -1) { if (sub >= -1) {
acc = ((uint64_t)env->active_tc.HI[ac] << 32) | acc = ((uint64_t)env->active_tc.HI[ac] << 32) |
((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO); ((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO);
temp = (acc >> (start_pos - size)) & temp = (acc >> (start_pos - size)) & (~0U >> (31 - size));
(((uint32_t)0x01 << (size + 1)) - 1);
set_DSPControl_efi(0, env); set_DSPControl_efi(0, env);
} else { } else {
set_DSPControl_efi(1, env); set_DSPControl_efi(1, env);
@@ -3440,10 +3441,9 @@ target_ulong helper_extpdp(target_ulong ac, target_ulong size,
if (sub >= -1) { if (sub >= -1) {
acc = ((uint64_t)env->active_tc.HI[ac] << 32) | acc = ((uint64_t)env->active_tc.HI[ac] << 32) |
((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO); ((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO);
temp = (acc >> (start_pos - size)) & temp = extract64(acc, start_pos - size, size + 1);
(((uint32_t)0x01 << (size + 1)) - 1);
set_DSPControl_pos(start_pos - (size + 1), env); set_DSPControl_pos(sub, env);
set_DSPControl_efi(0, env); set_DSPControl_efi(0, env);
} else { } else {
set_DSPControl_efi(1, env); set_DSPControl_efi(1, env);

View File

@@ -40,5 +40,23 @@ int main()
dsp = (dsp >> 14) & 0x01; dsp = (dsp >> 14) & 0x01;
assert(dsp == 1); assert(dsp == 1);
ach = 0;
acl = 0x80000001;
dsp = 0x1F;
result = 0x80000001;
__asm
("wrdsp %1\n\t"
"mthi %2, $ac2\n\t"
"mtlo %3, $ac2\n\t"
"extp %0, $ac2, 0x1F\n\t"
"rddsp %1\n\t"
: "=r"(rt), "+r"(dsp)
: "r"(ach), "r"(acl)
);
dsp = (dsp >> 14) & 0x01;
assert(dsp == 0);
assert(result == rt);
return 0; return 0;
} }

View File

@@ -42,5 +42,23 @@ int main()
efi = (dsp >> 14) & 0x01; efi = (dsp >> 14) & 0x01;
assert(efi == 1); assert(efi == 1);
ach = 0;
acl = 0;
dsp = 0;
result = 0;
__asm
("wrdsp %1\n\t"
"mthi %2, $ac1\n\t"
"mtlo %3, $ac1\n\t"
"extpdp %0, $ac1, 0x00\n\t"
"rddsp %1\n\t"
: "=r"(rt), "+r"(dsp)
: "r"(ach), "r"(acl)
);
assert(dsp == 0x3F);
assert(result == rt);
return 0; return 0;
} }

View File

@@ -34,7 +34,7 @@ g_free(void *ptr) "ptr %p"
qemu_memalign(size_t alignment, size_t size, void *ptr) "alignment %zu size %zu ptr %p" qemu_memalign(size_t alignment, size_t size, void *ptr) "alignment %zu size %zu ptr %p"
qemu_anon_ram_alloc(size_t size, void *ptr) "size %zu ptr %p" qemu_anon_ram_alloc(size_t size, void *ptr) "size %zu ptr %p"
qemu_vfree(void *ptr) "ptr %p" qemu_vfree(void *ptr) "ptr %p"
qemu_anon_ram_free(void *ptr, size_t size) "size %zu ptr %p" qemu_anon_ram_free(void *ptr, size_t size) "ptr %p size %zu"
# hw/virtio.c # hw/virtio.c
virtqueue_fill(void *vq, const void *elem, unsigned int len, unsigned int idx) "vq %p elem %p len %u idx %u" virtqueue_fill(void *vq, const void *elem, unsigned int len, unsigned int idx) "vq %p elem %p len %u idx %u"

View File

@@ -15,7 +15,7 @@
#include "qemu-common.h" #include "qemu-common.h"
void hexdump(const char *buf, FILE *fp, const char *prefix, size_t size) void qemu_hexdump(const char *buf, FILE *fp, const char *prefix, size_t size)
{ {
unsigned int b; unsigned int b;

View File

@@ -225,7 +225,7 @@ void iov_hexdump(const struct iovec *iov, const unsigned int iov_cnt,
size = size > limit ? limit : size; size = size > limit ? limit : size;
buf = g_malloc(size); buf = g_malloc(size);
iov_to_buf(iov, iov_cnt, 0, buf, size); iov_to_buf(iov, iov_cnt, 0, buf, size);
hexdump(buf, fp, prefix, size); qemu_hexdump(buf, fp, prefix, size);
g_free(buf); g_free(buf);
} }

1
vl.c
View File

@@ -609,6 +609,7 @@ static const RunStateTransition runstate_transitions_def[] = {
{ RUN_STATE_WATCHDOG, RUN_STATE_FINISH_MIGRATE }, { RUN_STATE_WATCHDOG, RUN_STATE_FINISH_MIGRATE },
{ RUN_STATE_GUEST_PANICKED, RUN_STATE_PAUSED }, { RUN_STATE_GUEST_PANICKED, RUN_STATE_PAUSED },
{ RUN_STATE_GUEST_PANICKED, RUN_STATE_FINISH_MIGRATE },
{ RUN_STATE_MAX, RUN_STATE_MAX }, { RUN_STATE_MAX, RUN_STATE_MAX },
}; };