Compare commits
52 Commits
qemu-2.1.0
...
v2.1.0-rc1
Author | SHA1 | Date | |
---|---|---|---|
|
675879f6f3 | ||
|
b653282ecc | ||
|
d614cb68da | ||
|
2ed982b6a9 | ||
|
32a02d070b | ||
|
f2879a5c9e | ||
|
67d01fb806 | ||
|
75c9a1a047 | ||
|
6ec1588e09 | ||
|
834fb1b269 | ||
|
eaa4980185 | ||
|
0c6ab8c988 | ||
|
b60c60070c | ||
|
03ae4133ab | ||
|
d6c23f8a1b | ||
|
da89a1cf92 | ||
|
be5c9ddabc | ||
|
a74029f6cb | ||
|
4bce526ec4 | ||
|
128f0e6614 | ||
|
c6ea9b73b1 | ||
|
ee0f2601b9 | ||
|
56de2e5269 | ||
|
97db046678 | ||
|
9540d1f8d9 | ||
|
f811d4743b | ||
|
643f593224 | ||
|
4aba9eb138 | ||
|
f4eb32b590 | ||
|
dd67c1d7e7 | ||
|
1b3abdcccf | ||
|
448ad91db4 | ||
|
5a18e67dfd | ||
|
aa729704f4 | ||
|
a42a1facb7 | ||
|
d02f8adc6d | ||
|
37253e1ec8 | ||
|
5a0f6fd5c8 | ||
|
bc3a7f90ff | ||
|
3f0838ab85 | ||
|
8b81bb3b06 | ||
|
dd98b71f48 | ||
|
319627006a | ||
|
b7c9285b8d | ||
|
22dc50d758 | ||
|
efc8188e93 | ||
|
812c1057f6 | ||
|
85d1277e66 | ||
|
9b79a76cdb | ||
|
0462faee67 | ||
|
e06cbc376e | ||
|
9d9de254c2 |
@@ -563,6 +563,7 @@ Devices
|
||||
-------
|
||||
IDE
|
||||
M: Kevin Wolf <kwolf@redhat.com>
|
||||
M: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
S: Odd Fixes
|
||||
F: include/hw/ide.h
|
||||
F: hw/ide/
|
||||
@@ -853,7 +854,7 @@ S: Odd Fixes
|
||||
F: scripts/checkpatch.pl
|
||||
|
||||
Seccomp
|
||||
M: Eduardo Otubo <otubo@linux.vnet.ibm.com>
|
||||
M: Eduardo Otubo <eduardo.otubo@profitbricks.com>
|
||||
S: Supported
|
||||
F: qemu-seccomp.c
|
||||
F: include/sysemu/seccomp.h
|
||||
|
3
Makefile
3
Makefile
@@ -344,7 +344,8 @@ multiboot.bin linuxboot.bin kvmvapic.bin \
|
||||
s390-zipl.rom \
|
||||
s390-ccw.img \
|
||||
spapr-rtas.bin slof.bin \
|
||||
palcode-clipper
|
||||
palcode-clipper \
|
||||
u-boot.e500
|
||||
else
|
||||
BLOBS=
|
||||
endif
|
||||
|
31
block.c
31
block.c
@@ -1905,6 +1905,7 @@ void bdrv_drain_all(void)
|
||||
bool bs_busy;
|
||||
|
||||
aio_context_acquire(aio_context);
|
||||
bdrv_flush_io_queue(bs);
|
||||
bdrv_start_throttled_reqs(bs);
|
||||
bs_busy = bdrv_requests_pending(bs);
|
||||
bs_busy |= aio_poll(aio_context, bs_busy);
|
||||
@@ -5782,3 +5783,33 @@ BlockDriverState *check_to_replace_node(const char *node_name, Error **errp)
|
||||
|
||||
return to_replace_bs;
|
||||
}
|
||||
|
||||
void bdrv_io_plug(BlockDriverState *bs)
|
||||
{
|
||||
BlockDriver *drv = bs->drv;
|
||||
if (drv && drv->bdrv_io_plug) {
|
||||
drv->bdrv_io_plug(bs);
|
||||
} else if (bs->file) {
|
||||
bdrv_io_plug(bs->file);
|
||||
}
|
||||
}
|
||||
|
||||
void bdrv_io_unplug(BlockDriverState *bs)
|
||||
{
|
||||
BlockDriver *drv = bs->drv;
|
||||
if (drv && drv->bdrv_io_unplug) {
|
||||
drv->bdrv_io_unplug(bs);
|
||||
} else if (bs->file) {
|
||||
bdrv_io_unplug(bs->file);
|
||||
}
|
||||
}
|
||||
|
||||
void bdrv_flush_io_queue(BlockDriverState *bs)
|
||||
{
|
||||
BlockDriver *drv = bs->drv;
|
||||
if (drv && drv->bdrv_flush_io_queue) {
|
||||
drv->bdrv_flush_io_queue(bs);
|
||||
} else if (bs->file) {
|
||||
bdrv_flush_io_queue(bs->file);
|
||||
}
|
||||
}
|
||||
|
@@ -25,6 +25,8 @@
|
||||
*/
|
||||
#define MAX_EVENTS 128
|
||||
|
||||
#define MAX_QUEUED_IO 128
|
||||
|
||||
struct qemu_laiocb {
|
||||
BlockDriverAIOCB common;
|
||||
struct qemu_laio_state *ctx;
|
||||
@@ -36,9 +38,19 @@ struct qemu_laiocb {
|
||||
QLIST_ENTRY(qemu_laiocb) node;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct iocb *iocbs[MAX_QUEUED_IO];
|
||||
int plugged;
|
||||
unsigned int size;
|
||||
unsigned int idx;
|
||||
} LaioQueue;
|
||||
|
||||
struct qemu_laio_state {
|
||||
io_context_t ctx;
|
||||
EventNotifier e;
|
||||
|
||||
/* io queue for submit at batch */
|
||||
LaioQueue io_q;
|
||||
};
|
||||
|
||||
static inline ssize_t io_event_ret(struct io_event *ev)
|
||||
@@ -135,6 +147,79 @@ static const AIOCBInfo laio_aiocb_info = {
|
||||
.cancel = laio_cancel,
|
||||
};
|
||||
|
||||
static void ioq_init(LaioQueue *io_q)
|
||||
{
|
||||
io_q->size = MAX_QUEUED_IO;
|
||||
io_q->idx = 0;
|
||||
io_q->plugged = 0;
|
||||
}
|
||||
|
||||
static int ioq_submit(struct qemu_laio_state *s)
|
||||
{
|
||||
int ret, i = 0;
|
||||
int len = s->io_q.idx;
|
||||
|
||||
do {
|
||||
ret = io_submit(s->ctx, len, s->io_q.iocbs);
|
||||
} while (i++ < 3 && ret == -EAGAIN);
|
||||
|
||||
/* empty io queue */
|
||||
s->io_q.idx = 0;
|
||||
|
||||
if (ret < 0) {
|
||||
i = 0;
|
||||
} else {
|
||||
i = ret;
|
||||
}
|
||||
|
||||
for (; i < len; i++) {
|
||||
struct qemu_laiocb *laiocb =
|
||||
container_of(s->io_q.iocbs[i], struct qemu_laiocb, iocb);
|
||||
|
||||
laiocb->ret = (ret < 0) ? ret : -EIO;
|
||||
qemu_laio_process_completion(s, laiocb);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void ioq_enqueue(struct qemu_laio_state *s, struct iocb *iocb)
|
||||
{
|
||||
unsigned int idx = s->io_q.idx;
|
||||
|
||||
s->io_q.iocbs[idx++] = iocb;
|
||||
s->io_q.idx = idx;
|
||||
|
||||
/* submit immediately if queue is full */
|
||||
if (idx == s->io_q.size) {
|
||||
ioq_submit(s);
|
||||
}
|
||||
}
|
||||
|
||||
void laio_io_plug(BlockDriverState *bs, void *aio_ctx)
|
||||
{
|
||||
struct qemu_laio_state *s = aio_ctx;
|
||||
|
||||
s->io_q.plugged++;
|
||||
}
|
||||
|
||||
int laio_io_unplug(BlockDriverState *bs, void *aio_ctx, bool unplug)
|
||||
{
|
||||
struct qemu_laio_state *s = aio_ctx;
|
||||
int ret = 0;
|
||||
|
||||
assert(s->io_q.plugged > 0 || !unplug);
|
||||
|
||||
if (unplug && --s->io_q.plugged > 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (s->io_q.idx > 0) {
|
||||
ret = ioq_submit(s);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
BlockDriverAIOCB *laio_submit(BlockDriverState *bs, void *aio_ctx, int fd,
|
||||
int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
|
||||
BlockDriverCompletionFunc *cb, void *opaque, int type)
|
||||
@@ -168,8 +253,13 @@ BlockDriverAIOCB *laio_submit(BlockDriverState *bs, void *aio_ctx, int fd,
|
||||
}
|
||||
io_set_eventfd(&laiocb->iocb, event_notifier_get_fd(&s->e));
|
||||
|
||||
if (io_submit(s->ctx, 1, &iocbs) < 0)
|
||||
goto out_free_aiocb;
|
||||
if (!s->io_q.plugged) {
|
||||
if (io_submit(s->ctx, 1, &iocbs) < 0) {
|
||||
goto out_free_aiocb;
|
||||
}
|
||||
} else {
|
||||
ioq_enqueue(s, iocbs);
|
||||
}
|
||||
return &laiocb->common;
|
||||
|
||||
out_free_aiocb:
|
||||
@@ -204,6 +294,8 @@ void *laio_init(void)
|
||||
goto out_close_efd;
|
||||
}
|
||||
|
||||
ioq_init(&s->io_q);
|
||||
|
||||
return s;
|
||||
|
||||
out_close_efd:
|
||||
|
@@ -265,9 +265,11 @@ static uint64_t coroutine_fn mirror_iteration(MirrorBlockJob *s)
|
||||
next_sector = sector_num;
|
||||
while (nb_chunks-- > 0) {
|
||||
MirrorBuffer *buf = QSIMPLEQ_FIRST(&s->buf_free);
|
||||
size_t remaining = (nb_sectors * BDRV_SECTOR_SIZE) - op->qiov.size;
|
||||
|
||||
QSIMPLEQ_REMOVE_HEAD(&s->buf_free, next);
|
||||
s->buf_free_count--;
|
||||
qemu_iovec_add(&op->qiov, buf, s->granularity);
|
||||
qemu_iovec_add(&op->qiov, buf, MIN(s->granularity, remaining));
|
||||
|
||||
/* Advance the HBitmapIter in parallel, so that we do not examine
|
||||
* the same sector twice.
|
||||
|
@@ -40,6 +40,8 @@ BlockDriverAIOCB *laio_submit(BlockDriverState *bs, void *aio_ctx, int fd,
|
||||
BlockDriverCompletionFunc *cb, void *opaque, int type);
|
||||
void laio_detach_aio_context(void *s, AioContext *old_context);
|
||||
void laio_attach_aio_context(void *s, AioContext *new_context);
|
||||
void laio_io_plug(BlockDriverState *bs, void *aio_ctx);
|
||||
int laio_io_unplug(BlockDriverState *bs, void *aio_ctx, bool unplug);
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
|
@@ -1057,6 +1057,36 @@ static BlockDriverAIOCB *raw_aio_submit(BlockDriverState *bs,
|
||||
cb, opaque, type);
|
||||
}
|
||||
|
||||
static void raw_aio_plug(BlockDriverState *bs)
|
||||
{
|
||||
#ifdef CONFIG_LINUX_AIO
|
||||
BDRVRawState *s = bs->opaque;
|
||||
if (s->use_aio) {
|
||||
laio_io_plug(bs, s->aio_ctx);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void raw_aio_unplug(BlockDriverState *bs)
|
||||
{
|
||||
#ifdef CONFIG_LINUX_AIO
|
||||
BDRVRawState *s = bs->opaque;
|
||||
if (s->use_aio) {
|
||||
laio_io_unplug(bs, s->aio_ctx, true);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void raw_aio_flush_io_queue(BlockDriverState *bs)
|
||||
{
|
||||
#ifdef CONFIG_LINUX_AIO
|
||||
BDRVRawState *s = bs->opaque;
|
||||
if (s->use_aio) {
|
||||
laio_io_unplug(bs, s->aio_ctx, false);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static BlockDriverAIOCB *raw_aio_readv(BlockDriverState *bs,
|
||||
int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
|
||||
BlockDriverCompletionFunc *cb, void *opaque)
|
||||
@@ -1133,12 +1163,12 @@ static int64_t raw_getlength(BlockDriverState *bs)
|
||||
struct stat st;
|
||||
|
||||
if (fstat(fd, &st))
|
||||
return -1;
|
||||
return -errno;
|
||||
if (S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode)) {
|
||||
struct disklabel dl;
|
||||
|
||||
if (ioctl(fd, DIOCGDINFO, &dl))
|
||||
return -1;
|
||||
return -errno;
|
||||
return (uint64_t)dl.d_secsize *
|
||||
dl.d_partitions[DISKPART(st.st_rdev)].p_size;
|
||||
} else
|
||||
@@ -1152,7 +1182,7 @@ static int64_t raw_getlength(BlockDriverState *bs)
|
||||
struct stat st;
|
||||
|
||||
if (fstat(fd, &st))
|
||||
return -1;
|
||||
return -errno;
|
||||
if (S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode)) {
|
||||
struct dkwedge_info dkw;
|
||||
|
||||
@@ -1162,7 +1192,7 @@ static int64_t raw_getlength(BlockDriverState *bs)
|
||||
struct disklabel dl;
|
||||
|
||||
if (ioctl(fd, DIOCGDINFO, &dl))
|
||||
return -1;
|
||||
return -errno;
|
||||
return (uint64_t)dl.d_secsize *
|
||||
dl.d_partitions[DISKPART(st.st_rdev)].p_size;
|
||||
}
|
||||
@@ -1175,6 +1205,7 @@ static int64_t raw_getlength(BlockDriverState *bs)
|
||||
BDRVRawState *s = bs->opaque;
|
||||
struct dk_minfo minfo;
|
||||
int ret;
|
||||
int64_t size;
|
||||
|
||||
ret = fd_open(bs);
|
||||
if (ret < 0) {
|
||||
@@ -1193,7 +1224,11 @@ static int64_t raw_getlength(BlockDriverState *bs)
|
||||
* There are reports that lseek on some devices fails, but
|
||||
* irc discussion said that contingency on contingency was overkill.
|
||||
*/
|
||||
return lseek(s->fd, 0, SEEK_END);
|
||||
size = lseek(s->fd, 0, SEEK_END);
|
||||
if (size < 0) {
|
||||
return -errno;
|
||||
}
|
||||
return size;
|
||||
}
|
||||
#elif defined(CONFIG_BSD)
|
||||
static int64_t raw_getlength(BlockDriverState *bs)
|
||||
@@ -1231,6 +1266,9 @@ again:
|
||||
size = LLONG_MAX;
|
||||
#else
|
||||
size = lseek(fd, 0LL, SEEK_END);
|
||||
if (size < 0) {
|
||||
return -errno;
|
||||
}
|
||||
#endif
|
||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
switch(s->type) {
|
||||
@@ -1247,6 +1285,9 @@ again:
|
||||
#endif
|
||||
} else {
|
||||
size = lseek(fd, 0, SEEK_END);
|
||||
if (size < 0) {
|
||||
return -errno;
|
||||
}
|
||||
}
|
||||
return size;
|
||||
}
|
||||
@@ -1255,13 +1296,18 @@ static int64_t raw_getlength(BlockDriverState *bs)
|
||||
{
|
||||
BDRVRawState *s = bs->opaque;
|
||||
int ret;
|
||||
int64_t size;
|
||||
|
||||
ret = fd_open(bs);
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
return lseek(s->fd, 0, SEEK_END);
|
||||
size = lseek(s->fd, 0, SEEK_END);
|
||||
if (size < 0) {
|
||||
return -errno;
|
||||
}
|
||||
return size;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1528,6 +1574,9 @@ static BlockDriver bdrv_file = {
|
||||
.bdrv_aio_flush = raw_aio_flush,
|
||||
.bdrv_aio_discard = raw_aio_discard,
|
||||
.bdrv_refresh_limits = raw_refresh_limits,
|
||||
.bdrv_io_plug = raw_aio_plug,
|
||||
.bdrv_io_unplug = raw_aio_unplug,
|
||||
.bdrv_flush_io_queue = raw_aio_flush_io_queue,
|
||||
|
||||
.bdrv_truncate = raw_truncate,
|
||||
.bdrv_getlength = raw_getlength,
|
||||
@@ -1927,6 +1976,9 @@ static BlockDriver bdrv_host_device = {
|
||||
.bdrv_aio_flush = raw_aio_flush,
|
||||
.bdrv_aio_discard = hdev_aio_discard,
|
||||
.bdrv_refresh_limits = raw_refresh_limits,
|
||||
.bdrv_io_plug = raw_aio_plug,
|
||||
.bdrv_io_unplug = raw_aio_unplug,
|
||||
.bdrv_flush_io_queue = raw_aio_flush_io_queue,
|
||||
|
||||
.bdrv_truncate = raw_truncate,
|
||||
.bdrv_getlength = raw_getlength,
|
||||
@@ -2072,6 +2124,9 @@ static BlockDriver bdrv_host_floppy = {
|
||||
.bdrv_aio_writev = raw_aio_writev,
|
||||
.bdrv_aio_flush = raw_aio_flush,
|
||||
.bdrv_refresh_limits = raw_refresh_limits,
|
||||
.bdrv_io_plug = raw_aio_plug,
|
||||
.bdrv_io_unplug = raw_aio_unplug,
|
||||
.bdrv_flush_io_queue = raw_aio_flush_io_queue,
|
||||
|
||||
.bdrv_truncate = raw_truncate,
|
||||
.bdrv_getlength = raw_getlength,
|
||||
@@ -2200,6 +2255,9 @@ static BlockDriver bdrv_host_cdrom = {
|
||||
.bdrv_aio_writev = raw_aio_writev,
|
||||
.bdrv_aio_flush = raw_aio_flush,
|
||||
.bdrv_refresh_limits = raw_refresh_limits,
|
||||
.bdrv_io_plug = raw_aio_plug,
|
||||
.bdrv_io_unplug = raw_aio_unplug,
|
||||
.bdrv_flush_io_queue = raw_aio_flush_io_queue,
|
||||
|
||||
.bdrv_truncate = raw_truncate,
|
||||
.bdrv_getlength = raw_getlength,
|
||||
@@ -2334,6 +2392,9 @@ static BlockDriver bdrv_host_cdrom = {
|
||||
.bdrv_aio_writev = raw_aio_writev,
|
||||
.bdrv_aio_flush = raw_aio_flush,
|
||||
.bdrv_refresh_limits = raw_refresh_limits,
|
||||
.bdrv_io_plug = raw_aio_plug,
|
||||
.bdrv_io_unplug = raw_aio_unplug,
|
||||
.bdrv_flush_io_queue = raw_aio_flush_io_queue,
|
||||
|
||||
.bdrv_truncate = raw_truncate,
|
||||
.bdrv_getlength = raw_getlength,
|
||||
|
@@ -3,6 +3,6 @@ libvixl_OBJS = utils.o \
|
||||
a64/decoder-a64.o \
|
||||
a64/disasm-a64.o
|
||||
|
||||
$(addprefix $(obj)/,$(libvixl_OBJS)): QEMU_CFLAGS += -I$(SRC_PATH)/disas/libvixl
|
||||
$(addprefix $(obj)/,$(libvixl_OBJS)): QEMU_CFLAGS := -I$(SRC_PATH)/disas/libvixl $(QEMU_CFLAGS)
|
||||
|
||||
common-obj-$(CONFIG_ARM_A64_DIS) += $(libvixl_OBJS)
|
||||
|
@@ -159,7 +159,7 @@ void acpi_memory_hotplug_init(MemoryRegion *as, Object *owner,
|
||||
|
||||
state->devs = g_malloc0(sizeof(*state->devs) * state->dev_count);
|
||||
memory_region_init_io(&state->io, owner, &acpi_memory_hotplug_ops, state,
|
||||
"apci-mem-hotplug", ACPI_MEMORY_HOTPLUG_IO_LEN);
|
||||
"acpi-mem-hotplug", ACPI_MEMORY_HOTPLUG_IO_LEN);
|
||||
memory_region_add_subregion(as, ACPI_MEMORY_HOTPLUG_BASE, &state->io);
|
||||
}
|
||||
|
||||
|
@@ -84,6 +84,7 @@ enum {
|
||||
};
|
||||
|
||||
static hwaddr motherboard_legacy_map[] = {
|
||||
[VE_NORFLASHALIAS] = 0,
|
||||
/* CS7: 0x10000000 .. 0x10020000 */
|
||||
[VE_SYSREGS] = 0x10000000,
|
||||
[VE_SP810] = 0x10001000,
|
||||
@@ -114,7 +115,6 @@ static hwaddr motherboard_legacy_map[] = {
|
||||
[VE_VIDEORAM] = 0x4c000000,
|
||||
[VE_ETHERNET] = 0x4e000000,
|
||||
[VE_USB] = 0x4f000000,
|
||||
[VE_NORFLASHALIAS] = -1, /* not present */
|
||||
};
|
||||
|
||||
static hwaddr motherboard_aseries_map[] = {
|
||||
|
@@ -84,6 +84,7 @@ static void handle_notify(EventNotifier *e)
|
||||
};
|
||||
|
||||
event_notifier_test_and_clear(&s->host_notifier);
|
||||
bdrv_io_plug(s->blk->conf.bs);
|
||||
for (;;) {
|
||||
/* Disable guest->host notifies to avoid unnecessary vmexits */
|
||||
vring_disable_notification(s->vdev, &s->vring);
|
||||
@@ -117,6 +118,7 @@ static void handle_notify(EventNotifier *e)
|
||||
break;
|
||||
}
|
||||
}
|
||||
bdrv_io_unplug(s->blk->conf.bs);
|
||||
}
|
||||
|
||||
/* Context: QEMU global mutex held */
|
||||
|
@@ -394,7 +394,8 @@ static int qdev_add_one_global(QemuOpts *opts, void *opaque)
|
||||
g->driver = qemu_opt_get(opts, "driver");
|
||||
g->property = qemu_opt_get(opts, "property");
|
||||
g->value = qemu_opt_get(opts, "value");
|
||||
oc = object_class_by_name(g->driver);
|
||||
oc = object_class_dynamic_cast(object_class_by_name(g->driver),
|
||||
TYPE_DEVICE);
|
||||
if (oc) {
|
||||
DeviceClass *dc = DEVICE_CLASS(oc);
|
||||
|
||||
|
@@ -957,7 +957,13 @@ static void device_initfn(Object *obj)
|
||||
|
||||
static void device_post_init(Object *obj)
|
||||
{
|
||||
qdev_prop_set_globals(DEVICE(obj), &error_abort);
|
||||
Error *err = NULL;
|
||||
qdev_prop_set_globals(DEVICE(obj), &err);
|
||||
if (err) {
|
||||
qerror_report_err(err);
|
||||
error_free(err);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
/* Unlink device from bus and free the structure. */
|
||||
|
@@ -93,10 +93,12 @@ struct XenFB {
|
||||
|
||||
static int common_bind(struct common *c)
|
||||
{
|
||||
int mfn;
|
||||
uint64_t mfn;
|
||||
|
||||
if (xenstore_read_fe_int(&c->xendev, "page-ref", &mfn) == -1)
|
||||
if (xenstore_read_fe_uint64(&c->xendev, "page-ref", &mfn) == -1)
|
||||
return -1;
|
||||
assert(mfn == (xen_pfn_t)mfn);
|
||||
|
||||
if (xenstore_read_fe_int(&c->xendev, "event-channel", &c->xendev.remote_port) == -1)
|
||||
return -1;
|
||||
|
||||
@@ -107,7 +109,7 @@ static int common_bind(struct common *c)
|
||||
return -1;
|
||||
|
||||
xen_be_bind_evtchn(&c->xendev);
|
||||
xen_be_printf(&c->xendev, 1, "ring mfn %d, remote-port %d, local-port %d\n",
|
||||
xen_be_printf(&c->xendev, 1, "ring mfn %"PRIx64", remote-port %d, local-port %d\n",
|
||||
mfn, c->xendev.remote_port, c->xendev.local_port);
|
||||
|
||||
return 0;
|
||||
@@ -409,7 +411,7 @@ static void input_event(struct XenDevice *xendev)
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
static void xenfb_copy_mfns(int mode, int count, unsigned long *dst, void *src)
|
||||
static void xenfb_copy_mfns(int mode, int count, xen_pfn_t *dst, void *src)
|
||||
{
|
||||
uint32_t *src32 = src;
|
||||
uint64_t *src64 = src;
|
||||
@@ -424,8 +426,8 @@ static int xenfb_map_fb(struct XenFB *xenfb)
|
||||
struct xenfb_page *page = xenfb->c.page;
|
||||
char *protocol = xenfb->c.xendev.protocol;
|
||||
int n_fbdirs;
|
||||
unsigned long *pgmfns = NULL;
|
||||
unsigned long *fbmfns = NULL;
|
||||
xen_pfn_t *pgmfns = NULL;
|
||||
xen_pfn_t *fbmfns = NULL;
|
||||
void *map, *pd;
|
||||
int mode, ret = -1;
|
||||
|
||||
@@ -483,8 +485,8 @@ static int xenfb_map_fb(struct XenFB *xenfb)
|
||||
n_fbdirs = xenfb->fbpages * mode / 8;
|
||||
n_fbdirs = (n_fbdirs + (XC_PAGE_SIZE - 1)) / XC_PAGE_SIZE;
|
||||
|
||||
pgmfns = g_malloc0(sizeof(unsigned long) * n_fbdirs);
|
||||
fbmfns = g_malloc0(sizeof(unsigned long) * xenfb->fbpages);
|
||||
pgmfns = g_malloc0(sizeof(xen_pfn_t) * n_fbdirs);
|
||||
fbmfns = g_malloc0(sizeof(xen_pfn_t) * xenfb->fbpages);
|
||||
|
||||
xenfb_copy_mfns(mode, n_fbdirs, pgmfns, pd);
|
||||
map = xc_map_foreign_pages(xen_xc, xenfb->c.xendev.dom,
|
||||
|
@@ -175,17 +175,18 @@ static void ahci_trigger_irq(AHCIState *s, AHCIDevice *d,
|
||||
ahci_check_irq(s);
|
||||
}
|
||||
|
||||
static void map_page(uint8_t **ptr, uint64_t addr, uint32_t wanted)
|
||||
static void map_page(AddressSpace *as, uint8_t **ptr, uint64_t addr,
|
||||
uint32_t wanted)
|
||||
{
|
||||
hwaddr len = wanted;
|
||||
|
||||
if (*ptr) {
|
||||
cpu_physical_memory_unmap(*ptr, len, 1, len);
|
||||
dma_memory_unmap(as, *ptr, len, DMA_DIRECTION_FROM_DEVICE, len);
|
||||
}
|
||||
|
||||
*ptr = cpu_physical_memory_map(addr, &len, 1);
|
||||
*ptr = dma_memory_map(as, addr, &len, DMA_DIRECTION_FROM_DEVICE);
|
||||
if (len < wanted) {
|
||||
cpu_physical_memory_unmap(*ptr, len, 1, len);
|
||||
dma_memory_unmap(as, *ptr, len, DMA_DIRECTION_FROM_DEVICE, len);
|
||||
*ptr = NULL;
|
||||
}
|
||||
}
|
||||
@@ -198,24 +199,24 @@ static void ahci_port_write(AHCIState *s, int port, int offset, uint32_t val)
|
||||
switch (offset) {
|
||||
case PORT_LST_ADDR:
|
||||
pr->lst_addr = val;
|
||||
map_page(&s->dev[port].lst,
|
||||
map_page(s->as, &s->dev[port].lst,
|
||||
((uint64_t)pr->lst_addr_hi << 32) | pr->lst_addr, 1024);
|
||||
s->dev[port].cur_cmd = NULL;
|
||||
break;
|
||||
case PORT_LST_ADDR_HI:
|
||||
pr->lst_addr_hi = val;
|
||||
map_page(&s->dev[port].lst,
|
||||
map_page(s->as, &s->dev[port].lst,
|
||||
((uint64_t)pr->lst_addr_hi << 32) | pr->lst_addr, 1024);
|
||||
s->dev[port].cur_cmd = NULL;
|
||||
break;
|
||||
case PORT_FIS_ADDR:
|
||||
pr->fis_addr = val;
|
||||
map_page(&s->dev[port].res_fis,
|
||||
map_page(s->as, &s->dev[port].res_fis,
|
||||
((uint64_t)pr->fis_addr_hi << 32) | pr->fis_addr, 256);
|
||||
break;
|
||||
case PORT_FIS_ADDR_HI:
|
||||
pr->fis_addr_hi = val;
|
||||
map_page(&s->dev[port].res_fis,
|
||||
map_page(s->as, &s->dev[port].res_fis,
|
||||
((uint64_t)pr->fis_addr_hi << 32) | pr->fis_addr, 256);
|
||||
break;
|
||||
case PORT_IRQ_STAT:
|
||||
@@ -639,6 +640,11 @@ static void ahci_write_fis_d2h(AHCIDevice *ad, uint8_t *cmd_fis)
|
||||
}
|
||||
}
|
||||
|
||||
static int prdt_tbl_entry_size(const AHCI_SG *tbl)
|
||||
{
|
||||
return (le32_to_cpu(tbl->flags_size) & AHCI_PRDT_SIZE_MASK) + 1;
|
||||
}
|
||||
|
||||
static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist, int offset)
|
||||
{
|
||||
AHCICmdHdr *cmd = ad->cur_cmd;
|
||||
@@ -681,7 +687,7 @@ static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist, int offset)
|
||||
sum = 0;
|
||||
for (i = 0; i < sglist_alloc_hint; i++) {
|
||||
/* flags_size is zero-based */
|
||||
tbl_entry_size = (le32_to_cpu(tbl[i].flags_size) + 1);
|
||||
tbl_entry_size = prdt_tbl_entry_size(&tbl[i]);
|
||||
if (offset <= (sum + tbl_entry_size)) {
|
||||
off_idx = i;
|
||||
off_pos = offset - sum;
|
||||
@@ -700,12 +706,12 @@ static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist, int offset)
|
||||
qemu_sglist_init(sglist, qbus->parent, (sglist_alloc_hint - off_idx),
|
||||
ad->hba->as);
|
||||
qemu_sglist_add(sglist, le64_to_cpu(tbl[off_idx].addr + off_pos),
|
||||
le32_to_cpu(tbl[off_idx].flags_size) + 1 - off_pos);
|
||||
prdt_tbl_entry_size(&tbl[off_idx]) - off_pos);
|
||||
|
||||
for (i = off_idx + 1; i < sglist_alloc_hint; i++) {
|
||||
/* flags_size is zero-based */
|
||||
qemu_sglist_add(sglist, le64_to_cpu(tbl[i].addr),
|
||||
le32_to_cpu(tbl[i].flags_size) + 1);
|
||||
prdt_tbl_entry_size(&tbl[i]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1260,9 +1266,9 @@ static int ahci_state_post_load(void *opaque, int version_id)
|
||||
ad = &s->dev[i];
|
||||
AHCIPortRegs *pr = &ad->port_regs;
|
||||
|
||||
map_page(&ad->lst,
|
||||
map_page(s->as, &ad->lst,
|
||||
((uint64_t)pr->lst_addr_hi << 32) | pr->lst_addr, 1024);
|
||||
map_page(&ad->res_fis,
|
||||
map_page(s->as, &ad->res_fis,
|
||||
((uint64_t)pr->fis_addr_hi << 32) | pr->fis_addr, 256);
|
||||
/*
|
||||
* All pending i/o should be flushed out on a migrate. However,
|
||||
|
@@ -201,6 +201,8 @@
|
||||
|
||||
#define AHCI_COMMAND_TABLE_ACMD 0x40
|
||||
|
||||
#define AHCI_PRDT_SIZE_MASK 0x3fffff
|
||||
|
||||
#define IDE_FEATURE_DMA 1
|
||||
|
||||
#define READ_FPDMA_QUEUED 0x60
|
||||
|
@@ -146,7 +146,13 @@ uint64_t pc_dimm_get_free_addr(uint64_t address_space_start,
|
||||
uint64_t new_addr, ret = 0;
|
||||
uint64_t address_space_end = address_space_start + address_space_size;
|
||||
|
||||
assert(address_space_end > address_space_size);
|
||||
if (!address_space_size) {
|
||||
error_setg(errp, "memory hotplug is not enabled, "
|
||||
"please add maxmem option");
|
||||
goto out;
|
||||
}
|
||||
|
||||
assert(address_space_end > address_space_start);
|
||||
object_child_foreach(qdev_get_machine(), pc_dimm_built_list, &list);
|
||||
|
||||
if (hint) {
|
||||
|
@@ -256,9 +256,7 @@ static void raven_pcihost_initfn(Object *obj)
|
||||
memory_region_init(&s->pci_io, obj, "pci-io", 0x3f800000);
|
||||
memory_region_init_io(&s->pci_io_non_contiguous, obj, &raven_io_ops, s,
|
||||
"pci-io-non-contiguous", 0x00800000);
|
||||
/* Open Hack'Ware hack: real size should be only 0x3f000000 bytes */
|
||||
memory_region_init(&s->pci_memory, obj, "pci-memory",
|
||||
0x3f000000 + 0xc0000000ULL);
|
||||
memory_region_init(&s->pci_memory, obj, "pci-memory", 0x3f000000);
|
||||
address_space_init(&s->pci_io_as, &s->pci_io, "raven-io");
|
||||
|
||||
/* CPU address space */
|
||||
|
@@ -827,6 +827,7 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
|
||||
}
|
||||
|
||||
pci_dev->bus = bus;
|
||||
pci_dev->devfn = devfn;
|
||||
dma_as = pci_device_iommu_address_space(pci_dev);
|
||||
|
||||
memory_region_init_alias(&pci_dev->bus_master_enable_region,
|
||||
@@ -836,7 +837,6 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
|
||||
address_space_init(&pci_dev->bus_master_as, &pci_dev->bus_master_enable_region,
|
||||
name);
|
||||
|
||||
pci_dev->devfn = devfn;
|
||||
pstrcpy(pci_dev->name, sizeof(pci_dev->name), name);
|
||||
pci_dev->irq_state = 0;
|
||||
pci_config_alloc(pci_dev);
|
||||
|
@@ -346,9 +346,6 @@ static void ppc_prep_reset(void *opaque)
|
||||
PowerPCCPU *cpu = opaque;
|
||||
|
||||
cpu_reset(CPU(cpu));
|
||||
|
||||
/* Reset address */
|
||||
cpu->env.nip = 0xfffffffc;
|
||||
}
|
||||
|
||||
static const MemoryRegionPortio prep_portio_list[] = {
|
||||
@@ -382,7 +379,6 @@ static void ppc_prep_init(MachineState *machine)
|
||||
#endif
|
||||
int linux_boot, i, nb_nics1;
|
||||
MemoryRegion *ram = g_new(MemoryRegion, 1);
|
||||
MemoryRegion *vga = g_new(MemoryRegion, 1);
|
||||
uint32_t kernel_base, initrd_base;
|
||||
long kernel_size, initrd_size;
|
||||
DeviceState *dev;
|
||||
@@ -508,14 +504,6 @@ static void ppc_prep_init(MachineState *machine)
|
||||
|
||||
/* init basic PC hardware */
|
||||
pci_vga_init(pci_bus);
|
||||
/* Open Hack'Ware hack: PCI BAR#0 is programmed to 0xf0000000.
|
||||
* While bios will access framebuffer at 0xf0000000, real physical
|
||||
* address is 0xf0000000 + 0xc0000000 (PCI memory base).
|
||||
* Alias the wrong memory accesses to the right place.
|
||||
*/
|
||||
memory_region_init_alias(vga, NULL, "vga-alias", pci_address_space(pci),
|
||||
0xf0000000, 0x1000000);
|
||||
memory_region_add_subregion_overlap(sysmem, 0xf0000000, vga, 10);
|
||||
|
||||
nb_nics1 = nb_nics;
|
||||
if (nb_nics1 > NE2000_NB_MAX)
|
||||
|
@@ -160,8 +160,7 @@ static int spapr_fixup_cpu_smt_dt(void *fdt, int offset, PowerPCCPU *cpu,
|
||||
int index = ppc_get_vcpu_dt_id(cpu);
|
||||
|
||||
if (cpu->cpu_version) {
|
||||
ret = fdt_setprop(fdt, offset, "cpu-version",
|
||||
&cpu->cpu_version, sizeof(cpu->cpu_version));
|
||||
ret = fdt_setprop_cell(fdt, offset, "cpu-version", cpu->cpu_version);
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
|
@@ -770,7 +770,7 @@ static target_ulong h_set_mode_resouce_addr_trans_mode(PowerPCCPU *cpu,
|
||||
prefix = 0x18000;
|
||||
break;
|
||||
case H_SET_MODE_ADDR_TRANS_C000_0000_0000_4000:
|
||||
prefix = 0xC000000000004000;
|
||||
prefix = 0xC000000000004000ULL;
|
||||
break;
|
||||
default:
|
||||
return H_UNSUPPORTED_FLAG;
|
||||
|
@@ -200,6 +200,7 @@ static void sch_handle_halt_func(SubchDev *sch)
|
||||
|
||||
PMCW *p = &sch->curr_status.pmcw;
|
||||
SCSW *s = &sch->curr_status.scsw;
|
||||
hwaddr curr_ccw = sch->channel_prog;
|
||||
int path;
|
||||
|
||||
/* Path management: In our simple css, we always choose the only path. */
|
||||
@@ -216,6 +217,10 @@ static void sch_handle_halt_func(SubchDev *sch)
|
||||
(s->ctrl & SCSW_ACTL_SUSP))) {
|
||||
s->dstat = SCSW_DSTAT_DEVICE_END;
|
||||
}
|
||||
if ((s->ctrl & (SCSW_ACTL_SUBCH_ACTIVE | SCSW_ACTL_DEVICE_ACTIVE)) ||
|
||||
(s->ctrl & SCSW_ACTL_SUSP)) {
|
||||
s->cpa = curr_ccw + 8;
|
||||
}
|
||||
s->cstat = 0;
|
||||
p->lpum = path;
|
||||
|
||||
@@ -398,6 +403,7 @@ static void sch_handle_start_func(SubchDev *sch, ORB *orb)
|
||||
s->ctrl |= SCSW_STCTL_PRIMARY | SCSW_STCTL_SECONDARY |
|
||||
SCSW_STCTL_STATUS_PEND;
|
||||
s->dstat = SCSW_DSTAT_CHANNEL_END | SCSW_DSTAT_DEVICE_END;
|
||||
s->cpa = sch->channel_prog + 8;
|
||||
break;
|
||||
case -ENOSYS:
|
||||
/* unsupported command, generate unit check (command reject) */
|
||||
@@ -408,6 +414,7 @@ static void sch_handle_start_func(SubchDev *sch, ORB *orb)
|
||||
s->ctrl &= ~SCSW_CTRL_MASK_STCTL;
|
||||
s->ctrl |= SCSW_STCTL_PRIMARY | SCSW_STCTL_SECONDARY |
|
||||
SCSW_STCTL_ALERT | SCSW_STCTL_STATUS_PEND;
|
||||
s->cpa = sch->channel_prog + 8;
|
||||
break;
|
||||
case -EFAULT:
|
||||
/* memory problem, generate channel data check */
|
||||
@@ -416,6 +423,7 @@ static void sch_handle_start_func(SubchDev *sch, ORB *orb)
|
||||
s->ctrl &= ~SCSW_CTRL_MASK_STCTL;
|
||||
s->ctrl |= SCSW_STCTL_PRIMARY | SCSW_STCTL_SECONDARY |
|
||||
SCSW_STCTL_ALERT | SCSW_STCTL_STATUS_PEND;
|
||||
s->cpa = sch->channel_prog + 8;
|
||||
break;
|
||||
case -EBUSY:
|
||||
/* subchannel busy, generate deferred cc 1 */
|
||||
@@ -436,6 +444,7 @@ static void sch_handle_start_func(SubchDev *sch, ORB *orb)
|
||||
s->ctrl &= ~SCSW_CTRL_MASK_STCTL;
|
||||
s->ctrl |= SCSW_STCTL_PRIMARY | SCSW_STCTL_SECONDARY |
|
||||
SCSW_STCTL_ALERT | SCSW_STCTL_STATUS_PEND;
|
||||
s->cpa = sch->channel_prog + 8;
|
||||
break;
|
||||
}
|
||||
} while (ret == -EAGAIN);
|
||||
|
@@ -494,6 +494,7 @@ static unsigned virtio_s390_get_features(DeviceState *d)
|
||||
|
||||
static Property s390_virtio_net_properties[] = {
|
||||
DEFINE_NIC_PROPERTIES(VirtIONetS390, vdev.nic_conf),
|
||||
DEFINE_VIRTIO_COMMON_FEATURES(VirtIOS390Device, host_features),
|
||||
DEFINE_VIRTIO_NET_FEATURES(VirtIOS390Device, host_features),
|
||||
DEFINE_VIRTIO_NET_PROPERTIES(VirtIONetS390, vdev.net_conf),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
@@ -614,6 +615,7 @@ static const TypeInfo virtio_s390_device_info = {
|
||||
|
||||
static Property s390_virtio_scsi_properties[] = {
|
||||
DEFINE_VIRTIO_SCSI_PROPERTIES(VirtIOSCSIS390, vdev.parent_obj.conf),
|
||||
DEFINE_VIRTIO_COMMON_FEATURES(VirtIOS390Device, host_features),
|
||||
DEFINE_VIRTIO_SCSI_FEATURES(VirtIOS390Device, host_features),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
@@ -1402,7 +1402,6 @@ static const TypeInfo virtio_ccw_net = {
|
||||
|
||||
static Property virtio_ccw_blk_properties[] = {
|
||||
DEFINE_PROP_STRING("devno", VirtioCcwDevice, bus_id),
|
||||
DEFINE_VIRTIO_BLK_FEATURES(VirtioCcwDevice, host_features[0]),
|
||||
DEFINE_PROP_BIT("ioeventfd", VirtioCcwDevice, flags,
|
||||
VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT, true),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
@@ -1430,7 +1429,6 @@ static const TypeInfo virtio_ccw_blk = {
|
||||
static Property virtio_ccw_serial_properties[] = {
|
||||
DEFINE_PROP_STRING("devno", VirtioCcwDevice, bus_id),
|
||||
DEFINE_VIRTIO_SERIAL_PROPERTIES(VirtioSerialCcw, vdev.serial),
|
||||
DEFINE_VIRTIO_COMMON_FEATURES(VirtioCcwDevice, host_features[0]),
|
||||
DEFINE_PROP_BIT("ioeventfd", VirtioCcwDevice, flags,
|
||||
VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT, true),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
@@ -1457,7 +1455,6 @@ static const TypeInfo virtio_ccw_serial = {
|
||||
|
||||
static Property virtio_ccw_balloon_properties[] = {
|
||||
DEFINE_PROP_STRING("devno", VirtioCcwDevice, bus_id),
|
||||
DEFINE_VIRTIO_COMMON_FEATURES(VirtioCcwDevice, host_features[0]),
|
||||
DEFINE_PROP_BIT("ioeventfd", VirtioCcwDevice, flags,
|
||||
VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT, true),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
@@ -1514,7 +1511,6 @@ static const TypeInfo virtio_ccw_scsi = {
|
||||
static Property vhost_ccw_scsi_properties[] = {
|
||||
DEFINE_PROP_STRING("devno", VirtioCcwDevice, bus_id),
|
||||
DEFINE_VHOST_SCSI_PROPERTIES(VirtIOSCSICcw, vdev.parent_obj.conf),
|
||||
DEFINE_VIRTIO_COMMON_FEATURES(VirtioCcwDevice, host_features[0]),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
@@ -1551,7 +1547,6 @@ static void virtio_ccw_rng_instance_init(Object *obj)
|
||||
|
||||
static Property virtio_ccw_rng_properties[] = {
|
||||
DEFINE_PROP_STRING("devno", VirtioCcwDevice, bus_id),
|
||||
DEFINE_VIRTIO_COMMON_FEATURES(VirtioCcwDevice, host_features[0]),
|
||||
DEFINE_VIRTIO_RNG_PROPERTIES(VirtIORNGCcw, vdev.conf),
|
||||
DEFINE_PROP_BIT("ioeventfd", VirtioCcwDevice, flags,
|
||||
VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT, true),
|
||||
@@ -1617,10 +1612,16 @@ static int virtio_ccw_busdev_unplug(DeviceState *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Property virtio_ccw_properties[] = {
|
||||
DEFINE_VIRTIO_COMMON_FEATURES(VirtioCcwDevice, host_features[0]),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
static void virtio_ccw_device_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
dc->props = virtio_ccw_properties;
|
||||
dc->init = virtio_ccw_busdev_init;
|
||||
dc->exit = virtio_ccw_busdev_exit;
|
||||
dc->unplug = virtio_ccw_busdev_unplug;
|
||||
|
@@ -369,10 +369,16 @@ static void virtio_mmio_realizefn(DeviceState *d, Error **errp)
|
||||
sysbus_init_mmio(sbd, &proxy->iomem);
|
||||
}
|
||||
|
||||
static Property virtio_mmio_properties[] = {
|
||||
DEFINE_VIRTIO_COMMON_FEATURES(VirtIOMMIOProxy, host_features),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
static void virtio_mmio_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
dc->props = virtio_mmio_properties;
|
||||
dc->realize = virtio_mmio_realizefn;
|
||||
dc->reset = virtio_mmio_reset;
|
||||
set_bit(DEVICE_CATEGORY_MISC, dc->categories);
|
||||
|
@@ -914,7 +914,6 @@ static Property virtio_9p_pci_properties[] = {
|
||||
DEFINE_PROP_BIT("ioeventfd", VirtIOPCIProxy, flags,
|
||||
VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, true),
|
||||
DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 2),
|
||||
DEFINE_VIRTIO_COMMON_FEATURES(VirtIOPCIProxy, host_features),
|
||||
DEFINE_VIRTIO_9P_PROPERTIES(V9fsPCIState, vdev.fsconf),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
@@ -1003,11 +1002,9 @@ static void virtio_pci_device_plugged(DeviceState *d)
|
||||
|
||||
static void virtio_pci_device_unplugged(DeviceState *d)
|
||||
{
|
||||
PCIDevice *pci_dev = PCI_DEVICE(d);
|
||||
VirtIOPCIProxy *proxy = VIRTIO_PCI(d);
|
||||
|
||||
virtio_pci_stop_ioeventfd(proxy);
|
||||
msix_uninit_exclusive_bar(pci_dev);
|
||||
}
|
||||
|
||||
static int virtio_pci_init(PCIDevice *pci_dev)
|
||||
@@ -1024,6 +1021,8 @@ static int virtio_pci_init(PCIDevice *pci_dev)
|
||||
static void virtio_pci_exit(PCIDevice *pci_dev)
|
||||
{
|
||||
VirtIOPCIProxy *proxy = VIRTIO_PCI(pci_dev);
|
||||
|
||||
msix_uninit_exclusive_bar(pci_dev);
|
||||
memory_region_destroy(&proxy->bar);
|
||||
}
|
||||
|
||||
@@ -1037,11 +1036,17 @@ static void virtio_pci_reset(DeviceState *qdev)
|
||||
proxy->flags &= ~VIRTIO_PCI_FLAG_BUS_MASTER_BUG;
|
||||
}
|
||||
|
||||
static Property virtio_pci_properties[] = {
|
||||
DEFINE_VIRTIO_COMMON_FEATURES(VirtIOPCIProxy, host_features),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
static void virtio_pci_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
|
||||
dc->props = virtio_pci_properties;
|
||||
k->init = virtio_pci_init;
|
||||
k->exit = virtio_pci_exit;
|
||||
k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET;
|
||||
@@ -1066,7 +1071,6 @@ static Property virtio_blk_pci_properties[] = {
|
||||
DEFINE_PROP_BIT("ioeventfd", VirtIOPCIProxy, flags,
|
||||
VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, true),
|
||||
DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 2),
|
||||
DEFINE_VIRTIO_BLK_FEATURES(VirtIOPCIProxy, host_features),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
@@ -1191,7 +1195,6 @@ static const TypeInfo virtio_scsi_pci_info = {
|
||||
static Property vhost_scsi_pci_properties[] = {
|
||||
DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors,
|
||||
DEV_NVECTORS_UNSPECIFIED),
|
||||
DEFINE_VIRTIO_COMMON_FEATURES(VirtIOPCIProxy, host_features),
|
||||
DEFINE_VHOST_SCSI_PROPERTIES(VHostSCSIPCI, vdev.parent_obj.conf),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
@@ -1272,7 +1275,6 @@ static void balloon_pci_stats_set_poll_interval(Object *obj, struct Visitor *v,
|
||||
}
|
||||
|
||||
static Property virtio_balloon_pci_properties[] = {
|
||||
DEFINE_VIRTIO_COMMON_FEATURES(VirtIOPCIProxy, host_features),
|
||||
DEFINE_PROP_UINT32("class", VirtIOPCIProxy, class_code, 0),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
@@ -1375,7 +1377,6 @@ static Property virtio_serial_pci_properties[] = {
|
||||
VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, true),
|
||||
DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 2),
|
||||
DEFINE_PROP_UINT32("class", VirtIOPCIProxy, class_code, 0),
|
||||
DEFINE_VIRTIO_COMMON_FEATURES(VirtIOPCIProxy, host_features),
|
||||
DEFINE_VIRTIO_SERIAL_PROPERTIES(VirtIOSerialPCI, vdev.serial),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
@@ -1471,7 +1472,6 @@ static const TypeInfo virtio_net_pci_info = {
|
||||
/* virtio-rng-pci */
|
||||
|
||||
static Property virtio_rng_pci_properties[] = {
|
||||
DEFINE_VIRTIO_COMMON_FEATURES(VirtIOPCIProxy, host_features),
|
||||
DEFINE_VIRTIO_RNG_PROPERTIES(VirtIORngPCI, vdev.conf),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
@@ -111,6 +111,19 @@ int xenstore_read_int(const char *base, const char *node, int *ival)
|
||||
return rc;
|
||||
}
|
||||
|
||||
int xenstore_read_uint64(const char *base, const char *node, uint64_t *uval)
|
||||
{
|
||||
char *val;
|
||||
int rc = -1;
|
||||
|
||||
val = xenstore_read_str(base, node);
|
||||
if (val && 1 == sscanf(val, "%"SCNu64, uval)) {
|
||||
rc = 0;
|
||||
}
|
||||
g_free(val);
|
||||
return rc;
|
||||
}
|
||||
|
||||
int xenstore_write_be_str(struct XenDevice *xendev, const char *node, const char *val)
|
||||
{
|
||||
return xenstore_write_str(xendev->be, node, val);
|
||||
@@ -146,6 +159,11 @@ int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival)
|
||||
return xenstore_read_int(xendev->fe, node, ival);
|
||||
}
|
||||
|
||||
int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node, uint64_t *uval)
|
||||
{
|
||||
return xenstore_read_uint64(xendev->fe, node, uval);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------- */
|
||||
|
||||
const char *xenbus_strstate(enum xenbus_state state)
|
||||
|
@@ -584,4 +584,8 @@ AioContext *bdrv_get_aio_context(BlockDriverState *bs);
|
||||
*/
|
||||
void bdrv_set_aio_context(BlockDriverState *bs, AioContext *new_context);
|
||||
|
||||
void bdrv_io_plug(BlockDriverState *bs);
|
||||
void bdrv_io_unplug(BlockDriverState *bs);
|
||||
void bdrv_flush_io_queue(BlockDriverState *bs);
|
||||
|
||||
#endif
|
||||
|
@@ -261,6 +261,11 @@ struct BlockDriver {
|
||||
void (*bdrv_attach_aio_context)(BlockDriverState *bs,
|
||||
AioContext *new_context);
|
||||
|
||||
/* io queue for linux-aio */
|
||||
void (*bdrv_io_plug)(BlockDriverState *bs);
|
||||
void (*bdrv_io_unplug)(BlockDriverState *bs);
|
||||
void (*bdrv_flush_io_queue)(BlockDriverState *bs);
|
||||
|
||||
QLIST_ENTRY(BlockDriver) list;
|
||||
};
|
||||
|
||||
|
@@ -152,9 +152,6 @@ typedef struct VirtIOBlockReq {
|
||||
BlockAcctCookie acct;
|
||||
} VirtIOBlockReq;
|
||||
|
||||
#define DEFINE_VIRTIO_BLK_FEATURES(_state, _field) \
|
||||
DEFINE_VIRTIO_COMMON_FEATURES(_state, _field)
|
||||
|
||||
int virtio_blk_handle_scsi_req(VirtIOBlock *blk,
|
||||
VirtQueueElement *elem);
|
||||
|
||||
|
@@ -258,7 +258,6 @@ struct virtio_net_ctrl_mq {
|
||||
#define VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET 0
|
||||
|
||||
#define DEFINE_VIRTIO_NET_FEATURES(_state, _field) \
|
||||
DEFINE_VIRTIO_COMMON_FEATURES(_state, _field), \
|
||||
DEFINE_PROP_BIT("any_layout", _state, _field, VIRTIO_F_ANY_LAYOUT, true), \
|
||||
DEFINE_PROP_BIT("csum", _state, _field, VIRTIO_NET_F_CSUM, true), \
|
||||
DEFINE_PROP_BIT("guest_csum", _state, _field, VIRTIO_NET_F_GUEST_CSUM, true), \
|
||||
|
@@ -178,7 +178,6 @@ typedef struct {
|
||||
DEFINE_PROP_UINT32("cmd_per_lun", _state, _conf_field.cmd_per_lun, 128)
|
||||
|
||||
#define DEFINE_VIRTIO_SCSI_FEATURES(_state, _feature_field) \
|
||||
DEFINE_VIRTIO_COMMON_FEATURES(_state, _feature_field), \
|
||||
DEFINE_PROP_BIT("hotplug", _state, _feature_field, VIRTIO_SCSI_F_HOTPLUG, \
|
||||
true), \
|
||||
DEFINE_PROP_BIT("param_change", _state, _feature_field, \
|
||||
|
@@ -74,6 +74,8 @@ char *xenstore_read_be_str(struct XenDevice *xendev, const char *node);
|
||||
int xenstore_read_be_int(struct XenDevice *xendev, const char *node, int *ival);
|
||||
char *xenstore_read_fe_str(struct XenDevice *xendev, const char *node);
|
||||
int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival);
|
||||
int xenstore_read_uint64(const char *base, const char *node, uint64_t *uval);
|
||||
int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node, uint64_t *uval);
|
||||
|
||||
const char *xenbus_strstate(enum xenbus_state state);
|
||||
struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev);
|
||||
|
@@ -84,7 +84,6 @@ struct CharDriverState {
|
||||
int avail_connections;
|
||||
int is_mux;
|
||||
guint fd_in_tag;
|
||||
guint fd_hup_tag;
|
||||
QemuOpts *opts;
|
||||
QTAILQ_ENTRY(CharDriverState) next;
|
||||
};
|
||||
|
@@ -3901,11 +3901,11 @@ int main(int argc, char **argv, char **envp)
|
||||
#elif defined TARGET_OPENRISC
|
||||
cpu_model = "or1200";
|
||||
#elif defined(TARGET_PPC)
|
||||
#ifdef TARGET_PPC64
|
||||
cpu_model = "970fx";
|
||||
#else
|
||||
# ifdef TARGET_PPC64
|
||||
cpu_model = "POWER7";
|
||||
# else
|
||||
cpu_model = "750";
|
||||
#endif
|
||||
# endif
|
||||
#else
|
||||
cpu_model = "any";
|
||||
#endif
|
||||
|
8
numa.c
8
numa.c
@@ -301,6 +301,14 @@ void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner,
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (memory_region_is_mapped(seg)) {
|
||||
char *path = object_get_canonical_path_component(OBJECT(backend));
|
||||
error_report("memory backend %s is used multiple times. Each "
|
||||
"-numa option must use a different memdev value.",
|
||||
path);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
memory_region_add_subregion(mr, addr, seg);
|
||||
vmstate_register_ram_global(seg);
|
||||
addr += size;
|
||||
|
@@ -17,7 +17,7 @@
|
||||
- SLOF (Slimline Open Firmware) is a free IEEE 1275 Open Firmware
|
||||
implementation for certain IBM POWER hardware. The sources are at
|
||||
https://github.com/aik/SLOF, and the image currently in qemu is
|
||||
built from git tag qemu-slof-20140404.
|
||||
built from git tag qemu-slof-20140630.
|
||||
|
||||
- sgabios (the Serial Graphics Adapter option ROM) provides a means for
|
||||
legacy x86 software to communicate with an attached serial console as
|
||||
|
Binary file not shown.
Binary file not shown.
@@ -51,6 +51,8 @@ static void jump_to_IPL_2(void)
|
||||
|
||||
static void jump_to_IPL_code(uint64_t address)
|
||||
{
|
||||
/* store the subsystem information _after_ the bootmap was loaded */
|
||||
write_subsystem_identification();
|
||||
/*
|
||||
* The IPL PSW is at address 0. We also must not overwrite the
|
||||
* content of non-BIOS memory after we loaded the guest, so we
|
||||
|
@@ -13,6 +13,22 @@
|
||||
|
||||
char stack[PAGE_SIZE * 8] __attribute__((__aligned__(PAGE_SIZE)));
|
||||
uint64_t boot_value;
|
||||
struct subchannel_id blk_schid = { .one = 1 };
|
||||
|
||||
/*
|
||||
* Priniciples of Operations (SA22-7832-09) chapter 17 requires that
|
||||
* a subsystem-identification is at 184-187 and bytes 188-191 are zero
|
||||
* after list-directed-IPL and ccw-IPL.
|
||||
*/
|
||||
void write_subsystem_identification(void)
|
||||
{
|
||||
struct subchannel_id *schid = (struct subchannel_id *) 184;
|
||||
uint32_t *zeroes = (uint32_t *) 188;
|
||||
|
||||
*schid = blk_schid;
|
||||
*zeroes = 0;
|
||||
}
|
||||
|
||||
|
||||
void virtio_panic(const char *string)
|
||||
{
|
||||
@@ -23,7 +39,6 @@ void virtio_panic(const char *string)
|
||||
|
||||
static void virtio_setup(uint64_t dev_info)
|
||||
{
|
||||
struct subchannel_id blk_schid = { .one = 1 };
|
||||
struct schib schib;
|
||||
int i;
|
||||
int r;
|
||||
|
@@ -50,6 +50,7 @@ void disabled_wait(void);
|
||||
|
||||
/* main.c */
|
||||
void virtio_panic(const char *string);
|
||||
void write_subsystem_identification(void);
|
||||
|
||||
/* sclp-ascii.c */
|
||||
void sclp_print(const char *string);
|
||||
|
BIN
pc-bios/slof.bin
BIN
pc-bios/slof.bin
Binary file not shown.
36
qemu-char.c
36
qemu-char.c
@@ -581,6 +581,12 @@ static Notifier muxes_realize_notify = {
|
||||
.notify = muxes_realize_done,
|
||||
};
|
||||
|
||||
static GSource *mux_chr_add_watch(CharDriverState *s, GIOCondition cond)
|
||||
{
|
||||
MuxDriver *d = s->opaque;
|
||||
return d->drv->chr_add_watch(d->drv, cond);
|
||||
}
|
||||
|
||||
static CharDriverState *qemu_chr_open_mux(CharDriverState *drv)
|
||||
{
|
||||
CharDriverState *chr;
|
||||
@@ -597,6 +603,9 @@ static CharDriverState *qemu_chr_open_mux(CharDriverState *drv)
|
||||
chr->chr_accept_input = mux_chr_accept_input;
|
||||
/* Frontend guest-open / -close notification is not support with muxes */
|
||||
chr->chr_set_fe_open = NULL;
|
||||
if (drv->chr_add_watch) {
|
||||
chr->chr_add_watch = mux_chr_add_watch;
|
||||
}
|
||||
/* only default to opened state if we've realized the initial
|
||||
* set of muxes
|
||||
*/
|
||||
@@ -2673,6 +2682,12 @@ static gboolean tcp_chr_read(GIOChannel *chan, GIOCondition cond, void *opaque)
|
||||
uint8_t buf[READ_BUF_LEN];
|
||||
int len, size;
|
||||
|
||||
if (cond & G_IO_HUP) {
|
||||
/* connection closed */
|
||||
tcp_chr_disconnect(chr);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (!s->connected || s->max_size <= 0) {
|
||||
return TRUE;
|
||||
}
|
||||
@@ -2724,25 +2739,6 @@ CharDriverState *qemu_chr_open_eventfd(int eventfd)
|
||||
}
|
||||
#endif
|
||||
|
||||
static gboolean tcp_chr_chan_close(GIOChannel *channel, GIOCondition cond,
|
||||
void *opaque)
|
||||
{
|
||||
CharDriverState *chr = opaque;
|
||||
|
||||
if (cond != G_IO_HUP) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* connection closed */
|
||||
tcp_chr_disconnect(chr);
|
||||
if (chr->fd_hup_tag) {
|
||||
g_source_remove(chr->fd_hup_tag);
|
||||
chr->fd_hup_tag = 0;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void tcp_chr_connect(void *opaque)
|
||||
{
|
||||
CharDriverState *chr = opaque;
|
||||
@@ -2752,8 +2748,6 @@ static void tcp_chr_connect(void *opaque)
|
||||
if (s->chan) {
|
||||
chr->fd_in_tag = io_add_watch_poll(s->chan, tcp_chr_read_poll,
|
||||
tcp_chr_read, chr);
|
||||
chr->fd_hup_tag = g_io_add_watch(s->chan, G_IO_HUP, tcp_chr_chan_close,
|
||||
chr);
|
||||
}
|
||||
qemu_chr_be_generic_open(chr);
|
||||
}
|
||||
|
@@ -590,7 +590,7 @@ check -r all} is required, which may take some time.
|
||||
This option can only be enabled if @code{compat=1.1} is specified.
|
||||
|
||||
@item nocow
|
||||
If this option is set to @code{on}, it will trun off COW of the file. It's only
|
||||
If this option is set to @code{on}, it will turn off COW of the file. It's only
|
||||
valid on btrfs, no effect on other file systems.
|
||||
|
||||
Btrfs has low performance when hosting a VM image file, even more when the guest
|
||||
@@ -603,7 +603,7 @@ does.
|
||||
Note: this option is only valid to new or empty files. If there is an existing
|
||||
file which is COW and has data blocks already, it couldn't be changed to NOCOW
|
||||
by setting @code{nocow=on}. One can issue @code{lsattr filename} to check if
|
||||
the NOCOW flag is set or not (Capitabl 'C' is NOCOW flag).
|
||||
the NOCOW flag is set or not (Capital 'C' is NOCOW flag).
|
||||
|
||||
@end table
|
||||
|
||||
|
@@ -475,7 +475,7 @@ check -r all} is required, which may take some time.
|
||||
This option can only be enabled if @code{compat=1.1} is specified.
|
||||
|
||||
@item nocow
|
||||
If this option is set to @code{on}, it will trun off COW of the file. It's only
|
||||
If this option is set to @code{on}, it will turn off COW of the file. It's only
|
||||
valid on btrfs, no effect on other file systems.
|
||||
|
||||
Btrfs has low performance when hosting a VM image file, even more when the guest
|
||||
@@ -488,7 +488,7 @@ does.
|
||||
Note: this option is only valid to new or empty files. If there is an existing
|
||||
file which is COW and has data blocks already, it couldn't be changed to NOCOW
|
||||
by setting @code{nocow=on}. One can issue @code{lsattr filename} to check if
|
||||
the NOCOW flag is set or not (Capitabl 'C' is NOCOW flag).
|
||||
the NOCOW flag is set or not (Capital 'C' is NOCOW flag).
|
||||
|
||||
@end table
|
||||
|
||||
|
101
qmp.c
101
qmp.c
@@ -433,11 +433,57 @@ ObjectTypeInfoList *qmp_qom_list_types(bool has_implements,
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Return a DevicePropertyInfo for a qdev property.
|
||||
*
|
||||
* If a qdev property with the given name does not exist, use the given default
|
||||
* type. If the qdev property info should not be shown, return NULL.
|
||||
*
|
||||
* The caller must free the return value.
|
||||
*/
|
||||
static DevicePropertyInfo *make_device_property_info(ObjectClass *klass,
|
||||
const char *name,
|
||||
const char *default_type)
|
||||
{
|
||||
DevicePropertyInfo *info;
|
||||
Property *prop;
|
||||
|
||||
do {
|
||||
for (prop = DEVICE_CLASS(klass)->props; prop && prop->name; prop++) {
|
||||
if (strcmp(name, prop->name) != 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO Properties without a parser are just for dirty hacks.
|
||||
* qdev_prop_ptr is the only such PropertyInfo. It's marked
|
||||
* for removal. This conditional should be removed along with
|
||||
* it.
|
||||
*/
|
||||
if (!prop->info->set) {
|
||||
return NULL; /* no way to set it, don't show */
|
||||
}
|
||||
|
||||
info = g_malloc0(sizeof(*info));
|
||||
info->name = g_strdup(prop->name);
|
||||
info->type = g_strdup(prop->info->legacy_name ?: prop->info->name);
|
||||
return info;
|
||||
}
|
||||
klass = object_class_get_parent(klass);
|
||||
} while (klass != object_class_by_name(TYPE_DEVICE));
|
||||
|
||||
/* Not a qdev property, use the default type */
|
||||
info = g_malloc0(sizeof(*info));
|
||||
info->name = g_strdup(name);
|
||||
info->type = g_strdup(default_type);
|
||||
return info;
|
||||
}
|
||||
|
||||
DevicePropertyInfoList *qmp_device_list_properties(const char *typename,
|
||||
Error **errp)
|
||||
{
|
||||
ObjectClass *klass;
|
||||
Property *prop;
|
||||
Object *obj;
|
||||
ObjectProperty *prop;
|
||||
DevicePropertyInfoList *prop_list = NULL;
|
||||
|
||||
klass = object_class_by_name(typename);
|
||||
@@ -453,32 +499,39 @@ DevicePropertyInfoList *qmp_device_list_properties(const char *typename,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
do {
|
||||
for (prop = DEVICE_CLASS(klass)->props; prop && prop->name; prop++) {
|
||||
DevicePropertyInfoList *entry;
|
||||
DevicePropertyInfo *info;
|
||||
obj = object_new(typename);
|
||||
|
||||
/*
|
||||
* TODO Properties without a parser are just for dirty hacks.
|
||||
* qdev_prop_ptr is the only such PropertyInfo. It's marked
|
||||
* for removal. This conditional should be removed along with
|
||||
* it.
|
||||
*/
|
||||
if (!prop->info->set) {
|
||||
continue; /* no way to set it, don't show */
|
||||
}
|
||||
QTAILQ_FOREACH(prop, &obj->properties, node) {
|
||||
DevicePropertyInfo *info;
|
||||
DevicePropertyInfoList *entry;
|
||||
|
||||
info = g_malloc0(sizeof(*info));
|
||||
info->name = g_strdup(prop->name);
|
||||
info->type = g_strdup(prop->info->legacy_name ?: prop->info->name);
|
||||
|
||||
entry = g_malloc0(sizeof(*entry));
|
||||
entry->value = info;
|
||||
entry->next = prop_list;
|
||||
prop_list = entry;
|
||||
/* Skip Object and DeviceState properties */
|
||||
if (strcmp(prop->name, "type") == 0 ||
|
||||
strcmp(prop->name, "realized") == 0 ||
|
||||
strcmp(prop->name, "hotpluggable") == 0 ||
|
||||
strcmp(prop->name, "parent_bus") == 0) {
|
||||
continue;
|
||||
}
|
||||
klass = object_class_get_parent(klass);
|
||||
} while (klass != object_class_by_name(TYPE_DEVICE));
|
||||
|
||||
/* Skip legacy properties since they are just string versions of
|
||||
* properties that we already list.
|
||||
*/
|
||||
if (strstart(prop->name, "legacy-", NULL)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
info = make_device_property_info(klass, prop->name, prop->type);
|
||||
if (!info) {
|
||||
continue;
|
||||
}
|
||||
|
||||
entry = g_malloc0(sizeof(*entry));
|
||||
entry->value = info;
|
||||
entry->next = prop_list;
|
||||
prop_list = entry;
|
||||
}
|
||||
|
||||
object_unref(obj);
|
||||
|
||||
return prop_list;
|
||||
}
|
||||
|
Submodule roms/SLOF updated: c90b50b505...f284ab3f03
Submodule roms/openhackware updated: 1af7e55425...c559da7c8e
@@ -72,10 +72,6 @@ typedef struct ARMCPU {
|
||||
uint64_t *cpreg_indexes;
|
||||
/* Values of the registers (cpreg_indexes[i]'s value is cpreg_values[i]) */
|
||||
uint64_t *cpreg_values;
|
||||
/* When using KVM, keeps a copy of the initial state of the VCPU,
|
||||
* so that on reset we can feed the reset values back into the kernel.
|
||||
*/
|
||||
uint64_t *cpreg_reset_values;
|
||||
/* Length of the indexes, values, reset_values arrays */
|
||||
int32_t cpreg_array_len;
|
||||
/* These are used only for migration: incoming data arrives in
|
||||
|
@@ -270,13 +270,6 @@ int kvm_arch_init_vcpu(CPUState *cs)
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Save a copy of the initial register values so that we can
|
||||
* feed it back to the kernel on VCPU reset.
|
||||
*/
|
||||
cpu->cpreg_reset_values = g_memdup(cpu->cpreg_values,
|
||||
cpu->cpreg_array_len *
|
||||
sizeof(cpu->cpreg_values[0]));
|
||||
|
||||
out:
|
||||
g_free(rlp);
|
||||
return ret;
|
||||
@@ -518,11 +511,9 @@ int kvm_arch_get_registers(CPUState *cs)
|
||||
|
||||
void kvm_arm_reset_vcpu(ARMCPU *cpu)
|
||||
{
|
||||
/* Feed the kernel back its initial register state */
|
||||
memmove(cpu->cpreg_values, cpu->cpreg_reset_values,
|
||||
cpu->cpreg_array_len * sizeof(cpu->cpreg_values[0]));
|
||||
|
||||
if (!write_list_to_kvmstate(cpu)) {
|
||||
abort();
|
||||
}
|
||||
/* Re-init VCPU so that all registers are set to
|
||||
* their respective reset values.
|
||||
*/
|
||||
kvm_arm_vcpu_init(CPU(cpu));
|
||||
write_kvmstate_to_list(cpu);
|
||||
}
|
||||
|
@@ -44,7 +44,6 @@
|
||||
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc); \
|
||||
\
|
||||
pcc->pvr = _pvr; \
|
||||
pcc->pvr_mask = CPU_POWERPC_DEFAULT_MASK; \
|
||||
pcc->svr = _svr; \
|
||||
dc->desc = _desc; \
|
||||
} \
|
||||
@@ -1136,9 +1135,9 @@
|
||||
#endif
|
||||
POWERPC_DEF("POWER7_v2.3", CPU_POWERPC_POWER7_v23, POWER7,
|
||||
"POWER7 v2.3")
|
||||
POWERPC_DEF("POWER7+_v2.1", CPU_POWERPC_POWER7P_v21, POWER7P,
|
||||
POWERPC_DEF("POWER7+_v2.1", CPU_POWERPC_POWER7P_v21, POWER7,
|
||||
"POWER7+ v2.1")
|
||||
POWERPC_DEF("POWER8E_v1.0", CPU_POWERPC_POWER8E_v10, POWER8E,
|
||||
POWERPC_DEF("POWER8E_v1.0", CPU_POWERPC_POWER8E_v10, POWER8,
|
||||
"POWER8E v1.0")
|
||||
POWERPC_DEF("POWER8_v1.0", CPU_POWERPC_POWER8_v10, POWER8,
|
||||
"POWER8 v1.0")
|
||||
|
@@ -39,7 +39,6 @@ extern PowerPCCPUAlias ppc_cpu_aliases[];
|
||||
/*****************************************************************************/
|
||||
/* PVR definitions for most known PowerPC */
|
||||
enum {
|
||||
CPU_POWERPC_DEFAULT_MASK = 0xFFFFFFFF,
|
||||
/* PowerPC 401 family */
|
||||
/* Generic PowerPC 401 */
|
||||
#define CPU_POWERPC_401 CPU_POWERPC_401G2
|
||||
@@ -553,17 +552,14 @@ enum {
|
||||
CPU_POWERPC_POWER6 = 0x003E0000,
|
||||
CPU_POWERPC_POWER6_5 = 0x0F000001, /* POWER6 in POWER5 mode */
|
||||
CPU_POWERPC_POWER6A = 0x0F000002,
|
||||
CPU_POWERPC_POWER_SERVER_MASK = 0xFFFF0000,
|
||||
CPU_POWERPC_POWER7_BASE = 0x003F0000,
|
||||
CPU_POWERPC_POWER7_MASK = 0xFFFF0000,
|
||||
CPU_POWERPC_POWER7_v23 = 0x003F0203,
|
||||
CPU_POWERPC_POWER7P_BASE = 0x004A0000,
|
||||
CPU_POWERPC_POWER7P_MASK = 0xFFFF0000,
|
||||
CPU_POWERPC_POWER7P_v21 = 0x004A0201,
|
||||
CPU_POWERPC_POWER8E_BASE = 0x004B0000,
|
||||
CPU_POWERPC_POWER8E_MASK = 0xFFFF0000,
|
||||
CPU_POWERPC_POWER8E_v10 = 0x004B0100,
|
||||
CPU_POWERPC_POWER8_BASE = 0x004D0000,
|
||||
CPU_POWERPC_POWER8_MASK = 0xFFFF0000,
|
||||
CPU_POWERPC_POWER8_v10 = 0x004D0100,
|
||||
CPU_POWERPC_970 = 0x00390202,
|
||||
CPU_POWERPC_970FX_v10 = 0x00391100,
|
||||
|
@@ -56,7 +56,7 @@ typedef struct PowerPCCPUClass {
|
||||
void (*parent_reset)(CPUState *cpu);
|
||||
|
||||
uint32_t pvr;
|
||||
uint32_t pvr_mask;
|
||||
bool (*pvr_match)(struct PowerPCCPUClass *pcc, uint32_t pvr);
|
||||
uint64_t pcr_mask;
|
||||
uint32_t svr;
|
||||
uint64_t insns_flags;
|
||||
|
@@ -83,16 +83,24 @@ static int ppc_gdb_register_len(int n)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void ppc_gdb_swap_register(uint8_t *mem_buf, int n, int len)
|
||||
/* We need to present the registers to gdb in the "current" memory ordering.
|
||||
For user-only mode we get this for free; TARGET_WORDS_BIGENDIAN is set to
|
||||
the proper ordering for the binary, and cannot be changed.
|
||||
For system mode, TARGET_WORDS_BIGENDIAN is always set, and we must check
|
||||
the current mode of the chip to see if we're running in little-endian. */
|
||||
static void maybe_bswap_register(CPUPPCState *env, uint8_t *mem_buf, int len)
|
||||
{
|
||||
if (len == 4) {
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
if (!msr_le) {
|
||||
/* do nothing */
|
||||
} else if (len == 4) {
|
||||
bswap32s((uint32_t *)mem_buf);
|
||||
} else if (len == 8) {
|
||||
bswap64s((uint64_t *)mem_buf);
|
||||
} else {
|
||||
g_assert_not_reached();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Old gdb always expects FP registers. Newer (xml-aware) gdb only
|
||||
@@ -150,10 +158,7 @@ int ppc_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (msr_le) {
|
||||
/* If cpu is in LE mode, convert memory contents to LE. */
|
||||
ppc_gdb_swap_register(mem_buf, n, r);
|
||||
}
|
||||
maybe_bswap_register(env, mem_buf, r);
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -209,10 +214,7 @@ int ppc_cpu_gdb_read_register_apple(CPUState *cs, uint8_t *mem_buf, int n)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (msr_le) {
|
||||
/* If cpu is in LE mode, convert memory contents to LE. */
|
||||
ppc_gdb_swap_register(mem_buf, n, r);
|
||||
}
|
||||
maybe_bswap_register(env, mem_buf, r);
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -225,10 +227,7 @@ int ppc_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
|
||||
if (!r) {
|
||||
return r;
|
||||
}
|
||||
if (msr_le) {
|
||||
/* If cpu is in LE mode, convert memory contents to LE. */
|
||||
ppc_gdb_swap_register(mem_buf, n, r);
|
||||
}
|
||||
maybe_bswap_register(env, mem_buf, r);
|
||||
if (n < 32) {
|
||||
/* gprs */
|
||||
env->gpr[n] = ldtul_p(mem_buf);
|
||||
@@ -278,10 +277,7 @@ int ppc_cpu_gdb_write_register_apple(CPUState *cs, uint8_t *mem_buf, int n)
|
||||
if (!r) {
|
||||
return r;
|
||||
}
|
||||
if (msr_le) {
|
||||
/* If cpu is in LE mode, convert memory contents to LE. */
|
||||
ppc_gdb_swap_register(mem_buf, n, r);
|
||||
}
|
||||
maybe_bswap_register(env, mem_buf, r);
|
||||
if (n < 32) {
|
||||
/* gprs */
|
||||
env->gpr[n] = ldq_p(mem_buf);
|
||||
|
@@ -897,10 +897,10 @@ static hwaddr booke206_tlb_to_page_size(CPUPPCState *env,
|
||||
|
||||
/* TLB check function for MAS based SoftTLBs */
|
||||
static int ppcmas_tlb_check(CPUPPCState *env, ppcmas_tlb_t *tlb,
|
||||
hwaddr *raddrp,
|
||||
target_ulong address, uint32_t pid)
|
||||
hwaddr *raddrp, target_ulong address,
|
||||
uint32_t pid)
|
||||
{
|
||||
target_ulong mask;
|
||||
hwaddr mask;
|
||||
uint32_t tlb_pid;
|
||||
|
||||
if (!msr_cm) {
|
||||
|
@@ -8062,6 +8062,17 @@ static void init_proc_POWER7 (CPUPPCState *env)
|
||||
init_proc_book3s_64(env, BOOK3S_CPU_POWER7);
|
||||
}
|
||||
|
||||
static bool ppc_pvr_match_power7(PowerPCCPUClass *pcc, uint32_t pvr)
|
||||
{
|
||||
if ((pvr & CPU_POWERPC_POWER_SERVER_MASK) == CPU_POWERPC_POWER7P_BASE) {
|
||||
return true;
|
||||
}
|
||||
if ((pvr & CPU_POWERPC_POWER_SERVER_MASK) == CPU_POWERPC_POWER7_BASE) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
POWERPC_FAMILY(POWER7)(ObjectClass *oc, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(oc);
|
||||
@@ -8070,69 +8081,7 @@ POWERPC_FAMILY(POWER7)(ObjectClass *oc, void *data)
|
||||
dc->fw_name = "PowerPC,POWER7";
|
||||
dc->desc = "POWER7";
|
||||
dc->props = powerpc_servercpu_properties;
|
||||
pcc->pvr = CPU_POWERPC_POWER7_BASE;
|
||||
pcc->pvr_mask = CPU_POWERPC_POWER7_MASK;
|
||||
pcc->pcr_mask = PCR_COMPAT_2_05 | PCR_COMPAT_2_06;
|
||||
pcc->init_proc = init_proc_POWER7;
|
||||
pcc->check_pow = check_pow_nocheck;
|
||||
pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB |
|
||||
PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES |
|
||||
PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE |
|
||||
PPC_FLOAT_FRSQRTES |
|
||||
PPC_FLOAT_STFIWX |
|
||||
PPC_FLOAT_EXT |
|
||||
PPC_CACHE | PPC_CACHE_ICBI | PPC_CACHE_DCBZ |
|
||||
PPC_MEM_SYNC | PPC_MEM_EIEIO |
|
||||
PPC_MEM_TLBIE | PPC_MEM_TLBSYNC |
|
||||
PPC_64B | PPC_ALTIVEC |
|
||||
PPC_SEGMENT_64B | PPC_SLBI |
|
||||
PPC_POPCNTB | PPC_POPCNTWD;
|
||||
pcc->insns_flags2 = PPC2_VSX | PPC2_DFP | PPC2_DBRX | PPC2_ISA205 |
|
||||
PPC2_PERM_ISA206 | PPC2_DIVE_ISA206 |
|
||||
PPC2_ATOMIC_ISA206 | PPC2_FP_CVT_ISA206 |
|
||||
PPC2_FP_TST_ISA206;
|
||||
pcc->msr_mask = (1ull << MSR_SF) |
|
||||
(1ull << MSR_VR) |
|
||||
(1ull << MSR_VSX) |
|
||||
(1ull << MSR_EE) |
|
||||
(1ull << MSR_PR) |
|
||||
(1ull << MSR_FP) |
|
||||
(1ull << MSR_ME) |
|
||||
(1ull << MSR_FE0) |
|
||||
(1ull << MSR_SE) |
|
||||
(1ull << MSR_DE) |
|
||||
(1ull << MSR_FE1) |
|
||||
(1ull << MSR_IR) |
|
||||
(1ull << MSR_DR) |
|
||||
(1ull << MSR_PMM) |
|
||||
(1ull << MSR_RI) |
|
||||
(1ull << MSR_LE);
|
||||
pcc->mmu_model = POWERPC_MMU_2_06;
|
||||
#if defined(CONFIG_SOFTMMU)
|
||||
pcc->handle_mmu_fault = ppc_hash64_handle_mmu_fault;
|
||||
#endif
|
||||
pcc->excp_model = POWERPC_EXCP_POWER7;
|
||||
pcc->bus_model = PPC_FLAGS_INPUT_POWER7;
|
||||
pcc->bfd_mach = bfd_mach_ppc64;
|
||||
pcc->flags = POWERPC_FLAG_VRE | POWERPC_FLAG_SE |
|
||||
POWERPC_FLAG_BE | POWERPC_FLAG_PMM |
|
||||
POWERPC_FLAG_BUS_CLK | POWERPC_FLAG_CFAR |
|
||||
POWERPC_FLAG_VSX;
|
||||
pcc->l1_dcache_size = 0x8000;
|
||||
pcc->l1_icache_size = 0x8000;
|
||||
pcc->interrupts_big_endian = ppc_cpu_interrupts_big_endian_lpcr;
|
||||
}
|
||||
|
||||
POWERPC_FAMILY(POWER7P)(ObjectClass *oc, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(oc);
|
||||
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
||||
|
||||
dc->fw_name = "PowerPC,POWER7+";
|
||||
dc->desc = "POWER7+";
|
||||
dc->props = powerpc_servercpu_properties;
|
||||
pcc->pvr = CPU_POWERPC_POWER7P_BASE;
|
||||
pcc->pvr_mask = CPU_POWERPC_POWER7P_MASK;
|
||||
pcc->pvr_match = ppc_pvr_match_power7;
|
||||
pcc->pcr_mask = PCR_COMPAT_2_05 | PCR_COMPAT_2_06;
|
||||
pcc->init_proc = init_proc_POWER7;
|
||||
pcc->check_pow = check_pow_nocheck;
|
||||
@@ -8189,16 +8138,26 @@ static void init_proc_POWER8(CPUPPCState *env)
|
||||
init_proc_book3s_64(env, BOOK3S_CPU_POWER8);
|
||||
}
|
||||
|
||||
POWERPC_FAMILY(POWER8E)(ObjectClass *oc, void *data)
|
||||
static bool ppc_pvr_match_power8(PowerPCCPUClass *pcc, uint32_t pvr)
|
||||
{
|
||||
if ((pvr & CPU_POWERPC_POWER_SERVER_MASK) == CPU_POWERPC_POWER8E_BASE) {
|
||||
return true;
|
||||
}
|
||||
if ((pvr & CPU_POWERPC_POWER_SERVER_MASK) == CPU_POWERPC_POWER8_BASE) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(oc);
|
||||
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
||||
|
||||
dc->fw_name = "PowerPC,POWER8";
|
||||
dc->desc = "POWER8E";
|
||||
dc->desc = "POWER8";
|
||||
dc->props = powerpc_servercpu_properties;
|
||||
pcc->pvr = CPU_POWERPC_POWER8E_BASE;
|
||||
pcc->pvr_mask = CPU_POWERPC_POWER8E_MASK;
|
||||
pcc->pvr_match = ppc_pvr_match_power8;
|
||||
pcc->pcr_mask = PCR_COMPAT_2_05 | PCR_COMPAT_2_06;
|
||||
pcc->init_proc = init_proc_POWER8;
|
||||
pcc->check_pow = check_pow_nocheck;
|
||||
@@ -8252,18 +8211,6 @@ POWERPC_FAMILY(POWER8E)(ObjectClass *oc, void *data)
|
||||
pcc->l1_icache_size = 0x8000;
|
||||
pcc->interrupts_big_endian = ppc_cpu_interrupts_big_endian_lpcr;
|
||||
}
|
||||
|
||||
POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(oc);
|
||||
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
||||
|
||||
ppc_POWER8E_cpu_family_class_init(oc, data);
|
||||
|
||||
dc->desc = "POWER8";
|
||||
pcc->pvr = CPU_POWERPC_POWER8_BASE;
|
||||
pcc->pvr_mask = CPU_POWERPC_POWER8_MASK;
|
||||
}
|
||||
#endif /* defined (TARGET_PPC64) */
|
||||
|
||||
|
||||
@@ -9245,7 +9192,6 @@ static gint ppc_cpu_compare_class_pvr_mask(gconstpointer a, gconstpointer b)
|
||||
ObjectClass *oc = (ObjectClass *)a;
|
||||
uint32_t pvr = *(uint32_t *)b;
|
||||
PowerPCCPUClass *pcc = (PowerPCCPUClass *)a;
|
||||
gint ret;
|
||||
|
||||
/* -cpu host does a PVR lookup during construction */
|
||||
if (unlikely(strcmp(object_class_get_name(oc),
|
||||
@@ -9257,9 +9203,11 @@ static gint ppc_cpu_compare_class_pvr_mask(gconstpointer a, gconstpointer b)
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = (((pcc->pvr & pcc->pvr_mask) == (pvr & pcc->pvr_mask)) ? 0 : -1);
|
||||
if (pcc->pvr_match(pcc, pvr)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return ret;
|
||||
return -1;
|
||||
}
|
||||
|
||||
PowerPCCPUClass *ppc_cpu_class_by_pvr_mask(uint32_t pvr)
|
||||
@@ -9551,6 +9499,10 @@ static void ppc_cpu_reset(CPUState *s)
|
||||
#endif
|
||||
#if !defined(TARGET_WORDS_BIGENDIAN)
|
||||
msr |= (target_ulong)1 << MSR_LE; /* Little-endian user mode */
|
||||
if (!((env->msr_mask >> MSR_LE) & 1)) {
|
||||
fprintf(stderr, "Selected CPU does not support little-endian.\n");
|
||||
exit(1);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -9656,6 +9608,11 @@ static void ppc_cpu_initfn(Object *obj)
|
||||
}
|
||||
}
|
||||
|
||||
static bool ppc_pvr_match_default(PowerPCCPUClass *pcc, uint32_t pvr)
|
||||
{
|
||||
return pcc->pvr == pvr;
|
||||
}
|
||||
|
||||
static void ppc_cpu_class_init(ObjectClass *oc, void *data)
|
||||
{
|
||||
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
||||
@@ -9663,8 +9620,7 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data)
|
||||
DeviceClass *dc = DEVICE_CLASS(oc);
|
||||
|
||||
pcc->parent_realize = dc->realize;
|
||||
pcc->pvr = CPU_POWERPC_DEFAULT_MASK;
|
||||
pcc->pvr_mask = CPU_POWERPC_DEFAULT_MASK;
|
||||
pcc->pvr_match = ppc_pvr_match_default;
|
||||
pcc->interrupts_big_endian = ppc_cpu_interrupts_big_endian_always;
|
||||
dc->realize = ppc_cpu_realizefn;
|
||||
dc->unrealize = ppc_cpu_unrealizefn;
|
||||
|
@@ -158,7 +158,7 @@ gcov-files-i386-y += hw/usb/hcd-ehci.c
|
||||
gcov-files-i386-y += hw/usb/hcd-uhci.c
|
||||
gcov-files-i386-y += hw/usb/dev-hid.c
|
||||
gcov-files-i386-y += hw/usb/dev-storage.c
|
||||
#check-qtest-i386-y += tests/vhost-user-test$(EXESUF)
|
||||
check-qtest-i386-$(CONFIG_POSIX) += tests/vhost-user-test$(EXESUF)
|
||||
check-qtest-x86_64-y = $(check-qtest-i386-y)
|
||||
gcov-files-i386-y += i386-softmmu/hw/timer/mc146818rtc.c
|
||||
gcov-files-x86_64-y = $(subst i386-softmmu/,x86_64-softmmu/,$(gcov-files-i386-y))
|
||||
@@ -333,11 +333,13 @@ tests/es1370-test$(EXESUF): tests/es1370-test.o
|
||||
tests/intel-hda-test$(EXESUF): tests/intel-hda-test.o
|
||||
tests/ioh3420-test$(EXESUF): tests/ioh3420-test.o
|
||||
tests/usb-hcd-ehci-test$(EXESUF): tests/usb-hcd-ehci-test.o $(libqos-pc-obj-y)
|
||||
tests/vhost-user-test$(EXESUF): tests/vhost-user-test.o qemu-char.o qemu-timer.o libqemuutil.a libqemustub.a
|
||||
tests/vhost-user-test$(EXESUF): tests/vhost-user-test.o qemu-char.o qemu-timer.o $(qtest-obj-y)
|
||||
tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_scm_helper.o
|
||||
tests/test-qemu-opts$(EXESUF): tests/test-qemu-opts.o libqemuutil.a libqemustub.a
|
||||
|
||||
#LIBS+= -lutil
|
||||
ifeq ($(CONFIG_POSIX),y)
|
||||
LIBS += -lutil
|
||||
endif
|
||||
|
||||
# QTest rules
|
||||
|
||||
|
@@ -217,6 +217,11 @@ class TestSingleDriveZeroLength(TestSingleDrive):
|
||||
test_small_buffer2 = None
|
||||
test_large_cluster = None
|
||||
|
||||
class TestSingleDriveUnalignedLength(TestSingleDrive):
|
||||
image_len = 1025 * 1024
|
||||
test_small_buffer2 = None
|
||||
test_large_cluster = None
|
||||
|
||||
class TestMirrorNoBacking(ImageMirroringTestCase):
|
||||
image_len = 2 * 1024 * 1024 # MB
|
||||
|
||||
@@ -735,6 +740,9 @@ class TestRepairQuorum(ImageMirroringTestCase):
|
||||
image_len = 1 * 1024 * 1024 # MB
|
||||
IMAGES = [ quorum_img1, quorum_img2, quorum_img3 ]
|
||||
|
||||
def has_quorum(self):
|
||||
return 'quorum' in iotests.qemu_img_pipe('--help')
|
||||
|
||||
def setUp(self):
|
||||
self.vm = iotests.VM()
|
||||
|
||||
@@ -752,8 +760,9 @@ class TestRepairQuorum(ImageMirroringTestCase):
|
||||
#assemble the quorum block device from the individual files
|
||||
args = { "options" : { "driver": "quorum", "id": "quorum0",
|
||||
"vote-threshold": 2, "children": [ "img0", "img1", "img2" ] } }
|
||||
result = self.vm.qmp("blockdev-add", **args)
|
||||
self.assert_qmp(result, 'return', {})
|
||||
if self.has_quorum():
|
||||
result = self.vm.qmp("blockdev-add", **args)
|
||||
self.assert_qmp(result, 'return', {})
|
||||
|
||||
|
||||
def tearDown(self):
|
||||
@@ -766,6 +775,9 @@ class TestRepairQuorum(ImageMirroringTestCase):
|
||||
pass
|
||||
|
||||
def test_complete(self):
|
||||
if not self.has_quorum():
|
||||
return
|
||||
|
||||
self.assert_no_active_block_jobs()
|
||||
|
||||
result = self.vm.qmp('drive-mirror', device='quorum0', sync='full',
|
||||
@@ -784,6 +796,9 @@ class TestRepairQuorum(ImageMirroringTestCase):
|
||||
'target image does not match source after mirroring')
|
||||
|
||||
def test_cancel(self):
|
||||
if not self.has_quorum():
|
||||
return
|
||||
|
||||
self.assert_no_active_block_jobs()
|
||||
|
||||
result = self.vm.qmp('drive-mirror', device='quorum0', sync='full',
|
||||
@@ -800,6 +815,9 @@ class TestRepairQuorum(ImageMirroringTestCase):
|
||||
self.vm.shutdown()
|
||||
|
||||
def test_cancel_after_ready(self):
|
||||
if not self.has_quorum():
|
||||
return
|
||||
|
||||
self.assert_no_active_block_jobs()
|
||||
|
||||
result = self.vm.qmp('drive-mirror', device='quorum0', sync='full',
|
||||
@@ -818,6 +836,9 @@ class TestRepairQuorum(ImageMirroringTestCase):
|
||||
'target image does not match source after mirroring')
|
||||
|
||||
def test_pause(self):
|
||||
if not self.has_quorum():
|
||||
return
|
||||
|
||||
self.assert_no_active_block_jobs()
|
||||
|
||||
result = self.vm.qmp('drive-mirror', device='quorum0', sync='full',
|
||||
@@ -846,6 +867,9 @@ class TestRepairQuorum(ImageMirroringTestCase):
|
||||
'target image does not match source after mirroring')
|
||||
|
||||
def test_medium_not_found(self):
|
||||
if not self.has_quorum():
|
||||
return
|
||||
|
||||
result = self.vm.qmp('drive-mirror', device='ide1-cd0', sync='full',
|
||||
node_name='repair0',
|
||||
replaces='img1',
|
||||
@@ -853,6 +877,9 @@ class TestRepairQuorum(ImageMirroringTestCase):
|
||||
self.assert_qmp(result, 'error/class', 'GenericError')
|
||||
|
||||
def test_image_not_found(self):
|
||||
if not self.has_quorum():
|
||||
return
|
||||
|
||||
result = self.vm.qmp('drive-mirror', device='quorum0', sync='full',
|
||||
node_name='repair0',
|
||||
replaces='img1',
|
||||
@@ -861,6 +888,9 @@ class TestRepairQuorum(ImageMirroringTestCase):
|
||||
self.assert_qmp(result, 'error/class', 'GenericError')
|
||||
|
||||
def test_device_not_found(self):
|
||||
if not self.has_quorum():
|
||||
return
|
||||
|
||||
result = self.vm.qmp('drive-mirror', device='nonexistent', sync='full',
|
||||
node_name='repair0',
|
||||
replaces='img1',
|
||||
@@ -868,6 +898,9 @@ class TestRepairQuorum(ImageMirroringTestCase):
|
||||
self.assert_qmp(result, 'error/class', 'DeviceNotFound')
|
||||
|
||||
def test_wrong_sync_mode(self):
|
||||
if not self.has_quorum():
|
||||
return
|
||||
|
||||
result = self.vm.qmp('drive-mirror', device='quorum0',
|
||||
node_name='repair0',
|
||||
replaces='img1',
|
||||
@@ -875,12 +908,18 @@ class TestRepairQuorum(ImageMirroringTestCase):
|
||||
self.assert_qmp(result, 'error/class', 'GenericError')
|
||||
|
||||
def test_no_node_name(self):
|
||||
if not self.has_quorum():
|
||||
return
|
||||
|
||||
result = self.vm.qmp('drive-mirror', device='quorum0', sync='full',
|
||||
replaces='img1',
|
||||
target=quorum_repair_img, format=iotests.imgfmt)
|
||||
self.assert_qmp(result, 'error/class', 'GenericError')
|
||||
|
||||
def test_unexistant_replaces(self):
|
||||
if not self.has_quorum():
|
||||
return
|
||||
|
||||
result = self.vm.qmp('drive-mirror', device='quorum0', sync='full',
|
||||
node_name='repair0',
|
||||
replaces='img77',
|
||||
@@ -888,6 +927,9 @@ class TestRepairQuorum(ImageMirroringTestCase):
|
||||
self.assert_qmp(result, 'error/class', 'GenericError')
|
||||
|
||||
def test_after_a_quorum_snapshot(self):
|
||||
if not self.has_quorum():
|
||||
return
|
||||
|
||||
result = self.vm.qmp('blockdev-snapshot-sync', node_name='img1',
|
||||
snapshot_file=quorum_snapshot_file,
|
||||
snapshot_node_name="snap1");
|
||||
|
@@ -1,5 +1,5 @@
|
||||
..............................................
|
||||
......................................................
|
||||
----------------------------------------------------------------------
|
||||
Ran 46 tests
|
||||
Ran 54 tests
|
||||
|
||||
OK
|
||||
|
@@ -390,7 +390,7 @@ static int xen_remove_from_physmap(XenIOState *state,
|
||||
start_addr >>= TARGET_PAGE_BITS;
|
||||
phys_offset >>= TARGET_PAGE_BITS;
|
||||
for (i = 0; i < size; i++) {
|
||||
unsigned long idx = start_addr + i;
|
||||
xen_pfn_t idx = start_addr + i;
|
||||
xen_pfn_t gpfn = phys_offset + i;
|
||||
|
||||
rc = xc_domain_add_to_physmap(xen_xc, xen_domid, XENMAPSPACE_gmfn, idx, gpfn);
|
||||
|
@@ -33,10 +33,10 @@
|
||||
# define DPRINTF(fmt, ...) do { } while (0)
|
||||
#endif
|
||||
|
||||
#if defined(__i386__)
|
||||
#if HOST_LONG_BITS == 32
|
||||
# define MCACHE_BUCKET_SHIFT 16
|
||||
# define MCACHE_MAX_SIZE (1UL<<31) /* 2GB Cap */
|
||||
#elif defined(__x86_64__)
|
||||
#else
|
||||
# define MCACHE_BUCKET_SHIFT 20
|
||||
# define MCACHE_MAX_SIZE (1UL<<35) /* 32GB Cap */
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user