Compare commits
108 Commits
v2.6.0-rc2
...
v2.6.0
Author | SHA1 | Date | |
---|---|---|---|
|
bfc766d38e | ||
|
860a3b3485 | ||
|
53db932604 | ||
|
975eb6a547 | ||
|
1beb99f787 | ||
|
fd3c136b3e | ||
|
2068192dcc | ||
|
7fa5c2c5dc | ||
|
bfa0f151a5 | ||
|
3bf1817079 | ||
|
277abf15a6 | ||
|
20b0f5fef6 | ||
|
1dbfd7892b | ||
|
47dac82d8b | ||
|
849880978e | ||
|
d208c50d9d | ||
|
ebb72c9f06 | ||
|
0a40bdab0d | ||
|
0d48dfedc5 | ||
|
8c4bf97580 | ||
|
736f85d5db | ||
|
61861eff69 | ||
|
d96391c1ff | ||
|
51b9b478cc | ||
|
d9d3aaea0b | ||
|
37f32349ea | ||
|
df18b2db69 | ||
|
f419a626c7 | ||
|
3123bd8ebf | ||
|
da34fed707 | ||
|
53343338a6 | ||
|
ab27c3b5e7 | ||
|
37989ced44 | ||
|
14560d69e7 | ||
|
54e18d35e4 | ||
|
bcd82a968f | ||
|
ee1e0f8e5d | ||
|
df7b97ff89 | ||
|
8d0d9b9f67 | ||
|
8d8fdbae01 | ||
|
eabb7b91b3 | ||
|
b4850e5ae9 | ||
|
81d9d1867f | ||
|
befbaf51ce | ||
|
fa59dd9582 | ||
|
8ca92f3c06 | ||
|
74f69050fe | ||
|
4150ae60eb | ||
|
f27a274259 | ||
|
9c83625bdd | ||
|
4113b0532d | ||
|
fe98b18b6f | ||
|
fb91f30bb9 | ||
|
1f7685fafa | ||
|
d85fa9eb87 | ||
|
5d4343e6c2 | ||
|
a882745356 | ||
|
d4dffa4a3f | ||
|
63d3145aad | ||
|
ef5d5641f5 | ||
|
bb97bfd901 | ||
|
5eb0b194e9 | ||
|
a087cc589d | ||
|
a49923d283 | ||
|
1ae3f2f178 | ||
|
ed3d807b0a | ||
|
9997cf7bda | ||
|
92b674b62a | ||
|
2e4cad2833 | ||
|
6a6fa68ae2 | ||
|
ba3899507a | ||
|
adde0204e4 | ||
|
c6c598ca5f | ||
|
afc474863f | ||
|
aa378598fe | ||
|
537d3e8e6b | ||
|
afbee7128c | ||
|
8e08f8a4a7 | ||
|
81bed73b53 | ||
|
5ce4397281 | ||
|
3424c8a9c8 | ||
|
072035eba1 | ||
|
c7b45f1282 | ||
|
cdc8845331 | ||
|
d1129a8ad9 | ||
|
23994a5f52 | ||
|
200650d49f | ||
|
e71fc0bae7 | ||
|
5f1525a685 | ||
|
339f06a3bc | ||
|
6bb6f6cd9e | ||
|
242fbc19ef | ||
|
bc78a01319 | ||
|
90c647db8d | ||
|
16aaf975ee | ||
|
9c057d0b68 | ||
|
32f6439cf7 | ||
|
66176fc6a7 | ||
|
c23fb11bbb | ||
|
bab246db1d | ||
|
9bdfb9e8ac | ||
|
0211b9becc | ||
|
7fa84cd8d4 | ||
|
5ceb77652e | ||
|
538a467329 | ||
|
de5f107744 | ||
|
01a780d51a | ||
|
4df26e88ee |
@@ -1050,7 +1050,6 @@ M: Andreas Färber <afaerber@suse.de>
|
||||
S: Supported
|
||||
F: qom/cpu.c
|
||||
F: include/qom/cpu.h
|
||||
F: target-i386/cpu.c
|
||||
|
||||
ICC Bus
|
||||
M: Igor Mammedov <imammedo@redhat.com>
|
||||
@@ -1156,8 +1155,6 @@ M: Eduardo Habkost <ehabkost@redhat.com>
|
||||
S: Maintained
|
||||
F: numa.c
|
||||
F: include/sysemu/numa.h
|
||||
K: numa|NUMA
|
||||
K: srat|SRAT
|
||||
T: git git://github.com/ehabkost/qemu.git numa
|
||||
|
||||
QAPI
|
||||
|
@@ -282,10 +282,12 @@ bool aio_pending(AioContext *ctx)
|
||||
int revents;
|
||||
|
||||
revents = node->pfd.revents & node->pfd.events;
|
||||
if (revents & (G_IO_IN | G_IO_HUP | G_IO_ERR) && node->io_read) {
|
||||
if (revents & (G_IO_IN | G_IO_HUP | G_IO_ERR) && node->io_read &&
|
||||
aio_node_check(ctx, node->is_external)) {
|
||||
return true;
|
||||
}
|
||||
if (revents & (G_IO_OUT | G_IO_ERR) && node->io_write) {
|
||||
if (revents & (G_IO_OUT | G_IO_ERR) && node->io_write &&
|
||||
aio_node_check(ctx, node->is_external)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -323,6 +325,7 @@ bool aio_dispatch(AioContext *ctx)
|
||||
|
||||
if (!node->deleted &&
|
||||
(revents & (G_IO_IN | G_IO_HUP | G_IO_ERR)) &&
|
||||
aio_node_check(ctx, node->is_external) &&
|
||||
node->io_read) {
|
||||
node->io_read(node->opaque);
|
||||
|
||||
@@ -333,6 +336,7 @@ bool aio_dispatch(AioContext *ctx)
|
||||
}
|
||||
if (!node->deleted &&
|
||||
(revents & (G_IO_OUT | G_IO_ERR)) &&
|
||||
aio_node_check(ctx, node->is_external) &&
|
||||
node->io_write) {
|
||||
node->io_write(node->opaque);
|
||||
progress = true;
|
||||
|
@@ -121,11 +121,19 @@ file_backend_instance_init(Object *o)
|
||||
set_mem_path, NULL);
|
||||
}
|
||||
|
||||
static void file_backend_instance_finalize(Object *o)
|
||||
{
|
||||
HostMemoryBackendFile *fb = MEMORY_BACKEND_FILE(o);
|
||||
|
||||
g_free(fb->mem_path);
|
||||
}
|
||||
|
||||
static const TypeInfo file_backend_info = {
|
||||
.name = TYPE_MEMORY_BACKEND_FILE,
|
||||
.parent = TYPE_MEMORY_BACKEND,
|
||||
.class_init = file_backend_class_init,
|
||||
.instance_init = file_backend_instance_init,
|
||||
.instance_finalize = file_backend_instance_finalize,
|
||||
.instance_size = sizeof(HostMemoryBackendFile),
|
||||
};
|
||||
|
||||
|
@@ -820,7 +820,7 @@ int blk_write_zeroes(BlockBackend *blk, int64_t sector_num,
|
||||
int nb_sectors, BdrvRequestFlags flags)
|
||||
{
|
||||
return blk_rw(blk, sector_num, NULL, nb_sectors, blk_write_entry,
|
||||
BDRV_REQ_ZERO_WRITE);
|
||||
flags | BDRV_REQ_ZERO_WRITE);
|
||||
}
|
||||
|
||||
static void error_callback_bh(void *opaque)
|
||||
@@ -852,6 +852,7 @@ BlockAIOCB *blk_abort_aio_request(BlockBackend *blk,
|
||||
typedef struct BlkAioEmAIOCB {
|
||||
BlockAIOCB common;
|
||||
BlkRwCo rwco;
|
||||
int bytes;
|
||||
bool has_returned;
|
||||
QEMUBH* bh;
|
||||
} BlkAioEmAIOCB;
|
||||
@@ -877,7 +878,7 @@ static void blk_aio_complete_bh(void *opaque)
|
||||
blk_aio_complete(opaque);
|
||||
}
|
||||
|
||||
static BlockAIOCB *blk_aio_prwv(BlockBackend *blk, int64_t offset,
|
||||
static BlockAIOCB *blk_aio_prwv(BlockBackend *blk, int64_t offset, int bytes,
|
||||
QEMUIOVector *qiov, CoroutineEntry co_entry,
|
||||
BdrvRequestFlags flags,
|
||||
BlockCompletionFunc *cb, void *opaque)
|
||||
@@ -893,6 +894,7 @@ static BlockAIOCB *blk_aio_prwv(BlockBackend *blk, int64_t offset,
|
||||
.flags = flags,
|
||||
.ret = NOT_DONE,
|
||||
};
|
||||
acb->bytes = bytes;
|
||||
acb->bh = NULL;
|
||||
acb->has_returned = false;
|
||||
|
||||
@@ -913,7 +915,8 @@ static void blk_aio_read_entry(void *opaque)
|
||||
BlkAioEmAIOCB *acb = opaque;
|
||||
BlkRwCo *rwco = &acb->rwco;
|
||||
|
||||
rwco->ret = blk_co_preadv(rwco->blk, rwco->offset, rwco->qiov->size,
|
||||
assert(rwco->qiov->size == acb->bytes);
|
||||
rwco->ret = blk_co_preadv(rwco->blk, rwco->offset, acb->bytes,
|
||||
rwco->qiov, rwco->flags);
|
||||
blk_aio_complete(acb);
|
||||
}
|
||||
@@ -923,8 +926,8 @@ static void blk_aio_write_entry(void *opaque)
|
||||
BlkAioEmAIOCB *acb = opaque;
|
||||
BlkRwCo *rwco = &acb->rwco;
|
||||
|
||||
rwco->ret = blk_co_pwritev(rwco->blk, rwco->offset,
|
||||
rwco->qiov ? rwco->qiov->size : 0,
|
||||
assert(!rwco->qiov || rwco->qiov->size == acb->bytes);
|
||||
rwco->ret = blk_co_pwritev(rwco->blk, rwco->offset, acb->bytes,
|
||||
rwco->qiov, rwco->flags);
|
||||
blk_aio_complete(acb);
|
||||
}
|
||||
@@ -937,8 +940,10 @@ BlockAIOCB *blk_aio_write_zeroes(BlockBackend *blk, int64_t sector_num,
|
||||
return blk_abort_aio_request(blk, cb, opaque, -EINVAL);
|
||||
}
|
||||
|
||||
return blk_aio_prwv(blk, sector_num << BDRV_SECTOR_BITS, NULL,
|
||||
blk_aio_write_entry, BDRV_REQ_ZERO_WRITE, cb, opaque);
|
||||
return blk_aio_prwv(blk, sector_num << BDRV_SECTOR_BITS,
|
||||
nb_sectors << BDRV_SECTOR_BITS, NULL,
|
||||
blk_aio_write_entry, flags | BDRV_REQ_ZERO_WRITE,
|
||||
cb, opaque);
|
||||
}
|
||||
|
||||
int blk_pread(BlockBackend *blk, int64_t offset, void *buf, int count)
|
||||
@@ -994,7 +999,8 @@ BlockAIOCB *blk_aio_readv(BlockBackend *blk, int64_t sector_num,
|
||||
return blk_abort_aio_request(blk, cb, opaque, -EINVAL);
|
||||
}
|
||||
|
||||
return blk_aio_prwv(blk, sector_num << BDRV_SECTOR_BITS, iov,
|
||||
assert(nb_sectors << BDRV_SECTOR_BITS == iov->size);
|
||||
return blk_aio_prwv(blk, sector_num << BDRV_SECTOR_BITS, iov->size, iov,
|
||||
blk_aio_read_entry, 0, cb, opaque);
|
||||
}
|
||||
|
||||
@@ -1006,7 +1012,8 @@ BlockAIOCB *blk_aio_writev(BlockBackend *blk, int64_t sector_num,
|
||||
return blk_abort_aio_request(blk, cb, opaque, -EINVAL);
|
||||
}
|
||||
|
||||
return blk_aio_prwv(blk, sector_num << BDRV_SECTOR_BITS, iov,
|
||||
assert(nb_sectors << BDRV_SECTOR_BITS == iov->size);
|
||||
return blk_aio_prwv(blk, sector_num << BDRV_SECTOR_BITS, iov->size, iov,
|
||||
blk_aio_write_entry, 0, cb, opaque);
|
||||
}
|
||||
|
||||
@@ -1446,7 +1453,7 @@ int coroutine_fn blk_co_write_zeroes(BlockBackend *blk, int64_t sector_num,
|
||||
|
||||
return blk_co_pwritev(blk, sector_num << BDRV_SECTOR_BITS,
|
||||
nb_sectors << BDRV_SECTOR_BITS, NULL,
|
||||
BDRV_REQ_ZERO_WRITE);
|
||||
flags | BDRV_REQ_ZERO_WRITE);
|
||||
}
|
||||
|
||||
int blk_write_compressed(BlockBackend *blk, int64_t sector_num,
|
||||
|
@@ -247,7 +247,7 @@ static void gluster_finish_aiocb(struct glfs_fd *fd, ssize_t ret, void *arg)
|
||||
if (!ret || ret == acb->size) {
|
||||
acb->ret = 0; /* Success */
|
||||
} else if (ret < 0) {
|
||||
acb->ret = ret; /* Read/Write failed */
|
||||
acb->ret = -errno; /* Read/Write failed */
|
||||
} else {
|
||||
acb->ret = -EIO; /* Partial read/write - fail it */
|
||||
}
|
||||
@@ -314,6 +314,23 @@ static int qemu_gluster_open(BlockDriverState *bs, QDict *options,
|
||||
goto out;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_GLUSTERFS_XLATOR_OPT
|
||||
/* Without this, if fsync fails for a recoverable reason (for instance,
|
||||
* ENOSPC), gluster will dump its cache, preventing retries. This means
|
||||
* almost certain data loss. Not all gluster versions support the
|
||||
* 'resync-failed-syncs-after-fsync' key value, but there is no way to
|
||||
* discover during runtime if it is supported (this api returns success for
|
||||
* unknown key/value pairs) */
|
||||
ret = glfs_set_xlator_option(s->glfs, "*-write-behind",
|
||||
"resync-failed-syncs-after-fsync",
|
||||
"on");
|
||||
if (ret < 0) {
|
||||
error_setg_errno(errp, errno, "Unable to set xlator key/value pair");
|
||||
ret = -errno;
|
||||
goto out;
|
||||
}
|
||||
#endif
|
||||
|
||||
qemu_gluster_parse_flags(bdrv_flags, &open_flags);
|
||||
|
||||
s->fd = glfs_open(s->glfs, gconf->image, open_flags);
|
||||
@@ -366,6 +383,16 @@ static int qemu_gluster_reopen_prepare(BDRVReopenState *state,
|
||||
goto exit;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_GLUSTERFS_XLATOR_OPT
|
||||
ret = glfs_set_xlator_option(reop_s->glfs, "*-write-behind",
|
||||
"resync-failed-syncs-after-fsync", "on");
|
||||
if (ret < 0) {
|
||||
error_setg_errno(errp, errno, "Unable to set xlator key/value pair");
|
||||
ret = -errno;
|
||||
goto exit;
|
||||
}
|
||||
#endif
|
||||
|
||||
reop_s->fd = glfs_open(reop_s->glfs, gconf->image, open_flags);
|
||||
if (reop_s->fd == NULL) {
|
||||
/* reops->glfs will be cleaned up in _abort */
|
||||
@@ -589,6 +616,17 @@ static coroutine_fn int qemu_gluster_co_writev(BlockDriverState *bs,
|
||||
return qemu_gluster_co_rw(bs, sector_num, nb_sectors, qiov, 1);
|
||||
}
|
||||
|
||||
static void qemu_gluster_close(BlockDriverState *bs)
|
||||
{
|
||||
BDRVGlusterState *s = bs->opaque;
|
||||
|
||||
if (s->fd) {
|
||||
glfs_close(s->fd);
|
||||
s->fd = NULL;
|
||||
}
|
||||
glfs_fini(s->glfs);
|
||||
}
|
||||
|
||||
static coroutine_fn int qemu_gluster_co_flush_to_disk(BlockDriverState *bs)
|
||||
{
|
||||
int ret;
|
||||
@@ -602,11 +640,35 @@ static coroutine_fn int qemu_gluster_co_flush_to_disk(BlockDriverState *bs)
|
||||
|
||||
ret = glfs_fsync_async(s->fd, gluster_finish_aiocb, &acb);
|
||||
if (ret < 0) {
|
||||
return -errno;
|
||||
ret = -errno;
|
||||
goto error;
|
||||
}
|
||||
|
||||
qemu_coroutine_yield();
|
||||
if (acb.ret < 0) {
|
||||
ret = acb.ret;
|
||||
goto error;
|
||||
}
|
||||
|
||||
return acb.ret;
|
||||
|
||||
error:
|
||||
/* Some versions of Gluster (3.5.6 -> 3.5.8?) will not retain its cache
|
||||
* after a fsync failure, so we have no way of allowing the guest to safely
|
||||
* continue. Gluster versions prior to 3.5.6 don't retain the cache
|
||||
* either, but will invalidate the fd on error, so this is again our only
|
||||
* option.
|
||||
*
|
||||
* The 'resync-failed-syncs-after-fsync' xlator option for the
|
||||
* write-behind cache will cause later gluster versions to retain its
|
||||
* cache after error, so long as the fd remains open. However, we
|
||||
* currently have no way of knowing if this option is supported.
|
||||
*
|
||||
* TODO: Once gluster provides a way for us to determine if the option
|
||||
* is supported, bypass the closure and setting drv to NULL. */
|
||||
qemu_gluster_close(bs);
|
||||
bs->drv = NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_GLUSTERFS_DISCARD
|
||||
@@ -661,17 +723,6 @@ static int64_t qemu_gluster_allocated_file_size(BlockDriverState *bs)
|
||||
}
|
||||
}
|
||||
|
||||
static void qemu_gluster_close(BlockDriverState *bs)
|
||||
{
|
||||
BDRVGlusterState *s = bs->opaque;
|
||||
|
||||
if (s->fd) {
|
||||
glfs_close(s->fd);
|
||||
s->fd = NULL;
|
||||
}
|
||||
glfs_fini(s->glfs);
|
||||
}
|
||||
|
||||
static int qemu_gluster_has_zero_init(BlockDriverState *bs)
|
||||
{
|
||||
/* GlusterFS volume could be backed by a block device */
|
||||
|
@@ -108,7 +108,7 @@ static void mirror_iteration_done(MirrorOp *op, int ret)
|
||||
|
||||
sectors_per_chunk = s->granularity >> BDRV_SECTOR_BITS;
|
||||
chunk_num = op->sector_num / sectors_per_chunk;
|
||||
nb_chunks = op->nb_sectors / sectors_per_chunk;
|
||||
nb_chunks = DIV_ROUND_UP(op->nb_sectors, sectors_per_chunk);
|
||||
bitmap_clear(s->in_flight_bitmap, chunk_num, nb_chunks);
|
||||
if (ret >= 0) {
|
||||
if (s->cow_bitmap) {
|
||||
@@ -161,6 +161,14 @@ static void mirror_read_complete(void *opaque, int ret)
|
||||
mirror_write_complete, op);
|
||||
}
|
||||
|
||||
static inline void mirror_clip_sectors(MirrorBlockJob *s,
|
||||
int64_t sector_num,
|
||||
int *nb_sectors)
|
||||
{
|
||||
*nb_sectors = MIN(*nb_sectors,
|
||||
s->bdev_length / BDRV_SECTOR_SIZE - sector_num);
|
||||
}
|
||||
|
||||
/* Round sector_num and/or nb_sectors to target cluster if COW is needed, and
|
||||
* return the offset of the adjusted tail sector against original. */
|
||||
static int mirror_cow_align(MirrorBlockJob *s,
|
||||
@@ -189,6 +197,9 @@ static int mirror_cow_align(MirrorBlockJob *s,
|
||||
s->target_cluster_sectors);
|
||||
}
|
||||
}
|
||||
/* Clipping may result in align_nb_sectors unaligned to chunk boundary, but
|
||||
* that doesn't matter because it's already the end of source image. */
|
||||
mirror_clip_sectors(s, align_sector_num, &align_nb_sectors);
|
||||
|
||||
ret = align_sector_num + align_nb_sectors - (*sector_num + *nb_sectors);
|
||||
*sector_num = align_sector_num;
|
||||
@@ -231,9 +242,8 @@ static int mirror_do_read(MirrorBlockJob *s, int64_t sector_num,
|
||||
/* The sector range must meet granularity because:
|
||||
* 1) Caller passes in aligned values;
|
||||
* 2) mirror_cow_align is used only when target cluster is larger. */
|
||||
assert(!(nb_sectors % sectors_per_chunk));
|
||||
assert(!(sector_num % sectors_per_chunk));
|
||||
nb_chunks = nb_sectors / sectors_per_chunk;
|
||||
nb_chunks = DIV_ROUND_UP(nb_sectors, sectors_per_chunk);
|
||||
|
||||
while (s->buf_free_count < nb_chunks) {
|
||||
trace_mirror_yield_in_flight(s, sector_num, s->in_flight);
|
||||
@@ -298,7 +308,7 @@ static void mirror_do_zero_or_discard(MirrorBlockJob *s,
|
||||
static uint64_t coroutine_fn mirror_iteration(MirrorBlockJob *s)
|
||||
{
|
||||
BlockDriverState *source = s->common.bs;
|
||||
int64_t sector_num;
|
||||
int64_t sector_num, first_chunk;
|
||||
uint64_t delay_ns = 0;
|
||||
/* At least the first dirty chunk is mirrored in one iteration. */
|
||||
int nb_chunks = 1;
|
||||
@@ -313,6 +323,12 @@ static uint64_t coroutine_fn mirror_iteration(MirrorBlockJob *s)
|
||||
assert(sector_num >= 0);
|
||||
}
|
||||
|
||||
first_chunk = sector_num / sectors_per_chunk;
|
||||
while (test_bit(first_chunk, s->in_flight_bitmap)) {
|
||||
trace_mirror_yield_in_flight(s, first_chunk, s->in_flight);
|
||||
mirror_wait_for_io(s);
|
||||
}
|
||||
|
||||
/* Find the number of consective dirty chunks following the first dirty
|
||||
* one, and wait for in flight requests in them. */
|
||||
while (nb_chunks * sectors_per_chunk < (s->buf_size >> BDRV_SECTOR_BITS)) {
|
||||
@@ -324,17 +340,17 @@ static uint64_t coroutine_fn mirror_iteration(MirrorBlockJob *s)
|
||||
break;
|
||||
}
|
||||
if (test_bit(next_chunk, s->in_flight_bitmap)) {
|
||||
if (nb_chunks > 0) {
|
||||
break;
|
||||
}
|
||||
trace_mirror_yield_in_flight(s, next_sector, s->in_flight);
|
||||
mirror_wait_for_io(s);
|
||||
/* Now retry. */
|
||||
} else {
|
||||
hbitmap_next = hbitmap_iter_next(&s->hbi);
|
||||
assert(hbitmap_next == next_sector);
|
||||
nb_chunks++;
|
||||
break;
|
||||
}
|
||||
|
||||
hbitmap_next = hbitmap_iter_next(&s->hbi);
|
||||
if (hbitmap_next > next_sector || hbitmap_next < 0) {
|
||||
/* The bitmap iterator's cache is stale, refresh it */
|
||||
bdrv_set_dirty_iter(&s->hbi, next_sector);
|
||||
hbitmap_next = hbitmap_iter_next(&s->hbi);
|
||||
}
|
||||
assert(hbitmap_next == next_sector);
|
||||
nb_chunks++;
|
||||
}
|
||||
|
||||
/* Clear dirty bits before querying the block status, because
|
||||
@@ -378,6 +394,7 @@ static uint64_t coroutine_fn mirror_iteration(MirrorBlockJob *s)
|
||||
}
|
||||
}
|
||||
|
||||
mirror_clip_sectors(s, sector_num, &io_sectors);
|
||||
switch (mirror_method) {
|
||||
case MIRROR_METHOD_COPY:
|
||||
io_sectors = mirror_do_read(s, sector_num, io_sectors);
|
||||
@@ -393,7 +410,7 @@ static uint64_t coroutine_fn mirror_iteration(MirrorBlockJob *s)
|
||||
}
|
||||
assert(io_sectors);
|
||||
sector_num += io_sectors;
|
||||
nb_chunks -= io_sectors / sectors_per_chunk;
|
||||
nb_chunks -= DIV_ROUND_UP(io_sectors, sectors_per_chunk);
|
||||
delay_ns += ratelimit_calculate_delay(&s->limit, io_sectors);
|
||||
}
|
||||
return delay_ns;
|
||||
@@ -478,6 +495,9 @@ out:
|
||||
block_job_completed(&s->common, data->ret);
|
||||
g_free(data);
|
||||
bdrv_drained_end(src);
|
||||
if (qemu_get_aio_context() == bdrv_get_aio_context(src)) {
|
||||
aio_enable_external(iohandler_get_aio_context());
|
||||
}
|
||||
bdrv_unref(src);
|
||||
}
|
||||
|
||||
@@ -699,6 +719,12 @@ immediate_exit:
|
||||
/* Before we switch to target in mirror_exit, make sure data doesn't
|
||||
* change. */
|
||||
bdrv_drained_begin(s->common.bs);
|
||||
if (qemu_get_aio_context() == bdrv_get_aio_context(bs)) {
|
||||
/* FIXME: virtio host notifiers run on iohandler_ctx, therefore the
|
||||
* above bdrv_drained_end isn't enough to quiesce it. This is ugly, we
|
||||
* need a block layer API change to achieve this. */
|
||||
aio_disable_external(iohandler_get_aio_context());
|
||||
}
|
||||
block_job_defer_to_main_loop(&s->common, mirror_exit, data);
|
||||
}
|
||||
|
||||
|
102
block/vpc.c
102
block/vpc.c
@@ -45,34 +45,34 @@ enum vhd_type {
|
||||
VHD_DIFFERENCING = 4,
|
||||
};
|
||||
|
||||
// Seconds since Jan 1, 2000 0:00:00 (UTC)
|
||||
/* Seconds since Jan 1, 2000 0:00:00 (UTC) */
|
||||
#define VHD_TIMESTAMP_BASE 946684800
|
||||
|
||||
#define VHD_CHS_MAX_C 65535LL
|
||||
#define VHD_CHS_MAX_H 16
|
||||
#define VHD_CHS_MAX_S 255
|
||||
|
||||
#define VHD_MAX_SECTORS (65535LL * 255 * 255)
|
||||
#define VHD_MAX_SECTORS 0xff000000 /* 2040 GiB max image size */
|
||||
#define VHD_MAX_GEOMETRY (VHD_CHS_MAX_C * VHD_CHS_MAX_H * VHD_CHS_MAX_S)
|
||||
|
||||
#define VPC_OPT_FORCE_SIZE "force_size"
|
||||
|
||||
// always big-endian
|
||||
/* always big-endian */
|
||||
typedef struct vhd_footer {
|
||||
char creator[8]; // "conectix"
|
||||
char creator[8]; /* "conectix" */
|
||||
uint32_t features;
|
||||
uint32_t version;
|
||||
|
||||
// Offset of next header structure, 0xFFFFFFFF if none
|
||||
/* Offset of next header structure, 0xFFFFFFFF if none */
|
||||
uint64_t data_offset;
|
||||
|
||||
// Seconds since Jan 1, 2000 0:00:00 (UTC)
|
||||
/* Seconds since Jan 1, 2000 0:00:00 (UTC) */
|
||||
uint32_t timestamp;
|
||||
|
||||
char creator_app[4]; // "vpc "
|
||||
char creator_app[4]; /* e.g., "vpc " */
|
||||
uint16_t major;
|
||||
uint16_t minor;
|
||||
char creator_os[4]; // "Wi2k"
|
||||
char creator_os[4]; /* "Wi2k" */
|
||||
|
||||
uint64_t orig_size;
|
||||
uint64_t current_size;
|
||||
@@ -83,29 +83,29 @@ typedef struct vhd_footer {
|
||||
|
||||
uint32_t type;
|
||||
|
||||
// Checksum of the Hard Disk Footer ("one's complement of the sum of all
|
||||
// the bytes in the footer without the checksum field")
|
||||
/* Checksum of the Hard Disk Footer ("one's complement of the sum of all
|
||||
the bytes in the footer without the checksum field") */
|
||||
uint32_t checksum;
|
||||
|
||||
// UUID used to identify a parent hard disk (backing file)
|
||||
/* UUID used to identify a parent hard disk (backing file) */
|
||||
uint8_t uuid[16];
|
||||
|
||||
uint8_t in_saved_state;
|
||||
} QEMU_PACKED VHDFooter;
|
||||
|
||||
typedef struct vhd_dyndisk_header {
|
||||
char magic[8]; // "cxsparse"
|
||||
char magic[8]; /* "cxsparse" */
|
||||
|
||||
// Offset of next header structure, 0xFFFFFFFF if none
|
||||
/* Offset of next header structure, 0xFFFFFFFF if none */
|
||||
uint64_t data_offset;
|
||||
|
||||
// Offset of the Block Allocation Table (BAT)
|
||||
/* Offset of the Block Allocation Table (BAT) */
|
||||
uint64_t table_offset;
|
||||
|
||||
uint32_t version;
|
||||
uint32_t max_table_entries; // 32bit/entry
|
||||
uint32_t max_table_entries; /* 32bit/entry */
|
||||
|
||||
// 2 MB by default, must be a power of two
|
||||
/* 2 MB by default, must be a power of two */
|
||||
uint32_t block_size;
|
||||
|
||||
uint32_t checksum;
|
||||
@@ -113,7 +113,7 @@ typedef struct vhd_dyndisk_header {
|
||||
uint32_t parent_timestamp;
|
||||
uint32_t reserved;
|
||||
|
||||
// Backing file name (in UTF-16)
|
||||
/* Backing file name (in UTF-16) */
|
||||
uint8_t parent_name[512];
|
||||
|
||||
struct {
|
||||
@@ -238,6 +238,7 @@ static int vpc_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
|
||||
ret = bdrv_pread(bs->file->bs, 0, s->footer_buf, HEADER_SIZE);
|
||||
if (ret < 0) {
|
||||
error_setg(errp, "Unable to read VHD header");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -246,9 +247,11 @@ static int vpc_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
int64_t offset = bdrv_getlength(bs->file->bs);
|
||||
if (offset < 0) {
|
||||
ret = offset;
|
||||
error_setg(errp, "Invalid file size");
|
||||
goto fail;
|
||||
} else if (offset < HEADER_SIZE) {
|
||||
ret = -EINVAL;
|
||||
error_setg(errp, "File too small for a VHD header");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -275,9 +278,9 @@ static int vpc_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
/* Write 'checksum' back to footer, or else will leave it with zero. */
|
||||
footer->checksum = cpu_to_be32(checksum);
|
||||
|
||||
// The visible size of a image in Virtual PC depends on the geometry
|
||||
// rather than on the size stored in the footer (the size in the footer
|
||||
// is too large usually)
|
||||
/* The visible size of a image in Virtual PC depends on the geometry
|
||||
rather than on the size stored in the footer (the size in the footer
|
||||
is too large usually) */
|
||||
bs->total_sectors = (int64_t)
|
||||
be16_to_cpu(footer->cyls) * footer->heads * footer->secs_per_cyl;
|
||||
|
||||
@@ -299,6 +302,8 @@ static int vpc_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
* 'qem2' : current_size QEMU (uses current_size)
|
||||
* 'win ' : current_size Hyper-V
|
||||
* 'd2v ' : current_size Disk2vhd
|
||||
* 'tap\0' : current_size XenServer
|
||||
* 'CTXS' : current_size XenConverter
|
||||
*
|
||||
* The user can override the table values via drive options, however
|
||||
* even with an override we will still use current_size for images
|
||||
@@ -306,15 +311,17 @@ static int vpc_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
*/
|
||||
use_chs = (!!strncmp(footer->creator_app, "win ", 4) &&
|
||||
!!strncmp(footer->creator_app, "qem2", 4) &&
|
||||
!!strncmp(footer->creator_app, "d2v ", 4)) || s->force_use_chs;
|
||||
!!strncmp(footer->creator_app, "d2v ", 4) &&
|
||||
!!strncmp(footer->creator_app, "CTXS", 4) &&
|
||||
!!memcmp(footer->creator_app, "tap", 4)) || s->force_use_chs;
|
||||
|
||||
if (!use_chs || bs->total_sectors == VHD_MAX_GEOMETRY || s->force_use_sz) {
|
||||
bs->total_sectors = be64_to_cpu(footer->current_size) /
|
||||
BDRV_SECTOR_SIZE;
|
||||
}
|
||||
|
||||
/* Allow a maximum disk size of approximately 2 TB */
|
||||
if (bs->total_sectors >= VHD_MAX_SECTORS) {
|
||||
/* Allow a maximum disk size of 2040 GiB */
|
||||
if (bs->total_sectors > VHD_MAX_SECTORS) {
|
||||
ret = -EFBIG;
|
||||
goto fail;
|
||||
}
|
||||
@@ -323,12 +330,14 @@ static int vpc_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
ret = bdrv_pread(bs->file->bs, be64_to_cpu(footer->data_offset), buf,
|
||||
HEADER_SIZE);
|
||||
if (ret < 0) {
|
||||
error_setg(errp, "Error reading dynamic VHD header");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
dyndisk_header = (VHDDynDiskHeader *) buf;
|
||||
|
||||
if (strncmp(dyndisk_header->magic, "cxsparse", 8)) {
|
||||
error_setg(errp, "Invalid header magic");
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
@@ -344,16 +353,14 @@ static int vpc_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
s->max_table_entries = be32_to_cpu(dyndisk_header->max_table_entries);
|
||||
|
||||
if ((bs->total_sectors * 512) / s->block_size > 0xffffffffU) {
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
if (s->max_table_entries > (VHD_MAX_SECTORS * 512) / s->block_size) {
|
||||
error_setg(errp, "Too many blocks");
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
computed_size = (uint64_t) s->max_table_entries * s->block_size;
|
||||
if (computed_size < bs->total_sectors * 512) {
|
||||
error_setg(errp, "Page table too small");
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
@@ -370,6 +377,7 @@ static int vpc_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
|
||||
s->pagetable = qemu_try_blockalign(bs->file->bs, pagetable_size);
|
||||
if (s->pagetable == NULL) {
|
||||
error_setg(errp, "Unable to allocate memory for page table");
|
||||
ret = -ENOMEM;
|
||||
goto fail;
|
||||
}
|
||||
@@ -379,6 +387,7 @@ static int vpc_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
ret = bdrv_pread(bs->file->bs, s->bat_offset, s->pagetable,
|
||||
pagetable_size);
|
||||
if (ret < 0) {
|
||||
error_setg(errp, "Error reading pagetable");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -457,16 +466,16 @@ static inline int64_t get_sector_offset(BlockDriverState *bs,
|
||||
pageentry_index = (offset % s->block_size) / 512;
|
||||
|
||||
if (pagetable_index >= s->max_table_entries || s->pagetable[pagetable_index] == 0xffffffff)
|
||||
return -1; // not allocated
|
||||
return -1; /* not allocated */
|
||||
|
||||
bitmap_offset = 512 * (uint64_t) s->pagetable[pagetable_index];
|
||||
block_offset = bitmap_offset + s->bitmap_size + (512 * pageentry_index);
|
||||
|
||||
// We must ensure that we don't write to any sectors which are marked as
|
||||
// unused in the bitmap. We get away with setting all bits in the block
|
||||
// bitmap each time we write to a new block. This might cause Virtual PC to
|
||||
// miss sparse read optimization, but it's not a problem in terms of
|
||||
// correctness.
|
||||
/* We must ensure that we don't write to any sectors which are marked as
|
||||
unused in the bitmap. We get away with setting all bits in the block
|
||||
bitmap each time we write to a new block. This might cause Virtual PC to
|
||||
miss sparse read optimization, but it's not a problem in terms of
|
||||
correctness. */
|
||||
if (write && (s->last_bitmap_offset != bitmap_offset)) {
|
||||
uint8_t bitmap[s->bitmap_size];
|
||||
|
||||
@@ -512,18 +521,18 @@ static int64_t alloc_block(BlockDriverState* bs, int64_t sector_num)
|
||||
int ret;
|
||||
uint8_t bitmap[s->bitmap_size];
|
||||
|
||||
// Check if sector_num is valid
|
||||
/* Check if sector_num is valid */
|
||||
if ((sector_num < 0) || (sector_num > bs->total_sectors))
|
||||
return -1;
|
||||
|
||||
// Write entry into in-memory BAT
|
||||
/* Write entry into in-memory BAT */
|
||||
index = (sector_num * 512) / s->block_size;
|
||||
if (s->pagetable[index] != 0xFFFFFFFF)
|
||||
return -1;
|
||||
|
||||
s->pagetable[index] = s->free_data_block_offset / 512;
|
||||
|
||||
// Initialize the block's bitmap
|
||||
/* Initialize the block's bitmap */
|
||||
memset(bitmap, 0xff, s->bitmap_size);
|
||||
ret = bdrv_pwrite_sync(bs->file->bs, s->free_data_block_offset, bitmap,
|
||||
s->bitmap_size);
|
||||
@@ -531,13 +540,13 @@ static int64_t alloc_block(BlockDriverState* bs, int64_t sector_num)
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Write new footer (the old one will be overwritten)
|
||||
/* Write new footer (the old one will be overwritten) */
|
||||
s->free_data_block_offset += s->block_size + s->bitmap_size;
|
||||
ret = rewrite_footer(bs);
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
|
||||
// Write BAT entry to disk
|
||||
/* Write BAT entry to disk */
|
||||
bat_offset = s->bat_offset + (4 * index);
|
||||
bat_value = cpu_to_be32(s->pagetable[index]);
|
||||
ret = bdrv_pwrite_sync(bs->file->bs, bat_offset, &bat_value, 4);
|
||||
@@ -718,7 +727,7 @@ static int64_t coroutine_fn vpc_co_get_block_status(BlockDriverState *bs,
|
||||
* Note that the geometry doesn't always exactly match total_sectors but
|
||||
* may round it down.
|
||||
*
|
||||
* Returns 0 on success, -EFBIG if the size is larger than ~2 TB. Override
|
||||
* Returns 0 on success, -EFBIG if the size is larger than 2040 GiB. Override
|
||||
* the hardware EIDE and ATA-2 limit of 16 heads (max disk size of 127 GB)
|
||||
* and instead allow up to 255 heads.
|
||||
*/
|
||||
@@ -770,7 +779,7 @@ static int create_dynamic_disk(BlockBackend *blk, uint8_t *buf,
|
||||
int ret;
|
||||
int64_t offset = 0;
|
||||
|
||||
// Write the footer (twice: at the beginning and at the end)
|
||||
/* Write the footer (twice: at the beginning and at the end) */
|
||||
block_size = 0x200000;
|
||||
num_bat_entries = (total_sectors + block_size / 512) / (block_size / 512);
|
||||
|
||||
@@ -785,7 +794,7 @@ static int create_dynamic_disk(BlockBackend *blk, uint8_t *buf,
|
||||
goto fail;
|
||||
}
|
||||
|
||||
// Write the initial BAT
|
||||
/* Write the initial BAT */
|
||||
offset = 3 * 512;
|
||||
|
||||
memset(buf, 0xFF, 512);
|
||||
@@ -797,7 +806,7 @@ static int create_dynamic_disk(BlockBackend *blk, uint8_t *buf,
|
||||
offset += 512;
|
||||
}
|
||||
|
||||
// Prepare the Dynamic Disk Header
|
||||
/* Prepare the Dynamic Disk Header */
|
||||
memset(buf, 0, 1024);
|
||||
|
||||
memcpy(dyndisk_header->magic, "cxsparse", 8);
|
||||
@@ -814,7 +823,7 @@ static int create_dynamic_disk(BlockBackend *blk, uint8_t *buf,
|
||||
|
||||
dyndisk_header->checksum = cpu_to_be32(vpc_checksum(buf, 1024));
|
||||
|
||||
// Write the header
|
||||
/* Write the header */
|
||||
offset = 512;
|
||||
|
||||
ret = blk_pwrite(blk, offset, buf, 1024);
|
||||
@@ -874,6 +883,7 @@ static int vpc_create(const char *filename, QemuOpts *opts, Error **errp)
|
||||
} else if (!strcmp(disk_type_param, "fixed")) {
|
||||
disk_type = VHD_FIXED;
|
||||
} else {
|
||||
error_setg(errp, "Invalid disk type, %s", disk_type_param);
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
@@ -922,8 +932,9 @@ static int vpc_create(const char *filename, QemuOpts *opts, Error **errp)
|
||||
|
||||
if ((int64_t)cyls * heads * secs_per_cyl == VHD_MAX_GEOMETRY) {
|
||||
total_sectors = total_size / BDRV_SECTOR_SIZE;
|
||||
/* Allow a maximum disk size of approximately 2 TB */
|
||||
/* Allow a maximum disk size of 2040 GiB */
|
||||
if (total_sectors > VHD_MAX_SECTORS) {
|
||||
error_setg(errp, "Disk size is too large, max size is 2040 GiB");
|
||||
ret = -EFBIG;
|
||||
goto out;
|
||||
}
|
||||
@@ -974,6 +985,9 @@ static int vpc_create(const char *filename, QemuOpts *opts, Error **errp)
|
||||
} else {
|
||||
ret = create_fixed_disk(blk, buf, total_size);
|
||||
}
|
||||
if (ret < 0) {
|
||||
error_setg(errp, "Unable to create or write VHD header");
|
||||
}
|
||||
|
||||
out:
|
||||
blk_unref(blk);
|
||||
|
@@ -1109,6 +1109,8 @@ static int vvfat_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
goto fail;
|
||||
}
|
||||
memcpy(s->volume_label, label, label_length);
|
||||
} else {
|
||||
memcpy(s->volume_label, "QEMU VVFAT", 10);
|
||||
}
|
||||
|
||||
if (floppy) {
|
||||
@@ -2283,12 +2285,17 @@ DLOG(fprintf(stderr, "commit_direntries for %s, parent_mapping_index %d\n", mapp
|
||||
factor * (old_cluster_count - new_cluster_count));
|
||||
|
||||
for (c = first_cluster; !fat_eof(s, c); c = modified_fat_get(s, c)) {
|
||||
direntry_t *first_direntry;
|
||||
void* direntry = array_get(&(s->directory), current_dir_index);
|
||||
int ret = vvfat_read(s->bs, cluster2sector(s, c), direntry,
|
||||
s->sectors_per_cluster);
|
||||
if (ret)
|
||||
return ret;
|
||||
assert(!strncmp(s->directory.pointer, "QEMU", 4));
|
||||
|
||||
/* The first directory entry on the filesystem is the volume name */
|
||||
first_direntry = (direntry_t*) s->directory.pointer;
|
||||
assert(!memcmp(first_direntry->name, s->volume_label, 11));
|
||||
|
||||
current_dir_index += factor;
|
||||
}
|
||||
|
||||
|
34
configure
vendored
34
configure
vendored
@@ -298,6 +298,7 @@ coroutine=""
|
||||
coroutine_pool=""
|
||||
seccomp=""
|
||||
glusterfs=""
|
||||
glusterfs_xlator_opt="no"
|
||||
glusterfs_discard="no"
|
||||
glusterfs_zerofill="no"
|
||||
archipelago="no"
|
||||
@@ -1872,6 +1873,9 @@ if test "$seccomp" != "no" ; then
|
||||
i386|x86_64)
|
||||
libseccomp_minver="2.1.0"
|
||||
;;
|
||||
mips)
|
||||
libseccomp_minver="2.2.0"
|
||||
;;
|
||||
arm|aarch64)
|
||||
libseccomp_minver="2.2.3"
|
||||
;;
|
||||
@@ -3397,6 +3401,9 @@ if test "$glusterfs" != "no" ; then
|
||||
glusterfs="yes"
|
||||
glusterfs_cflags=`$pkg_config --cflags glusterfs-api`
|
||||
glusterfs_libs=`$pkg_config --libs glusterfs-api`
|
||||
if $pkg_config --atleast-version=4 glusterfs-api; then
|
||||
glusterfs_xlator_opt="yes"
|
||||
fi
|
||||
if $pkg_config --atleast-version=5 glusterfs-api; then
|
||||
glusterfs_discard="yes"
|
||||
fi
|
||||
@@ -4486,6 +4493,21 @@ if test "$fortify_source" != "no"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
##########################################
|
||||
# check if struct fsxattr is available via linux/fs.h
|
||||
|
||||
have_fsxattr=no
|
||||
cat > $TMPC << EOF
|
||||
#include <linux/fs.h>
|
||||
struct fsxattr foo;
|
||||
int main(void) {
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
if compile_prog "" "" ; then
|
||||
have_fsxattr=yes
|
||||
fi
|
||||
|
||||
##########################################
|
||||
# End of CC checks
|
||||
# After here, no more $cc or $ld runs
|
||||
@@ -5153,6 +5175,14 @@ fi
|
||||
if test "$have_ifaddrs_h" = "yes" ; then
|
||||
echo "HAVE_IFADDRS_H=y" >> $config_host_mak
|
||||
fi
|
||||
|
||||
# Work around a system header bug with some kernel/XFS header
|
||||
# versions where they both try to define 'struct fsxattr':
|
||||
# xfs headers will not try to redefine structs from linux headers
|
||||
# if this macro is set.
|
||||
if test "$have_fsxattr" = "yes" ; then
|
||||
echo "HAVE_FSXATTR=y" >> $config_host_mak
|
||||
fi
|
||||
if test "$vte" = "yes" ; then
|
||||
echo "CONFIG_VTE=y" >> $config_host_mak
|
||||
echo "VTE_CFLAGS=$vte_cflags" >> $config_host_mak
|
||||
@@ -5339,6 +5369,10 @@ if test "$glusterfs" = "yes" ; then
|
||||
echo "GLUSTERFS_LIBS=$glusterfs_libs" >> $config_host_mak
|
||||
fi
|
||||
|
||||
if test "$glusterfs_xlator_opt" = "yes" ; then
|
||||
echo "CONFIG_GLUSTERFS_XLATOR_OPT=y" >> $config_host_mak
|
||||
fi
|
||||
|
||||
if test "$glusterfs_discard" = "yes" ; then
|
||||
echo "CONFIG_GLUSTERFS_DISCARD=y" >> $config_host_mak
|
||||
fi
|
||||
|
@@ -210,29 +210,27 @@ the following syntax:
|
||||
|
||||
-fw_cfg [name=]<item_name>,file=<path>
|
||||
|
||||
where <item_name> is the fw_cfg item name, and <path> is the location
|
||||
on the host file system of a file containing the data to be inserted.
|
||||
|
||||
Small enough items may be provided directly as strings on the command
|
||||
line, using the syntax:
|
||||
Or
|
||||
|
||||
-fw_cfg [name=]<item_name>,string=<string>
|
||||
|
||||
The terminating NUL character of the content <string> will NOT be
|
||||
included as part of the fw_cfg item data, which is consistent with
|
||||
the absence of a NUL terminator for items inserted via the file option.
|
||||
See QEMU man page for more documentation.
|
||||
|
||||
Both <item_name> and, if applicable, the content <string> are passed
|
||||
through by QEMU without any interpretation, expansion, or further
|
||||
processing. Any such processing (potentially performed e.g., by the shell)
|
||||
is outside of QEMU's responsibility; as such, using plain ASCII characters
|
||||
is recommended.
|
||||
Using item_name with plain ASCII characters only is recommended.
|
||||
|
||||
NOTE: Users *SHOULD* choose item names beginning with the prefix "opt/"
|
||||
when using the "-fw_cfg" command line option, to avoid conflicting with
|
||||
item names used internally by QEMU. For instance:
|
||||
Item names beginning with "opt/" are reserved for users. QEMU will
|
||||
never create entries with such names unless explicitly ordered by the
|
||||
user.
|
||||
|
||||
-fw_cfg name=opt/my_item_name,file=./my_blob.bin
|
||||
To avoid clashes among different users, it is strongly recommended
|
||||
that you use names beginning with opt/RFQDN/, where RFQDN is a reverse
|
||||
fully qualified domain name you control. For instance, if SeaBIOS
|
||||
wanted to define additional names, the prefix "opt/org.seabios/" would
|
||||
be appropriate.
|
||||
|
||||
Similarly, QEMU developers *SHOULD NOT* use item names prefixed with
|
||||
"opt/" when inserting items programmatically, e.g. via fw_cfg_add_file().
|
||||
For historical reasons, "opt/ovmf/" is reserved for OVMF firmware.
|
||||
|
||||
Prefix "opt/org.qemu/" is reserved for QEMU itself.
|
||||
|
||||
Use of names not beginning with "opt/" is potentially dangerous and
|
||||
entirely unsupported. QEMU will warn if you try.
|
||||
|
@@ -135,9 +135,8 @@ void bios_linker_loader_alloc(GArray *linker,
|
||||
strncpy(entry.alloc.file, file, sizeof entry.alloc.file - 1);
|
||||
entry.command = cpu_to_le32(BIOS_LINKER_LOADER_COMMAND_ALLOCATE);
|
||||
entry.alloc.align = cpu_to_le32(alloc_align);
|
||||
entry.alloc.zone = cpu_to_le32(alloc_fseg ?
|
||||
BIOS_LINKER_LOADER_ALLOC_ZONE_FSEG :
|
||||
BIOS_LINKER_LOADER_ALLOC_ZONE_HIGH);
|
||||
entry.alloc.zone = alloc_fseg ? BIOS_LINKER_LOADER_ALLOC_ZONE_FSEG :
|
||||
BIOS_LINKER_LOADER_ALLOC_ZONE_HIGH;
|
||||
|
||||
/* Alloc entries must come first, so prepend them */
|
||||
g_array_prepend_vals(linker, &entry, sizeof entry);
|
||||
|
@@ -536,7 +536,6 @@ void acpi_pm_tmr_init(ACPIREGS *ar, acpi_update_sci_fn update_sci,
|
||||
ar->tmr.timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, acpi_pm_tmr_timer, ar);
|
||||
memory_region_init_io(&ar->tmr.io, memory_region_owner(parent),
|
||||
&acpi_pm_tmr_ops, ar, "acpi-tmr", 4);
|
||||
memory_region_clear_global_locking(&ar->tmr.io);
|
||||
memory_region_add_subregion(parent, 8, &ar->tmr.io);
|
||||
}
|
||||
|
||||
|
@@ -68,7 +68,7 @@ static const ARMInsnFixup bootloader_aarch64[] = {
|
||||
*/
|
||||
|
||||
static const ARMInsnFixup bootloader[] = {
|
||||
{ 0xe28fe008 }, /* add lr, pc, #8 */
|
||||
{ 0xe28fe004 }, /* add lr, pc, #4 */
|
||||
{ 0xe51ff004 }, /* ldr pc, [pc, #-4] */
|
||||
{ 0, FIXUP_BOARD_SETUP },
|
||||
#define BOOTLOADER_NO_BOARD_SETUP_OFFSET 3
|
||||
|
@@ -46,6 +46,7 @@
|
||||
#include "exec/address-spaces.h"
|
||||
#include "qemu/host-utils.h"
|
||||
#include "hw/sysbus.h"
|
||||
#include "sysemu/sysemu.h"
|
||||
|
||||
#define PFLASH_BUG(fmt, ...) \
|
||||
do { \
|
||||
@@ -97,6 +98,7 @@ struct pflash_t {
|
||||
MemoryRegion mem;
|
||||
char *name;
|
||||
void *storage;
|
||||
VMChangeStateEntry *vmstate;
|
||||
};
|
||||
|
||||
static int pflash_post_load(void *opaque, int version_id);
|
||||
@@ -944,13 +946,25 @@ MemoryRegion *pflash_cfi01_get_memory(pflash_t *fl)
|
||||
return &fl->mem;
|
||||
}
|
||||
|
||||
static void postload_update_cb(void *opaque, int running, RunState state)
|
||||
{
|
||||
pflash_t *pfl = opaque;
|
||||
|
||||
/* This is called after bdrv_invalidate_cache_all. */
|
||||
qemu_del_vm_change_state_handler(pfl->vmstate);
|
||||
pfl->vmstate = NULL;
|
||||
|
||||
DPRINTF("%s: updating bdrv for %s\n", __func__, pfl->name);
|
||||
pflash_update(pfl, 0, pfl->sector_len * pfl->nb_blocs);
|
||||
}
|
||||
|
||||
static int pflash_post_load(void *opaque, int version_id)
|
||||
{
|
||||
pflash_t *pfl = opaque;
|
||||
|
||||
if (!pfl->ro) {
|
||||
DPRINTF("%s: updating bdrv for %s\n", __func__, pfl->name);
|
||||
pflash_update(pfl, 0, pfl->sector_len * pfl->nb_blocs);
|
||||
pfl->vmstate = qemu_add_vm_change_state_handler(postload_update_cb,
|
||||
pfl);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@@ -375,6 +375,9 @@ static void uart_write(void *opaque, hwaddr offset,
|
||||
|
||||
DB_PRINT(" offset:%x data:%08x\n", (unsigned)offset, (unsigned)value);
|
||||
offset >>= 2;
|
||||
if (offset >= CADENCE_UART_R_MAX) {
|
||||
return;
|
||||
}
|
||||
switch (offset) {
|
||||
case R_IER: /* ier (wts imr) */
|
||||
s->r[R_IMR] |= value;
|
||||
|
122
hw/display/vga.c
122
hw/display/vga.c
@@ -142,6 +142,13 @@ static uint32_t expand4[256];
|
||||
static uint16_t expand2[256];
|
||||
static uint8_t expand4to8[16];
|
||||
|
||||
static void vbe_update_vgaregs(VGACommonState *s);
|
||||
|
||||
static inline bool vbe_enabled(VGACommonState *s)
|
||||
{
|
||||
return s->vbe_regs[VBE_DISPI_INDEX_ENABLE] & VBE_DISPI_ENABLED;
|
||||
}
|
||||
|
||||
static void vga_update_memory_access(VGACommonState *s)
|
||||
{
|
||||
hwaddr base, offset, size;
|
||||
@@ -179,6 +186,7 @@ static void vga_update_memory_access(VGACommonState *s)
|
||||
size = 0x8000;
|
||||
break;
|
||||
}
|
||||
assert(offset + size <= s->vram_size);
|
||||
memory_region_init_alias(&s->chain4_alias, memory_region_owner(&s->vram),
|
||||
"vga.chain4", &s->vram, offset, size);
|
||||
memory_region_add_subregion_overlap(s->legacy_address_space, base,
|
||||
@@ -478,6 +486,7 @@ void vga_ioport_write(void *opaque, uint32_t addr, uint32_t val)
|
||||
printf("vga: write SR%x = 0x%02x\n", s->sr_index, val);
|
||||
#endif
|
||||
s->sr[s->sr_index] = val & sr_mask[s->sr_index];
|
||||
vbe_update_vgaregs(s);
|
||||
if (s->sr_index == VGA_SEQ_CLOCK_MODE) {
|
||||
s->update_retrace_info(s);
|
||||
}
|
||||
@@ -509,6 +518,7 @@ void vga_ioport_write(void *opaque, uint32_t addr, uint32_t val)
|
||||
printf("vga: write GR%x = 0x%02x\n", s->gr_index, val);
|
||||
#endif
|
||||
s->gr[s->gr_index] = val & gr_mask[s->gr_index];
|
||||
vbe_update_vgaregs(s);
|
||||
vga_update_memory_access(s);
|
||||
break;
|
||||
case VGA_CRT_IM:
|
||||
@@ -527,10 +537,12 @@ void vga_ioport_write(void *opaque, uint32_t addr, uint32_t val)
|
||||
if (s->cr_index == VGA_CRTC_OVERFLOW) {
|
||||
s->cr[VGA_CRTC_OVERFLOW] = (s->cr[VGA_CRTC_OVERFLOW] & ~0x10) |
|
||||
(val & 0x10);
|
||||
vbe_update_vgaregs(s);
|
||||
}
|
||||
return;
|
||||
}
|
||||
s->cr[s->cr_index] = val;
|
||||
vbe_update_vgaregs(s);
|
||||
|
||||
switch(s->cr_index) {
|
||||
case VGA_CRTC_H_TOTAL:
|
||||
@@ -563,7 +575,7 @@ static void vbe_fixup_regs(VGACommonState *s)
|
||||
uint16_t *r = s->vbe_regs;
|
||||
uint32_t bits, linelength, maxy, offset;
|
||||
|
||||
if (!(r[VBE_DISPI_INDEX_ENABLE] & VBE_DISPI_ENABLED)) {
|
||||
if (!vbe_enabled(s)) {
|
||||
/* vbe is turned off -- nothing to do */
|
||||
return;
|
||||
}
|
||||
@@ -638,6 +650,49 @@ static void vbe_fixup_regs(VGACommonState *s)
|
||||
s->vbe_start_addr = offset / 4;
|
||||
}
|
||||
|
||||
/* we initialize the VGA graphic mode */
|
||||
static void vbe_update_vgaregs(VGACommonState *s)
|
||||
{
|
||||
int h, shift_control;
|
||||
|
||||
if (!vbe_enabled(s)) {
|
||||
/* vbe is turned off -- nothing to do */
|
||||
return;
|
||||
}
|
||||
|
||||
/* graphic mode + memory map 1 */
|
||||
s->gr[VGA_GFX_MISC] = (s->gr[VGA_GFX_MISC] & ~0x0c) | 0x04 |
|
||||
VGA_GR06_GRAPHICS_MODE;
|
||||
s->cr[VGA_CRTC_MODE] |= 3; /* no CGA modes */
|
||||
s->cr[VGA_CRTC_OFFSET] = s->vbe_line_offset >> 3;
|
||||
/* width */
|
||||
s->cr[VGA_CRTC_H_DISP] =
|
||||
(s->vbe_regs[VBE_DISPI_INDEX_XRES] >> 3) - 1;
|
||||
/* height (only meaningful if < 1024) */
|
||||
h = s->vbe_regs[VBE_DISPI_INDEX_YRES] - 1;
|
||||
s->cr[VGA_CRTC_V_DISP_END] = h;
|
||||
s->cr[VGA_CRTC_OVERFLOW] = (s->cr[VGA_CRTC_OVERFLOW] & ~0x42) |
|
||||
((h >> 7) & 0x02) | ((h >> 3) & 0x40);
|
||||
/* line compare to 1023 */
|
||||
s->cr[VGA_CRTC_LINE_COMPARE] = 0xff;
|
||||
s->cr[VGA_CRTC_OVERFLOW] |= 0x10;
|
||||
s->cr[VGA_CRTC_MAX_SCAN] |= 0x40;
|
||||
|
||||
if (s->vbe_regs[VBE_DISPI_INDEX_BPP] == 4) {
|
||||
shift_control = 0;
|
||||
s->sr[VGA_SEQ_CLOCK_MODE] &= ~8; /* no double line */
|
||||
} else {
|
||||
shift_control = 2;
|
||||
/* set chain 4 mode */
|
||||
s->sr[VGA_SEQ_MEMORY_MODE] |= VGA_SR04_CHN_4M;
|
||||
/* activate all planes */
|
||||
s->sr[VGA_SEQ_PLANE_WRITE] |= VGA_SR02_ALL_PLANES;
|
||||
}
|
||||
s->gr[VGA_GFX_MODE] = (s->gr[VGA_GFX_MODE] & ~0x60) |
|
||||
(shift_control << 5);
|
||||
s->cr[VGA_CRTC_MAX_SCAN] &= ~0x9f; /* no double scan */
|
||||
}
|
||||
|
||||
static uint32_t vbe_ioport_read_index(void *opaque, uint32_t addr)
|
||||
{
|
||||
VGACommonState *s = opaque;
|
||||
@@ -714,13 +769,10 @@ void vbe_ioport_write_data(void *opaque, uint32_t addr, uint32_t val)
|
||||
case VBE_DISPI_INDEX_Y_OFFSET:
|
||||
s->vbe_regs[s->vbe_index] = val;
|
||||
vbe_fixup_regs(s);
|
||||
vbe_update_vgaregs(s);
|
||||
break;
|
||||
case VBE_DISPI_INDEX_BANK:
|
||||
if (s->vbe_regs[VBE_DISPI_INDEX_BPP] == 4) {
|
||||
val &= (s->vbe_bank_mask >> 2);
|
||||
} else {
|
||||
val &= s->vbe_bank_mask;
|
||||
}
|
||||
val &= s->vbe_bank_mask;
|
||||
s->vbe_regs[s->vbe_index] = val;
|
||||
s->bank_offset = (val << 16);
|
||||
vga_update_memory_access(s);
|
||||
@@ -728,52 +780,19 @@ void vbe_ioport_write_data(void *opaque, uint32_t addr, uint32_t val)
|
||||
case VBE_DISPI_INDEX_ENABLE:
|
||||
if ((val & VBE_DISPI_ENABLED) &&
|
||||
!(s->vbe_regs[VBE_DISPI_INDEX_ENABLE] & VBE_DISPI_ENABLED)) {
|
||||
int h, shift_control;
|
||||
|
||||
s->vbe_regs[VBE_DISPI_INDEX_VIRT_WIDTH] = 0;
|
||||
s->vbe_regs[VBE_DISPI_INDEX_X_OFFSET] = 0;
|
||||
s->vbe_regs[VBE_DISPI_INDEX_Y_OFFSET] = 0;
|
||||
s->vbe_regs[VBE_DISPI_INDEX_ENABLE] |= VBE_DISPI_ENABLED;
|
||||
vbe_fixup_regs(s);
|
||||
vbe_update_vgaregs(s);
|
||||
|
||||
/* clear the screen */
|
||||
if (!(val & VBE_DISPI_NOCLEARMEM)) {
|
||||
memset(s->vram_ptr, 0,
|
||||
s->vbe_regs[VBE_DISPI_INDEX_YRES] * s->vbe_line_offset);
|
||||
}
|
||||
|
||||
/* we initialize the VGA graphic mode */
|
||||
/* graphic mode + memory map 1 */
|
||||
s->gr[VGA_GFX_MISC] = (s->gr[VGA_GFX_MISC] & ~0x0c) | 0x04 |
|
||||
VGA_GR06_GRAPHICS_MODE;
|
||||
s->cr[VGA_CRTC_MODE] |= 3; /* no CGA modes */
|
||||
s->cr[VGA_CRTC_OFFSET] = s->vbe_line_offset >> 3;
|
||||
/* width */
|
||||
s->cr[VGA_CRTC_H_DISP] =
|
||||
(s->vbe_regs[VBE_DISPI_INDEX_XRES] >> 3) - 1;
|
||||
/* height (only meaningful if < 1024) */
|
||||
h = s->vbe_regs[VBE_DISPI_INDEX_YRES] - 1;
|
||||
s->cr[VGA_CRTC_V_DISP_END] = h;
|
||||
s->cr[VGA_CRTC_OVERFLOW] = (s->cr[VGA_CRTC_OVERFLOW] & ~0x42) |
|
||||
((h >> 7) & 0x02) | ((h >> 3) & 0x40);
|
||||
/* line compare to 1023 */
|
||||
s->cr[VGA_CRTC_LINE_COMPARE] = 0xff;
|
||||
s->cr[VGA_CRTC_OVERFLOW] |= 0x10;
|
||||
s->cr[VGA_CRTC_MAX_SCAN] |= 0x40;
|
||||
|
||||
if (s->vbe_regs[VBE_DISPI_INDEX_BPP] == 4) {
|
||||
shift_control = 0;
|
||||
s->sr[VGA_SEQ_CLOCK_MODE] &= ~8; /* no double line */
|
||||
} else {
|
||||
shift_control = 2;
|
||||
/* set chain 4 mode */
|
||||
s->sr[VGA_SEQ_MEMORY_MODE] |= VGA_SR04_CHN_4M;
|
||||
/* activate all planes */
|
||||
s->sr[VGA_SEQ_PLANE_WRITE] |= VGA_SR02_ALL_PLANES;
|
||||
}
|
||||
s->gr[VGA_GFX_MODE] = (s->gr[VGA_GFX_MODE] & ~0x60) |
|
||||
(shift_control << 5);
|
||||
s->cr[VGA_CRTC_MAX_SCAN] &= ~0x9f; /* no double scan */
|
||||
} else {
|
||||
s->bank_offset = 0;
|
||||
}
|
||||
@@ -819,13 +838,21 @@ uint32_t vga_mem_readb(VGACommonState *s, hwaddr addr)
|
||||
|
||||
if (s->sr[VGA_SEQ_MEMORY_MODE] & VGA_SR04_CHN_4M) {
|
||||
/* chain 4 mode : simplest access */
|
||||
assert(addr < s->vram_size);
|
||||
ret = s->vram_ptr[addr];
|
||||
} else if (s->gr[VGA_GFX_MODE] & 0x10) {
|
||||
/* odd/even mode (aka text mode mapping) */
|
||||
plane = (s->gr[VGA_GFX_PLANE_READ] & 2) | (addr & 1);
|
||||
ret = s->vram_ptr[((addr & ~1) << 1) | plane];
|
||||
addr = ((addr & ~1) << 1) | plane;
|
||||
if (addr >= s->vram_size) {
|
||||
return 0xff;
|
||||
}
|
||||
ret = s->vram_ptr[addr];
|
||||
} else {
|
||||
/* standard VGA latched access */
|
||||
if (addr * sizeof(uint32_t) >= s->vram_size) {
|
||||
return 0xff;
|
||||
}
|
||||
s->latch = ((uint32_t *)s->vram_ptr)[addr];
|
||||
|
||||
if (!(s->gr[VGA_GFX_MODE] & 0x08)) {
|
||||
@@ -882,6 +909,7 @@ void vga_mem_writeb(VGACommonState *s, hwaddr addr, uint32_t val)
|
||||
plane = addr & 3;
|
||||
mask = (1 << plane);
|
||||
if (s->sr[VGA_SEQ_PLANE_WRITE] & mask) {
|
||||
assert(addr < s->vram_size);
|
||||
s->vram_ptr[addr] = val;
|
||||
#ifdef DEBUG_VGA_MEM
|
||||
printf("vga: chain4: [0x" TARGET_FMT_plx "]\n", addr);
|
||||
@@ -895,6 +923,9 @@ void vga_mem_writeb(VGACommonState *s, hwaddr addr, uint32_t val)
|
||||
mask = (1 << plane);
|
||||
if (s->sr[VGA_SEQ_PLANE_WRITE] & mask) {
|
||||
addr = ((addr & ~1) << 1) | plane;
|
||||
if (addr >= s->vram_size) {
|
||||
return;
|
||||
}
|
||||
s->vram_ptr[addr] = val;
|
||||
#ifdef DEBUG_VGA_MEM
|
||||
printf("vga: odd/even: [0x" TARGET_FMT_plx "]\n", addr);
|
||||
@@ -968,6 +999,9 @@ void vga_mem_writeb(VGACommonState *s, hwaddr addr, uint32_t val)
|
||||
mask = s->sr[VGA_SEQ_PLANE_WRITE];
|
||||
s->plane_updated |= mask; /* only used to detect font change */
|
||||
write_mask = mask16[mask];
|
||||
if (addr * sizeof(uint32_t) >= s->vram_size) {
|
||||
return;
|
||||
}
|
||||
((uint32_t *)s->vram_ptr)[addr] =
|
||||
(((uint32_t *)s->vram_ptr)[addr] & ~write_mask) |
|
||||
(val & write_mask);
|
||||
@@ -1046,7 +1080,7 @@ static void vga_get_offsets(VGACommonState *s,
|
||||
{
|
||||
uint32_t start_addr, line_offset, line_compare;
|
||||
|
||||
if (s->vbe_regs[VBE_DISPI_INDEX_ENABLE] & VBE_DISPI_ENABLED) {
|
||||
if (vbe_enabled(s)) {
|
||||
line_offset = s->vbe_line_offset;
|
||||
start_addr = s->vbe_start_addr;
|
||||
line_compare = 65535;
|
||||
@@ -1371,7 +1405,7 @@ static int vga_get_bpp(VGACommonState *s)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (s->vbe_regs[VBE_DISPI_INDEX_ENABLE] & VBE_DISPI_ENABLED) {
|
||||
if (vbe_enabled(s)) {
|
||||
ret = s->vbe_regs[VBE_DISPI_INDEX_BPP];
|
||||
} else {
|
||||
ret = 0;
|
||||
@@ -1383,7 +1417,7 @@ static void vga_get_resolution(VGACommonState *s, int *pwidth, int *pheight)
|
||||
{
|
||||
int width, height;
|
||||
|
||||
if (s->vbe_regs[VBE_DISPI_INDEX_ENABLE] & VBE_DISPI_ENABLED) {
|
||||
if (vbe_enabled(s)) {
|
||||
width = s->vbe_regs[VBE_DISPI_INDEX_XRES];
|
||||
height = s->vbe_regs[VBE_DISPI_INDEX_YRES];
|
||||
} else {
|
||||
|
@@ -775,7 +775,7 @@ static void xenfb_handle_events(struct XenFB *xenfb)
|
||||
|
||||
prod = page->out_prod;
|
||||
out_cons = page->out_cons;
|
||||
if (prod - out_cons >= XENFB_OUT_RING_LEN) {
|
||||
if (prod - out_cons > XENFB_OUT_RING_LEN) {
|
||||
return;
|
||||
}
|
||||
xen_rmb(); /* ensure we see ring contents up to prod */
|
||||
|
@@ -685,8 +685,8 @@ static bool cuda_cmd_set_time(CUDAState *s,
|
||||
return false;
|
||||
}
|
||||
|
||||
ti = (((uint32_t)in_data[1]) << 24) + (((uint32_t)in_data[2]) << 16)
|
||||
+ (((uint32_t)in_data[3]) << 8) + in_data[4];
|
||||
ti = (((uint32_t)in_data[0]) << 24) + (((uint32_t)in_data[1]) << 16)
|
||||
+ (((uint32_t)in_data[2]) << 8) + in_data[3];
|
||||
s->tick_offset = ti - (qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL)
|
||||
/ NANOSECONDS_PER_SECOND);
|
||||
return true;
|
||||
|
@@ -940,11 +940,10 @@ static void spapr_finalize_fdt(sPAPRMachineState *spapr,
|
||||
|
||||
QLIST_FOREACH(phb, &spapr->phbs, list) {
|
||||
ret = spapr_populate_pci_dt(phb, PHANDLE_XICP, fdt);
|
||||
}
|
||||
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "couldn't setup PCI devices in fdt\n");
|
||||
exit(1);
|
||||
if (ret < 0) {
|
||||
error_report("couldn't setup PCI devices in fdt");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
/* RTAS */
|
||||
|
@@ -364,7 +364,17 @@ static void attach(sPAPRDRConnector *drc, DeviceState *d, void *fdt,
|
||||
drc->fdt = fdt;
|
||||
drc->fdt_start_offset = fdt_start_offset;
|
||||
drc->configured = coldplug;
|
||||
drc->signalled = coldplug;
|
||||
/* 'logical' DR resources such as memory/cpus are in some cases treated
|
||||
* as a pool of resources from which the guest is free to choose from
|
||||
* based on only a count. for resources that can be assigned in this
|
||||
* fashion, we must assume the resource is signalled immediately
|
||||
* since a single hotplug request might make an arbitrary number of
|
||||
* such attached resources available to the guest, as opposed to
|
||||
* 'physical' DR resources such as PCI where each device/resource is
|
||||
* signalled individually.
|
||||
*/
|
||||
drc->signalled = (drc->type != SPAPR_DR_CONNECTOR_TYPE_PCI)
|
||||
? true : coldplug;
|
||||
|
||||
object_property_add_link(OBJECT(drc), "device",
|
||||
object_get_typename(OBJECT(drc->dev)),
|
||||
|
@@ -442,6 +442,9 @@ static void spapr_hotplug_req_event(uint8_t hp_id, uint8_t hp_action,
|
||||
switch (drc_type) {
|
||||
case SPAPR_DR_CONNECTOR_TYPE_PCI:
|
||||
hp->hotplug_type = RTAS_LOG_V6_HP_TYPE_PCI;
|
||||
if (hp->hotplug_action == RTAS_LOG_V6_HP_ACTION_ADD) {
|
||||
spapr_hotplug_set_signalled(drc);
|
||||
}
|
||||
break;
|
||||
case SPAPR_DR_CONNECTOR_TYPE_LMB:
|
||||
hp->hotplug_type = RTAS_LOG_V6_HP_TYPE_MEMORY;
|
||||
@@ -462,10 +465,6 @@ static void spapr_hotplug_req_event(uint8_t hp_id, uint8_t hp_action,
|
||||
|
||||
rtas_event_log_queue(RTAS_LOG_TYPE_HOTPLUG, new_hp, true);
|
||||
|
||||
if (hp->hotplug_action == RTAS_LOG_V6_HP_ACTION_ADD) {
|
||||
spapr_hotplug_set_signalled(drc);
|
||||
}
|
||||
|
||||
qemu_irq_pulse(xics_get_qirq(spapr->icp, spapr->check_exception_irq));
|
||||
}
|
||||
|
||||
|
@@ -1816,6 +1816,9 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb,
|
||||
sizeof(interrupt_map)));
|
||||
|
||||
tcet = spapr_tce_find_by_liobn(SPAPR_PCI_LIOBN(phb->index, 0));
|
||||
if (!tcet) {
|
||||
return -1;
|
||||
}
|
||||
spapr_dma_dt(fdt, bus_off, "ibm,dma-window",
|
||||
tcet->liobn, tcet->bus_offset,
|
||||
tcet->nb_table << tcet->page_shift);
|
||||
|
@@ -407,7 +407,7 @@ static int init_event_notifier(EmulatedState *card)
|
||||
DPRINTF(card, 2, "event notifier creation failed\n");
|
||||
return -1;
|
||||
}
|
||||
event_notifier_set_handler(&card->notifier, card_event_handler);
|
||||
event_notifier_set_handler(&card->notifier, false, card_event_handler);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -1397,7 +1397,7 @@ static int ehci_process_itd(EHCIState *ehci,
|
||||
{
|
||||
USBDevice *dev;
|
||||
USBEndpoint *ep;
|
||||
uint32_t i, len, pid, dir, devaddr, endp, xfers = 0;
|
||||
uint32_t i, len, pid, dir, devaddr, endp;
|
||||
uint32_t pg, off, ptr1, ptr2, max, mult;
|
||||
|
||||
ehci->periodic_sched_active = PERIODIC_ACTIVE;
|
||||
@@ -1489,10 +1489,9 @@ static int ehci_process_itd(EHCIState *ehci,
|
||||
ehci_raise_irq(ehci, USBSTS_INT);
|
||||
}
|
||||
itd->transact[i] &= ~ITD_XACT_ACTIVE;
|
||||
xfers++;
|
||||
}
|
||||
}
|
||||
return xfers ? 0 : -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -2011,6 +2010,7 @@ static int ehci_state_writeback(EHCIQueue *q)
|
||||
static void ehci_advance_state(EHCIState *ehci, int async)
|
||||
{
|
||||
EHCIQueue *q = NULL;
|
||||
int itd_count = 0;
|
||||
int again;
|
||||
|
||||
do {
|
||||
@@ -2035,10 +2035,12 @@ static void ehci_advance_state(EHCIState *ehci, int async)
|
||||
|
||||
case EST_FETCHITD:
|
||||
again = ehci_state_fetchitd(ehci, async);
|
||||
itd_count++;
|
||||
break;
|
||||
|
||||
case EST_FETCHSITD:
|
||||
again = ehci_state_fetchsitd(ehci, async);
|
||||
itd_count++;
|
||||
break;
|
||||
|
||||
case EST_ADVANCEQUEUE:
|
||||
@@ -2087,7 +2089,8 @@ static void ehci_advance_state(EHCIState *ehci, int async)
|
||||
break;
|
||||
}
|
||||
|
||||
if (again < 0) {
|
||||
if (again < 0 || itd_count > 16) {
|
||||
/* TODO: notify guest (raise HSE irq?) */
|
||||
fprintf(stderr, "processing error - resetting ehci HC\n");
|
||||
ehci_reset(ehci);
|
||||
again = 0;
|
||||
|
@@ -776,19 +776,6 @@ static int uhci_handle_td(UHCIState *s, UHCIQueue *q, uint32_t qh_addr,
|
||||
uint8_t pid = td->token & 0xff;
|
||||
UHCIAsync *async;
|
||||
|
||||
switch (pid) {
|
||||
case USB_TOKEN_OUT:
|
||||
case USB_TOKEN_SETUP:
|
||||
case USB_TOKEN_IN:
|
||||
break;
|
||||
default:
|
||||
/* invalid pid : frame interrupted */
|
||||
s->status |= UHCI_STS_HCPERR;
|
||||
s->cmd &= ~UHCI_CMD_RS;
|
||||
uhci_update_irq(s);
|
||||
return TD_RESULT_STOP_FRAME;
|
||||
}
|
||||
|
||||
async = uhci_async_find_td(s, td_addr);
|
||||
if (async) {
|
||||
if (uhci_queue_verify(async->queue, qh_addr, td, td_addr, queuing)) {
|
||||
@@ -828,6 +815,19 @@ static int uhci_handle_td(UHCIState *s, UHCIQueue *q, uint32_t qh_addr,
|
||||
return TD_RESULT_NEXT_QH;
|
||||
}
|
||||
|
||||
switch (pid) {
|
||||
case USB_TOKEN_OUT:
|
||||
case USB_TOKEN_SETUP:
|
||||
case USB_TOKEN_IN:
|
||||
break;
|
||||
default:
|
||||
/* invalid pid : frame interrupted */
|
||||
s->status |= UHCI_STS_HCPERR;
|
||||
s->cmd &= ~UHCI_CMD_RS;
|
||||
uhci_update_irq(s);
|
||||
return TD_RESULT_STOP_FRAME;
|
||||
}
|
||||
|
||||
if (async) {
|
||||
if (queuing) {
|
||||
/* we are busy filling the queue, we are not prepared
|
||||
|
@@ -1775,10 +1775,10 @@ void virtio_queue_set_guest_notifier_fd_handler(VirtQueue *vq, bool assign,
|
||||
bool with_irqfd)
|
||||
{
|
||||
if (assign && !with_irqfd) {
|
||||
event_notifier_set_handler(&vq->guest_notifier,
|
||||
event_notifier_set_handler(&vq->guest_notifier, false,
|
||||
virtio_queue_guest_notifier_read);
|
||||
} else {
|
||||
event_notifier_set_handler(&vq->guest_notifier, NULL);
|
||||
event_notifier_set_handler(&vq->guest_notifier, false, NULL);
|
||||
}
|
||||
if (!assign) {
|
||||
/* Test and clear notifier before closing it,
|
||||
@@ -1829,10 +1829,10 @@ void virtio_queue_set_host_notifier_fd_handler(VirtQueue *vq, bool assign,
|
||||
bool set_handler)
|
||||
{
|
||||
if (assign && set_handler) {
|
||||
event_notifier_set_handler(&vq->host_notifier,
|
||||
event_notifier_set_handler(&vq->host_notifier, true,
|
||||
virtio_queue_host_notifier_read);
|
||||
} else {
|
||||
event_notifier_set_handler(&vq->host_notifier, NULL);
|
||||
event_notifier_set_handler(&vq->host_notifier, true, NULL);
|
||||
}
|
||||
if (!assign) {
|
||||
/* Test and clear notifier before after disabling event,
|
||||
|
@@ -34,7 +34,9 @@ int event_notifier_init(EventNotifier *, int active);
|
||||
void event_notifier_cleanup(EventNotifier *);
|
||||
int event_notifier_set(EventNotifier *);
|
||||
int event_notifier_test_and_clear(EventNotifier *);
|
||||
int event_notifier_set_handler(EventNotifier *, EventNotifierHandler *);
|
||||
int event_notifier_set_handler(EventNotifier *,
|
||||
bool is_external,
|
||||
EventNotifierHandler *);
|
||||
|
||||
#ifdef CONFIG_POSIX
|
||||
void event_notifier_init_fd(EventNotifier *, int fd);
|
||||
|
@@ -204,6 +204,7 @@ void qemu_set_fd_handler(int fd,
|
||||
void *opaque);
|
||||
|
||||
GSource *iohandler_get_g_source(void);
|
||||
AioContext *iohandler_get_aio_context(void);
|
||||
#ifdef CONFIG_POSIX
|
||||
/**
|
||||
* qemu_add_child_watch: Register a child process for reaping.
|
||||
|
@@ -140,7 +140,7 @@ typedef bool (*user_creatable_add_opts_predicate)(const char *type);
|
||||
* user_creatable_add_opts_foreach:
|
||||
* @opaque: a user_creatable_add_opts_predicate callback or NULL
|
||||
* @opts: options to create
|
||||
* @errp: if an error occurs, a pointer to an area to store the error
|
||||
* @errp: unused
|
||||
*
|
||||
* An iterator callback to be used in conjunction with
|
||||
* the qemu_opts_foreach() method for creating a list of
|
||||
@@ -148,8 +148,9 @@ typedef bool (*user_creatable_add_opts_predicate)(const char *type);
|
||||
*
|
||||
* The @opaque parameter can be passed a user_creatable_add_opts_predicate
|
||||
* callback to filter which types of object are created during iteration.
|
||||
* When it fails, report the error.
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
* Returns: 0 on success, -1 when an error was reported.
|
||||
*/
|
||||
int user_creatable_add_opts_foreach(void *opaque,
|
||||
QemuOpts *opts, Error **errp);
|
||||
|
@@ -44,6 +44,12 @@ static void iohandler_init(void)
|
||||
}
|
||||
}
|
||||
|
||||
AioContext *iohandler_get_aio_context(void)
|
||||
{
|
||||
iohandler_init();
|
||||
return iohandler_ctx;
|
||||
}
|
||||
|
||||
GSource *iohandler_get_g_source(void)
|
||||
{
|
||||
iohandler_init();
|
||||
|
23
nbd/client.c
23
nbd/client.c
@@ -192,13 +192,18 @@ static int nbd_receive_list(QIOChannel *ioc, char **name, Error **errp)
|
||||
return -1;
|
||||
}
|
||||
} else if (type == NBD_REP_SERVER) {
|
||||
if (len < sizeof(namelen) || len > NBD_MAX_BUFFER_SIZE) {
|
||||
error_setg(errp, "incorrect option length");
|
||||
return -1;
|
||||
}
|
||||
if (read_sync(ioc, &namelen, sizeof(namelen)) != sizeof(namelen)) {
|
||||
error_setg(errp, "failed to read option name length");
|
||||
return -1;
|
||||
}
|
||||
namelen = be32_to_cpu(namelen);
|
||||
if (len != (namelen + sizeof(namelen))) {
|
||||
error_setg(errp, "incorrect option mame length");
|
||||
len -= sizeof(namelen);
|
||||
if (len < namelen) {
|
||||
error_setg(errp, "incorrect option name length");
|
||||
return -1;
|
||||
}
|
||||
if (namelen > 255) {
|
||||
@@ -214,6 +219,20 @@ static int nbd_receive_list(QIOChannel *ioc, char **name, Error **errp)
|
||||
return -1;
|
||||
}
|
||||
(*name)[namelen] = '\0';
|
||||
len -= namelen;
|
||||
if (len) {
|
||||
char *buf = g_malloc(len + 1);
|
||||
if (read_sync(ioc, buf, len) != len) {
|
||||
error_setg(errp, "failed to read export description");
|
||||
g_free(*name);
|
||||
g_free(buf);
|
||||
*name = NULL;
|
||||
return -1;
|
||||
}
|
||||
buf[len] = '\0';
|
||||
TRACE("Ignoring export description: %s", buf);
|
||||
g_free(buf);
|
||||
}
|
||||
} else {
|
||||
error_setg(errp, "Unexpected reply type %x expected %x",
|
||||
type, NBD_REP_SERVER);
|
||||
|
25
nbd/server.c
25
nbd/server.c
@@ -449,11 +449,19 @@ static int nbd_negotiate_options(NBDClient *client)
|
||||
client->ioc = QIO_CHANNEL(tioc);
|
||||
break;
|
||||
|
||||
case NBD_OPT_EXPORT_NAME:
|
||||
/* No way to return an error to client, so drop connection */
|
||||
TRACE("Option 0x%x not permitted before TLS", clientflags);
|
||||
return -EINVAL;
|
||||
|
||||
default:
|
||||
TRACE("Option 0x%x not permitted before TLS", clientflags);
|
||||
if (nbd_negotiate_drop_sync(client->ioc, length) != length) {
|
||||
return -EIO;
|
||||
}
|
||||
nbd_negotiate_send_rep(client->ioc, NBD_REP_ERR_TLS_REQD,
|
||||
clientflags);
|
||||
return -EINVAL;
|
||||
break;
|
||||
}
|
||||
} else if (fixedNewstyle) {
|
||||
switch (clientflags) {
|
||||
@@ -471,6 +479,9 @@ static int nbd_negotiate_options(NBDClient *client)
|
||||
return nbd_negotiate_handle_export_name(client, length);
|
||||
|
||||
case NBD_OPT_STARTTLS:
|
||||
if (nbd_negotiate_drop_sync(client->ioc, length) != length) {
|
||||
return -EIO;
|
||||
}
|
||||
if (client->tlscreds) {
|
||||
TRACE("TLS already enabled");
|
||||
nbd_negotiate_send_rep(client->ioc, NBD_REP_ERR_INVALID,
|
||||
@@ -480,7 +491,7 @@ static int nbd_negotiate_options(NBDClient *client)
|
||||
nbd_negotiate_send_rep(client->ioc, NBD_REP_ERR_POLICY,
|
||||
clientflags);
|
||||
}
|
||||
return -EINVAL;
|
||||
break;
|
||||
default:
|
||||
TRACE("Unsupported option 0x%x", clientflags);
|
||||
if (nbd_negotiate_drop_sync(client->ioc, length) != length) {
|
||||
@@ -1080,9 +1091,8 @@ static void nbd_trip(void *opaque)
|
||||
}
|
||||
}
|
||||
|
||||
ret = blk_read(exp->blk,
|
||||
(request.from + exp->dev_offset) / BDRV_SECTOR_SIZE,
|
||||
req->data, request.len / BDRV_SECTOR_SIZE);
|
||||
ret = blk_pread(exp->blk, request.from + exp->dev_offset,
|
||||
req->data, request.len);
|
||||
if (ret < 0) {
|
||||
LOG("reading from file failed");
|
||||
reply.error = -ret;
|
||||
@@ -1104,9 +1114,8 @@ static void nbd_trip(void *opaque)
|
||||
|
||||
TRACE("Writing to device");
|
||||
|
||||
ret = blk_write(exp->blk,
|
||||
(request.from + exp->dev_offset) / BDRV_SECTOR_SIZE,
|
||||
req->data, request.len / BDRV_SECTOR_SIZE);
|
||||
ret = blk_pwrite(exp->blk, request.from + exp->dev_offset,
|
||||
req->data, request.len);
|
||||
if (ret < 0) {
|
||||
LOG("writing to file failed");
|
||||
reply.error = -ret;
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
36
po/de_DE.po
36
po/de_DE.po
@@ -6,7 +6,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: QEMU 1.4.50\n"
|
||||
"Report-Msgid-Bugs-To: qemu-devel@nongnu.org\n"
|
||||
"POT-Creation-Date: 2015-12-10 13:29+0000\n"
|
||||
"POT-Creation-Date: 2016-04-18 14:50+0100\n"
|
||||
"PO-Revision-Date: 2012-02-28 16:00+0100\n"
|
||||
"Last-Translator: Kevin Wolf <kwolf@redhat.com>\n"
|
||||
"Language-Team: Deutsch <de@li.org>\n"
|
||||
@@ -16,70 +16,70 @@ msgstr ""
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n!=1);\n"
|
||||
|
||||
#: ui/gtk.c:271
|
||||
#: ui/gtk.c:273
|
||||
msgid " - Press Ctrl+Alt+G to release grab"
|
||||
msgstr " - Strg+Alt+G drücken, um Eingabegeräte freizugeben"
|
||||
|
||||
#: ui/gtk.c:275
|
||||
#: ui/gtk.c:277
|
||||
msgid " [Paused]"
|
||||
msgstr " [Angehalten]"
|
||||
|
||||
#: ui/gtk.c:1783
|
||||
#: ui/gtk.c:1833
|
||||
msgid "_Pause"
|
||||
msgstr "_Angehalten"
|
||||
|
||||
#: ui/gtk.c:1789
|
||||
#: ui/gtk.c:1839
|
||||
msgid "_Reset"
|
||||
msgstr "_Reset"
|
||||
|
||||
#: ui/gtk.c:1792
|
||||
#: ui/gtk.c:1842
|
||||
msgid "Power _Down"
|
||||
msgstr "_Herunterfahren"
|
||||
|
||||
#: ui/gtk.c:1798
|
||||
#: ui/gtk.c:1848
|
||||
msgid "_Quit"
|
||||
msgstr "_Beenden"
|
||||
|
||||
#: ui/gtk.c:1890
|
||||
#: ui/gtk.c:1940
|
||||
msgid "_Fullscreen"
|
||||
msgstr "_Vollbild"
|
||||
|
||||
#: ui/gtk.c:1904
|
||||
#: ui/gtk.c:1954
|
||||
msgid "Zoom _In"
|
||||
msgstr "_Heranzoomen"
|
||||
|
||||
#: ui/gtk.c:1911
|
||||
#: ui/gtk.c:1961
|
||||
msgid "Zoom _Out"
|
||||
msgstr "_Wegzoomen"
|
||||
|
||||
#: ui/gtk.c:1918
|
||||
#: ui/gtk.c:1968
|
||||
msgid "Best _Fit"
|
||||
msgstr "_Einpassen"
|
||||
|
||||
#: ui/gtk.c:1925
|
||||
#: ui/gtk.c:1975
|
||||
msgid "Zoom To _Fit"
|
||||
msgstr "Auf _Fenstergröße skalieren"
|
||||
|
||||
#: ui/gtk.c:1931
|
||||
#: ui/gtk.c:1981
|
||||
msgid "Grab On _Hover"
|
||||
msgstr "Tastatur _automatisch einfangen"
|
||||
|
||||
#: ui/gtk.c:1934
|
||||
#: ui/gtk.c:1984
|
||||
msgid "_Grab Input"
|
||||
msgstr "_Eingabegeräte einfangen"
|
||||
|
||||
#: ui/gtk.c:1963
|
||||
#: ui/gtk.c:2013
|
||||
msgid "Show _Tabs"
|
||||
msgstr "Reiter anzeigen"
|
||||
|
||||
#: ui/gtk.c:1966
|
||||
#: ui/gtk.c:2016
|
||||
msgid "Detach Tab"
|
||||
msgstr "Reiter abtrennen"
|
||||
|
||||
#: ui/gtk.c:1978
|
||||
#: ui/gtk.c:2028
|
||||
msgid "_Machine"
|
||||
msgstr "_Maschine"
|
||||
|
||||
#: ui/gtk.c:1983
|
||||
#: ui/gtk.c:2033
|
||||
msgid "_View"
|
||||
msgstr "_Ansicht"
|
||||
|
36
po/fr_FR.po
36
po/fr_FR.po
@@ -6,7 +6,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: QEMU 1.4.50\n"
|
||||
"Report-Msgid-Bugs-To: qemu-devel@nongnu.org\n"
|
||||
"POT-Creation-Date: 2015-12-10 13:29+0000\n"
|
||||
"POT-Creation-Date: 2016-04-18 14:50+0100\n"
|
||||
"PO-Revision-Date: 2014-07-28 23:25+0200\n"
|
||||
"Last-Translator: Aurelien Jarno <aurelien@aurel32.net>\n"
|
||||
"Language-Team: French <FR@li.org>\n"
|
||||
@@ -17,70 +17,70 @@ msgstr ""
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Lokalize 1.4\n"
|
||||
|
||||
#: ui/gtk.c:271
|
||||
#: ui/gtk.c:273
|
||||
msgid " - Press Ctrl+Alt+G to release grab"
|
||||
msgstr "- Appuyer sur Ctrl+Alt+G pour arrêter la capture"
|
||||
|
||||
#: ui/gtk.c:275
|
||||
#: ui/gtk.c:277
|
||||
msgid " [Paused]"
|
||||
msgstr " [En pause]"
|
||||
|
||||
#: ui/gtk.c:1783
|
||||
#: ui/gtk.c:1833
|
||||
msgid "_Pause"
|
||||
msgstr "_Pause"
|
||||
|
||||
#: ui/gtk.c:1789
|
||||
#: ui/gtk.c:1839
|
||||
msgid "_Reset"
|
||||
msgstr "_Réinitialiser"
|
||||
|
||||
#: ui/gtk.c:1792
|
||||
#: ui/gtk.c:1842
|
||||
msgid "Power _Down"
|
||||
msgstr "_Éteindre"
|
||||
|
||||
#: ui/gtk.c:1798
|
||||
#: ui/gtk.c:1848
|
||||
msgid "_Quit"
|
||||
msgstr "_Quitter"
|
||||
|
||||
#: ui/gtk.c:1890
|
||||
#: ui/gtk.c:1940
|
||||
msgid "_Fullscreen"
|
||||
msgstr "Mode _plein écran"
|
||||
|
||||
#: ui/gtk.c:1904
|
||||
#: ui/gtk.c:1954
|
||||
msgid "Zoom _In"
|
||||
msgstr "Zoom _avant"
|
||||
|
||||
#: ui/gtk.c:1911
|
||||
#: ui/gtk.c:1961
|
||||
msgid "Zoom _Out"
|
||||
msgstr "_Zoom arrière"
|
||||
|
||||
#: ui/gtk.c:1918
|
||||
#: ui/gtk.c:1968
|
||||
msgid "Best _Fit"
|
||||
msgstr "Zoom _idéal"
|
||||
|
||||
#: ui/gtk.c:1925
|
||||
#: ui/gtk.c:1975
|
||||
msgid "Zoom To _Fit"
|
||||
msgstr "Zoomer pour a_juster"
|
||||
|
||||
#: ui/gtk.c:1931
|
||||
#: ui/gtk.c:1981
|
||||
msgid "Grab On _Hover"
|
||||
msgstr "Capturer en _survolant"
|
||||
|
||||
#: ui/gtk.c:1934
|
||||
#: ui/gtk.c:1984
|
||||
msgid "_Grab Input"
|
||||
msgstr "_Capturer les entrées"
|
||||
|
||||
#: ui/gtk.c:1963
|
||||
#: ui/gtk.c:2013
|
||||
msgid "Show _Tabs"
|
||||
msgstr "Montrer les _onglets"
|
||||
|
||||
#: ui/gtk.c:1966
|
||||
#: ui/gtk.c:2016
|
||||
msgid "Detach Tab"
|
||||
msgstr "_Détacher l'onglet"
|
||||
|
||||
#: ui/gtk.c:1978
|
||||
#: ui/gtk.c:2028
|
||||
msgid "_Machine"
|
||||
msgstr "_Machine"
|
||||
|
||||
#: ui/gtk.c:1983
|
||||
#: ui/gtk.c:2033
|
||||
msgid "_View"
|
||||
msgstr "_Vue"
|
||||
|
36
po/hu.po
36
po/hu.po
@@ -6,7 +6,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: QEMU 1.4.50\n"
|
||||
"Report-Msgid-Bugs-To: qemu-devel@nongnu.org\n"
|
||||
"POT-Creation-Date: 2015-12-10 13:29+0000\n"
|
||||
"POT-Creation-Date: 2016-04-18 14:50+0100\n"
|
||||
"PO-Revision-Date: 2013-05-06 20:42+0200\n"
|
||||
"Last-Translator: Ákos Kovács <akoskovacs@gmx.com>\n"
|
||||
"Language-Team: Hungarian <hu@li.org>\n"
|
||||
@@ -15,73 +15,73 @@ msgstr ""
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: ui/gtk.c:271
|
||||
#: ui/gtk.c:273
|
||||
msgid " - Press Ctrl+Alt+G to release grab"
|
||||
msgstr " - Nyomj Ctrl+Alt+G-t a bemeneti eszközök elengedéséhez"
|
||||
|
||||
#: ui/gtk.c:275
|
||||
#: ui/gtk.c:277
|
||||
msgid " [Paused]"
|
||||
msgstr " [Megállítva]"
|
||||
|
||||
#: ui/gtk.c:1783
|
||||
#: ui/gtk.c:1833
|
||||
msgid "_Pause"
|
||||
msgstr "_Megállítás"
|
||||
|
||||
#: ui/gtk.c:1789
|
||||
#: ui/gtk.c:1839
|
||||
msgid "_Reset"
|
||||
msgstr "Új_raindítás"
|
||||
|
||||
#: ui/gtk.c:1792
|
||||
#: ui/gtk.c:1842
|
||||
msgid "Power _Down"
|
||||
msgstr "_Leállítás"
|
||||
|
||||
#: ui/gtk.c:1798
|
||||
#: ui/gtk.c:1848
|
||||
msgid "_Quit"
|
||||
msgstr ""
|
||||
|
||||
#: ui/gtk.c:1890
|
||||
#: ui/gtk.c:1940
|
||||
msgid "_Fullscreen"
|
||||
msgstr ""
|
||||
|
||||
#: ui/gtk.c:1904
|
||||
#: ui/gtk.c:1954
|
||||
#, fuzzy
|
||||
msgid "Zoom _In"
|
||||
msgstr "Ablakmérethez _igazítás"
|
||||
|
||||
#: ui/gtk.c:1911
|
||||
#: ui/gtk.c:1961
|
||||
#, fuzzy
|
||||
msgid "Zoom _Out"
|
||||
msgstr "Ablakmérethez _igazítás"
|
||||
|
||||
#: ui/gtk.c:1918
|
||||
#: ui/gtk.c:1968
|
||||
msgid "Best _Fit"
|
||||
msgstr ""
|
||||
|
||||
#: ui/gtk.c:1925
|
||||
#: ui/gtk.c:1975
|
||||
msgid "Zoom To _Fit"
|
||||
msgstr "Ablakmérethez _igazítás"
|
||||
|
||||
#: ui/gtk.c:1931
|
||||
#: ui/gtk.c:1981
|
||||
msgid "Grab On _Hover"
|
||||
msgstr "Automatikus _elfogás"
|
||||
|
||||
#: ui/gtk.c:1934
|
||||
#: ui/gtk.c:1984
|
||||
msgid "_Grab Input"
|
||||
msgstr "_Bemeneti eszközök megragadása"
|
||||
|
||||
#: ui/gtk.c:1963
|
||||
#: ui/gtk.c:2013
|
||||
msgid "Show _Tabs"
|
||||
msgstr "_Fülek megjelenítése"
|
||||
|
||||
#: ui/gtk.c:1966
|
||||
#: ui/gtk.c:2016
|
||||
msgid "Detach Tab"
|
||||
msgstr ""
|
||||
|
||||
#: ui/gtk.c:1978
|
||||
#: ui/gtk.c:2028
|
||||
msgid "_Machine"
|
||||
msgstr "_Gép"
|
||||
|
||||
#: ui/gtk.c:1983
|
||||
#: ui/gtk.c:2033
|
||||
msgid "_View"
|
||||
msgstr "_Nézet"
|
||||
|
||||
|
36
po/it.po
36
po/it.po
@@ -6,7 +6,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: QEMU 1.4.50\n"
|
||||
"Report-Msgid-Bugs-To: qemu-devel@nongnu.org\n"
|
||||
"POT-Creation-Date: 2015-12-10 13:29+0000\n"
|
||||
"POT-Creation-Date: 2016-04-18 14:50+0100\n"
|
||||
"PO-Revision-Date: 2014-07-29 08:25+0200\n"
|
||||
"Last-Translator: Paolo Bonzini <pbonzini@redhat.com>\n"
|
||||
"Language-Team: Italian <it@li.org>\n"
|
||||
@@ -16,70 +16,70 @@ msgstr ""
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
|
||||
#: ui/gtk.c:271
|
||||
#: ui/gtk.c:273
|
||||
msgid " - Press Ctrl+Alt+G to release grab"
|
||||
msgstr " - Premere Ctrl+Alt+G per rilasciare l'input"
|
||||
|
||||
#: ui/gtk.c:275
|
||||
#: ui/gtk.c:277
|
||||
msgid " [Paused]"
|
||||
msgstr " [Pausa]"
|
||||
|
||||
#: ui/gtk.c:1783
|
||||
#: ui/gtk.c:1833
|
||||
msgid "_Pause"
|
||||
msgstr "_Pausa"
|
||||
|
||||
#: ui/gtk.c:1789
|
||||
#: ui/gtk.c:1839
|
||||
msgid "_Reset"
|
||||
msgstr "_Reset"
|
||||
|
||||
#: ui/gtk.c:1792
|
||||
#: ui/gtk.c:1842
|
||||
msgid "Power _Down"
|
||||
msgstr "_Spegni"
|
||||
|
||||
#: ui/gtk.c:1798
|
||||
#: ui/gtk.c:1848
|
||||
msgid "_Quit"
|
||||
msgstr "_Esci"
|
||||
|
||||
#: ui/gtk.c:1890
|
||||
#: ui/gtk.c:1940
|
||||
msgid "_Fullscreen"
|
||||
msgstr ""
|
||||
|
||||
#: ui/gtk.c:1904
|
||||
#: ui/gtk.c:1954
|
||||
msgid "Zoom _In"
|
||||
msgstr "_Aumenta zoom"
|
||||
|
||||
#: ui/gtk.c:1911
|
||||
#: ui/gtk.c:1961
|
||||
msgid "Zoom _Out"
|
||||
msgstr "_Riduci zoom"
|
||||
|
||||
#: ui/gtk.c:1918
|
||||
#: ui/gtk.c:1968
|
||||
msgid "Best _Fit"
|
||||
msgstr "A_nnulla zoom"
|
||||
|
||||
#: ui/gtk.c:1925
|
||||
#: ui/gtk.c:1975
|
||||
msgid "Zoom To _Fit"
|
||||
msgstr "Adatta alla _finestra"
|
||||
|
||||
#: ui/gtk.c:1931
|
||||
#: ui/gtk.c:1981
|
||||
msgid "Grab On _Hover"
|
||||
msgstr "Cattura _automatica input"
|
||||
|
||||
#: ui/gtk.c:1934
|
||||
#: ui/gtk.c:1984
|
||||
msgid "_Grab Input"
|
||||
msgstr "_Cattura input"
|
||||
|
||||
#: ui/gtk.c:1963
|
||||
#: ui/gtk.c:2013
|
||||
msgid "Show _Tabs"
|
||||
msgstr "Mostra _tab"
|
||||
|
||||
#: ui/gtk.c:1966
|
||||
#: ui/gtk.c:2016
|
||||
msgid "Detach Tab"
|
||||
msgstr "_Sposta in una nuova finestra"
|
||||
|
||||
#: ui/gtk.c:1978
|
||||
#: ui/gtk.c:2028
|
||||
msgid "_Machine"
|
||||
msgstr "_Macchina virtuale"
|
||||
|
||||
#: ui/gtk.c:1983
|
||||
#: ui/gtk.c:2033
|
||||
msgid "_View"
|
||||
msgstr "_Visualizza"
|
||||
|
@@ -5,9 +5,9 @@
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: QEMU 2.4.93\n"
|
||||
"Project-Id-Version: QEMU 2.5.92\n"
|
||||
"Report-Msgid-Bugs-To: qemu-devel@nongnu.org\n"
|
||||
"POT-Creation-Date: 2015-12-10 13:29+0000\n"
|
||||
"POT-Creation-Date: 2016-04-18 14:50+0100\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@@ -16,70 +16,70 @@ msgstr ""
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: ui/gtk.c:271
|
||||
#: ui/gtk.c:273
|
||||
msgid " - Press Ctrl+Alt+G to release grab"
|
||||
msgstr ""
|
||||
|
||||
#: ui/gtk.c:275
|
||||
#: ui/gtk.c:277
|
||||
msgid " [Paused]"
|
||||
msgstr ""
|
||||
|
||||
#: ui/gtk.c:1783
|
||||
#: ui/gtk.c:1833
|
||||
msgid "_Pause"
|
||||
msgstr ""
|
||||
|
||||
#: ui/gtk.c:1789
|
||||
#: ui/gtk.c:1839
|
||||
msgid "_Reset"
|
||||
msgstr ""
|
||||
|
||||
#: ui/gtk.c:1792
|
||||
#: ui/gtk.c:1842
|
||||
msgid "Power _Down"
|
||||
msgstr ""
|
||||
|
||||
#: ui/gtk.c:1798
|
||||
#: ui/gtk.c:1848
|
||||
msgid "_Quit"
|
||||
msgstr ""
|
||||
|
||||
#: ui/gtk.c:1890
|
||||
#: ui/gtk.c:1940
|
||||
msgid "_Fullscreen"
|
||||
msgstr ""
|
||||
|
||||
#: ui/gtk.c:1904
|
||||
#: ui/gtk.c:1954
|
||||
msgid "Zoom _In"
|
||||
msgstr ""
|
||||
|
||||
#: ui/gtk.c:1911
|
||||
#: ui/gtk.c:1961
|
||||
msgid "Zoom _Out"
|
||||
msgstr ""
|
||||
|
||||
#: ui/gtk.c:1918
|
||||
#: ui/gtk.c:1968
|
||||
msgid "Best _Fit"
|
||||
msgstr ""
|
||||
|
||||
#: ui/gtk.c:1925
|
||||
#: ui/gtk.c:1975
|
||||
msgid "Zoom To _Fit"
|
||||
msgstr ""
|
||||
|
||||
#: ui/gtk.c:1931
|
||||
#: ui/gtk.c:1981
|
||||
msgid "Grab On _Hover"
|
||||
msgstr ""
|
||||
|
||||
#: ui/gtk.c:1934
|
||||
#: ui/gtk.c:1984
|
||||
msgid "_Grab Input"
|
||||
msgstr ""
|
||||
|
||||
#: ui/gtk.c:1963
|
||||
#: ui/gtk.c:2013
|
||||
msgid "Show _Tabs"
|
||||
msgstr ""
|
||||
|
||||
#: ui/gtk.c:1966
|
||||
#: ui/gtk.c:2016
|
||||
msgid "Detach Tab"
|
||||
msgstr ""
|
||||
|
||||
#: ui/gtk.c:1978
|
||||
#: ui/gtk.c:2028
|
||||
msgid "_Machine"
|
||||
msgstr ""
|
||||
|
||||
#: ui/gtk.c:1983
|
||||
#: ui/gtk.c:2033
|
||||
msgid "_View"
|
||||
msgstr ""
|
||||
|
36
po/tr.po
36
po/tr.po
@@ -6,7 +6,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: QEMU 1.4.50\n"
|
||||
"Report-Msgid-Bugs-To: qemu-devel@nongnu.org\n"
|
||||
"POT-Creation-Date: 2015-12-10 13:29+0000\n"
|
||||
"POT-Creation-Date: 2016-04-18 14:50+0100\n"
|
||||
"PO-Revision-Date: 2013-04-22 18:35+0300\n"
|
||||
"Last-Translator: Ozan Çağlayan <ozancag@gmail.com>\n"
|
||||
"Language-Team: Türkçe <>\n"
|
||||
@@ -17,72 +17,72 @@ msgstr ""
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
"X-Generator: Gtranslator 2.91.6\n"
|
||||
|
||||
#: ui/gtk.c:271
|
||||
#: ui/gtk.c:273
|
||||
msgid " - Press Ctrl+Alt+G to release grab"
|
||||
msgstr " - Yakalamayı durdurmak için Ctrl+Alt+G tuşlarına basın"
|
||||
|
||||
#: ui/gtk.c:275
|
||||
#: ui/gtk.c:277
|
||||
msgid " [Paused]"
|
||||
msgstr " [Duraklatıldı]"
|
||||
|
||||
#: ui/gtk.c:1783
|
||||
#: ui/gtk.c:1833
|
||||
msgid "_Pause"
|
||||
msgstr "_Duraklat"
|
||||
|
||||
#: ui/gtk.c:1789
|
||||
#: ui/gtk.c:1839
|
||||
msgid "_Reset"
|
||||
msgstr "_Sıfırla"
|
||||
|
||||
#: ui/gtk.c:1792
|
||||
#: ui/gtk.c:1842
|
||||
msgid "Power _Down"
|
||||
msgstr "_Kapat"
|
||||
|
||||
#: ui/gtk.c:1798
|
||||
#: ui/gtk.c:1848
|
||||
msgid "_Quit"
|
||||
msgstr ""
|
||||
|
||||
#: ui/gtk.c:1890
|
||||
#: ui/gtk.c:1940
|
||||
msgid "_Fullscreen"
|
||||
msgstr ""
|
||||
|
||||
#: ui/gtk.c:1904
|
||||
#: ui/gtk.c:1954
|
||||
#, fuzzy
|
||||
msgid "Zoom _In"
|
||||
msgstr "Yakınlaş ve Sığ_dır"
|
||||
|
||||
#: ui/gtk.c:1911
|
||||
#: ui/gtk.c:1961
|
||||
#, fuzzy
|
||||
msgid "Zoom _Out"
|
||||
msgstr "Yakınlaş ve Sığ_dır"
|
||||
|
||||
#: ui/gtk.c:1918
|
||||
#: ui/gtk.c:1968
|
||||
msgid "Best _Fit"
|
||||
msgstr ""
|
||||
|
||||
#: ui/gtk.c:1925
|
||||
#: ui/gtk.c:1975
|
||||
msgid "Zoom To _Fit"
|
||||
msgstr "Yakınlaş ve Sığ_dır"
|
||||
|
||||
#: ui/gtk.c:1931
|
||||
#: ui/gtk.c:1981
|
||||
msgid "Grab On _Hover"
|
||||
msgstr "Ü_zerindeyken Yakala"
|
||||
|
||||
#: ui/gtk.c:1934
|
||||
#: ui/gtk.c:1984
|
||||
msgid "_Grab Input"
|
||||
msgstr "Girdiyi _Yakala"
|
||||
|
||||
#: ui/gtk.c:1963
|
||||
#: ui/gtk.c:2013
|
||||
msgid "Show _Tabs"
|
||||
msgstr "Se_kmeleri Göster"
|
||||
|
||||
#: ui/gtk.c:1966
|
||||
#: ui/gtk.c:2016
|
||||
msgid "Detach Tab"
|
||||
msgstr ""
|
||||
|
||||
#: ui/gtk.c:1978
|
||||
#: ui/gtk.c:2028
|
||||
msgid "_Machine"
|
||||
msgstr "_Makine"
|
||||
|
||||
#: ui/gtk.c:1983
|
||||
#: ui/gtk.c:2033
|
||||
msgid "_View"
|
||||
msgstr "_Görüntüle"
|
||||
|
36
po/zh_CN.po
36
po/zh_CN.po
@@ -6,7 +6,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: QEMU 2.2\n"
|
||||
"Report-Msgid-Bugs-To: qemu-devel@nongnu.org\n"
|
||||
"POT-Creation-Date: 2015-12-10 13:29+0000\n"
|
||||
"POT-Creation-Date: 2016-04-18 14:50+0100\n"
|
||||
"PO-Revision-Date: 2014-07-31 10:00+0800\n"
|
||||
"Last-Translator: Fam Zheng <famz@redhat.com>\n"
|
||||
"Language-Team: Chinese <zh@li.org>\n"
|
||||
@@ -17,70 +17,70 @@ msgstr ""
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Lokalize 1.4\n"
|
||||
|
||||
#: ui/gtk.c:271
|
||||
#: ui/gtk.c:273
|
||||
msgid " - Press Ctrl+Alt+G to release grab"
|
||||
msgstr " - 按下 Ctrl+Alt+G 取消捕获"
|
||||
|
||||
#: ui/gtk.c:275
|
||||
#: ui/gtk.c:277
|
||||
msgid " [Paused]"
|
||||
msgstr " [已暂停]"
|
||||
|
||||
#: ui/gtk.c:1783
|
||||
#: ui/gtk.c:1833
|
||||
msgid "_Pause"
|
||||
msgstr "暂停(_P)"
|
||||
|
||||
#: ui/gtk.c:1789
|
||||
#: ui/gtk.c:1839
|
||||
msgid "_Reset"
|
||||
msgstr "重置(_R)"
|
||||
|
||||
#: ui/gtk.c:1792
|
||||
#: ui/gtk.c:1842
|
||||
msgid "Power _Down"
|
||||
msgstr "关闭电源(_D)"
|
||||
|
||||
#: ui/gtk.c:1798
|
||||
#: ui/gtk.c:1848
|
||||
msgid "_Quit"
|
||||
msgstr "退出(_Q)"
|
||||
|
||||
#: ui/gtk.c:1890
|
||||
#: ui/gtk.c:1940
|
||||
msgid "_Fullscreen"
|
||||
msgstr "全屏(_F)"
|
||||
|
||||
#: ui/gtk.c:1904
|
||||
#: ui/gtk.c:1954
|
||||
msgid "Zoom _In"
|
||||
msgstr "放大(_I)"
|
||||
|
||||
#: ui/gtk.c:1911
|
||||
#: ui/gtk.c:1961
|
||||
msgid "Zoom _Out"
|
||||
msgstr "缩小(_O)"
|
||||
|
||||
#: ui/gtk.c:1918
|
||||
#: ui/gtk.c:1968
|
||||
msgid "Best _Fit"
|
||||
msgstr "最合适大小(_F)"
|
||||
|
||||
#: ui/gtk.c:1925
|
||||
#: ui/gtk.c:1975
|
||||
msgid "Zoom To _Fit"
|
||||
msgstr "缩放以适应大小(_F)"
|
||||
|
||||
#: ui/gtk.c:1931
|
||||
#: ui/gtk.c:1981
|
||||
msgid "Grab On _Hover"
|
||||
msgstr "鼠标经过时捕获(_H)"
|
||||
|
||||
#: ui/gtk.c:1934
|
||||
#: ui/gtk.c:1984
|
||||
msgid "_Grab Input"
|
||||
msgstr "捕获输入(_G)"
|
||||
|
||||
#: ui/gtk.c:1963
|
||||
#: ui/gtk.c:2013
|
||||
msgid "Show _Tabs"
|
||||
msgstr "显示标签页(_T)"
|
||||
|
||||
#: ui/gtk.c:1966
|
||||
#: ui/gtk.c:2016
|
||||
msgid "Detach Tab"
|
||||
msgstr "分离标签页"
|
||||
|
||||
#: ui/gtk.c:1978
|
||||
#: ui/gtk.c:2028
|
||||
msgid "_Machine"
|
||||
msgstr "虚拟机(_M)"
|
||||
|
||||
#: ui/gtk.c:1983
|
||||
#: ui/gtk.c:2033
|
||||
msgid "_View"
|
||||
msgstr "视图(_V)"
|
||||
|
@@ -222,7 +222,7 @@ static void parse_type_int64(Visitor *v, const char *name, int64_t *obj,
|
||||
return;
|
||||
|
||||
error:
|
||||
error_setg(errp, QERR_INVALID_PARAMETER_VALUE, name,
|
||||
error_setg(errp, QERR_INVALID_PARAMETER_VALUE, name ? name : "null",
|
||||
"an int64 value or range");
|
||||
}
|
||||
|
||||
|
39
qemu-img.c
39
qemu-img.c
@@ -435,8 +435,7 @@ static int img_create(int argc, char **argv)
|
||||
|
||||
if (qemu_opts_foreach(&qemu_object_opts,
|
||||
user_creatable_add_opts_foreach,
|
||||
NULL, &local_err)) {
|
||||
error_report_err(local_err);
|
||||
NULL, NULL)) {
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -598,7 +597,6 @@ static int img_check(int argc, char **argv)
|
||||
bool writethrough;
|
||||
ImageCheck *check;
|
||||
bool quiet = false;
|
||||
Error *local_err = NULL;
|
||||
bool image_opts = false;
|
||||
|
||||
fmt = NULL;
|
||||
@@ -679,8 +677,7 @@ static int img_check(int argc, char **argv)
|
||||
|
||||
if (qemu_opts_foreach(&qemu_object_opts,
|
||||
user_creatable_add_opts_foreach,
|
||||
NULL, &local_err)) {
|
||||
error_report_err(local_err);
|
||||
NULL, NULL)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -871,8 +868,7 @@ static int img_commit(int argc, char **argv)
|
||||
|
||||
if (qemu_opts_foreach(&qemu_object_opts,
|
||||
user_creatable_add_opts_foreach,
|
||||
NULL, &local_err)) {
|
||||
error_report_err(local_err);
|
||||
NULL, NULL)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1133,7 +1129,6 @@ static int img_compare(int argc, char **argv)
|
||||
int64_t nb_sectors;
|
||||
int c, pnum;
|
||||
uint64_t progress_base;
|
||||
Error *local_err = NULL;
|
||||
bool image_opts = false;
|
||||
|
||||
cache = BDRV_DEFAULT_CACHE;
|
||||
@@ -1201,8 +1196,7 @@ static int img_compare(int argc, char **argv)
|
||||
|
||||
if (qemu_opts_foreach(&qemu_object_opts,
|
||||
user_creatable_add_opts_foreach,
|
||||
NULL, &local_err)) {
|
||||
error_report_err(local_err);
|
||||
NULL, NULL)) {
|
||||
ret = 2;
|
||||
goto out4;
|
||||
}
|
||||
@@ -1864,8 +1858,7 @@ static int img_convert(int argc, char **argv)
|
||||
|
||||
if (qemu_opts_foreach(&qemu_object_opts,
|
||||
user_creatable_add_opts_foreach,
|
||||
NULL, &local_err)) {
|
||||
error_report_err(local_err);
|
||||
NULL, NULL)) {
|
||||
goto fail_getopt;
|
||||
}
|
||||
|
||||
@@ -2299,7 +2292,6 @@ static int img_info(int argc, char **argv)
|
||||
bool chain = false;
|
||||
const char *filename, *fmt, *output;
|
||||
ImageInfoList *list;
|
||||
Error *local_err = NULL;
|
||||
bool image_opts = false;
|
||||
|
||||
fmt = NULL;
|
||||
@@ -2363,8 +2355,7 @@ static int img_info(int argc, char **argv)
|
||||
|
||||
if (qemu_opts_foreach(&qemu_object_opts,
|
||||
user_creatable_add_opts_foreach,
|
||||
NULL, &local_err)) {
|
||||
error_report_err(local_err);
|
||||
NULL, NULL)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -2513,7 +2504,6 @@ static int img_map(int argc, char **argv)
|
||||
int64_t length;
|
||||
MapEntry curr = { .length = 0 }, next;
|
||||
int ret = 0;
|
||||
Error *local_err = NULL;
|
||||
bool image_opts = false;
|
||||
|
||||
fmt = NULL;
|
||||
@@ -2573,8 +2563,7 @@ static int img_map(int argc, char **argv)
|
||||
|
||||
if (qemu_opts_foreach(&qemu_object_opts,
|
||||
user_creatable_add_opts_foreach,
|
||||
NULL, &local_err)) {
|
||||
error_report_err(local_err);
|
||||
NULL, NULL)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -2717,8 +2706,7 @@ static int img_snapshot(int argc, char **argv)
|
||||
|
||||
if (qemu_opts_foreach(&qemu_object_opts,
|
||||
user_creatable_add_opts_foreach,
|
||||
NULL, &err)) {
|
||||
error_report_err(err);
|
||||
NULL, NULL)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -2867,8 +2855,7 @@ static int img_rebase(int argc, char **argv)
|
||||
|
||||
if (qemu_opts_foreach(&qemu_object_opts,
|
||||
user_creatable_add_opts_foreach,
|
||||
NULL, &local_err)) {
|
||||
error_report_err(local_err);
|
||||
NULL, NULL)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -3133,7 +3120,6 @@ static int img_resize(int argc, char **argv)
|
||||
bool quiet = false;
|
||||
BlockBackend *blk = NULL;
|
||||
QemuOpts *param;
|
||||
Error *local_err = NULL;
|
||||
|
||||
static QemuOptsList resize_options = {
|
||||
.name = "resize_options",
|
||||
@@ -3204,8 +3190,7 @@ static int img_resize(int argc, char **argv)
|
||||
|
||||
if (qemu_opts_foreach(&qemu_object_opts,
|
||||
user_creatable_add_opts_foreach,
|
||||
NULL, &local_err)) {
|
||||
error_report_err(local_err);
|
||||
NULL, NULL)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -3297,7 +3282,6 @@ static int img_amend(int argc, char **argv)
|
||||
bool quiet = false, progress = false;
|
||||
BlockBackend *blk = NULL;
|
||||
BlockDriverState *bs = NULL;
|
||||
Error *local_err = NULL;
|
||||
bool image_opts = false;
|
||||
|
||||
cache = BDRV_DEFAULT_CACHE;
|
||||
@@ -3365,8 +3349,7 @@ static int img_amend(int argc, char **argv)
|
||||
|
||||
if (qemu_opts_foreach(&qemu_object_opts,
|
||||
user_creatable_add_opts_foreach,
|
||||
NULL, &local_err)) {
|
||||
error_report_err(local_err);
|
||||
NULL, NULL)) {
|
||||
ret = -1;
|
||||
goto out_no_progress;
|
||||
}
|
||||
|
@@ -1416,6 +1416,7 @@ struct aio_ctx {
|
||||
int vflag;
|
||||
int Cflag;
|
||||
int Pflag;
|
||||
int zflag;
|
||||
BlockAcctCookie acct;
|
||||
int pattern;
|
||||
struct timeval t1;
|
||||
@@ -1446,8 +1447,10 @@ static void aio_write_done(void *opaque, int ret)
|
||||
print_report("wrote", &t2, ctx->offset, ctx->qiov.size,
|
||||
ctx->qiov.size, 1, ctx->Cflag);
|
||||
out:
|
||||
qemu_io_free(ctx->buf);
|
||||
qemu_iovec_destroy(&ctx->qiov);
|
||||
if (!ctx->zflag) {
|
||||
qemu_io_free(ctx->buf);
|
||||
qemu_iovec_destroy(&ctx->qiov);
|
||||
}
|
||||
g_free(ctx);
|
||||
}
|
||||
|
||||
@@ -1612,6 +1615,7 @@ static void aio_write_help(void)
|
||||
" -P, -- use different pattern to fill file\n"
|
||||
" -C, -- report statistics in a machine parsable format\n"
|
||||
" -q, -- quiet mode, do not show I/O statistics\n"
|
||||
" -z, -- write zeroes using blk_aio_write_zeroes\n"
|
||||
"\n");
|
||||
}
|
||||
|
||||
@@ -1622,7 +1626,7 @@ static const cmdinfo_t aio_write_cmd = {
|
||||
.cfunc = aio_write_f,
|
||||
.argmin = 2,
|
||||
.argmax = -1,
|
||||
.args = "[-Cq] [-P pattern ] off len [len..]",
|
||||
.args = "[-Cqz] [-P pattern ] off len [len..]",
|
||||
.oneline = "asynchronously writes a number of bytes",
|
||||
.help = aio_write_help,
|
||||
};
|
||||
@@ -1634,7 +1638,7 @@ static int aio_write_f(BlockBackend *blk, int argc, char **argv)
|
||||
struct aio_ctx *ctx = g_new0(struct aio_ctx, 1);
|
||||
|
||||
ctx->blk = blk;
|
||||
while ((c = getopt(argc, argv, "CqP:")) != -1) {
|
||||
while ((c = getopt(argc, argv, "CqP:z")) != -1) {
|
||||
switch (c) {
|
||||
case 'C':
|
||||
ctx->Cflag = 1;
|
||||
@@ -1649,6 +1653,9 @@ static int aio_write_f(BlockBackend *blk, int argc, char **argv)
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case 'z':
|
||||
ctx->zflag = 1;
|
||||
break;
|
||||
default:
|
||||
g_free(ctx);
|
||||
return qemuio_command_usage(&aio_write_cmd);
|
||||
@@ -1660,6 +1667,18 @@ static int aio_write_f(BlockBackend *blk, int argc, char **argv)
|
||||
return qemuio_command_usage(&aio_write_cmd);
|
||||
}
|
||||
|
||||
if (ctx->zflag && optind != argc - 2) {
|
||||
printf("-z supports only a single length parameter\n");
|
||||
g_free(ctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (ctx->zflag && ctx->Pflag) {
|
||||
printf("-z and -P cannot be specified at the same time\n");
|
||||
g_free(ctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
ctx->offset = cvtnum(argv[optind]);
|
||||
if (ctx->offset < 0) {
|
||||
print_cvtnum_err(ctx->offset, argv[optind]);
|
||||
@@ -1676,19 +1695,33 @@ static int aio_write_f(BlockBackend *blk, int argc, char **argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
nr_iov = argc - optind;
|
||||
ctx->buf = create_iovec(blk, &ctx->qiov, &argv[optind], nr_iov, pattern);
|
||||
if (ctx->buf == NULL) {
|
||||
block_acct_invalid(blk_get_stats(blk), BLOCK_ACCT_WRITE);
|
||||
g_free(ctx);
|
||||
return 0;
|
||||
}
|
||||
if (ctx->zflag) {
|
||||
int64_t count = cvtnum(argv[optind]);
|
||||
if (count < 0) {
|
||||
print_cvtnum_err(count, argv[optind]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
gettimeofday(&ctx->t1, NULL);
|
||||
block_acct_start(blk_get_stats(blk), &ctx->acct, ctx->qiov.size,
|
||||
BLOCK_ACCT_WRITE);
|
||||
blk_aio_writev(blk, ctx->offset >> 9, &ctx->qiov,
|
||||
ctx->qiov.size >> 9, aio_write_done, ctx);
|
||||
ctx->qiov.size = count;
|
||||
blk_aio_write_zeroes(blk, ctx->offset >> 9, count >> 9, 0,
|
||||
aio_write_done, ctx);
|
||||
} else {
|
||||
nr_iov = argc - optind;
|
||||
ctx->buf = create_iovec(blk, &ctx->qiov, &argv[optind], nr_iov,
|
||||
pattern);
|
||||
if (ctx->buf == NULL) {
|
||||
block_acct_invalid(blk_get_stats(blk), BLOCK_ACCT_WRITE);
|
||||
g_free(ctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
gettimeofday(&ctx->t1, NULL);
|
||||
block_acct_start(blk_get_stats(blk), &ctx->acct, ctx->qiov.size,
|
||||
BLOCK_ACCT_WRITE);
|
||||
|
||||
blk_aio_writev(blk, ctx->offset >> 9, &ctx->qiov,
|
||||
ctx->qiov.size >> 9, aio_write_done, ctx);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -534,8 +534,7 @@ int main(int argc, char **argv)
|
||||
|
||||
if (qemu_opts_foreach(&qemu_object_opts,
|
||||
user_creatable_add_opts_foreach,
|
||||
NULL, &local_error)) {
|
||||
error_report_err(local_error);
|
||||
NULL, NULL)) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
@@ -215,7 +215,7 @@ static int find_partition(BlockBackend *blk, int partition,
|
||||
|
||||
static void termsig_handler(int signum)
|
||||
{
|
||||
state = TERMINATE;
|
||||
atomic_cmpxchg(&state, RUNNING, TERMINATE);
|
||||
qemu_notify_event();
|
||||
}
|
||||
|
||||
@@ -711,8 +711,7 @@ int main(int argc, char **argv)
|
||||
|
||||
if (qemu_opts_foreach(&qemu_object_opts,
|
||||
user_creatable_add_opts_foreach,
|
||||
NULL, &local_err)) {
|
||||
error_report_err(local_err);
|
||||
NULL, NULL)) {
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
@@ -2864,18 +2864,32 @@ ETEXI
|
||||
|
||||
DEF("fw_cfg", HAS_ARG, QEMU_OPTION_fwcfg,
|
||||
"-fw_cfg [name=]<name>,file=<file>\n"
|
||||
" add named fw_cfg entry from file\n"
|
||||
" add named fw_cfg entry with contents from file\n"
|
||||
"-fw_cfg [name=]<name>,string=<str>\n"
|
||||
" add named fw_cfg entry from string\n",
|
||||
" add named fw_cfg entry with contents from string\n",
|
||||
QEMU_ARCH_ALL)
|
||||
STEXI
|
||||
|
||||
@item -fw_cfg [name=]@var{name},file=@var{file}
|
||||
@findex -fw_cfg
|
||||
Add named fw_cfg entry from file. @var{name} determines the name of
|
||||
the entry in the fw_cfg file directory exposed to the guest.
|
||||
Add named fw_cfg entry with contents from file @var{file}.
|
||||
|
||||
@item -fw_cfg [name=]@var{name},string=@var{str}
|
||||
Add named fw_cfg entry from string.
|
||||
Add named fw_cfg entry with contents from string @var{str}.
|
||||
|
||||
The terminating NUL character of the contents of @var{str} will not be
|
||||
included as part of the fw_cfg item data. To insert contents with
|
||||
embedded NUL characters, you have to use the @var{file} parameter.
|
||||
|
||||
The fw_cfg entries are passed by QEMU through to the guest.
|
||||
|
||||
Example:
|
||||
@example
|
||||
-fw_cfg name=opt/com.mycompany/blob,file=./my_blob.bin
|
||||
@end example
|
||||
creates an fw_cfg entry named opt/com.mycompany/blob with contents
|
||||
from ./my_blob.bin.
|
||||
|
||||
ETEXI
|
||||
|
||||
DEF("serial", HAS_ARG, QEMU_OPTION_serial, \
|
||||
|
@@ -16,11 +16,13 @@
|
||||
#include <seccomp.h>
|
||||
#include "sysemu/seccomp.h"
|
||||
|
||||
/* For some architectures (notably ARM) cacheflush is not supported until
|
||||
* libseccomp 2.2.3, but configure enforces that we are using a more recent
|
||||
* version on those hosts, so it is OK for this check to be less strict.
|
||||
*/
|
||||
#if SCMP_VER_MAJOR >= 3
|
||||
#define HAVE_CACHEFLUSH
|
||||
#elif SCMP_VER_MAJOR == 2 && SCMP_VER_MINOR >= 3
|
||||
#define HAVE_CACHEFLUSH
|
||||
#elif SCMP_VER_MAJOR == 2 && SCMP_VER_MINOR == 2 && SCMP_VER_MICRO >= 3
|
||||
#elif SCMP_VER_MAJOR == 2 && SCMP_VER_MINOR >= 2
|
||||
#define HAVE_CACHEFLUSH
|
||||
#endif
|
||||
|
||||
@@ -250,6 +252,7 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
|
||||
#ifdef HAVE_CACHEFLUSH
|
||||
{ SCMP_SYS(cacheflush), 240 },
|
||||
#endif
|
||||
{ SCMP_SYS(sysinfo), 240 },
|
||||
};
|
||||
|
||||
int seccomp_start(void)
|
||||
|
@@ -170,6 +170,7 @@ int user_creatable_add_opts_foreach(void *opaque, QemuOpts *opts, Error **errp)
|
||||
{
|
||||
bool (*type_predicate)(const char *) = opaque;
|
||||
Object *obj = NULL;
|
||||
Error *err = NULL;
|
||||
const char *type;
|
||||
|
||||
type = qemu_opt_get(opts, "qom-type");
|
||||
@@ -178,8 +179,9 @@ int user_creatable_add_opts_foreach(void *opaque, QemuOpts *opts, Error **errp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
obj = user_creatable_add_opts(opts, errp);
|
||||
obj = user_creatable_add_opts(opts, &err);
|
||||
if (!obj) {
|
||||
error_report_err(err);
|
||||
return -1;
|
||||
}
|
||||
object_unref(obj);
|
||||
|
@@ -275,7 +275,7 @@ void replay_configure(QemuOpts *opts)
|
||||
rr = qemu_opt_get(opts, "rr");
|
||||
if (!rr) {
|
||||
/* Just enabling icount */
|
||||
return;
|
||||
goto out;
|
||||
} else if (!strcmp(rr, "record")) {
|
||||
mode = REPLAY_MODE_RECORD;
|
||||
} else if (!strcmp(rr, "replay")) {
|
||||
@@ -293,6 +293,7 @@ void replay_configure(QemuOpts *opts)
|
||||
|
||||
replay_enable(fname, mode);
|
||||
|
||||
out:
|
||||
loc_pop(&loc);
|
||||
}
|
||||
|
||||
|
Submodule roms/openbios updated: 0dbda5d935...422b916649
@@ -186,7 +186,7 @@ icmp_input(struct mbuf *m, int hlen)
|
||||
sotranslate_out(so, &addr);
|
||||
|
||||
if(sendto(so->s, icmp_ping_msg, strlen(icmp_ping_msg), 0,
|
||||
(struct sockaddr *)&addr, sizeof(addr)) == -1) {
|
||||
(struct sockaddr *)&addr, sockaddr_size(&addr)) == -1) {
|
||||
DEBUG_MISC((dfd,"icmp_input udp sendto tx errno = %d-%s\n",
|
||||
errno,strerror(errno)));
|
||||
icmp_send_error(m, ICMP_UNREACH, ICMP_UNREACH_NET, 0, strerror(errno));
|
||||
|
@@ -347,9 +347,4 @@ struct tcpcb *tcp_drop(struct tcpcb *tp, int err);
|
||||
#define max(x,y) ((x) > (y) ? (x) : (y))
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#undef errno
|
||||
#define errno (WSAGetLastError())
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@@ -627,7 +627,7 @@ sosendto(struct socket *so, struct mbuf *m)
|
||||
|
||||
/* Don't care what port we get */
|
||||
ret = sendto(so->s, m->m_data, m->m_len, 0,
|
||||
(struct sockaddr *)&addr, sizeof(addr));
|
||||
(struct sockaddr *)&addr, sockaddr_size(&addr));
|
||||
if (ret < 0)
|
||||
return -1;
|
||||
|
||||
|
@@ -122,6 +122,18 @@ static inline int sockaddr_equal(struct sockaddr_storage *a,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline socklen_t sockaddr_size(struct sockaddr_storage *a)
|
||||
{
|
||||
switch (a->ss_family) {
|
||||
case AF_INET:
|
||||
return sizeof(struct sockaddr_in);
|
||||
case AF_INET6:
|
||||
return sizeof(struct sockaddr_in6);
|
||||
default:
|
||||
g_assert_not_reached();
|
||||
}
|
||||
}
|
||||
|
||||
struct socket *solookup(struct socket **, struct socket *,
|
||||
struct sockaddr_storage *, struct sockaddr_storage *);
|
||||
struct socket *socreate(Slirp *);
|
||||
|
@@ -659,6 +659,7 @@ findso:
|
||||
}
|
||||
|
||||
if ((tcp_fconnect(so, so->so_ffamily) == -1) &&
|
||||
(errno != EAGAIN) &&
|
||||
(errno != EINPROGRESS) && (errno != EWOULDBLOCK)
|
||||
) {
|
||||
uint8_t code;
|
||||
|
@@ -413,7 +413,7 @@ int tcp_fconnect(struct socket *so, unsigned short af)
|
||||
sotranslate_out(so, &addr);
|
||||
|
||||
/* We don't care what port we get */
|
||||
ret = connect(s,(struct sockaddr *)&addr,sizeof (addr));
|
||||
ret = connect(s, (struct sockaddr *)&addr, sockaddr_size(&addr));
|
||||
|
||||
/*
|
||||
* If it's not in progress, it failed, so we just return 0,
|
||||
|
@@ -40,3 +40,4 @@ stub-obj-y += qmp_pc_dimm_device_list.o
|
||||
stub-obj-y += target-monitor-defs.o
|
||||
stub-obj-y += target-get-monitor-def.o
|
||||
stub-obj-y += vhost.o
|
||||
stub-obj-y += iohandler.o
|
||||
|
8
stubs/iohandler.c
Normal file
8
stubs/iohandler.c
Normal file
@@ -0,0 +1,8 @@
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu-common.h"
|
||||
#include "qemu/main-loop.h"
|
||||
|
||||
AioContext *iohandler_get_aio_context(void)
|
||||
{
|
||||
abort();
|
||||
}
|
@@ -9,3 +9,13 @@ void qemu_set_fd_handler(int fd,
|
||||
{
|
||||
abort();
|
||||
}
|
||||
|
||||
void aio_set_fd_handler(AioContext *ctx,
|
||||
int fd,
|
||||
bool is_external,
|
||||
IOHandler *io_read,
|
||||
IOHandler *io_write,
|
||||
void *opaque)
|
||||
{
|
||||
abort();
|
||||
}
|
||||
|
@@ -2897,6 +2897,14 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
|
||||
env->cpuid_level = 7;
|
||||
}
|
||||
|
||||
if (x86_cpu_filter_features(cpu) && cpu->enforce_cpuid) {
|
||||
error_setg(&local_err,
|
||||
kvm_enabled() ?
|
||||
"Host doesn't support requested features" :
|
||||
"TCG doesn't support requested features");
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* On AMD CPUs, some CPUID[8000_0001].EDX bits must match the bits on
|
||||
* CPUID[1].EDX.
|
||||
*/
|
||||
@@ -2907,14 +2915,6 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
|
||||
}
|
||||
|
||||
|
||||
if (x86_cpu_filter_features(cpu) && cpu->enforce_cpuid) {
|
||||
error_setg(&local_err,
|
||||
kvm_enabled() ?
|
||||
"Host doesn't support requested features" :
|
||||
"TCG doesn't support requested features");
|
||||
goto out;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
qemu_register_reset(x86_cpu_machine_reset_cb, cpu);
|
||||
|
||||
|
@@ -88,7 +88,7 @@ HvSintRoute *kvm_hv_sint_route_create(uint32_t vcpu_id, uint32_t sint,
|
||||
goto err_sint_set_notifier;
|
||||
}
|
||||
|
||||
event_notifier_set_handler(&sint_route->sint_ack_notifier,
|
||||
event_notifier_set_handler(&sint_route->sint_ack_notifier, false,
|
||||
kvm_hv_sint_ack_handler);
|
||||
|
||||
gsi = kvm_irqchip_add_hv_sint_route(kvm_state, vcpu_id, sint);
|
||||
@@ -112,7 +112,7 @@ HvSintRoute *kvm_hv_sint_route_create(uint32_t vcpu_id, uint32_t sint,
|
||||
err_irqfd:
|
||||
kvm_irqchip_release_virq(kvm_state, gsi);
|
||||
err_gsi:
|
||||
event_notifier_set_handler(&sint_route->sint_ack_notifier, NULL);
|
||||
event_notifier_set_handler(&sint_route->sint_ack_notifier, false, NULL);
|
||||
event_notifier_cleanup(&sint_route->sint_ack_notifier);
|
||||
err_sint_set_notifier:
|
||||
event_notifier_cleanup(&sint_route->sint_set_notifier);
|
||||
@@ -128,7 +128,7 @@ void kvm_hv_sint_route_destroy(HvSintRoute *sint_route)
|
||||
&sint_route->sint_set_notifier,
|
||||
sint_route->gsi);
|
||||
kvm_irqchip_release_virq(kvm_state, sint_route->gsi);
|
||||
event_notifier_set_handler(&sint_route->sint_ack_notifier, NULL);
|
||||
event_notifier_set_handler(&sint_route->sint_ack_notifier, false, NULL);
|
||||
event_notifier_cleanup(&sint_route->sint_ack_notifier);
|
||||
event_notifier_cleanup(&sint_route->sint_set_notifier);
|
||||
g_free(sint_route);
|
||||
|
@@ -2294,29 +2294,29 @@ void helper_deret(CPUMIPSState *env)
|
||||
}
|
||||
#endif /* !CONFIG_USER_ONLY */
|
||||
|
||||
static inline void check_hwrena(CPUMIPSState *env, int reg)
|
||||
static inline void check_hwrena(CPUMIPSState *env, int reg, uintptr_t pc)
|
||||
{
|
||||
if ((env->hflags & MIPS_HFLAG_CP0) || (env->CP0_HWREna & (1 << reg))) {
|
||||
return;
|
||||
}
|
||||
do_raise_exception(env, EXCP_RI, GETPC());
|
||||
do_raise_exception(env, EXCP_RI, pc);
|
||||
}
|
||||
|
||||
target_ulong helper_rdhwr_cpunum(CPUMIPSState *env)
|
||||
{
|
||||
check_hwrena(env, 0);
|
||||
check_hwrena(env, 0, GETPC());
|
||||
return env->CP0_EBase & 0x3ff;
|
||||
}
|
||||
|
||||
target_ulong helper_rdhwr_synci_step(CPUMIPSState *env)
|
||||
{
|
||||
check_hwrena(env, 1);
|
||||
check_hwrena(env, 1, GETPC());
|
||||
return env->SYNCI_Step;
|
||||
}
|
||||
|
||||
target_ulong helper_rdhwr_cc(CPUMIPSState *env)
|
||||
{
|
||||
check_hwrena(env, 2);
|
||||
check_hwrena(env, 2, GETPC());
|
||||
#ifdef CONFIG_USER_ONLY
|
||||
return env->CP0_Count;
|
||||
#else
|
||||
@@ -2326,19 +2326,19 @@ target_ulong helper_rdhwr_cc(CPUMIPSState *env)
|
||||
|
||||
target_ulong helper_rdhwr_ccres(CPUMIPSState *env)
|
||||
{
|
||||
check_hwrena(env, 3);
|
||||
check_hwrena(env, 3, GETPC());
|
||||
return env->CCRes;
|
||||
}
|
||||
|
||||
target_ulong helper_rdhwr_performance(CPUMIPSState *env)
|
||||
{
|
||||
check_hwrena(env, 4);
|
||||
check_hwrena(env, 4, GETPC());
|
||||
return env->CP0_Performance0;
|
||||
}
|
||||
|
||||
target_ulong helper_rdhwr_xnp(CPUMIPSState *env)
|
||||
{
|
||||
check_hwrena(env, 5);
|
||||
check_hwrena(env, 5, GETPC());
|
||||
return (env->CP0_Config5 >> CP0C5_XNP) & 1;
|
||||
}
|
||||
|
||||
|
@@ -2415,6 +2415,16 @@ static inline bool msr_is_64bit(CPUPPCState *env, target_ulong msr)
|
||||
return msr & (1ULL << MSR_SF);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether register rx is in the range between start and
|
||||
* start + nregs (as needed by the LSWX and LSWI instructions)
|
||||
*/
|
||||
static inline bool lsw_reg_in_range(int start, int nregs, int rx)
|
||||
{
|
||||
return (start + nregs <= 32 && rx >= start && rx < start + nregs) ||
|
||||
(start + nregs > 32 && (rx >= start || rx < start + nregs - 32));
|
||||
}
|
||||
|
||||
extern void (*cpu_ppc_hypercall)(PowerPCCPU *);
|
||||
|
||||
#include "exec/exec-all.h"
|
||||
|
@@ -136,7 +136,7 @@ static void cpu_pre_save(void *opaque)
|
||||
|
||||
env->spr[SPR_LR] = env->lr;
|
||||
env->spr[SPR_CTR] = env->ctr;
|
||||
env->spr[SPR_XER] = env->xer;
|
||||
env->spr[SPR_XER] = cpu_read_xer(env);
|
||||
#if defined(TARGET_PPC64)
|
||||
env->spr[SPR_CFAR] = env->cfar;
|
||||
#endif
|
||||
|
@@ -102,8 +102,9 @@ void helper_lswx(CPUPPCState *env, target_ulong addr, uint32_t reg,
|
||||
{
|
||||
if (likely(xer_bc != 0)) {
|
||||
int num_used_regs = (xer_bc + 3) / 4;
|
||||
if (unlikely((ra != 0 && reg < ra && (reg + num_used_regs) > ra) ||
|
||||
(reg < rb && (reg + num_used_regs) > rb))) {
|
||||
if (unlikely((ra != 0 && lsw_reg_in_range(reg, num_used_regs, ra)) ||
|
||||
lsw_reg_in_range(reg, num_used_regs, rb))) {
|
||||
env->nip += 4; /* Compensate the "nip - 4" from gen_lswx() */
|
||||
helper_raise_exception_err(env, POWERPC_EXCP_PROGRAM,
|
||||
POWERPC_EXCP_INVAL |
|
||||
POWERPC_EXCP_INVAL_LSWX);
|
||||
|
@@ -3227,10 +3227,8 @@ static void gen_lswi(DisasContext *ctx)
|
||||
|
||||
if (nb == 0)
|
||||
nb = 32;
|
||||
nr = nb / 4;
|
||||
if (unlikely(((start + nr) > 32 &&
|
||||
start <= ra && (start + nr - 32) > ra) ||
|
||||
((start + nr) <= 32 && start <= ra && (start + nr) > ra))) {
|
||||
nr = (nb + 3) / 4;
|
||||
if (unlikely(lsw_reg_in_range(start, nr, ra))) {
|
||||
gen_inval_exception(ctx, POWERPC_EXCP_INVAL_LSWX);
|
||||
return;
|
||||
}
|
||||
|
@@ -158,9 +158,8 @@ void sparc_cpu_do_interrupt(CPUState *cs)
|
||||
} else if ((intno & 0x1c0) == TT_FILL) {
|
||||
cpu_set_cwp(env, cpu_cwp_inc(env, env->cwp + 1));
|
||||
}
|
||||
env->tbr &= ~0x7fffULL;
|
||||
env->tbr |= ((env->tl > 1) ? 1 << 14 : 0) | (intno << 5);
|
||||
env->pc = env->tbr;
|
||||
env->pc = env->tbr & ~0x7fffULL;
|
||||
env->pc |= ((env->tl > 1) ? 1 << 14 : 0) | (intno << 5);
|
||||
env->npc = env->pc + 4;
|
||||
cs->exception_index = -1;
|
||||
}
|
||||
|
@@ -2059,11 +2059,11 @@ void helper_ldda_asi(CPUSPARCState *env, target_ulong addr, int asi, int rd)
|
||||
bswap64s(&env->gregs[rd + 1]);
|
||||
}
|
||||
} else {
|
||||
env->regwptr[rd] = cpu_ldq_nucleus(env, addr);
|
||||
env->regwptr[rd + 1] = cpu_ldq_nucleus(env, addr + 8);
|
||||
env->regwptr[rd - 8] = cpu_ldq_nucleus(env, addr);
|
||||
env->regwptr[rd + 1 - 8] = cpu_ldq_nucleus(env, addr + 8);
|
||||
if (asi == 0x2c) {
|
||||
bswap64s(&env->regwptr[rd]);
|
||||
bswap64s(&env->regwptr[rd + 1]);
|
||||
bswap64s(&env->regwptr[rd - 8]);
|
||||
bswap64s(&env->regwptr[rd + 1 - 8]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -2076,8 +2076,8 @@ void helper_ldda_asi(CPUSPARCState *env, target_ulong addr, int asi, int rd)
|
||||
env->gregs[rd] = helper_ld_asi(env, addr, asi, 4, 0);
|
||||
env->gregs[rd + 1] = helper_ld_asi(env, addr + 4, asi, 4, 0);
|
||||
} else {
|
||||
env->regwptr[rd] = helper_ld_asi(env, addr, asi, 4, 0);
|
||||
env->regwptr[rd + 1] = helper_ld_asi(env, addr + 4, asi, 4, 0);
|
||||
env->regwptr[rd - 8] = helper_ld_asi(env, addr, asi, 4, 0);
|
||||
env->regwptr[rd + 1 - 8] = helper_ld_asi(env, addr + 4, asi, 4, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@@ -18,14 +18,14 @@
|
||||
makes things much cleaner. */
|
||||
QEMU_BUILD_BUG_ON(TCG_TYPE_I32 != 0 || TCG_TYPE_I64 != 1);
|
||||
|
||||
#ifndef NDEBUG
|
||||
#ifdef CONFIG_DEBUG_TCG
|
||||
static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
|
||||
"%x0", "%x1", "%x2", "%x3", "%x4", "%x5", "%x6", "%x7",
|
||||
"%x8", "%x9", "%x10", "%x11", "%x12", "%x13", "%x14", "%x15",
|
||||
"%x16", "%x17", "%x18", "%x19", "%x20", "%x21", "%x22", "%x23",
|
||||
"%x24", "%x25", "%x26", "%x27", "%x28", "%fp", "%x30", "%sp",
|
||||
};
|
||||
#endif /* NDEBUG */
|
||||
#endif /* CONFIG_DEBUG_TCG */
|
||||
|
||||
static const int tcg_target_reg_alloc_order[] = {
|
||||
TCG_REG_X20, TCG_REG_X21, TCG_REG_X22, TCG_REG_X23,
|
||||
@@ -67,7 +67,7 @@ static const int tcg_target_call_oarg_regs[1] = {
|
||||
static inline void reloc_pc26(tcg_insn_unit *code_ptr, tcg_insn_unit *target)
|
||||
{
|
||||
ptrdiff_t offset = target - code_ptr;
|
||||
assert(offset == sextract64(offset, 0, 26));
|
||||
tcg_debug_assert(offset == sextract64(offset, 0, 26));
|
||||
/* read instruction, mask away previous PC_REL26 parameter contents,
|
||||
set the proper offset, then write back the instruction. */
|
||||
*code_ptr = deposit32(*code_ptr, 0, 26, offset);
|
||||
@@ -76,14 +76,14 @@ static inline void reloc_pc26(tcg_insn_unit *code_ptr, tcg_insn_unit *target)
|
||||
static inline void reloc_pc19(tcg_insn_unit *code_ptr, tcg_insn_unit *target)
|
||||
{
|
||||
ptrdiff_t offset = target - code_ptr;
|
||||
assert(offset == sextract64(offset, 0, 19));
|
||||
tcg_debug_assert(offset == sextract64(offset, 0, 19));
|
||||
*code_ptr = deposit32(*code_ptr, 5, 19, offset);
|
||||
}
|
||||
|
||||
static inline void patch_reloc(tcg_insn_unit *code_ptr, int type,
|
||||
intptr_t value, intptr_t addend)
|
||||
{
|
||||
assert(addend == 0);
|
||||
tcg_debug_assert(addend == 0);
|
||||
switch (type) {
|
||||
case R_AARCH64_JUMP26:
|
||||
case R_AARCH64_CALL26:
|
||||
@@ -402,7 +402,7 @@ static void tcg_out_insn_3314(TCGContext *s, AArch64Insn insn,
|
||||
insn |= pre << 24;
|
||||
insn |= w << 23;
|
||||
|
||||
assert(ofs >= -0x200 && ofs < 0x200 && (ofs & 7) == 0);
|
||||
tcg_debug_assert(ofs >= -0x200 && ofs < 0x200 && (ofs & 7) == 0);
|
||||
insn |= (ofs & (0x7f << 3)) << (15 - 3);
|
||||
|
||||
tcg_out32(s, insn | r2 << 10 | rn << 5 | r1);
|
||||
@@ -412,9 +412,9 @@ static void tcg_out_insn_3401(TCGContext *s, AArch64Insn insn, TCGType ext,
|
||||
TCGReg rd, TCGReg rn, uint64_t aimm)
|
||||
{
|
||||
if (aimm > 0xfff) {
|
||||
assert((aimm & 0xfff) == 0);
|
||||
tcg_debug_assert((aimm & 0xfff) == 0);
|
||||
aimm >>= 12;
|
||||
assert(aimm <= 0xfff);
|
||||
tcg_debug_assert(aimm <= 0xfff);
|
||||
aimm |= 1 << 12; /* apply LSL 12 */
|
||||
}
|
||||
tcg_out32(s, insn | ext << 31 | aimm << 10 | rn << 5 | rd);
|
||||
@@ -444,7 +444,7 @@ static void tcg_out_insn_3403(TCGContext *s, AArch64Insn insn, TCGType ext,
|
||||
static void tcg_out_insn_3405(TCGContext *s, AArch64Insn insn, TCGType ext,
|
||||
TCGReg rd, uint16_t half, unsigned shift)
|
||||
{
|
||||
assert((shift & ~0x30) == 0);
|
||||
tcg_debug_assert((shift & ~0x30) == 0);
|
||||
tcg_out32(s, insn | ext << 31 | shift << (21 - 4) | half << 5 | rd);
|
||||
}
|
||||
|
||||
@@ -538,7 +538,7 @@ static void tcg_out_logicali(TCGContext *s, AArch64Insn insn, TCGType ext,
|
||||
{
|
||||
unsigned h, l, r, c;
|
||||
|
||||
assert(is_limm(limm));
|
||||
tcg_debug_assert(is_limm(limm));
|
||||
|
||||
h = clz64(limm);
|
||||
l = ctz64(limm);
|
||||
@@ -793,7 +793,7 @@ static void tcg_out_cmp(TCGContext *s, TCGType ext, TCGReg a,
|
||||
static inline void tcg_out_goto(TCGContext *s, tcg_insn_unit *target)
|
||||
{
|
||||
ptrdiff_t offset = target - s->code_ptr;
|
||||
assert(offset == sextract64(offset, 0, 26));
|
||||
tcg_debug_assert(offset == sextract64(offset, 0, 26));
|
||||
tcg_out_insn(s, 3206, B, offset);
|
||||
}
|
||||
|
||||
@@ -867,7 +867,7 @@ static void tcg_out_brcond(TCGContext *s, TCGMemOp ext, TCGCond c, TCGArg a,
|
||||
offset = tcg_in32(s) >> 5;
|
||||
} else {
|
||||
offset = l->u.value_ptr - s->code_ptr;
|
||||
assert(offset == sextract64(offset, 0, 19));
|
||||
tcg_debug_assert(offset == sextract64(offset, 0, 19));
|
||||
}
|
||||
|
||||
if (need_cmp) {
|
||||
@@ -990,7 +990,7 @@ static void * const qemu_st_helpers[16] = {
|
||||
static inline void tcg_out_adr(TCGContext *s, TCGReg rd, void *target)
|
||||
{
|
||||
ptrdiff_t offset = tcg_pcrel_diff(s, target);
|
||||
assert(offset == sextract64(offset, 0, 21));
|
||||
tcg_debug_assert(offset == sextract64(offset, 0, 21));
|
||||
tcg_out_insn(s, 3406, ADR, rd, offset);
|
||||
}
|
||||
|
||||
@@ -1294,7 +1294,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
|
||||
#ifndef USE_DIRECT_JUMP
|
||||
#error "USE_DIRECT_JUMP required for aarch64"
|
||||
#endif
|
||||
assert(s->tb_jmp_offset != NULL); /* consistency for USE_DIRECT_JUMP */
|
||||
tcg_debug_assert(s->tb_jmp_offset != NULL); /* consistency for USE_DIRECT_JUMP */
|
||||
s->tb_jmp_offset[a0] = tcg_current_code_size(s);
|
||||
/* actual branch destination will be patched by
|
||||
aarch64_tb_set_jmp_target later, beware retranslation. */
|
||||
|
@@ -67,7 +67,7 @@ bool use_idiv_instructions;
|
||||
# define USING_SOFTMMU 0
|
||||
#endif
|
||||
|
||||
#ifndef NDEBUG
|
||||
#ifdef CONFIG_DEBUG_TCG
|
||||
static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
|
||||
"%r0",
|
||||
"%r1",
|
||||
@@ -124,8 +124,8 @@ static inline void reloc_pc24(tcg_insn_unit *code_ptr, tcg_insn_unit *target)
|
||||
static void patch_reloc(tcg_insn_unit *code_ptr, int type,
|
||||
intptr_t value, intptr_t addend)
|
||||
{
|
||||
assert(type == R_ARM_PC24);
|
||||
assert(addend == 0);
|
||||
tcg_debug_assert(type == R_ARM_PC24);
|
||||
tcg_debug_assert(addend == 0);
|
||||
reloc_pc24(code_ptr, (tcg_insn_unit *)value);
|
||||
}
|
||||
|
||||
@@ -492,7 +492,7 @@ static inline void tcg_out_dat_rI(TCGContext *s, int cond, int opc, TCGArg dst,
|
||||
*/
|
||||
if (rhs_is_const) {
|
||||
int rot = encode_imm(rhs);
|
||||
assert(rot >= 0);
|
||||
tcg_debug_assert(rot >= 0);
|
||||
tcg_out_dat_imm(s, cond, opc, dst, lhs, rotl(rhs, rot) | (rot << 7));
|
||||
} else {
|
||||
tcg_out_dat_reg(s, cond, opc, dst, lhs, rhs, SHIFT_IMM_LSL(0));
|
||||
@@ -511,7 +511,7 @@ static void tcg_out_dat_rIK(TCGContext *s, int cond, int opc, int opinv,
|
||||
if (rot < 0) {
|
||||
rhs = ~rhs;
|
||||
rot = encode_imm(rhs);
|
||||
assert(rot >= 0);
|
||||
tcg_debug_assert(rot >= 0);
|
||||
opc = opinv;
|
||||
}
|
||||
tcg_out_dat_imm(s, cond, opc, dst, lhs, rotl(rhs, rot) | (rot << 7));
|
||||
@@ -532,7 +532,7 @@ static void tcg_out_dat_rIN(TCGContext *s, int cond, int opc, int opneg,
|
||||
if (rot < 0) {
|
||||
rhs = -rhs;
|
||||
rot = encode_imm(rhs);
|
||||
assert(rot >= 0);
|
||||
tcg_debug_assert(rot >= 0);
|
||||
opc = opneg;
|
||||
}
|
||||
tcg_out_dat_imm(s, cond, opc, dst, lhs, rotl(rhs, rot) | (rot << 7));
|
||||
@@ -1100,7 +1100,7 @@ static TCGReg NAME(TCGContext *s, TCGReg argreg, ARGTYPE arg) \
|
||||
} else { \
|
||||
int ofs = (argreg - 4) * 4; \
|
||||
EXT_ARG; \
|
||||
assert(ofs + 4 <= TCG_STATIC_CALL_ARGS_SIZE); \
|
||||
tcg_debug_assert(ofs + 4 <= TCG_STATIC_CALL_ARGS_SIZE); \
|
||||
tcg_out_st32_12(s, COND_AL, arg, TCG_REG_CALL_STACK, ofs); \
|
||||
} \
|
||||
return argreg + 1; \
|
||||
|
@@ -24,7 +24,7 @@
|
||||
|
||||
#include "tcg-be-ldst.h"
|
||||
|
||||
#ifndef NDEBUG
|
||||
#ifdef CONFIG_DEBUG_TCG
|
||||
static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
|
||||
#if TCG_TARGET_REG_BITS == 64
|
||||
"%rax", "%rcx", "%rdx", "%rbx", "%rsp", "%rbp", "%rsi", "%rdi",
|
||||
@@ -425,7 +425,7 @@ static void tcg_out_opc(TCGContext *s, int opc, int r, int rm, int x)
|
||||
}
|
||||
if (opc & P_DATA16) {
|
||||
/* We should never be asking for both 16 and 64-bit operation. */
|
||||
assert((opc & P_REXW) == 0);
|
||||
tcg_debug_assert((opc & P_REXW) == 0);
|
||||
tcg_out8(s, 0x66);
|
||||
}
|
||||
if (opc & P_ADDR32) {
|
||||
@@ -599,7 +599,7 @@ static void tcg_out_modrm_sib_offset(TCGContext *s, int opc, int r, int rm,
|
||||
if (index < 0) {
|
||||
index = 4;
|
||||
} else {
|
||||
assert(index != TCG_REG_ESP);
|
||||
tcg_debug_assert(index != TCG_REG_ESP);
|
||||
}
|
||||
|
||||
tcg_out_opc(s, opc, r, rm, index);
|
||||
@@ -745,14 +745,14 @@ static inline void tcg_out_rolw_8(TCGContext *s, int reg)
|
||||
static inline void tcg_out_ext8u(TCGContext *s, int dest, int src)
|
||||
{
|
||||
/* movzbl */
|
||||
assert(src < 4 || TCG_TARGET_REG_BITS == 64);
|
||||
tcg_debug_assert(src < 4 || TCG_TARGET_REG_BITS == 64);
|
||||
tcg_out_modrm(s, OPC_MOVZBL + P_REXB_RM, dest, src);
|
||||
}
|
||||
|
||||
static void tcg_out_ext8s(TCGContext *s, int dest, int src, int rexw)
|
||||
{
|
||||
/* movsbl */
|
||||
assert(src < 4 || TCG_TARGET_REG_BITS == 64);
|
||||
tcg_debug_assert(src < 4 || TCG_TARGET_REG_BITS == 64);
|
||||
tcg_out_modrm(s, OPC_MOVSBL + P_REXB_RM + rexw, dest, src);
|
||||
}
|
||||
|
||||
|
@@ -27,7 +27,7 @@
|
||||
* Register definitions
|
||||
*/
|
||||
|
||||
#ifndef NDEBUG
|
||||
#ifdef CONFIG_DEBUG_TCG
|
||||
static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
|
||||
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
|
||||
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
|
||||
@@ -710,8 +710,8 @@ static uint64_t get_reloc_pcrel21b_slot2(tcg_insn_unit *pc)
|
||||
static void patch_reloc(tcg_insn_unit *code_ptr, int type,
|
||||
intptr_t value, intptr_t addend)
|
||||
{
|
||||
assert(addend == 0);
|
||||
assert(type == R_IA64_PCREL21B);
|
||||
tcg_debug_assert(addend == 0);
|
||||
tcg_debug_assert(type == R_IA64_PCREL21B);
|
||||
reloc_pcrel21b_slot2(code_ptr, (tcg_insn_unit *)value);
|
||||
}
|
||||
|
||||
@@ -809,7 +809,7 @@ static inline void tcg_out_mov(TCGContext *s, TCGType type,
|
||||
|
||||
static inline uint64_t tcg_opc_movi_a(int qp, TCGReg dst, int64_t src)
|
||||
{
|
||||
assert(src == sextract64(src, 0, 22));
|
||||
tcg_debug_assert(src == sextract64(src, 0, 22));
|
||||
return tcg_opc_a5(qp, OPC_ADDL_A5, dst, src, TCG_REG_R0);
|
||||
}
|
||||
|
||||
|
@@ -35,7 +35,7 @@
|
||||
#define LO_OFF (MIPS_BE * 4)
|
||||
#define HI_OFF (4 - LO_OFF)
|
||||
|
||||
#ifndef NDEBUG
|
||||
#ifdef CONFIG_DEBUG_TCG
|
||||
static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
|
||||
"zero",
|
||||
"at",
|
||||
@@ -127,7 +127,7 @@ static inline uint32_t reloc_pc16_val(tcg_insn_unit *pc, tcg_insn_unit *target)
|
||||
{
|
||||
/* Let the compiler perform the right-shift as part of the arithmetic. */
|
||||
ptrdiff_t disp = target - (pc + 1);
|
||||
assert(disp == (int16_t)disp);
|
||||
tcg_debug_assert(disp == (int16_t)disp);
|
||||
return disp & 0xffff;
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ static inline void reloc_pc16(tcg_insn_unit *pc, tcg_insn_unit *target)
|
||||
|
||||
static inline uint32_t reloc_26_val(tcg_insn_unit *pc, tcg_insn_unit *target)
|
||||
{
|
||||
assert((((uintptr_t)pc ^ (uintptr_t)target) & 0xf0000000) == 0);
|
||||
tcg_debug_assert((((uintptr_t)pc ^ (uintptr_t)target) & 0xf0000000) == 0);
|
||||
return ((uintptr_t)target >> 2) & 0x3ffffff;
|
||||
}
|
||||
|
||||
@@ -150,8 +150,8 @@ static inline void reloc_26(tcg_insn_unit *pc, tcg_insn_unit *target)
|
||||
static void patch_reloc(tcg_insn_unit *code_ptr, int type,
|
||||
intptr_t value, intptr_t addend)
|
||||
{
|
||||
assert(type == R_MIPS_PC16);
|
||||
assert(addend == 0);
|
||||
tcg_debug_assert(type == R_MIPS_PC16);
|
||||
tcg_debug_assert(addend == 0);
|
||||
reloc_pc16(code_ptr, (tcg_insn_unit *)value);
|
||||
}
|
||||
|
||||
@@ -432,7 +432,7 @@ static bool tcg_out_opc_jmp(TCGContext *s, MIPSInsn opc, void *target)
|
||||
if ((from ^ dest) & -(1 << 28)) {
|
||||
return false;
|
||||
}
|
||||
assert((dest & 3) == 0);
|
||||
tcg_debug_assert((dest & 3) == 0);
|
||||
|
||||
inst = opc;
|
||||
inst |= (dest >> 2) & 0x3ffffff;
|
||||
@@ -807,9 +807,9 @@ static void tcg_out_setcond2(TCGContext *s, TCGCond cond, TCGReg ret,
|
||||
TCGReg tmp0 = TCG_TMP0;
|
||||
TCGReg tmp1 = ret;
|
||||
|
||||
assert(ret != TCG_TMP0);
|
||||
tcg_debug_assert(ret != TCG_TMP0);
|
||||
if (ret == ah || ret == bh) {
|
||||
assert(ret != TCG_TMP1);
|
||||
tcg_debug_assert(ret != TCG_TMP1);
|
||||
tmp1 = TCG_TMP1;
|
||||
}
|
||||
|
||||
@@ -1470,8 +1470,8 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
|
||||
case INDEX_op_and_i32:
|
||||
if (c2 && a2 != (uint16_t)a2) {
|
||||
int msb = ctz32(~a2) - 1;
|
||||
assert(use_mips32r2_instructions);
|
||||
assert(is_p2m1(a2));
|
||||
tcg_debug_assert(use_mips32r2_instructions);
|
||||
tcg_debug_assert(is_p2m1(a2));
|
||||
tcg_out_opc_bf(s, OPC_EXT, a0, a1, msb, 0);
|
||||
break;
|
||||
}
|
||||
|
@@ -959,12 +959,12 @@ void tcg_optimize(TCGContext *s)
|
||||
}
|
||||
|
||||
if (partmask == 0) {
|
||||
assert(nb_oargs == 1);
|
||||
tcg_debug_assert(nb_oargs == 1);
|
||||
tcg_opt_gen_movi(s, op, args, args[0], 0);
|
||||
continue;
|
||||
}
|
||||
if (affected == 0) {
|
||||
assert(nb_oargs == 1);
|
||||
tcg_debug_assert(nb_oargs == 1);
|
||||
tcg_opt_gen_mov(s, op, args, args[0], args[1]);
|
||||
continue;
|
||||
}
|
||||
|
@@ -89,7 +89,7 @@ static bool have_isa_2_06;
|
||||
#define TCG_GUEST_BASE_REG 30
|
||||
#endif
|
||||
|
||||
#ifndef NDEBUG
|
||||
#ifdef CONFIG_DEBUG_TCG
|
||||
static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
|
||||
"r0",
|
||||
"r1",
|
||||
@@ -207,7 +207,7 @@ static inline bool in_range_b(tcg_target_long target)
|
||||
static uint32_t reloc_pc24_val(tcg_insn_unit *pc, tcg_insn_unit *target)
|
||||
{
|
||||
ptrdiff_t disp = tcg_ptr_byte_diff(target, pc);
|
||||
assert(in_range_b(disp));
|
||||
tcg_debug_assert(in_range_b(disp));
|
||||
return disp & 0x3fffffc;
|
||||
}
|
||||
|
||||
@@ -219,7 +219,7 @@ static void reloc_pc24(tcg_insn_unit *pc, tcg_insn_unit *target)
|
||||
static uint16_t reloc_pc14_val(tcg_insn_unit *pc, tcg_insn_unit *target)
|
||||
{
|
||||
ptrdiff_t disp = tcg_ptr_byte_diff(target, pc);
|
||||
assert(disp == (int16_t) disp);
|
||||
tcg_debug_assert(disp == (int16_t) disp);
|
||||
return disp & 0xfffc;
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ static void patch_reloc(tcg_insn_unit *code_ptr, int type,
|
||||
{
|
||||
tcg_insn_unit *target = (tcg_insn_unit *)value;
|
||||
|
||||
assert(addend == 0);
|
||||
tcg_debug_assert(addend == 0);
|
||||
switch (type) {
|
||||
case R_PPC_REL14:
|
||||
reloc_pc14(code_ptr, target);
|
||||
@@ -565,7 +565,7 @@ static void tcg_out_mov(TCGContext *s, TCGType type, TCGReg ret, TCGReg arg)
|
||||
static inline void tcg_out_rld(TCGContext *s, int op, TCGReg ra, TCGReg rs,
|
||||
int sh, int mb)
|
||||
{
|
||||
assert(TCG_TARGET_REG_BITS == 64);
|
||||
tcg_debug_assert(TCG_TARGET_REG_BITS == 64);
|
||||
sh = SH(sh & 0x1f) | (((sh >> 5) & 1) << 1);
|
||||
mb = MB64((mb >> 5) | ((mb << 1) & 0x3f));
|
||||
tcg_out32(s, op | RA(ra) | RS(rs) | sh | mb);
|
||||
@@ -718,7 +718,7 @@ static void tcg_out_andi64(TCGContext *s, TCGReg dst, TCGReg src, uint64_t c)
|
||||
{
|
||||
int mb, me;
|
||||
|
||||
assert(TCG_TARGET_REG_BITS == 64);
|
||||
tcg_debug_assert(TCG_TARGET_REG_BITS == 64);
|
||||
if (mask64_operand(c, &mb, &me)) {
|
||||
if (mb == 0) {
|
||||
tcg_out_rld(s, RLDICR, dst, src, 0, me);
|
||||
@@ -834,7 +834,7 @@ static inline void tcg_out_ld(TCGContext *s, TCGType type, TCGReg ret,
|
||||
{
|
||||
int opi, opx;
|
||||
|
||||
assert(TCG_TARGET_REG_BITS == 64 || type == TCG_TYPE_I32);
|
||||
tcg_debug_assert(TCG_TARGET_REG_BITS == 64 || type == TCG_TYPE_I32);
|
||||
if (type == TCG_TYPE_I32) {
|
||||
opi = LWZ, opx = LWZX;
|
||||
} else {
|
||||
@@ -848,7 +848,7 @@ static inline void tcg_out_st(TCGContext *s, TCGType type, TCGReg arg,
|
||||
{
|
||||
int opi, opx;
|
||||
|
||||
assert(TCG_TARGET_REG_BITS == 64 || type == TCG_TYPE_I32);
|
||||
tcg_debug_assert(TCG_TARGET_REG_BITS == 64 || type == TCG_TYPE_I32);
|
||||
if (type == TCG_TYPE_I32) {
|
||||
opi = STW, opx = STWX;
|
||||
} else {
|
||||
@@ -981,7 +981,7 @@ static void tcg_out_setcond(TCGContext *s, TCGType type, TCGCond cond,
|
||||
{
|
||||
int crop, sh;
|
||||
|
||||
assert(TCG_TARGET_REG_BITS == 64 || type == TCG_TYPE_I32);
|
||||
tcg_debug_assert(TCG_TARGET_REG_BITS == 64 || type == TCG_TYPE_I32);
|
||||
|
||||
/* Ignore high bits of a potential constant arg2. */
|
||||
if (type == TCG_TYPE_I32) {
|
||||
@@ -1251,11 +1251,11 @@ void ppc_tb_set_jmp_target(uintptr_t jmp_addr, uintptr_t addr)
|
||||
diff = addr - (uintptr_t)tb_ret_addr;
|
||||
lo = (int16_t)diff;
|
||||
hi = (int32_t)(diff - lo);
|
||||
assert(diff == hi + lo);
|
||||
tcg_debug_assert(diff == hi + lo);
|
||||
i1 = ADDIS | TAI(TCG_REG_TMP1, TCG_REG_RA, hi >> 16);
|
||||
i2 = ADDI | TAI(TCG_REG_TMP1, TCG_REG_TMP1, lo);
|
||||
} else {
|
||||
assert(TCG_TARGET_REG_BITS == 32 || addr == (int32_t)addr);
|
||||
tcg_debug_assert(TCG_TARGET_REG_BITS == 32 || addr == (int32_t)addr);
|
||||
i1 = ADDIS | TAI(TCG_REG_TMP1, 0, addr >> 16);
|
||||
i2 = ORI | SAI(TCG_REG_TMP1, TCG_REG_TMP1, addr);
|
||||
}
|
||||
@@ -1857,7 +1857,7 @@ static void tcg_target_qemu_prologue(TCGContext *s)
|
||||
}
|
||||
|
||||
/* Epilogue */
|
||||
assert(tb_ret_addr == s->code_ptr);
|
||||
tcg_debug_assert(tb_ret_addr == s->code_ptr);
|
||||
|
||||
tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_R0, TCG_REG_R1, FRAME_SIZE+LR_OFFSET);
|
||||
for (i = 0; i < ARRAY_SIZE(tcg_target_callee_save_regs); ++i) {
|
||||
|
@@ -221,7 +221,7 @@ typedef enum S390Opcode {
|
||||
RX_STH = 0x40,
|
||||
} S390Opcode;
|
||||
|
||||
#ifndef NDEBUG
|
||||
#ifdef CONFIG_DEBUG_TCG
|
||||
static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
|
||||
"%r0", "%r1", "%r2", "%r3", "%r4", "%r5", "%r6", "%r7",
|
||||
"%r8", "%r9", "%r10" "%r11" "%r12" "%r13" "%r14" "%r15"
|
||||
@@ -348,15 +348,15 @@ static void patch_reloc(tcg_insn_unit *code_ptr, int type,
|
||||
intptr_t value, intptr_t addend)
|
||||
{
|
||||
intptr_t pcrel2 = (tcg_insn_unit *)value - (code_ptr - 1);
|
||||
assert(addend == -2);
|
||||
tcg_debug_assert(addend == -2);
|
||||
|
||||
switch (type) {
|
||||
case R_390_PC16DBL:
|
||||
assert(pcrel2 == (int16_t)pcrel2);
|
||||
tcg_debug_assert(pcrel2 == (int16_t)pcrel2);
|
||||
tcg_patch16(code_ptr, pcrel2);
|
||||
break;
|
||||
case R_390_PC32DBL:
|
||||
assert(pcrel2 == (int32_t)pcrel2);
|
||||
tcg_debug_assert(pcrel2 == (int32_t)pcrel2);
|
||||
tcg_patch32(code_ptr, pcrel2);
|
||||
break;
|
||||
default:
|
||||
|
@@ -24,7 +24,7 @@
|
||||
|
||||
#include "tcg-be-null.h"
|
||||
|
||||
#ifndef NDEBUG
|
||||
#ifdef CONFIG_DEBUG_TCG
|
||||
static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
|
||||
"%g0",
|
||||
"%g1",
|
||||
@@ -289,7 +289,7 @@ static void patch_reloc(tcg_insn_unit *code_ptr, int type,
|
||||
{
|
||||
uint32_t insn;
|
||||
|
||||
assert(addend == 0);
|
||||
tcg_debug_assert(addend == 0);
|
||||
value = tcg_ptr_byte_diff((tcg_insn_unit *)value, code_ptr);
|
||||
|
||||
switch (type) {
|
||||
@@ -1108,7 +1108,7 @@ static void tcg_out_qemu_ld(TCGContext *s, TCGReg data, TCGReg addr,
|
||||
} else {
|
||||
func = qemu_ld_trampoline[memop & (MO_BSWAP | MO_SSIZE)];
|
||||
}
|
||||
assert(func != NULL);
|
||||
tcg_debug_assert(func != NULL);
|
||||
tcg_out_call_nodelay(s, func);
|
||||
/* delay slot */
|
||||
tcg_out_movi(s, TCG_TYPE_I32, param, oi);
|
||||
@@ -1187,7 +1187,7 @@ static void tcg_out_qemu_st(TCGContext *s, TCGReg data, TCGReg addr,
|
||||
tcg_out_mov(s, TCG_TYPE_REG, param++, data);
|
||||
|
||||
func = qemu_st_trampoline[memop & (MO_BSWAP | MO_SIZE)];
|
||||
assert(func != NULL);
|
||||
tcg_debug_assert(func != NULL);
|
||||
tcg_out_call_nodelay(s, func);
|
||||
/* delay slot */
|
||||
tcg_out_movi(s, TCG_TYPE_I32, param, oi);
|
||||
@@ -1645,7 +1645,7 @@ void tb_set_jmp_target1(uintptr_t jmp_addr, uintptr_t addr)
|
||||
|
||||
/* We can reach the entire address space for 32-bit. For 64-bit
|
||||
the code_gen_buffer can't be larger than 2GB. */
|
||||
assert(disp == (int32_t)disp);
|
||||
tcg_debug_assert(disp == (int32_t)disp);
|
||||
|
||||
*ptr = CALL | (uint32_t)disp >> 2;
|
||||
flush_icache_range(jmp_addr, jmp_addr + 4);
|
||||
|
45
tcg/tcg.c
45
tcg/tcg.c
@@ -31,11 +31,6 @@
|
||||
/* Define to jump the ELF file used to communicate with GDB. */
|
||||
#undef DEBUG_JIT
|
||||
|
||||
#if !defined(CONFIG_DEBUG_TCG) && !defined(NDEBUG)
|
||||
/* define it to suppress various consistency checks (faster) */
|
||||
#define NDEBUG
|
||||
#endif
|
||||
|
||||
#include "qemu/cutils.h"
|
||||
#include "qemu/host-utils.h"
|
||||
#include "qemu/timer.h"
|
||||
@@ -229,7 +224,7 @@ static void tcg_out_label(TCGContext *s, TCGLabel *l, tcg_insn_unit *ptr)
|
||||
intptr_t value = (intptr_t)ptr;
|
||||
TCGRelocation *r;
|
||||
|
||||
assert(!l->has_value);
|
||||
tcg_debug_assert(!l->has_value);
|
||||
|
||||
for (r = l->u.first_reloc; r != NULL; r = r->next) {
|
||||
patch_reloc(r->ptr, r->type, value, r->addend);
|
||||
@@ -645,9 +640,9 @@ static void tcg_temp_free_internal(int idx)
|
||||
}
|
||||
#endif
|
||||
|
||||
assert(idx >= s->nb_globals && idx < s->nb_temps);
|
||||
tcg_debug_assert(idx >= s->nb_globals && idx < s->nb_temps);
|
||||
ts = &s->temps[idx];
|
||||
assert(ts->temp_allocated != 0);
|
||||
tcg_debug_assert(ts->temp_allocated != 0);
|
||||
ts->temp_allocated = 0;
|
||||
|
||||
k = ts->base_type + (ts->temp_local ? TCG_TYPE_COUNT : 0);
|
||||
@@ -948,7 +943,7 @@ static char *tcg_get_arg_str_ptr(TCGContext *s, char *buf, int buf_size,
|
||||
static char *tcg_get_arg_str_idx(TCGContext *s, char *buf,
|
||||
int buf_size, int idx)
|
||||
{
|
||||
assert(idx >= 0 && idx < s->nb_temps);
|
||||
tcg_debug_assert(idx >= 0 && idx < s->nb_temps);
|
||||
return tcg_get_arg_str_ptr(s, buf, buf_size, &s->temps[idx]);
|
||||
}
|
||||
|
||||
@@ -1191,25 +1186,25 @@ void tcg_add_target_add_op_defs(const TCGTargetOpDef *tdefs)
|
||||
if (tdefs->op == (TCGOpcode)-1)
|
||||
break;
|
||||
op = tdefs->op;
|
||||
assert((unsigned)op < NB_OPS);
|
||||
tcg_debug_assert((unsigned)op < NB_OPS);
|
||||
def = &tcg_op_defs[op];
|
||||
#if defined(CONFIG_DEBUG_TCG)
|
||||
/* Duplicate entry in op definitions? */
|
||||
assert(!def->used);
|
||||
tcg_debug_assert(!def->used);
|
||||
def->used = 1;
|
||||
#endif
|
||||
nb_args = def->nb_iargs + def->nb_oargs;
|
||||
for(i = 0; i < nb_args; i++) {
|
||||
ct_str = tdefs->args_ct_str[i];
|
||||
/* Incomplete TCGTargetOpDef entry? */
|
||||
assert(ct_str != NULL);
|
||||
tcg_debug_assert(ct_str != NULL);
|
||||
tcg_regset_clear(def->args_ct[i].u.regs);
|
||||
def->args_ct[i].ct = 0;
|
||||
if (ct_str[0] >= '0' && ct_str[0] <= '9') {
|
||||
int oarg;
|
||||
oarg = ct_str[0] - '0';
|
||||
assert(oarg < def->nb_oargs);
|
||||
assert(def->args_ct[oarg].ct & TCG_CT_REG);
|
||||
tcg_debug_assert(oarg < def->nb_oargs);
|
||||
tcg_debug_assert(def->args_ct[oarg].ct & TCG_CT_REG);
|
||||
/* TCG_CT_ALIAS is for the output arguments. The input
|
||||
argument is tagged with TCG_CT_IALIAS. */
|
||||
def->args_ct[i] = def->args_ct[oarg];
|
||||
@@ -1238,7 +1233,7 @@ void tcg_add_target_add_op_defs(const TCGTargetOpDef *tdefs)
|
||||
}
|
||||
|
||||
/* TCGTargetOpDef entry with too much information? */
|
||||
assert(i == TCG_MAX_OP_ARGS || tdefs->args_ct_str[i] == NULL);
|
||||
tcg_debug_assert(i == TCG_MAX_OP_ARGS || tdefs->args_ct_str[i] == NULL);
|
||||
|
||||
/* sort the constraints (XXX: this is just an heuristic) */
|
||||
sort_constraints(def, 0, def->nb_oargs);
|
||||
@@ -1586,7 +1581,7 @@ static void tcg_liveness_analysis(TCGContext *s)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef NDEBUG
|
||||
#ifdef CONFIG_DEBUG_TCG
|
||||
static void dump_regs(TCGContext *s)
|
||||
{
|
||||
TCGTemp *ts;
|
||||
@@ -1685,7 +1680,7 @@ static void tcg_reg_sync(TCGContext *s, TCGReg reg, TCGRegSet allocated_regs)
|
||||
{
|
||||
TCGTemp *ts = s->reg_to_temp[reg];
|
||||
|
||||
assert(ts->val_type == TEMP_VAL_REG);
|
||||
tcg_debug_assert(ts->val_type == TEMP_VAL_REG);
|
||||
if (!ts->mem_coherent && !ts->fixed_reg) {
|
||||
if (!ts->mem_allocated) {
|
||||
temp_allocate_frame(s, temp_idx(s, ts));
|
||||
@@ -1822,7 +1817,7 @@ static inline void temp_save(TCGContext *s, TCGTemp *ts,
|
||||
/* ??? Liveness does not yet incorporate indirect bases. */
|
||||
if (!ts->indirect_base) {
|
||||
/* The liveness analysis already ensures that globals are back
|
||||
in memory. Keep an assert for safety. */
|
||||
in memory. Keep an tcg_debug_assert for safety. */
|
||||
tcg_debug_assert(ts->val_type == TEMP_VAL_MEM || ts->fixed_reg);
|
||||
return;
|
||||
}
|
||||
@@ -1880,8 +1875,8 @@ static void tcg_reg_alloc_bb_end(TCGContext *s, TCGRegSet allocated_regs)
|
||||
/* ??? Liveness does not yet incorporate indirect bases. */
|
||||
if (!ts->indirect_base) {
|
||||
/* The liveness analysis already ensures that temps are dead.
|
||||
Keep an assert for safety. */
|
||||
assert(ts->val_type == TEMP_VAL_DEAD);
|
||||
Keep an tcg_debug_assert for safety. */
|
||||
tcg_debug_assert(ts->val_type == TEMP_VAL_DEAD);
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
@@ -1952,9 +1947,9 @@ static void tcg_reg_alloc_mov(TCGContext *s, const TCGOpDef *def,
|
||||
if (IS_DEAD_ARG(0) && !ots->fixed_reg) {
|
||||
/* mov to a non-saved dead register makes no sense (even with
|
||||
liveness analysis disabled). */
|
||||
assert(NEED_SYNC_ARG(0));
|
||||
tcg_debug_assert(NEED_SYNC_ARG(0));
|
||||
/* The code above should have moved the temp to a register. */
|
||||
assert(ts->val_type == TEMP_VAL_REG);
|
||||
tcg_debug_assert(ts->val_type == TEMP_VAL_REG);
|
||||
if (!ots->mem_allocated) {
|
||||
temp_allocate_frame(s, args[0]);
|
||||
}
|
||||
@@ -1982,7 +1977,7 @@ static void tcg_reg_alloc_mov(TCGContext *s, const TCGOpDef *def,
|
||||
} else {
|
||||
/* The code in the first if block should have moved the
|
||||
temp to a register. */
|
||||
assert(ts->val_type == TEMP_VAL_REG);
|
||||
tcg_debug_assert(ts->val_type == TEMP_VAL_REG);
|
||||
if (IS_DEAD_ARG(1) && !ts->fixed_reg && !ots->fixed_reg) {
|
||||
/* the mov can be suppressed */
|
||||
if (ots->val_type == TEMP_VAL_REG) {
|
||||
@@ -2283,7 +2278,7 @@ static void tcg_reg_alloc_call(TCGContext *s, int nb_oargs, int nb_iargs,
|
||||
arg = args[i];
|
||||
ts = &s->temps[arg];
|
||||
reg = tcg_target_call_oarg_regs[i];
|
||||
assert(s->reg_to_temp[reg] == NULL);
|
||||
tcg_debug_assert(s->reg_to_temp[reg] == NULL);
|
||||
|
||||
if (ts->fixed_reg) {
|
||||
if (ts->reg != reg) {
|
||||
@@ -2454,7 +2449,7 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb)
|
||||
tcg_reg_alloc_op(s, def, opc, args, dead_args, sync_args);
|
||||
break;
|
||||
}
|
||||
#ifndef NDEBUG
|
||||
#ifdef CONFIG_DEBUG_TCG
|
||||
check_regs(s);
|
||||
#endif
|
||||
/* Test for (pending) buffer overflow. The assumption is that any
|
||||
|
@@ -315,7 +315,7 @@ static const int tcg_target_call_oarg_regs[] = {
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifndef NDEBUG
|
||||
#ifdef CONFIG_DEBUG_TCG
|
||||
static const char *const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
|
||||
"r00",
|
||||
"r01",
|
||||
@@ -360,9 +360,9 @@ static void patch_reloc(tcg_insn_unit *code_ptr, int type,
|
||||
intptr_t value, intptr_t addend)
|
||||
{
|
||||
/* tcg_out_reloc always uses the same type, addend. */
|
||||
assert(type == sizeof(tcg_target_long));
|
||||
assert(addend == 0);
|
||||
assert(value != 0);
|
||||
tcg_debug_assert(type == sizeof(tcg_target_long));
|
||||
tcg_debug_assert(addend == 0);
|
||||
tcg_debug_assert(value != 0);
|
||||
if (TCG_TARGET_REG_BITS == 32) {
|
||||
tcg_patch32(code_ptr, value);
|
||||
} else {
|
||||
@@ -419,7 +419,7 @@ static void tcg_out_op_t(TCGContext *s, TCGOpcode op)
|
||||
/* Write register. */
|
||||
static void tcg_out_r(TCGContext *s, TCGArg t0)
|
||||
{
|
||||
assert(t0 < TCG_TARGET_NB_REGS);
|
||||
tcg_debug_assert(t0 < TCG_TARGET_NB_REGS);
|
||||
tcg_out8(s, t0);
|
||||
}
|
||||
|
||||
@@ -427,7 +427,7 @@ static void tcg_out_r(TCGContext *s, TCGArg t0)
|
||||
static void tcg_out_ri(TCGContext *s, int const_arg, TCGArg arg)
|
||||
{
|
||||
if (const_arg) {
|
||||
assert(const_arg == 1);
|
||||
tcg_debug_assert(const_arg == 1);
|
||||
tcg_out8(s, TCG_CONST);
|
||||
tcg_out_i(s, arg);
|
||||
} else {
|
||||
@@ -439,7 +439,7 @@ static void tcg_out_ri(TCGContext *s, int const_arg, TCGArg arg)
|
||||
static void tcg_out_ri32(TCGContext *s, int const_arg, TCGArg arg)
|
||||
{
|
||||
if (const_arg) {
|
||||
assert(const_arg == 1);
|
||||
tcg_debug_assert(const_arg == 1);
|
||||
tcg_out8(s, TCG_CONST);
|
||||
tcg_out32(s, arg);
|
||||
} else {
|
||||
@@ -452,7 +452,7 @@ static void tcg_out_ri32(TCGContext *s, int const_arg, TCGArg arg)
|
||||
static void tcg_out_ri64(TCGContext *s, int const_arg, TCGArg arg)
|
||||
{
|
||||
if (const_arg) {
|
||||
assert(const_arg == 1);
|
||||
tcg_debug_assert(const_arg == 1);
|
||||
tcg_out8(s, TCG_CONST);
|
||||
tcg_out64(s, arg);
|
||||
} else {
|
||||
@@ -466,7 +466,7 @@ static void tci_out_label(TCGContext *s, TCGLabel *label)
|
||||
{
|
||||
if (label->has_value) {
|
||||
tcg_out_i(s, label->u.value);
|
||||
assert(label->u.value);
|
||||
tcg_debug_assert(label->u.value);
|
||||
} else {
|
||||
tcg_out_reloc(s, s->code_ptr, sizeof(tcg_target_ulong), label, 0);
|
||||
s->code_ptr += sizeof(tcg_target_ulong);
|
||||
@@ -483,12 +483,12 @@ static void tcg_out_ld(TCGContext *s, TCGType type, TCGReg ret, TCGReg arg1,
|
||||
tcg_out_r(s, arg1);
|
||||
tcg_out32(s, arg2);
|
||||
} else {
|
||||
assert(type == TCG_TYPE_I64);
|
||||
tcg_debug_assert(type == TCG_TYPE_I64);
|
||||
#if TCG_TARGET_REG_BITS == 64
|
||||
tcg_out_op_t(s, INDEX_op_ld_i64);
|
||||
tcg_out_r(s, ret);
|
||||
tcg_out_r(s, arg1);
|
||||
assert(arg2 == (int32_t)arg2);
|
||||
tcg_debug_assert(arg2 == (int32_t)arg2);
|
||||
tcg_out32(s, arg2);
|
||||
#else
|
||||
TODO();
|
||||
@@ -500,7 +500,7 @@ static void tcg_out_ld(TCGContext *s, TCGType type, TCGReg ret, TCGReg arg1,
|
||||
static void tcg_out_mov(TCGContext *s, TCGType type, TCGReg ret, TCGReg arg)
|
||||
{
|
||||
uint8_t *old_code_ptr = s->code_ptr;
|
||||
assert(ret != arg);
|
||||
tcg_debug_assert(ret != arg);
|
||||
#if TCG_TARGET_REG_BITS == 32
|
||||
tcg_out_op_t(s, INDEX_op_mov_i32);
|
||||
#else
|
||||
@@ -521,7 +521,7 @@ static void tcg_out_movi(TCGContext *s, TCGType type,
|
||||
tcg_out_r(s, t0);
|
||||
tcg_out32(s, arg32);
|
||||
} else {
|
||||
assert(type == TCG_TYPE_I64);
|
||||
tcg_debug_assert(type == TCG_TYPE_I64);
|
||||
#if TCG_TARGET_REG_BITS == 64
|
||||
tcg_out_op_t(s, INDEX_op_movi_i64);
|
||||
tcg_out_r(s, t0);
|
||||
@@ -555,14 +555,14 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args,
|
||||
case INDEX_op_goto_tb:
|
||||
if (s->tb_jmp_offset) {
|
||||
/* Direct jump method. */
|
||||
assert(args[0] < ARRAY_SIZE(s->tb_jmp_offset));
|
||||
tcg_debug_assert(args[0] < ARRAY_SIZE(s->tb_jmp_offset));
|
||||
s->tb_jmp_offset[args[0]] = tcg_current_code_size(s);
|
||||
tcg_out32(s, 0);
|
||||
} else {
|
||||
/* Indirect jump method. */
|
||||
TODO();
|
||||
}
|
||||
assert(args[0] < ARRAY_SIZE(s->tb_next_offset));
|
||||
tcg_debug_assert(args[0] < ARRAY_SIZE(s->tb_next_offset));
|
||||
s->tb_next_offset[args[0]] = tcg_current_code_size(s);
|
||||
break;
|
||||
case INDEX_op_br:
|
||||
@@ -613,7 +613,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args,
|
||||
case INDEX_op_st_i64:
|
||||
tcg_out_r(s, args[0]);
|
||||
tcg_out_r(s, args[1]);
|
||||
assert(args[2] == (int32_t)args[2]);
|
||||
tcg_debug_assert(args[2] == (int32_t)args[2]);
|
||||
tcg_out32(s, args[2]);
|
||||
break;
|
||||
case INDEX_op_add_i32:
|
||||
@@ -640,9 +640,9 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args,
|
||||
tcg_out_r(s, args[0]);
|
||||
tcg_out_r(s, args[1]);
|
||||
tcg_out_r(s, args[2]);
|
||||
assert(args[3] <= UINT8_MAX);
|
||||
tcg_debug_assert(args[3] <= UINT8_MAX);
|
||||
tcg_out8(s, args[3]);
|
||||
assert(args[4] <= UINT8_MAX);
|
||||
tcg_debug_assert(args[4] <= UINT8_MAX);
|
||||
tcg_out8(s, args[4]);
|
||||
break;
|
||||
|
||||
@@ -671,9 +671,9 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args,
|
||||
tcg_out_r(s, args[0]);
|
||||
tcg_out_r(s, args[1]);
|
||||
tcg_out_r(s, args[2]);
|
||||
assert(args[3] <= UINT8_MAX);
|
||||
tcg_debug_assert(args[3] <= UINT8_MAX);
|
||||
tcg_out8(s, args[3]);
|
||||
assert(args[4] <= UINT8_MAX);
|
||||
tcg_debug_assert(args[4] <= UINT8_MAX);
|
||||
tcg_out8(s, args[4]);
|
||||
break;
|
||||
case INDEX_op_div_i64: /* Optional (TCG_TARGET_HAS_div_i64). */
|
||||
@@ -819,7 +819,7 @@ static void tcg_out_st(TCGContext *s, TCGType type, TCGReg arg, TCGReg arg1,
|
||||
tcg_out_r(s, arg1);
|
||||
tcg_out32(s, arg2);
|
||||
} else {
|
||||
assert(type == TCG_TYPE_I64);
|
||||
tcg_debug_assert(type == TCG_TYPE_I64);
|
||||
#if TCG_TARGET_REG_BITS == 64
|
||||
tcg_out_op_t(s, INDEX_op_st_i64);
|
||||
tcg_out_r(s, arg);
|
||||
@@ -850,7 +850,7 @@ static void tcg_target_init(TCGContext *s)
|
||||
#endif
|
||||
|
||||
/* The current code uses uint8_t for tcg operations. */
|
||||
assert(tcg_op_defs_max <= UINT8_MAX);
|
||||
tcg_debug_assert(tcg_op_defs_max <= UINT8_MAX);
|
||||
|
||||
/* Registers available for 32 bit operations. */
|
||||
tcg_regset_set32(tcg_target_available_regs[TCG_TYPE_I32], 0,
|
||||
|
@@ -83,7 +83,9 @@ check-unit-y += tests/test-crypto-cipher$(EXESUF)
|
||||
check-unit-y += tests/test-crypto-secret$(EXESUF)
|
||||
check-unit-$(CONFIG_GNUTLS) += tests/test-crypto-tlscredsx509$(EXESUF)
|
||||
check-unit-$(CONFIG_GNUTLS) += tests/test-crypto-tlssession$(EXESUF)
|
||||
#check-unit-$(CONFIG_LINUX) += tests/test-qga$(EXESUF)
|
||||
ifneq (,$(findstring qemu-ga,$(TOOLS)))
|
||||
check-unit-$(CONFIG_LINUX) += tests/test-qga$(EXESUF)
|
||||
endif
|
||||
check-unit-y += tests/test-timed-average$(EXESUF)
|
||||
check-unit-y += tests/test-io-task$(EXESUF)
|
||||
check-unit-y += tests/test-io-channel-socket$(EXESUF)
|
||||
|
@@ -25,7 +25,6 @@ seq=`basename $0`
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
tmp=/tmp/$$
|
||||
status=1 # failure is the default!
|
||||
|
||||
_cleanup()
|
||||
|
@@ -25,7 +25,6 @@ seq=`basename $0`
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
tmp=/tmp/$$
|
||||
status=1 # failure is the default!
|
||||
|
||||
_cleanup()
|
||||
|
@@ -25,7 +25,6 @@ seq=`basename $0`
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
tmp=/tmp/$$
|
||||
status=1 # failure is the default!
|
||||
|
||||
_cleanup()
|
||||
|
@@ -25,7 +25,6 @@ seq=`basename $0`
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
tmp=/tmp/$$
|
||||
status=1 # failure is the default!
|
||||
|
||||
_cleanup()
|
||||
|
@@ -28,7 +28,6 @@ seq=`basename $0`
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
tmp=/tmp/$$
|
||||
status=1 # failure is the default!
|
||||
|
||||
_cleanup()
|
||||
|
@@ -25,7 +25,6 @@ seq=`basename $0`
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
tmp=/tmp/$$
|
||||
status=1 # failure is the default!
|
||||
|
||||
_cleanup()
|
||||
|
@@ -25,7 +25,6 @@ seq=`basename $0`
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
tmp=/tmp/$$
|
||||
status=1 # failure is the default!
|
||||
|
||||
_cleanup()
|
||||
|
@@ -25,7 +25,6 @@ seq=`basename $0`
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
tmp=/tmp/$$
|
||||
status=1 # failure is the default!
|
||||
|
||||
_cleanup()
|
||||
|
@@ -25,7 +25,6 @@ seq=`basename $0`
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
tmp=/tmp/$$
|
||||
status=1 # failure is the default!
|
||||
|
||||
_cleanup()
|
||||
|
@@ -25,7 +25,6 @@ seq=`basename $0`
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
tmp=/tmp/$$
|
||||
status=1 # failure is the default!
|
||||
|
||||
_cleanup()
|
||||
|
@@ -27,7 +27,6 @@ seq=`basename $0`
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
tmp=/tmp/$$
|
||||
status=1 # failure is the default!
|
||||
|
||||
_cleanup()
|
||||
|
@@ -25,7 +25,6 @@ seq=`basename $0`
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
tmp=/tmp/$$
|
||||
status=1 # failure is the default!
|
||||
|
||||
_cleanup()
|
||||
|
@@ -27,7 +27,6 @@ seq=`basename $0`
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
tmp=/tmp/$$
|
||||
status=1 # failure is the default!
|
||||
|
||||
_cleanup()
|
||||
|
@@ -25,7 +25,6 @@ seq=`basename $0`
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
tmp=/tmp/$$
|
||||
status=1 # failure is the default!
|
||||
|
||||
_cleanup()
|
||||
|
@@ -25,7 +25,6 @@ seq=`basename $0`
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
tmp=/tmp/$$
|
||||
status=1 # failure is the default!
|
||||
|
||||
_cleanup()
|
||||
|
@@ -25,7 +25,6 @@ seq=`basename $0`
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
tmp=/tmp/$$
|
||||
status=1 # failure is the default!
|
||||
|
||||
_cleanup()
|
||||
|
@@ -27,7 +27,6 @@ seq=`basename $0`
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
tmp=/tmp/$$
|
||||
status=1 # failure is the default!
|
||||
|
||||
_cleanup()
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user