Skip to content

Commit 07ad22a

Browse files
author
Andre Beckus
committed
Merge in changes from QEMU v2.1.1 (that happened since v2.1.0).
Merge from master v2.1.1 tag.
2 parents afcff44 + 3cb451e commit 07ad22a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+711
-238
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.1.0
1+
2.1.1

backends/hostmem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ host_memory_backend_memory_complete(UserCreatable *uc, Error **errp)
304304
/* ensure policy won't be ignored in case memory is preallocated
305305
* before mbind(). note: MPOL_MF_STRICT is ignored on hugepages so
306306
* this doesn't catch hugepage case. */
307-
unsigned flags = MPOL_MF_STRICT;
307+
unsigned flags = MPOL_MF_STRICT | MPOL_MF_MOVE;
308308

309309
/* check for invalid host-nodes and policies and give more verbose
310310
* error messages than mbind(). */

block/blkdebug.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,10 @@ static void error_callback_bh(void *opaque)
449449
static void blkdebug_aio_cancel(BlockDriverAIOCB *blockacb)
450450
{
451451
BlkdebugAIOCB *acb = container_of(blockacb, BlkdebugAIOCB, common);
452+
if (acb->bh) {
453+
qemu_bh_delete(acb->bh);
454+
acb->bh = NULL;
455+
}
452456
qemu_aio_release(acb);
453457
}
454458

block/iscsi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1509,7 +1509,8 @@ static int iscsi_truncate(BlockDriverState *bs, int64_t offset)
15091509
if (iscsilun->allocationmap != NULL) {
15101510
g_free(iscsilun->allocationmap);
15111511
iscsilun->allocationmap =
1512-
bitmap_new(DIV_ROUND_UP(bs->total_sectors,
1512+
bitmap_new(DIV_ROUND_UP(sector_lun2qemu(iscsilun->num_blocks,
1513+
iscsilun),
15131514
iscsilun->cluster_sectors));
15141515
}
15151516

block/raw-posix.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,15 @@ static ssize_t handle_aiocb_rw_linear(RawPosixAIOData *aiocb, char *buf)
747747
}
748748
if (len == -1 && errno == EINTR) {
749749
continue;
750+
} else if (len == -1 && errno == EINVAL &&
751+
(aiocb->bs->open_flags & BDRV_O_NOCACHE) &&
752+
!(aiocb->aio_type & QEMU_AIO_WRITE) &&
753+
offset > 0) {
754+
/* O_DIRECT pread() may fail with EINVAL when offset is unaligned
755+
* after a short read. Assume that O_DIRECT short reads only occur
756+
* at EOF. Therefore this is a short read, not an I/O error.
757+
*/
758+
break;
750759
} else if (len == -1) {
751760
offset = -errno;
752761
break;

configure

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1723,6 +1723,7 @@ fi
17231723

17241724
cat > $TMPC <<EOF
17251725
#include <sys/socket.h>
1726+
#include <linux/ip.h>
17261727
int main(void) { return sizeof(struct mmsghdr); }
17271728
EOF
17281729
if compile_prog "" "" ; then

exec.c

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,15 +430,50 @@ static int cpu_common_post_load(void *opaque, int version_id)
430430
return 0;
431431
}
432432

433+
static int cpu_common_pre_load(void *opaque)
434+
{
435+
CPUState *cpu = opaque;
436+
437+
cpu->exception_index = 0;
438+
439+
return 0;
440+
}
441+
442+
static bool cpu_common_exception_index_needed(void *opaque)
443+
{
444+
CPUState *cpu = opaque;
445+
446+
return cpu->exception_index != 0;
447+
}
448+
449+
static const VMStateDescription vmstate_cpu_common_exception_index = {
450+
.name = "cpu_common/exception_index",
451+
.version_id = 1,
452+
.minimum_version_id = 1,
453+
.fields = (VMStateField[]) {
454+
VMSTATE_INT32(exception_index, CPUState),
455+
VMSTATE_END_OF_LIST()
456+
}
457+
};
458+
433459
const VMStateDescription vmstate_cpu_common = {
434460
.name = "cpu_common",
435461
.version_id = 1,
436462
.minimum_version_id = 1,
463+
.pre_load = cpu_common_pre_load,
437464
.post_load = cpu_common_post_load,
438465
.fields = (VMStateField[]) {
439466
VMSTATE_UINT32(halted, CPUState),
440467
VMSTATE_UINT32(interrupt_request, CPUState),
441468
VMSTATE_END_OF_LIST()
469+
},
470+
.subsections = (VMStateSubsection[]) {
471+
{
472+
.vmsd = &vmstate_cpu_common_exception_index,
473+
.needed = cpu_common_exception_index_needed,
474+
} , {
475+
/* empty */
476+
}
442477
}
443478
};
444479

hw/acpi/pcihp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ static uint64_t pci_read(void *opaque, hwaddr addr, unsigned int size)
231231
uint32_t val = 0;
232232
int bsel = s->hotplug_select;
233233

234-
if (bsel < 0 || bsel > ACPI_PCIHP_MAX_HOTPLUG_BUS) {
234+
if (bsel < 0 || bsel >= ACPI_PCIHP_MAX_HOTPLUG_BUS) {
235235
return 0;
236236
}
237237

hw/arm/virt.c

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,20 +194,41 @@ static void fdt_add_psci_node(const VirtBoardInfo *vbi)
194194

195195
/* No PSCI for TCG yet */
196196
if (kvm_enabled()) {
197+
uint32_t cpu_suspend_fn;
198+
uint32_t cpu_off_fn;
199+
uint32_t cpu_on_fn;
200+
uint32_t migrate_fn;
201+
197202
qemu_fdt_add_subnode(fdt, "/psci");
198203
if (armcpu->psci_version == 2) {
199204
const char comp[] = "arm,psci-0.2\0arm,psci";
200205
qemu_fdt_setprop(fdt, "/psci", "compatible", comp, sizeof(comp));
206+
207+
cpu_off_fn = QEMU_PSCI_0_2_FN_CPU_OFF;
208+
if (arm_feature(&armcpu->env, ARM_FEATURE_AARCH64)) {
209+
cpu_suspend_fn = QEMU_PSCI_0_2_FN64_CPU_SUSPEND;
210+
cpu_on_fn = QEMU_PSCI_0_2_FN64_CPU_ON;
211+
migrate_fn = QEMU_PSCI_0_2_FN64_MIGRATE;
212+
} else {
213+
cpu_suspend_fn = QEMU_PSCI_0_2_FN_CPU_SUSPEND;
214+
cpu_on_fn = QEMU_PSCI_0_2_FN_CPU_ON;
215+
migrate_fn = QEMU_PSCI_0_2_FN_MIGRATE;
216+
}
201217
} else {
202218
qemu_fdt_setprop_string(fdt, "/psci", "compatible", "arm,psci");
219+
220+
cpu_suspend_fn = QEMU_PSCI_0_1_FN_CPU_SUSPEND;
221+
cpu_off_fn = QEMU_PSCI_0_1_FN_CPU_OFF;
222+
cpu_on_fn = QEMU_PSCI_0_1_FN_CPU_ON;
223+
migrate_fn = QEMU_PSCI_0_1_FN_MIGRATE;
203224
}
204225

205226
qemu_fdt_setprop_string(fdt, "/psci", "method", "hvc");
206-
qemu_fdt_setprop_cell(fdt, "/psci", "cpu_suspend",
207-
PSCI_FN_CPU_SUSPEND);
208-
qemu_fdt_setprop_cell(fdt, "/psci", "cpu_off", PSCI_FN_CPU_OFF);
209-
qemu_fdt_setprop_cell(fdt, "/psci", "cpu_on", PSCI_FN_CPU_ON);
210-
qemu_fdt_setprop_cell(fdt, "/psci", "migrate", PSCI_FN_MIGRATE);
227+
228+
qemu_fdt_setprop_cell(fdt, "/psci", "cpu_suspend", cpu_suspend_fn);
229+
qemu_fdt_setprop_cell(fdt, "/psci", "cpu_off", cpu_off_fn);
230+
qemu_fdt_setprop_cell(fdt, "/psci", "cpu_on", cpu_on_fn);
231+
qemu_fdt_setprop_cell(fdt, "/psci", "migrate", migrate_fn);
211232
}
212233
}
213234

hw/block/virtio-blk.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,8 +469,9 @@ static void virtio_blk_dma_restart_bh(void *opaque)
469469
s->rq = NULL;
470470

471471
while (req) {
472+
VirtIOBlockReq *next = req->next;
472473
virtio_blk_handle_request(req, &mrb);
473-
req = req->next;
474+
req = next;
474475
}
475476

476477
virtio_submit_multiwrite(s->bs, &mrb);

0 commit comments

Comments
 (0)