Compare commits
51 Commits
v8.0.4
...
opensuse-4
Author | SHA1 | Date | |
---|---|---|---|
|
b57f42da8d | ||
|
560dd9a3a7 | ||
|
7f33eb9cd4 | ||
|
ed61fdd829 | ||
|
91a6e0481a | ||
|
838eec0353 | ||
|
4bc5570900 | ||
|
756712c75e | ||
|
1048d84e05 | ||
|
4e12b31f16 | ||
|
af88d83b9c | ||
|
f2403fd1c6 | ||
|
ae7f129c60 | ||
|
8aefabab1d | ||
|
29a20e5a2c | ||
|
d91378bc16 | ||
|
d9713ce40d | ||
|
3978d68898 | ||
|
408c3a5686 | ||
|
d35fc8a454 | ||
|
4cc6030332 | ||
|
9e0a90bc4e | ||
|
8fb222aa75 | ||
|
e374e96c7d | ||
|
0a37f2c783 | ||
|
0c7065f882 | ||
|
0256c4cb26 | ||
|
2273c56795 | ||
|
44b8a52346 | ||
|
580a2bae92 | ||
|
d7d839cc6c | ||
|
d6e170d533 | ||
|
de954c9572 | ||
|
785a1da63f | ||
666d34717a | |||
b9fd756a71 | |||
|
34d7972523 | ||
|
3751af319b | ||
|
289b245512 | ||
|
dbc5a51203 | ||
|
982d2cb95c | ||
|
06eeffef91 | ||
|
4956069219 | ||
|
a4c69b30ba | ||
|
1300c99a37 | ||
|
d3114f8537 | ||
|
2d398e9411 | ||
|
a28003060d | ||
|
535b9a7707 | ||
|
dedddb28a9 | ||
|
db75a41fad |
4
Makefile
4
Makefile
@@ -521,7 +521,7 @@ fsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap
|
||||
|
||||
scsi/qemu-pr-helper$(EXESUF): scsi/qemu-pr-helper.o scsi/utils.o $(authz-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
|
||||
ifdef CONFIG_MPATH
|
||||
scsi/qemu-pr-helper$(EXESUF): LIBS += -ludev -lmultipath -lmpathpersist
|
||||
scsi/qemu-pr-helper$(EXESUF): LIBS += -ludev -lmpathpersist -lmultipath
|
||||
endif
|
||||
|
||||
qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/scripts/hxtool
|
||||
@@ -809,6 +809,7 @@ ifneq ($(BLOBS),)
|
||||
$(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(qemu_datadir)"; \
|
||||
done
|
||||
endif
|
||||
ifneq ($(or $(CONFIG_GTK),$(CONFIG_SDL)),)
|
||||
for s in $(ICON_SIZES); do \
|
||||
mkdir -p "$(DESTDIR)/$(qemu_icondir)/hicolor/$${s}/apps"; \
|
||||
$(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu_$${s}.png \
|
||||
@@ -823,6 +824,7 @@ endif
|
||||
mkdir -p "$(DESTDIR)/$(qemu_desktopdir)"
|
||||
$(INSTALL_DATA) $(SRC_PATH)/ui/qemu.desktop \
|
||||
"$(DESTDIR)/$(qemu_desktopdir)/qemu.desktop"
|
||||
endif
|
||||
ifdef CONFIG_GTK
|
||||
$(MAKE) -C po $@
|
||||
endif
|
||||
|
@@ -42,6 +42,10 @@ STPFILES=
|
||||
# Makefile Tests
|
||||
include $(SRC_PATH)/tests/tcg/Makefile.include
|
||||
|
||||
ifdef CONFIG_LINUX_USER
|
||||
PROGS+=$(QEMU_PROG)-binfmt
|
||||
endif
|
||||
|
||||
config-target.h: config-target.h-timestamp
|
||||
config-target.h-timestamp: config-target.mak
|
||||
|
||||
@@ -130,6 +134,8 @@ QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) \
|
||||
obj-y += linux-user/
|
||||
obj-y += gdbstub.o thunk.o
|
||||
|
||||
obj-binfmt-y += linux-user/
|
||||
|
||||
endif #CONFIG_LINUX_USER
|
||||
|
||||
#########################################################
|
||||
@@ -170,7 +176,11 @@ GENERATED_FILES += hmp-commands.h hmp-commands-info.h
|
||||
|
||||
endif # CONFIG_SOFTMMU
|
||||
|
||||
ifdef CONFIG_LINUX_USER
|
||||
dummy := $(call unnest-vars,,obj-y obj-binfmt-y)
|
||||
else
|
||||
dummy := $(call unnest-vars,,obj-y)
|
||||
endif
|
||||
all-obj-y := $(obj-y)
|
||||
|
||||
include $(SRC_PATH)/Makefile.objs
|
||||
@@ -207,6 +217,9 @@ ifdef CONFIG_DARWIN
|
||||
$(call quiet-command,SetFile -a C $@,"SETFILE","$(TARGET_DIR)$@")
|
||||
endif
|
||||
|
||||
$(QEMU_PROG)-binfmt: $(obj-binfmt-y)
|
||||
$(call LINK,$^)
|
||||
|
||||
gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/scripts/feature_to_c.sh
|
||||
$(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/scripts/feature_to_c.sh $@ $(TARGET_XML_FILES),"GEN","$(TARGET_DIR)$@")
|
||||
|
||||
|
@@ -21,6 +21,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
#define HW_POISON_H /* avoid poison since we patch against rules it "enforces" */
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qapi/error.h"
|
||||
|
@@ -22,6 +22,7 @@
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#define HW_POISON_H /* avoid poison since we patch against rules it "enforces" */
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu/option.h"
|
||||
@@ -190,6 +191,17 @@ static void mux_chr_accept_input(Chardev *chr)
|
||||
be->chr_read(be->opaque,
|
||||
&d->buffer[m][d->cons[m]++ & MUX_BUFFER_MASK], 1);
|
||||
}
|
||||
|
||||
#if defined(TARGET_S390X)
|
||||
/*
|
||||
* We're still not able to sync producer and consumer, so let's wait a bit
|
||||
* and try again by then.
|
||||
*/
|
||||
if (d->prod[m] != d->cons[m]) {
|
||||
qemu_mod_timer(d->accept_timer, qemu_get_clock_ns(vm_clock)
|
||||
+ (int64_t)100000);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static int mux_chr_can_read(void *opaque)
|
||||
@@ -324,6 +336,10 @@ static void qemu_chr_open_mux(Chardev *chr,
|
||||
}
|
||||
|
||||
d->focus = -1;
|
||||
#if defined(TARGET_S390X)
|
||||
d->accept_timer = qemu_new_timer_ns(vm_clock,
|
||||
(QEMUTimerCB *)mux_chr_accept_input, chr);
|
||||
#endif
|
||||
/* only default to opened state if we've realized the initial
|
||||
* set of muxes
|
||||
*/
|
||||
|
@@ -22,6 +22,7 @@
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#define HW_POISON_H /* avoid poison since we patch against rules it "enforces" */
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/cutils.h"
|
||||
#include "monitor/monitor.h"
|
||||
|
7
configure
vendored
7
configure
vendored
@@ -3755,7 +3755,7 @@ int main(void) {
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
if compile_prog "" "-ludev -lmultipath -lmpathpersist" ; then
|
||||
if compile_prog "" "-ludev -lmpathpersist -lmultipath" ; then
|
||||
mpathpersist=yes
|
||||
mpathpersist_new_api=yes
|
||||
else
|
||||
@@ -6166,12 +6166,13 @@ if { test "$cpu" = "i386" || test "$cpu" = "x86_64"; } && \
|
||||
fi
|
||||
done
|
||||
fi
|
||||
if test "$cpu" = "ppc64" && test "$targetos" != "Darwin" ; then
|
||||
if test "$cpu" = "ppc64" && test "$targetos" != "Darwin" && \
|
||||
test "$softmmu" = yes ; then
|
||||
roms="$roms spapr-rtas"
|
||||
fi
|
||||
|
||||
# Only build s390-ccw bios if we're on s390x and the compiler has -march=z900
|
||||
if test "$cpu" = "s390x" ; then
|
||||
if test "$cpu" = "s390x" && test "$softmmu" = yes ; then
|
||||
write_c_skeleton
|
||||
if compile_prog "-march=z900" ""; then
|
||||
roms="$roms s390-ccw"
|
||||
|
@@ -542,7 +542,7 @@ static bool
|
||||
vu_set_mem_table_exec_postcopy(VuDev *dev, VhostUserMsg *vmsg)
|
||||
{
|
||||
int i;
|
||||
VhostUserMemory *memory = &vmsg->payload.memory;
|
||||
VhostUserMemory m = vmsg->payload.memory, *memory = &m;
|
||||
dev->nregions = memory->nregions;
|
||||
|
||||
DPRINT("Nregions: %d\n", memory->nregions);
|
||||
@@ -684,7 +684,7 @@ static bool
|
||||
vu_set_mem_table_exec(VuDev *dev, VhostUserMsg *vmsg)
|
||||
{
|
||||
int i;
|
||||
VhostUserMemory *memory = &vmsg->payload.memory;
|
||||
VhostUserMemory m = vmsg->payload.memory, *memory = &m;
|
||||
|
||||
for (i = 0; i < dev->nregions; i++) {
|
||||
VuDevRegion *r = &dev->regions[i];
|
||||
@@ -813,7 +813,7 @@ vu_set_vring_num_exec(VuDev *dev, VhostUserMsg *vmsg)
|
||||
static bool
|
||||
vu_set_vring_addr_exec(VuDev *dev, VhostUserMsg *vmsg)
|
||||
{
|
||||
struct vhost_vring_addr *vra = &vmsg->payload.addr;
|
||||
struct vhost_vring_addr addr = vmsg->payload.addr, *vra = &addr;
|
||||
unsigned int index = vra->index;
|
||||
VuVirtq *vq = &dev->vq[index];
|
||||
|
||||
|
2
exec.c
2
exec.c
@@ -2281,11 +2281,13 @@ RAMBlock *qemu_ram_alloc_from_fd(ram_addr_t size, MemoryRegion *mr,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifndef TARGET_PPC
|
||||
if (kvm_enabled() && !kvm_has_sync_mmu()) {
|
||||
error_setg(errp,
|
||||
"host lacks kvm mmu notifiers, -mem-path unsupported");
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (phys_mem_alloc != qemu_anon_ram_alloc) {
|
||||
/*
|
||||
|
@@ -315,7 +315,7 @@ static bool piix4_vmstate_need_smbus(void *opaque, int version_id)
|
||||
static const VMStateDescription vmstate_acpi = {
|
||||
.name = "piix4_pm",
|
||||
.version_id = 3,
|
||||
.minimum_version_id = 3,
|
||||
.minimum_version_id = 2, /* qemu-kvm */
|
||||
.minimum_version_id_old = 1,
|
||||
.load_state_old = acpi_load_old,
|
||||
.post_load = vmstate_acpi_post_load,
|
||||
|
@@ -263,6 +263,9 @@ static void xen_block_realize(XenDevice *xendev, Error **errp)
|
||||
|
||||
xen_block_set_size(blockdev);
|
||||
|
||||
if (!monitor_add_blk(conf->blk, blockdev->drive->id, errp)) {
|
||||
return;
|
||||
}
|
||||
blockdev->dataplane =
|
||||
xen_block_dataplane_create(xendev, conf, blockdev->props.iothread);
|
||||
}
|
||||
@@ -730,6 +733,8 @@ static XenBlockDrive *xen_block_drive_create(const char *id,
|
||||
const char *mode = qdict_get_try_str(opts, "mode");
|
||||
const char *direct_io_safe = qdict_get_try_str(opts, "direct-io-safe");
|
||||
const char *discard_enable = qdict_get_try_str(opts, "discard-enable");
|
||||
const char *suse_diskcache_disable_flush = qdict_get_try_str(opts,
|
||||
"suse-diskcache-disable-flush");
|
||||
char *driver = NULL;
|
||||
char *filename = NULL;
|
||||
XenBlockDrive *drive = NULL;
|
||||
@@ -799,6 +804,16 @@ static XenBlockDrive *xen_block_drive_create(const char *id,
|
||||
}
|
||||
}
|
||||
|
||||
if (suse_diskcache_disable_flush) {
|
||||
unsigned long value;
|
||||
if (!qemu_strtoul(suse_diskcache_disable_flush, NULL, 2, &value) && !!value) {
|
||||
QDict *cache_qdict = qdict_new();
|
||||
|
||||
qdict_put_bool(cache_qdict, "no-flush", true);
|
||||
qdict_put_obj(file_layer, "cache", QOBJECT(cache_qdict));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* It is necessary to turn file locking off as an emulated device
|
||||
* may have already opened the same image file.
|
||||
|
@@ -33,24 +33,6 @@
|
||||
|
||||
#include "qxl.h"
|
||||
|
||||
/*
|
||||
* NOTE: SPICE_RING_PROD_ITEM accesses memory on the pci bar and as
|
||||
* such can be changed by the guest, so to avoid a guest trigerrable
|
||||
* abort we just qxl_set_guest_bug and set the return to NULL. Still
|
||||
* it may happen as a result of emulator bug as well.
|
||||
*/
|
||||
#undef SPICE_RING_PROD_ITEM
|
||||
#define SPICE_RING_PROD_ITEM(qxl, r, ret) { \
|
||||
uint32_t prod = (r)->prod & SPICE_RING_INDEX_MASK(r); \
|
||||
if (prod >= ARRAY_SIZE((r)->items)) { \
|
||||
qxl_set_guest_bug(qxl, "SPICE_RING_PROD_ITEM indices mismatch " \
|
||||
"%u >= %zu", prod, ARRAY_SIZE((r)->items)); \
|
||||
ret = NULL; \
|
||||
} else { \
|
||||
ret = &(r)->items[prod].el; \
|
||||
} \
|
||||
}
|
||||
|
||||
#undef SPICE_RING_CONS_ITEM
|
||||
#define SPICE_RING_CONS_ITEM(qxl, r, ret) { \
|
||||
uint32_t cons = (r)->cons & SPICE_RING_INDEX_MASK(r); \
|
||||
@@ -414,7 +396,8 @@ static void init_qxl_rom(PCIQXLDevice *d)
|
||||
static void init_qxl_ram(PCIQXLDevice *d)
|
||||
{
|
||||
uint8_t *buf;
|
||||
uint64_t *item;
|
||||
uint32_t prod;
|
||||
QXLReleaseRing *ring;
|
||||
|
||||
buf = d->vga.vram_ptr;
|
||||
d->ram = (QXLRam *)(buf + le32_to_cpu(d->shadow_rom.ram_header_offset));
|
||||
@@ -426,9 +409,12 @@ static void init_qxl_ram(PCIQXLDevice *d)
|
||||
SPICE_RING_INIT(&d->ram->cmd_ring);
|
||||
SPICE_RING_INIT(&d->ram->cursor_ring);
|
||||
SPICE_RING_INIT(&d->ram->release_ring);
|
||||
SPICE_RING_PROD_ITEM(d, &d->ram->release_ring, item);
|
||||
assert(item);
|
||||
*item = 0;
|
||||
|
||||
ring = &d->ram->release_ring;
|
||||
prod = ring->prod & SPICE_RING_INDEX_MASK(ring);
|
||||
assert(prod < ARRAY_SIZE(ring->items));
|
||||
ring->items[prod].el = 0;
|
||||
|
||||
qxl_ring_set_dirty(d);
|
||||
}
|
||||
|
||||
@@ -732,7 +718,7 @@ static int interface_req_cmd_notification(QXLInstance *sin)
|
||||
static inline void qxl_push_free_res(PCIQXLDevice *d, int flush)
|
||||
{
|
||||
QXLReleaseRing *ring = &d->ram->release_ring;
|
||||
uint64_t *item;
|
||||
uint32_t prod;
|
||||
int notify;
|
||||
|
||||
#define QXL_FREE_BUNCH_SIZE 32
|
||||
@@ -759,11 +745,15 @@ static inline void qxl_push_free_res(PCIQXLDevice *d, int flush)
|
||||
if (notify) {
|
||||
qxl_send_events(d, QXL_INTERRUPT_DISPLAY);
|
||||
}
|
||||
SPICE_RING_PROD_ITEM(d, ring, item);
|
||||
if (!item) {
|
||||
|
||||
ring = &d->ram->release_ring;
|
||||
prod = ring->prod & SPICE_RING_INDEX_MASK(ring);
|
||||
if (prod >= ARRAY_SIZE(ring->items)) {
|
||||
qxl_set_guest_bug(d, "SPICE_RING_PROD_ITEM indices mismatch "
|
||||
"%u >= %zu", prod, ARRAY_SIZE(ring->items));
|
||||
return;
|
||||
}
|
||||
*item = 0;
|
||||
ring->items[prod].el = 0;
|
||||
d->num_free_res = 0;
|
||||
d->last_release = NULL;
|
||||
qxl_ring_set_dirty(d);
|
||||
@@ -775,8 +765,12 @@ static void interface_release_resource(QXLInstance *sin,
|
||||
{
|
||||
PCIQXLDevice *qxl = container_of(sin, PCIQXLDevice, ssd.qxl);
|
||||
QXLReleaseRing *ring;
|
||||
uint64_t *item, id;
|
||||
uint32_t prod;
|
||||
uint64_t id;
|
||||
|
||||
if (!ext.info) {
|
||||
return;
|
||||
}
|
||||
if (ext.group_id == MEMSLOT_GROUP_HOST) {
|
||||
/* host group -> vga mode update request */
|
||||
QXLCommandExt *cmdext = (void *)(intptr_t)(ext.info->id);
|
||||
@@ -792,16 +786,18 @@ static void interface_release_resource(QXLInstance *sin,
|
||||
* pci bar 0, $command.release_info
|
||||
*/
|
||||
ring = &qxl->ram->release_ring;
|
||||
SPICE_RING_PROD_ITEM(qxl, ring, item);
|
||||
if (!item) {
|
||||
prod = ring->prod & SPICE_RING_INDEX_MASK(ring);
|
||||
if (prod >= ARRAY_SIZE(ring->items)) {
|
||||
qxl_set_guest_bug(qxl, "SPICE_RING_PROD_ITEM indices mismatch "
|
||||
"%u >= %zu", prod, ARRAY_SIZE(ring->items));
|
||||
return;
|
||||
}
|
||||
if (*item == 0) {
|
||||
if (ring->items[prod].el == 0) {
|
||||
/* stick head into the ring */
|
||||
id = ext.info->id;
|
||||
ext.info->next = 0;
|
||||
qxl_ram_set_dirty(qxl, &ext.info->next);
|
||||
*item = id;
|
||||
ring->items[prod].el = id;
|
||||
qxl_ring_set_dirty(qxl);
|
||||
} else {
|
||||
/* append item to the list */
|
||||
|
@@ -777,6 +777,31 @@ static void pc_i440fx_0_15_machine_options(MachineClass *m)
|
||||
{
|
||||
static GlobalProperty compat[] = {
|
||||
PC_CPU_MODEL_IDS("0.15")
|
||||
{
|
||||
.driver = "VGA",
|
||||
.property = "vgamem_mb",
|
||||
.value = stringify(16),
|
||||
},{
|
||||
.driver = "vmware-svga",
|
||||
.property = "vgamem_mb",
|
||||
.value = stringify(16),
|
||||
},{
|
||||
.driver = "qxl-vga",
|
||||
.property = "vgamem_mb",
|
||||
.value = stringify(16),
|
||||
},{
|
||||
.driver = "qxl",
|
||||
.property = "vgamem_mb",
|
||||
.value = stringify(16),
|
||||
},{
|
||||
.driver = "isa-cirrus-vga",
|
||||
.property = "vgamem_mb",
|
||||
.value = stringify(16),
|
||||
},{
|
||||
.driver = "cirrus-vga",
|
||||
.property = "vgamem_mb",
|
||||
.value = stringify(16),
|
||||
},
|
||||
};
|
||||
|
||||
pc_i440fx_1_0_machine_options(m);
|
||||
|
@@ -288,8 +288,8 @@ static void exynos4210_gic_realize(DeviceState *dev, Error **errp)
|
||||
SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
|
||||
const char cpu_prefix[] = "exynos4210-gic-alias_cpu";
|
||||
const char dist_prefix[] = "exynos4210-gic-alias_dist";
|
||||
char cpu_alias_name[sizeof(cpu_prefix) + 3];
|
||||
char dist_alias_name[sizeof(cpu_prefix) + 3];
|
||||
char cpu_alias_name[sizeof(cpu_prefix) + 7];
|
||||
char dist_alias_name[sizeof(cpu_prefix) + 8];
|
||||
SysBusDevice *gicbusdev;
|
||||
uint32_t i;
|
||||
|
||||
|
@@ -960,6 +960,7 @@ void smbios_entry_add(QemuOpts *opts, Error **errp)
|
||||
struct smbios_structure_header *header;
|
||||
int size;
|
||||
struct smbios_table *table; /* legacy mode only */
|
||||
uint8_t *dbl_nulls, *orig_end;
|
||||
|
||||
qemu_opts_validate(opts, qemu_smbios_file_opts, &err);
|
||||
if (err) {
|
||||
@@ -974,11 +975,21 @@ void smbios_entry_add(QemuOpts *opts, Error **errp)
|
||||
}
|
||||
|
||||
/*
|
||||
* NOTE: standard double '\0' terminator expected, per smbios spec.
|
||||
* (except in legacy mode, where the second '\0' is implicit and
|
||||
* will be inserted by the BIOS).
|
||||
* NOTE: standard double '\0' terminator expected, per smbios spec,
|
||||
* unless the data is formatted for legacy mode, which is used by
|
||||
* pc-i440fx-2.0 and earlier machine types. Legacy mode structures
|
||||
* without strings have no '\0' terminators, and those with strings
|
||||
* also don't have an additional '\0' terminator at the end of the
|
||||
* final string '\0' terminator. The BIOS will add the '\0' terminators
|
||||
* to comply with the smbios spec.
|
||||
* For greater compatibility, regardless of the machine type used,
|
||||
* either format is accepted.
|
||||
*/
|
||||
smbios_tables = g_realloc(smbios_tables, smbios_tables_len + size);
|
||||
smbios_tables = g_realloc(smbios_tables, smbios_tables_len + size + 2);
|
||||
orig_end = smbios_tables + smbios_tables_len + size;
|
||||
/* add extra null bytes to end in case of legacy file data */
|
||||
*orig_end = '\0';
|
||||
*(orig_end + 1) = '\0';
|
||||
header = (struct smbios_structure_header *)(smbios_tables +
|
||||
smbios_tables_len);
|
||||
|
||||
@@ -993,6 +1004,19 @@ void smbios_entry_add(QemuOpts *opts, Error **errp)
|
||||
header->type);
|
||||
return;
|
||||
}
|
||||
for (dbl_nulls = smbios_tables + smbios_tables_len + header->length;
|
||||
dbl_nulls + 2 <= orig_end; dbl_nulls++) {
|
||||
if (*dbl_nulls == '\0' && *(dbl_nulls + 1) == '\0') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (dbl_nulls + 2 < orig_end) {
|
||||
error_setg(errp, "SMBIOS file data malformed");
|
||||
return;
|
||||
}
|
||||
/* increase size by how many extra nulls were actually needed */
|
||||
size += dbl_nulls + 2 - orig_end;
|
||||
smbios_tables = g_realloc(smbios_tables, smbios_tables_len + size);
|
||||
set_bit(header->type, have_binfile_bitmap);
|
||||
|
||||
if (header->type == 4) {
|
||||
@@ -1013,6 +1037,17 @@ void smbios_entry_add(QemuOpts *opts, Error **errp)
|
||||
* delete the one we don't need from smbios_set_defaults(),
|
||||
* once we know which machine version has been requested.
|
||||
*/
|
||||
if (dbl_nulls + 2 == orig_end) {
|
||||
/* chop off nulls to get legacy format */
|
||||
if (header->length + 2 == size) {
|
||||
size -= 2;
|
||||
} else {
|
||||
size -= 1;
|
||||
}
|
||||
} else {
|
||||
/* undo conversion from legacy format to per-spec format */
|
||||
size -= dbl_nulls + 2 - orig_end;
|
||||
}
|
||||
if (!smbios_entries) {
|
||||
smbios_entries_len = sizeof(uint16_t);
|
||||
smbios_entries = g_malloc0(smbios_entries_len);
|
||||
|
@@ -259,6 +259,12 @@ static int pit_dispatch_post_load(void *opaque, int version_id)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool is_qemu_kvm(void *opaque, int version_id)
|
||||
{
|
||||
/* HACK: We ignore incoming migration from upstream qemu */
|
||||
return version_id < 3;
|
||||
}
|
||||
|
||||
static const VMStateDescription vmstate_pit_common = {
|
||||
.name = "i8254",
|
||||
.version_id = 3,
|
||||
@@ -268,6 +274,7 @@ static const VMStateDescription vmstate_pit_common = {
|
||||
.pre_save = pit_dispatch_pre_save,
|
||||
.post_load = pit_dispatch_post_load,
|
||||
.fields = (VMStateField[]) {
|
||||
VMSTATE_UNUSED_TEST(is_qemu_kvm, 4),
|
||||
VMSTATE_UINT32_V(channels[0].irq_disabled, PITCommonState, 3),
|
||||
VMSTATE_STRUCT_ARRAY(channels, PITCommonState, 3, 2,
|
||||
vmstate_pit_channel, PITChannelState),
|
||||
|
@@ -1711,9 +1711,22 @@ static void usb_mtp_write_metadata(MTPState *s, uint64_t dlen)
|
||||
assert(!s->write_pending);
|
||||
assert(p != NULL);
|
||||
|
||||
/*
|
||||
* We are about to access a packed struct. We are confident that the pointer
|
||||
* address won't be unaligned, so we ignore GCC warnings.
|
||||
*/
|
||||
#if defined(CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE) && QEMU_GNUC_PREREQ(9, 0)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
|
||||
#endif
|
||||
|
||||
filename = utf16_to_str(MIN(dataset->length, filename_chars),
|
||||
dataset->filename);
|
||||
|
||||
#if defined(CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE) && QEMU_GNUC_PREREQ(9, 0)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
if (strchr(filename, '/')) {
|
||||
usb_mtp_queue_result(s, RES_PARAMETER_NOT_SUPPORTED, d->trans,
|
||||
0, 0, 0, 0);
|
||||
|
@@ -3322,6 +3322,7 @@ static void usb_xhci_init(XHCIState *xhci)
|
||||
usb_bus_new(&xhci->bus, sizeof(xhci->bus), &xhci_bus_ops, dev);
|
||||
|
||||
for (i = 0; i < usbports; i++) {
|
||||
g_assert(i < MAX(MAXPORTS_2, MAXPORTS_3));
|
||||
speedmask = 0;
|
||||
if (i < xhci->numports_2) {
|
||||
if (xhci_get_flag(xhci, XHCI_FLAG_SS_FIRST)) {
|
||||
|
@@ -34,6 +34,9 @@ typedef struct MuxChardev {
|
||||
Chardev parent;
|
||||
CharBackend *backends[MAX_MUX];
|
||||
CharBackend chr;
|
||||
#if defined(TARGET_S390X)
|
||||
QEMUTimer *accept_timer;
|
||||
#endif
|
||||
int focus;
|
||||
int mux_cnt;
|
||||
int term_got_escape;
|
||||
|
@@ -7,3 +7,5 @@ obj-$(TARGET_HAS_BFLT) += flatload.o
|
||||
obj-$(TARGET_I386) += vm86.o
|
||||
obj-$(TARGET_ARM) += arm/nwfpe/
|
||||
obj-$(TARGET_M68K) += m68k-sim.o
|
||||
|
||||
obj-binfmt-y = binfmt.o
|
||||
|
68
linux-user/binfmt.c
Normal file
68
linux-user/binfmt.c
Normal file
@@ -0,0 +1,68 @@
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
#include <libgen.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef __x86_64__
|
||||
#define ARCH_NAME "x86_64"
|
||||
#endif
|
||||
|
||||
int main(int argc, char **argv, char **envp)
|
||||
{
|
||||
char *binfmt;
|
||||
char **new_argv;
|
||||
|
||||
/*
|
||||
* Check if our file name ends with -binfmt
|
||||
*/
|
||||
binfmt = argv[0] + strlen(argv[0]) - strlen("-binfmt");
|
||||
if (strcmp(binfmt, "-binfmt")) {
|
||||
fprintf(stderr, "%s: Invalid executable name\n", argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
if (argc < 3) {
|
||||
fprintf(stderr, "%s: Please use me through binfmt with P flag\n",
|
||||
argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
binfmt[0] = '\0';
|
||||
/* Now argv[0] is the real qemu binary name */
|
||||
|
||||
#ifdef ARCH_NAME
|
||||
{
|
||||
char *hostbin;
|
||||
char *guestarch;
|
||||
int r;
|
||||
|
||||
guestarch = strrchr(argv[0], '-') ;
|
||||
if (!guestarch) {
|
||||
goto skip;
|
||||
}
|
||||
guestarch++;
|
||||
r = asprintf(&hostbin, "/emul/" ARCH_NAME "-for-%s/%s", guestarch, argv[1]);
|
||||
if ((r > 0) && !access(hostbin, X_OK)) {
|
||||
/*
|
||||
* We found a host binary replacement for the non-host binary. Let's
|
||||
* use that instead!
|
||||
*/
|
||||
return execve(hostbin, &argv[2], envp);
|
||||
}
|
||||
}
|
||||
skip:
|
||||
#endif
|
||||
|
||||
new_argv = (char **)malloc((argc + 2) * sizeof(*new_argv));
|
||||
if (argc > 3) {
|
||||
memcpy(&new_argv[4], &argv[3], (argc - 3) * sizeof(*new_argv));
|
||||
}
|
||||
new_argv[0] = argv[0];
|
||||
new_argv[1] = (char *)"-0";
|
||||
new_argv[2] = argv[2];
|
||||
new_argv[3] = argv[1];
|
||||
new_argv[argc + 1] = NULL;
|
||||
|
||||
return execve(new_argv[0], new_argv, envp);
|
||||
}
|
@@ -2872,7 +2872,7 @@ struct target_elf_prpsinfo {
|
||||
target_gid_t pr_gid;
|
||||
target_pid_t pr_pid, pr_ppid, pr_pgrp, pr_sid;
|
||||
/* Lots missing */
|
||||
char pr_fname[16]; /* filename of executable */
|
||||
char pr_fname[16] QEMU_NONSTRING; /* filename of executable */
|
||||
char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */
|
||||
};
|
||||
|
||||
|
@@ -219,8 +219,25 @@
|
||||
IOCTL(SIOCGRARP, IOC_R, MK_PTR(MK_STRUCT(STRUCT_arpreq)))
|
||||
IOCTL(SIOCGIWNAME, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_char_ifreq)))
|
||||
IOCTL(SIOCGPGRP, IOC_R, MK_PTR(TYPE_INT)) /* pid_t */
|
||||
IOCTL(SIOCGSTAMP, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timeval)))
|
||||
IOCTL(SIOCGSTAMPNS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timespec)))
|
||||
|
||||
/*
|
||||
* We can't use IOCTL_SPECIAL() because it will set
|
||||
* host_cmd to XXX_OLD and XXX_NEW and these macros
|
||||
* are not defined with kernel prior to 5.2.
|
||||
* We must set host_cmd to the same value as in target_cmd
|
||||
* otherwise the consistency check in syscall_init()
|
||||
* will trigger an error.
|
||||
* host_cmd is ignored by the do_ioctl_XXX() helpers.
|
||||
* FIXME: create a macro to define this kind of entry
|
||||
*/
|
||||
{ TARGET_SIOCGSTAMP_OLD, TARGET_SIOCGSTAMP_OLD,
|
||||
"SIOCGSTAMP_OLD", IOC_R, do_ioctl_SIOCGSTAMP },
|
||||
{ TARGET_SIOCGSTAMPNS_OLD, TARGET_SIOCGSTAMPNS_OLD,
|
||||
"SIOCGSTAMPNS_OLD", IOC_R, do_ioctl_SIOCGSTAMPNS },
|
||||
{ TARGET_SIOCGSTAMP_NEW, TARGET_SIOCGSTAMP_NEW,
|
||||
"SIOCGSTAMP_NEW", IOC_R, do_ioctl_SIOCGSTAMP },
|
||||
{ TARGET_SIOCGSTAMPNS_NEW, TARGET_SIOCGSTAMPNS_NEW,
|
||||
"SIOCGSTAMPNS_NEW", IOC_R, do_ioctl_SIOCGSTAMPNS },
|
||||
|
||||
IOCTL(RNDGETENTCNT, IOC_R, MK_PTR(TYPE_INT))
|
||||
IOCTL(RNDADDTOENTCNT, IOC_W, MK_PTR(TYPE_INT))
|
||||
|
@@ -206,10 +206,10 @@ abi_long memcpy_to_target(abi_ulong dest, const void *src,
|
||||
void target_set_brk(abi_ulong new_brk);
|
||||
abi_long do_brk(abi_ulong new_brk);
|
||||
void syscall_init(void);
|
||||
abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
|
||||
abi_long arg2, abi_long arg3, abi_long arg4,
|
||||
abi_long arg5, abi_long arg6, abi_long arg7,
|
||||
abi_long arg8);
|
||||
abi_long do_syscall(void *cpu_env, int num, abi_ulong arg1,
|
||||
abi_ulong arg2, abi_ulong arg3, abi_ulong arg4,
|
||||
abi_ulong arg5, abi_ulong arg6, abi_ulong arg7,
|
||||
abi_ulong arg8);
|
||||
void gemu_log(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
|
||||
extern __thread CPUState *thread_cpu;
|
||||
void cpu_loop(CPUArchState *env);
|
||||
|
@@ -575,6 +575,10 @@ static void QEMU_NORETURN dump_core_and_abort(int target_sig)
|
||||
trace_user_force_sig(env, target_sig, host_sig);
|
||||
gdb_signalled(env, target_sig);
|
||||
|
||||
if (target_sig == 6) {
|
||||
goto no_core;
|
||||
}
|
||||
|
||||
/* dump core if supported by target binary format */
|
||||
if (core_dump_signal(target_sig) && (ts->bprm->core_dump != NULL)) {
|
||||
stop_all_tasks();
|
||||
@@ -592,6 +596,8 @@ static void QEMU_NORETURN dump_core_and_abort(int target_sig)
|
||||
target_sig, strsignal(host_sig), "core dumped" );
|
||||
}
|
||||
|
||||
no_core:
|
||||
|
||||
/* The proper exit code for dying from an uncaught signal is
|
||||
* -<signal>. The kernel doesn't allow exit() or _exit() to pass
|
||||
* a negative value. To get the proper exit code we need to
|
||||
|
@@ -37,6 +37,7 @@
|
||||
#include <sched.h>
|
||||
#include <sys/timex.h>
|
||||
#include <sys/socket.h>
|
||||
#include <linux/sockios.h>
|
||||
#include <sys/un.h>
|
||||
#include <sys/uio.h>
|
||||
#include <poll.h>
|
||||
@@ -1139,8 +1140,9 @@ static inline abi_long copy_from_user_timeval(struct timeval *tv,
|
||||
{
|
||||
struct target_timeval *target_tv;
|
||||
|
||||
if (!lock_user_struct(VERIFY_READ, target_tv, target_tv_addr, 1))
|
||||
if (!lock_user_struct(VERIFY_READ, target_tv, target_tv_addr, 1)) {
|
||||
return -TARGET_EFAULT;
|
||||
}
|
||||
|
||||
__get_user(tv->tv_sec, &target_tv->tv_sec);
|
||||
__get_user(tv->tv_usec, &target_tv->tv_usec);
|
||||
@@ -1155,8 +1157,9 @@ static inline abi_long copy_to_user_timeval(abi_ulong target_tv_addr,
|
||||
{
|
||||
struct target_timeval *target_tv;
|
||||
|
||||
if (!lock_user_struct(VERIFY_WRITE, target_tv, target_tv_addr, 0))
|
||||
if (!lock_user_struct(VERIFY_WRITE, target_tv, target_tv_addr, 0)) {
|
||||
return -TARGET_EFAULT;
|
||||
}
|
||||
|
||||
__put_user(tv->tv_sec, &target_tv->tv_sec);
|
||||
__put_user(tv->tv_usec, &target_tv->tv_usec);
|
||||
@@ -1166,6 +1169,65 @@ static inline abi_long copy_to_user_timeval(abi_ulong target_tv_addr,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline abi_long copy_to_user_timeval64(abi_ulong target_tv_addr,
|
||||
const struct timeval *tv)
|
||||
{
|
||||
struct target__kernel_sock_timeval *target_tv;
|
||||
|
||||
if (!lock_user_struct(VERIFY_WRITE, target_tv, target_tv_addr, 0)) {
|
||||
return -TARGET_EFAULT;
|
||||
}
|
||||
|
||||
__put_user(tv->tv_sec, &target_tv->tv_sec);
|
||||
__put_user(tv->tv_usec, &target_tv->tv_usec);
|
||||
|
||||
unlock_user_struct(target_tv, target_tv_addr, 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline abi_long target_to_host_timespec(struct timespec *host_ts,
|
||||
abi_ulong target_addr)
|
||||
{
|
||||
struct target_timespec *target_ts;
|
||||
|
||||
if (!lock_user_struct(VERIFY_READ, target_ts, target_addr, 1)) {
|
||||
return -TARGET_EFAULT;
|
||||
}
|
||||
__get_user(host_ts->tv_sec, &target_ts->tv_sec);
|
||||
__get_user(host_ts->tv_nsec, &target_ts->tv_nsec);
|
||||
unlock_user_struct(target_ts, target_addr, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline abi_long host_to_target_timespec(abi_ulong target_addr,
|
||||
struct timespec *host_ts)
|
||||
{
|
||||
struct target_timespec *target_ts;
|
||||
|
||||
if (!lock_user_struct(VERIFY_WRITE, target_ts, target_addr, 0)) {
|
||||
return -TARGET_EFAULT;
|
||||
}
|
||||
__put_user(host_ts->tv_sec, &target_ts->tv_sec);
|
||||
__put_user(host_ts->tv_nsec, &target_ts->tv_nsec);
|
||||
unlock_user_struct(target_ts, target_addr, 1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline abi_long host_to_target_timespec64(abi_ulong target_addr,
|
||||
struct timespec *host_ts)
|
||||
{
|
||||
struct target__kernel_timespec *target_ts;
|
||||
|
||||
if (!lock_user_struct(VERIFY_WRITE, target_ts, target_addr, 0)) {
|
||||
return -TARGET_EFAULT;
|
||||
}
|
||||
__put_user(host_ts->tv_sec, &target_ts->tv_sec);
|
||||
__put_user(host_ts->tv_nsec, &target_ts->tv_nsec);
|
||||
unlock_user_struct(target_ts, target_addr, 1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline abi_long copy_from_user_timezone(struct timezone *tz,
|
||||
abi_ulong target_tz_addr)
|
||||
{
|
||||
@@ -4790,6 +4852,54 @@ static abi_long do_ioctl_kdsigaccept(const IOCTLEntry *ie, uint8_t *buf_temp,
|
||||
return get_errno(safe_ioctl(fd, ie->host_cmd, sig));
|
||||
}
|
||||
|
||||
static abi_long do_ioctl_SIOCGSTAMP(const IOCTLEntry *ie, uint8_t *buf_temp,
|
||||
int fd, int cmd, abi_long arg)
|
||||
{
|
||||
struct timeval tv;
|
||||
abi_long ret;
|
||||
|
||||
ret = get_errno(safe_ioctl(fd, SIOCGSTAMP, &tv));
|
||||
if (is_error(ret)) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (cmd == (int)TARGET_SIOCGSTAMP_OLD) {
|
||||
if (copy_to_user_timeval(arg, &tv)) {
|
||||
return -TARGET_EFAULT;
|
||||
}
|
||||
} else {
|
||||
if (copy_to_user_timeval64(arg, &tv)) {
|
||||
return -TARGET_EFAULT;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static abi_long do_ioctl_SIOCGSTAMPNS(const IOCTLEntry *ie, uint8_t *buf_temp,
|
||||
int fd, int cmd, abi_long arg)
|
||||
{
|
||||
struct timespec ts;
|
||||
abi_long ret;
|
||||
|
||||
ret = get_errno(safe_ioctl(fd, SIOCGSTAMPNS, &ts));
|
||||
if (is_error(ret)) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (cmd == (int)TARGET_SIOCGSTAMPNS_OLD) {
|
||||
if (host_to_target_timespec(arg, &ts)) {
|
||||
return -TARGET_EFAULT;
|
||||
}
|
||||
} else{
|
||||
if (host_to_target_timespec64(arg, &ts)) {
|
||||
return -TARGET_EFAULT;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef TIOCGPTPEER
|
||||
static abi_long do_ioctl_tiocgptpeer(const IOCTLEntry *ie, uint8_t *buf_temp,
|
||||
int fd, int cmd, abi_long arg)
|
||||
@@ -4824,7 +4934,19 @@ static abi_long do_ioctl(int fd, int cmd, abi_long arg)
|
||||
ie = ioctl_entries;
|
||||
for(;;) {
|
||||
if (ie->target_cmd == 0) {
|
||||
gemu_log("Unsupported ioctl: cmd=0x%04lx\n", (long)cmd);
|
||||
int i;
|
||||
gemu_log("Unsupported ioctl: cmd=0x%04lx (%x)\n", (unsigned long)cmd,
|
||||
(unsigned int)(cmd & (TARGET_IOC_SIZEMASK << TARGET_IOC_SIZESHIFT))
|
||||
>> TARGET_IOC_SIZESHIFT);
|
||||
for (i = 0; ioctl_entries[i].target_cmd; i++) {
|
||||
if ((ioctl_entries[i].target_cmd & ~(TARGET_IOC_SIZEMASK
|
||||
<< TARGET_IOC_SIZESHIFT)) == (cmd & ~(TARGET_IOC_SIZEMASK <<
|
||||
TARGET_IOC_SIZESHIFT)))
|
||||
gemu_log("%p\t->\t%s (%x)\n", (void *)(unsigned long)
|
||||
ioctl_entries[i].host_cmd, ioctl_entries[i].name,
|
||||
(ioctl_entries[i].target_cmd & (TARGET_IOC_SIZEMASK
|
||||
<< TARGET_IOC_SIZESHIFT)) >> TARGET_IOC_SIZESHIFT);
|
||||
}
|
||||
return -TARGET_ENOSYS;
|
||||
}
|
||||
if (ie->target_cmd == cmd)
|
||||
@@ -4853,6 +4975,13 @@ static abi_long do_ioctl(int fd, int cmd, abi_long arg)
|
||||
arg_type++;
|
||||
target_size = thunk_type_size(arg_type, 0);
|
||||
switch(ie->access) {
|
||||
/*
|
||||
* FIXME: actually the direction given in the ioctl should be
|
||||
* correct so we can assume the communication is uni-directional.
|
||||
* The alsa developers did not like this concept though and
|
||||
* declared ioctls IOC_R and IOC_W even though they were IOC_RW.
|
||||
*/
|
||||
/*
|
||||
case IOC_R:
|
||||
ret = get_errno(safe_ioctl(fd, ie->host_cmd, buf_temp));
|
||||
if (!is_error(ret)) {
|
||||
@@ -4871,6 +5000,7 @@ static abi_long do_ioctl(int fd, int cmd, abi_long arg)
|
||||
unlock_user(argptr, arg, 0);
|
||||
ret = get_errno(safe_ioctl(fd, ie->host_cmd, buf_temp));
|
||||
break;
|
||||
*/
|
||||
default:
|
||||
case IOC_RW:
|
||||
argptr = lock_user(VERIFY_READ, arg, target_size, 1);
|
||||
@@ -6160,32 +6290,6 @@ static inline abi_long target_ftruncate64(void *cpu_env, abi_long arg1,
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline abi_long target_to_host_timespec(struct timespec *host_ts,
|
||||
abi_ulong target_addr)
|
||||
{
|
||||
struct target_timespec *target_ts;
|
||||
|
||||
if (!lock_user_struct(VERIFY_READ, target_ts, target_addr, 1))
|
||||
return -TARGET_EFAULT;
|
||||
__get_user(host_ts->tv_sec, &target_ts->tv_sec);
|
||||
__get_user(host_ts->tv_nsec, &target_ts->tv_nsec);
|
||||
unlock_user_struct(target_ts, target_addr, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline abi_long host_to_target_timespec(abi_ulong target_addr,
|
||||
struct timespec *host_ts)
|
||||
{
|
||||
struct target_timespec *target_ts;
|
||||
|
||||
if (!lock_user_struct(VERIFY_WRITE, target_ts, target_addr, 0))
|
||||
return -TARGET_EFAULT;
|
||||
__put_user(host_ts->tv_sec, &target_ts->tv_sec);
|
||||
__put_user(host_ts->tv_nsec, &target_ts->tv_nsec);
|
||||
unlock_user_struct(target_ts, target_addr, 1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline abi_long target_to_host_itimerspec(struct itimerspec *host_itspec,
|
||||
abi_ulong target_addr)
|
||||
{
|
||||
@@ -6691,6 +6795,25 @@ static int open_self_stat(void *cpu_env, int fd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int open_cpuinfo(void *cpu_env, int fd)
|
||||
{
|
||||
dprintf(fd,
|
||||
"Processor : ARMv7 Processor rev 5 (v7l)\n"
|
||||
"BogoMIPS : 799.53\n"
|
||||
"Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3\n"
|
||||
"CPU implementer : 0x41\n"
|
||||
"CPU architecture: 7\n"
|
||||
"CPU variant : 0x2\n"
|
||||
"CPU part : 0xc08\n"
|
||||
"CPU revision : 5\n"
|
||||
"\n"
|
||||
"Hardware : Genesi Efika MX (Smarttop)\n"
|
||||
"Revision : 51030\n"
|
||||
"Serial : 0000000000000000\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int open_self_auxv(void *cpu_env, int fd)
|
||||
{
|
||||
CPUState *cpu = ENV_GET_CPU((CPUArchState *)cpu_env);
|
||||
@@ -6811,6 +6934,7 @@ static int do_openat(void *cpu_env, int dirfd, const char *pathname, int flags,
|
||||
#if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
|
||||
{ "/proc/net/route", open_net_route, is_proc },
|
||||
#endif
|
||||
{ "cpuinfo", open_cpuinfo, is_proc_myself },
|
||||
{ NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
@@ -6948,10 +7072,10 @@ static int host_to_target_cpu_mask(const unsigned long *host_mask,
|
||||
* of syscall results, can be performed.
|
||||
* All errnos that do_syscall() returns must be -TARGET_<errcode>.
|
||||
*/
|
||||
static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
|
||||
abi_long arg2, abi_long arg3, abi_long arg4,
|
||||
abi_long arg5, abi_long arg6, abi_long arg7,
|
||||
abi_long arg8)
|
||||
static abi_long do_syscall1(void *cpu_env, int num, abi_ulong arg1,
|
||||
abi_ulong arg2, abi_ulong arg3, abi_ulong arg4,
|
||||
abi_ulong arg5, abi_ulong arg6, abi_ulong arg7,
|
||||
abi_ulong arg8)
|
||||
{
|
||||
CPUState *cpu = ENV_GET_CPU(cpu_env);
|
||||
abi_long ret;
|
||||
@@ -7302,8 +7426,13 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
|
||||
return ret;
|
||||
#endif
|
||||
#ifdef TARGET_NR_lseek
|
||||
case TARGET_NR_lseek:
|
||||
return get_errno(lseek(arg1, arg2, arg3));
|
||||
case TARGET_NR_lseek: {
|
||||
off_t off = arg2;
|
||||
if (arg3 != SEEK_SET) {
|
||||
off = (abi_long)arg2;
|
||||
}
|
||||
return get_errno(lseek(arg1, off, arg3));
|
||||
}
|
||||
#endif
|
||||
#if defined(TARGET_NR_getxpid) && defined(TARGET_ALPHA)
|
||||
/* Alpha specific */
|
||||
@@ -8173,6 +8302,9 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
|
||||
case TARGET_NR_gettimeofday:
|
||||
{
|
||||
struct timeval tv;
|
||||
if (copy_from_user_timeval(&tv, arg1)) {
|
||||
return -TARGET_EFAULT;
|
||||
}
|
||||
ret = get_errno(gettimeofday(&tv, NULL));
|
||||
if (!is_error(ret)) {
|
||||
if (copy_to_user_timeval(arg1, &tv))
|
||||
@@ -9312,7 +9444,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
|
||||
{
|
||||
struct timespec ts, *pts;
|
||||
|
||||
if (arg3 >= 0) {
|
||||
if ((abi_long)arg3 >= 0) {
|
||||
/* Convert ms to secs, ns */
|
||||
ts.tv_sec = arg3 / 1000;
|
||||
ts.tv_nsec = (arg3 % 1000) * 1000000LL;
|
||||
@@ -9684,7 +9816,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
|
||||
*/
|
||||
ret = -TARGET_EINVAL;
|
||||
if (cpu_isar_feature(aa64_sve, arm_env_get_cpu(cpu_env))
|
||||
&& arg2 >= 0 && arg2 <= 512 * 16 && !(arg2 & 15)) {
|
||||
&& arg2 <= 512 * 16 && !(arg2 & 15)) {
|
||||
CPUARMState *env = cpu_env;
|
||||
ARMCPU *cpu = arm_env_get_cpu(env);
|
||||
uint32_t vq, old_vq;
|
||||
@@ -11587,10 +11719,10 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
|
||||
return ret;
|
||||
}
|
||||
|
||||
abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
|
||||
abi_long arg2, abi_long arg3, abi_long arg4,
|
||||
abi_long arg5, abi_long arg6, abi_long arg7,
|
||||
abi_long arg8)
|
||||
abi_long do_syscall(void *cpu_env, int num, abi_ulong arg1,
|
||||
abi_ulong arg2, abi_ulong arg3, abi_ulong arg4,
|
||||
abi_ulong arg5, abi_ulong arg6, abi_ulong arg7,
|
||||
abi_ulong arg8)
|
||||
{
|
||||
CPUState *cpu = ENV_GET_CPU(cpu_env);
|
||||
abi_long ret;
|
||||
|
@@ -208,16 +208,34 @@ struct target_linger {
|
||||
abi_int l_linger; /* How long to linger for */
|
||||
};
|
||||
|
||||
#if defined(TARGET_SPARC64) && !defined(TARGET_ABI32)
|
||||
struct target_timeval {
|
||||
abi_long tv_sec;
|
||||
abi_int tv_usec;
|
||||
};
|
||||
#define target__kernel_sock_timeval target_timeval
|
||||
#else
|
||||
struct target_timeval {
|
||||
abi_long tv_sec;
|
||||
abi_long tv_usec;
|
||||
};
|
||||
|
||||
struct target__kernel_sock_timeval {
|
||||
abi_llong tv_sec;
|
||||
abi_llong tv_usec;
|
||||
};
|
||||
#endif
|
||||
|
||||
struct target_timespec {
|
||||
abi_long tv_sec;
|
||||
abi_long tv_nsec;
|
||||
};
|
||||
|
||||
struct target__kernel_timespec {
|
||||
abi_llong tv_sec;
|
||||
abi_llong tv_nsec;
|
||||
};
|
||||
|
||||
struct target_timezone {
|
||||
abi_int tz_minuteswest;
|
||||
abi_int tz_dsttime;
|
||||
@@ -743,8 +761,17 @@ struct target_pollfd {
|
||||
#define TARGET_SIOCATMARK 0x8905
|
||||
#define TARGET_SIOCGPGRP 0x8904
|
||||
#endif
|
||||
#define TARGET_SIOCGSTAMP 0x8906 /* Get stamp (timeval) */
|
||||
#define TARGET_SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */
|
||||
|
||||
#if defined(TARGET_SH4)
|
||||
#define TARGET_SIOCGSTAMP_OLD TARGET_IOR('s', 100, struct target_timeval)
|
||||
#define TARGET_SIOCGSTAMPNS_OLD TARGET_IOR('s', 101, struct target_timespec)
|
||||
#else
|
||||
#define TARGET_SIOCGSTAMP_OLD 0x8906
|
||||
#define TARGET_SIOCGSTAMPNS_OLD 0x8907
|
||||
#endif
|
||||
|
||||
#define TARGET_SIOCGSTAMP_NEW TARGET_IOR(0x89, 0x06, abi_llong[2])
|
||||
#define TARGET_SIOCGSTAMPNS_NEW TARGET_IOR(0x89, 0x07, abi_llong[2])
|
||||
|
||||
/* Networking ioctls */
|
||||
#define TARGET_SIOCADDRT 0x890B /* add routing table entry */
|
||||
|
@@ -14,12 +14,6 @@ STRUCT(serial_icounter_struct,
|
||||
STRUCT(sockaddr,
|
||||
TYPE_SHORT, MK_ARRAY(TYPE_CHAR, 14))
|
||||
|
||||
STRUCT(timeval,
|
||||
MK_ARRAY(TYPE_LONG, 2))
|
||||
|
||||
STRUCT(timespec,
|
||||
MK_ARRAY(TYPE_LONG, 2))
|
||||
|
||||
STRUCT(rtentry,
|
||||
TYPE_ULONG, MK_STRUCT(STRUCT_sockaddr), MK_STRUCT(STRUCT_sockaddr), MK_STRUCT(STRUCT_sockaddr),
|
||||
TYPE_SHORT, TYPE_SHORT, TYPE_ULONG, TYPE_PTRVOID, TYPE_SHORT, TYPE_PTRVOID,
|
||||
|
@@ -72,9 +72,8 @@ const char *cpu_to_uname_machine(void *cpu_env)
|
||||
|
||||
#define COPY_UTSNAME_FIELD(dest, src) \
|
||||
do { \
|
||||
/* __NEW_UTS_LEN doesn't include terminating null */ \
|
||||
(void) strncpy((dest), (src), __NEW_UTS_LEN); \
|
||||
(dest)[__NEW_UTS_LEN] = '\0'; \
|
||||
memcpy((dest), (src), MIN(sizeof(src), sizeof(dest))); \
|
||||
(dest)[sizeof(dest) - 1] = '\0'; \
|
||||
} while (0)
|
||||
|
||||
int sys_uname(struct new_utsname *buf)
|
||||
|
@@ -2689,7 +2689,7 @@ void qmp_xen_save_devices_state(const char *filename, bool has_live, bool live,
|
||||
* So call bdrv_inactivate_all (release locks) here to let the other
|
||||
* side of the migration take controle of the images.
|
||||
*/
|
||||
if (live && !saved_vm_running) {
|
||||
if (!saved_vm_running) {
|
||||
ret = bdrv_inactivate_all();
|
||||
if (ret) {
|
||||
error_setg(errp, "%s: bdrv_inactivate_all() failed (%d)",
|
||||
|
@@ -53,6 +53,7 @@ libc.a: $(LIBCOBJS)
|
||||
LIBNETOBJS := args.o dhcp.o dns.o icmpv6.o ipv6.o tcp.o udp.o bootp.o \
|
||||
dhcpv6.o ethernet.o ipv4.o ndp.o tftp.o pxelinux.o
|
||||
LIBNETCFLAGS := $(QEMU_CFLAGS) $(CFLAGS) -DDHCPARCH=0x1F $(LIBC_INC) $(LIBNET_INC)
|
||||
LIBNETCFLAGS += -Wno-address-of-packed-member
|
||||
|
||||
%.o : $(SLOF_DIR)/lib/libnet/%.c
|
||||
$(call quiet-command,$(CC) $(LIBNETCFLAGS) -c -o $@ $<,"CC","$(TARGET_DIR)$@")
|
||||
|
@@ -109,8 +109,20 @@ static int parse_acl_file(const char *filename, ACLList *acl_list)
|
||||
}
|
||||
*argend = 0;
|
||||
|
||||
if (!g_str_equal(cmd, "include") && strlen(arg) >= IFNAMSIZ) {
|
||||
fprintf(stderr, "name `%s' too long: %zu\n", arg, strlen(arg));
|
||||
fclose(f);
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (strcmp(cmd, "deny") == 0) {
|
||||
acl_rule = g_malloc(sizeof(*acl_rule));
|
||||
acl_rule = calloc(1, sizeof(*acl_rule));
|
||||
if (!acl_rule) {
|
||||
fclose(f);
|
||||
errno = ENOMEM;
|
||||
return -1;
|
||||
}
|
||||
if (strcmp(arg, "all") == 0) {
|
||||
acl_rule->type = ACL_DENY_ALL;
|
||||
} else {
|
||||
@@ -119,7 +131,12 @@ static int parse_acl_file(const char *filename, ACLList *acl_list)
|
||||
}
|
||||
QSIMPLEQ_INSERT_TAIL(acl_list, acl_rule, entry);
|
||||
} else if (strcmp(cmd, "allow") == 0) {
|
||||
acl_rule = g_malloc(sizeof(*acl_rule));
|
||||
acl_rule = calloc(1, sizeof(*acl_rule));
|
||||
if (!acl_rule) {
|
||||
fclose(f);
|
||||
errno = ENOMEM;
|
||||
return -1;
|
||||
}
|
||||
if (strcmp(arg, "all") == 0) {
|
||||
acl_rule->type = ACL_ALLOW_ALL;
|
||||
} else {
|
||||
@@ -254,6 +271,10 @@ int main(int argc, char **argv)
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
if (strlen(bridge) >= IFNAMSIZ) {
|
||||
fprintf(stderr, "name `%s' too long: %zu\n", bridge, strlen(bridge));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (bridge == NULL || unixfd == -1) {
|
||||
usage();
|
||||
@@ -413,6 +434,18 @@ int main(int argc, char **argv)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_LIBCAP
|
||||
/*
|
||||
* avoid sending the fd as root user if running suid to not fool
|
||||
* peer credentials to daemons that dont expect that
|
||||
*/
|
||||
if (setuid(getuid()) < 0) {
|
||||
fprintf(stderr, "Failed to drop privileges.\n");
|
||||
ret = EXIT_FAILURE;
|
||||
goto cleanup;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* write fd to the domain socket */
|
||||
if (send_fd(unixfd, fd) == -1) {
|
||||
fprintf(stderr, "failed to write fd to unix socket: %s\n",
|
||||
@@ -434,7 +467,7 @@ cleanup:
|
||||
}
|
||||
while ((acl_rule = QSIMPLEQ_FIRST(&acl_list)) != NULL) {
|
||||
QSIMPLEQ_REMOVE_HEAD(&acl_list, entry);
|
||||
g_free(acl_rule);
|
||||
free(acl_rule);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@@ -49,6 +49,12 @@ SEABIOS_EXTRAVERSION="-prebuilt.qemu.org"
|
||||
#
|
||||
EDK2_EFIROM = edk2/BaseTools/Source/C/bin/EfiRom
|
||||
|
||||
# NB: Certain SUSE qemu subpackages use date information, but we want
|
||||
# reproducible builds, so we use a pre-determined timestamp, rather
|
||||
# than the current timestamp to acheive consistent results build to
|
||||
# build.
|
||||
PACKAGING_TIMESTAMP = $(shell date -r ../VERSION +%s)
|
||||
|
||||
default:
|
||||
@echo "nothing is build by default"
|
||||
@echo "available build targets:"
|
||||
@@ -91,7 +97,7 @@ build-seabios-config-%: config.%
|
||||
|
||||
.PHONY: sgabios skiboot
|
||||
sgabios:
|
||||
$(MAKE) -C sgabios
|
||||
$(MAKE) -C sgabios PACKAGING_TIMESTAMP=$(PACKAGING_TIMESTAMP)
|
||||
cp sgabios/sgabios.bin ../pc-bios
|
||||
|
||||
|
||||
@@ -111,11 +117,13 @@ efi-rom-%: build-pxe-roms build-efi-roms $(EDK2_EFIROM)
|
||||
|
||||
build-pxe-roms:
|
||||
$(MAKE) -C ipxe/src CONFIG=qemu \
|
||||
PACKAGING_TIMESTAMP=$(PACKAGING_TIMESTAMP) \
|
||||
CROSS_COMPILE=$(x86_64_cross_prefix) \
|
||||
$(patsubst %,bin/%.rom,$(pxerom_targets))
|
||||
|
||||
build-efi-roms: build-pxe-roms
|
||||
$(MAKE) -C ipxe/src CONFIG=qemu \
|
||||
PACKAGING_TIMESTAMP=$(PACKAGING_TIMESTAMP) \
|
||||
CROSS_COMPILE=$(x86_64_cross_prefix) \
|
||||
$(patsubst %,bin-i386-efi/%.efidrv,$(pxerom_targets)) \
|
||||
$(patsubst %,bin-x86_64-efi/%.efidrv,$(pxerom_targets))
|
||||
@@ -137,7 +145,9 @@ $(EDK2_EFIROM):
|
||||
EXTRA_LDFLAGS='$(EDK2_BASETOOLS_LDFLAGS)'
|
||||
|
||||
slof:
|
||||
$(MAKE) -C SLOF CROSS=$(powerpc64_cross_prefix) qemu
|
||||
$(MAKE) -C SLOF CROSS=$(powerpc64_cross_prefix) \
|
||||
PACKAGING_TIMESTAMP=$(PACKAGING_TIMESTAMP) \
|
||||
qemu
|
||||
cp SLOF/boot_rom.bin ../pc-bios/slof.bin
|
||||
|
||||
u-boot.e500:
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/python3
|
||||
#
|
||||
# Migration Stream Analyzer
|
||||
#
|
||||
|
@@ -262,7 +262,7 @@ qemu_generate_register() {
|
||||
flags="${flags}F"
|
||||
fi
|
||||
|
||||
echo ":qemu-$cpu:M::$magic:$mask:$qemu:$flags"
|
||||
echo ":qemu-$cpu:M::$magic:$mask:$qemu:P$flags"
|
||||
}
|
||||
|
||||
qemu_register_interpreter() {
|
||||
@@ -301,9 +301,9 @@ qemu_set_binfmts() {
|
||||
continue
|
||||
fi
|
||||
|
||||
qemu="$QEMU_PATH/qemu-$cpu"
|
||||
qemu="$QEMU_PATH/qemu-$cpu-binfmt"
|
||||
if [ "$cpu" = "i486" ] ; then
|
||||
qemu="$QEMU_PATH/qemu-i386"
|
||||
qemu="$QEMU_PATH/qemu-i386-binfmt"
|
||||
fi
|
||||
|
||||
qemu="$qemu$QEMU_SUFFIX"
|
||||
@@ -319,7 +319,7 @@ BINFMT_SET=qemu_register_interpreter
|
||||
SYSTEMDDIR="/etc/binfmt.d"
|
||||
DEBIANDIR="/usr/share/binfmts"
|
||||
|
||||
QEMU_PATH=/usr/local/bin
|
||||
QEMU_PATH=/usr/bin
|
||||
CREDENTIAL=no
|
||||
PERSISTENT=no
|
||||
QEMU_SUFFIX=""
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/python
|
||||
#!/usr/bin/python3
|
||||
#
|
||||
# Compares vmstate information stored in JSON format, obtained from
|
||||
# the -dump-vmstate QEMU command.
|
||||
|
@@ -1076,7 +1076,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
|
||||
.feat_names = {
|
||||
NULL, NULL, "avx512-4vnniw", "avx512-4fmaps",
|
||||
NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, "md-clear", NULL,
|
||||
NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL,
|
||||
|
@@ -1708,7 +1708,7 @@ uint64_t cpu_get_tsc(CPUX86State *env);
|
||||
/* XXX: This value should match the one returned by CPUID
|
||||
* and in exec.c */
|
||||
# if defined(TARGET_X86_64)
|
||||
# define TCG_PHYS_ADDR_BITS 40
|
||||
# define TCG_PHYS_ADDR_BITS 42
|
||||
# else
|
||||
# define TCG_PHYS_ADDR_BITS 36
|
||||
# endif
|
||||
|
@@ -906,7 +906,6 @@ static int hyperv_init_vcpu(X86CPU *cpu)
|
||||
}
|
||||
|
||||
static Error *invtsc_mig_blocker;
|
||||
static Error *vmx_mig_blocker;
|
||||
|
||||
#define KVM_MAX_CPUID_ENTRIES 100
|
||||
|
||||
@@ -1270,17 +1269,6 @@ int kvm_arch_init_vcpu(CPUState *cs)
|
||||
!!(c->ecx & CPUID_EXT_SMX);
|
||||
}
|
||||
|
||||
if ((env->features[FEAT_1_ECX] & CPUID_EXT_VMX) && !vmx_mig_blocker) {
|
||||
error_setg(&vmx_mig_blocker,
|
||||
"Nested VMX virtualization does not support live migration yet");
|
||||
r = migrate_add_blocker(vmx_mig_blocker, &local_err);
|
||||
if (local_err) {
|
||||
error_report_err(local_err);
|
||||
error_free(vmx_mig_blocker);
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
if (env->mcg_cap & MCG_LMCE_P) {
|
||||
has_msr_mcg_ext_ctl = has_msr_feature_control = true;
|
||||
}
|
||||
|
@@ -2605,7 +2605,7 @@ int kvmppc_define_rtas_kernel_token(uint32_t token, const char *function)
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
strncpy(args.name, function, sizeof(args.name));
|
||||
strncpy(args.name, function, sizeof(args.name) - 1);
|
||||
|
||||
return kvm_vm_ioctl(kvm_state, KVM_PPC_RTAS_DEFINE_TOKEN, &args);
|
||||
}
|
||||
|
@@ -923,7 +923,7 @@ check-report-unit.tap: $(check-unit-y)
|
||||
# Reports and overall runs
|
||||
|
||||
check-report.tap: $(patsubst %,check-report-qtest-%.tap, $(QTEST_TARGETS)) check-report-unit.tap
|
||||
$(call quiet-command,./scripts/tap-merge.py $^ > $@,"GEN","$@")
|
||||
$(call quiet-command,./scripts/tap-merge.pl < $^ > $@,"GEN","$@")
|
||||
|
||||
# FPU Emulation tests (aka softfloat)
|
||||
#
|
||||
|
@@ -63,6 +63,7 @@ echo
|
||||
# Test that a backing file isn't written
|
||||
_launch_qemu -drive id=testdisk,file="$TEST_IMG",backing.file.filename="$TEST_IMG.base"
|
||||
_send_qemu_cmd $QEMU_HANDLE "commit testdisk" "(qemu)"
|
||||
sleep 5
|
||||
_send_qemu_cmd $QEMU_HANDLE '' '(qemu)'
|
||||
_cleanup_qemu
|
||||
_img_info | _filter_img_info
|
||||
@@ -72,6 +73,7 @@ _img_info | _filter_img_info
|
||||
_make_test_img -F raw -b "$TEST_IMG.orig" 64M
|
||||
_launch_qemu -drive id=testdisk,file="$TEST_IMG",backing.file.filename="$TEST_IMG.base",backing.driver=$IMGFMT
|
||||
_send_qemu_cmd $QEMU_HANDLE "commit testdisk" "(qemu)"
|
||||
sleep 5
|
||||
_send_qemu_cmd $QEMU_HANDLE '' '(qemu)'
|
||||
_cleanup_qemu
|
||||
_img_info | _filter_img_info
|
||||
|
@@ -1,7 +1,7 @@
|
||||
QA output created by 162
|
||||
|
||||
=== NBD ===
|
||||
qemu-img: Could not open 'json:{"driver": "nbd", "host": 42}': Failed to connect socket: Invalid argument
|
||||
qemu-img: Could not open 'json:{"driver": "nbd", "host": 42}': Failed to connect socket: Network is unreachable
|
||||
image: nbd://localhost:PORT
|
||||
image: nbd+unix://?socket=42
|
||||
|
||||
|
@@ -76,7 +76,7 @@ _timed_wait_for()
|
||||
timeout=yes
|
||||
|
||||
QEMU_STATUS[$h]=0
|
||||
while IFS= read -t ${QEMU_COMM_TIMEOUT} resp <&${QEMU_OUT[$h]}
|
||||
while IFS= read -t $((${QEMU_COMM_TIMEOUT}*3)) resp <&${QEMU_OUT[$h]}
|
||||
do
|
||||
if [ -z "${silent}" ] && [ -z "${mismatch_only}" ]; then
|
||||
echo "${resp}" | _filter_testdir | _filter_qemu \
|
||||
|
@@ -1,3 +1,4 @@
|
||||
#define HW_POISON_H /* avoid poison since we patch against rules it "enforces" */
|
||||
#include "qemu/osdep.h"
|
||||
#include <glib/gstdio.h>
|
||||
|
||||
|
@@ -171,6 +171,7 @@ static void do_test_cancel(bool sync)
|
||||
/* Cancel the jobs that haven't been started yet. */
|
||||
num_canceled = 0;
|
||||
for (i = 0; i < 100; i++) {
|
||||
smp_mb(); /* test is currently racy */
|
||||
if (atomic_cmpxchg(&data[i].n, 0, 3) == 0) {
|
||||
data[i].ret = -ECANCELED;
|
||||
if (sync) {
|
||||
@@ -185,6 +186,7 @@ static void do_test_cancel(bool sync)
|
||||
g_assert_cmpint(num_canceled, <, 100);
|
||||
|
||||
for (i = 0; i < 100; i++) {
|
||||
smp_mb(); /* test is currently racy */
|
||||
if (data[i].aiocb && data[i].n != 3) {
|
||||
if (sync) {
|
||||
/* Canceling the others will be a blocking operation. */
|
||||
@@ -201,6 +203,7 @@ static void do_test_cancel(bool sync)
|
||||
}
|
||||
g_assert_cmpint(active, ==, 0);
|
||||
for (i = 0; i < 100; i++) {
|
||||
smp_mb(); /* test is currently racy */
|
||||
if (data[i].n == 3) {
|
||||
g_assert_cmpint(data[i].ret, ==, -ECANCELED);
|
||||
g_assert(data[i].aiocb == NULL);
|
||||
|
@@ -59,7 +59,11 @@ void qkbd_state_key_event(QKbdState *kbd, QKeyCode qcode, bool down)
|
||||
}
|
||||
|
||||
/* update key and modifier state */
|
||||
change_bit(qcode, kbd->keys);
|
||||
if (down) {
|
||||
set_bit(qcode, kbd->keys);
|
||||
} else {
|
||||
clear_bit(qcode, kbd->keys);
|
||||
}
|
||||
switch (qcode) {
|
||||
case Q_KEY_CODE_SHIFT:
|
||||
case Q_KEY_CODE_SHIFT_R:
|
||||
|
@@ -830,6 +830,7 @@ static int unix_listen_saddr(UnixSocketAddress *saddr,
|
||||
int sock, fd;
|
||||
char *pathbuf = NULL;
|
||||
const char *path;
|
||||
size_t pathlen;
|
||||
|
||||
sock = qemu_socket(PF_UNIX, SOCK_STREAM, 0);
|
||||
if (sock < 0) {
|
||||
@@ -845,7 +846,8 @@ static int unix_listen_saddr(UnixSocketAddress *saddr,
|
||||
path = pathbuf = g_strdup_printf("%s/qemu-socket-XXXXXX", tmpdir);
|
||||
}
|
||||
|
||||
if (strlen(path) > sizeof(un.sun_path)) {
|
||||
pathlen = strlen(path);
|
||||
if (pathlen > sizeof(un.sun_path)) {
|
||||
error_setg(errp, "UNIX socket path '%s' is too long", path);
|
||||
error_append_hint(errp, "Path must be less than %zu bytes\n",
|
||||
sizeof(un.sun_path));
|
||||
@@ -877,7 +879,7 @@ static int unix_listen_saddr(UnixSocketAddress *saddr,
|
||||
|
||||
memset(&un, 0, sizeof(un));
|
||||
un.sun_family = AF_UNIX;
|
||||
strncpy(un.sun_path, path, sizeof(un.sun_path));
|
||||
memcpy(un.sun_path, path, pathlen);
|
||||
|
||||
if (bind(sock, (struct sockaddr*) &un, sizeof(un)) < 0) {
|
||||
error_setg_errno(errp, errno, "Failed to bind socket to %s", path);
|
||||
@@ -901,6 +903,7 @@ static int unix_connect_saddr(UnixSocketAddress *saddr, Error **errp)
|
||||
{
|
||||
struct sockaddr_un un;
|
||||
int sock, rc;
|
||||
size_t pathlen;
|
||||
|
||||
if (saddr->path == NULL) {
|
||||
error_setg(errp, "unix connect: no path specified");
|
||||
@@ -913,7 +916,8 @@ static int unix_connect_saddr(UnixSocketAddress *saddr, Error **errp)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (strlen(saddr->path) > sizeof(un.sun_path)) {
|
||||
pathlen = strlen(saddr->path);
|
||||
if (pathlen > sizeof(un.sun_path)) {
|
||||
error_setg(errp, "UNIX socket path '%s' is too long", saddr->path);
|
||||
error_append_hint(errp, "Path must be less than %zu bytes\n",
|
||||
sizeof(un.sun_path));
|
||||
@@ -922,7 +926,7 @@ static int unix_connect_saddr(UnixSocketAddress *saddr, Error **errp)
|
||||
|
||||
memset(&un, 0, sizeof(un));
|
||||
un.sun_family = AF_UNIX;
|
||||
strncpy(un.sun_path, saddr->path, sizeof(un.sun_path));
|
||||
memcpy(un.sun_path, saddr->path, pathlen);
|
||||
|
||||
/* connect to peer */
|
||||
do {
|
||||
|
@@ -308,7 +308,12 @@ static void thread_pool_init_one(ThreadPool *pool, AioContext *ctx)
|
||||
qemu_mutex_init(&pool->lock);
|
||||
qemu_cond_init(&pool->worker_stopped);
|
||||
qemu_sem_init(&pool->sem, 0);
|
||||
pool->max_threads = 64;
|
||||
if (sizeof(pool) == 4) {
|
||||
/* 32bit systems run out of virtual memory quickly */
|
||||
pool->max_threads = 4;
|
||||
} else {
|
||||
pool->max_threads = 64;
|
||||
}
|
||||
pool->new_thread_bh = aio_bh_new(ctx, spawn_thread_bh_fn, pool);
|
||||
|
||||
QLIST_INIT(&pool->head);
|
||||
|
12
vl.c
12
vl.c
@@ -29,6 +29,7 @@
|
||||
#include "qemu/cutils.h"
|
||||
#include "qemu/help_option.h"
|
||||
#include "qemu/uuid.h"
|
||||
#include <sys/resource.h>
|
||||
#include "sysemu/seccomp.h"
|
||||
|
||||
#ifdef CONFIG_SDL
|
||||
@@ -3021,6 +3022,7 @@ int main(int argc, char **argv, char **envp)
|
||||
bool list_data_dirs = false;
|
||||
char *dir, **dirs;
|
||||
BlockdevOptionsQueue bdo_queue = QSIMPLEQ_HEAD_INITIALIZER(bdo_queue);
|
||||
struct rlimit rlimit_as;
|
||||
|
||||
module_call_init(MODULE_INIT_TRACE);
|
||||
|
||||
@@ -3029,6 +3031,16 @@ int main(int argc, char **argv, char **envp)
|
||||
|
||||
qemu_mutex_lock_iothread();
|
||||
|
||||
/*
|
||||
* Try to raise the soft address space limit.
|
||||
* Default on SLES 11 SP2 is 80% of physical+swap memory.
|
||||
*/
|
||||
getrlimit(RLIMIT_AS, &rlimit_as);
|
||||
if (rlimit_as.rlim_cur < rlimit_as.rlim_max) {
|
||||
rlimit_as.rlim_cur = rlimit_as.rlim_max;
|
||||
setrlimit(RLIMIT_AS, &rlimit_as);
|
||||
}
|
||||
|
||||
atexit(qemu_run_exit_notifiers);
|
||||
error_set_progname(argv[0]);
|
||||
qemu_init_exec_dir(argv[0]);
|
||||
|
Reference in New Issue
Block a user