Compare commits
47 Commits
migration-
...
opensuse-5
Author | SHA1 | Date | |
---|---|---|---|
|
b0e8bf31a6 | ||
|
4ef8b0b6af | ||
|
920a076238 | ||
|
f4275eee5e | ||
|
d4b37929d0 | ||
|
a5c30553b8 | ||
|
6ce0cadeaf | ||
|
7a21186254 | ||
|
88d231c0fd | ||
|
ac2d3b95b4 | ||
|
608e2ce79b | ||
|
72d4a29460 | ||
|
33a9e308c1 | ||
|
b917bdc896 | ||
|
168ed2f32b | ||
|
8f9d00f001 | ||
|
12d57090ce | ||
|
c533b86db1 | ||
|
280af56726 | ||
|
7360aafa6e | ||
|
43870abc1c | ||
|
26ac39c901 | ||
|
9efa653af0 | ||
|
89be95731a | ||
|
f74da81d83 | ||
|
586510d95e | ||
|
8112de3b4f | ||
34da98b6f8 | |||
2144ace785 | |||
|
fb98aaf3c6 | ||
|
5471f3df2e | ||
|
7c69634557 | ||
|
49de3604e3 | ||
|
ea3cb6ef57 | ||
|
fa2f4ebca8 | ||
|
c3a527c35c | ||
|
d2a5cbf760 | ||
|
200872d93d | ||
|
75a1047d51 | ||
|
79c96008b4 | ||
|
c7e6191051 | ||
|
da48144b75 | ||
|
bb856f2e4b | ||
|
5e9b52bd1e | ||
|
8ea26e1b3c | ||
|
f1b2d2e442 | ||
|
10077a7ece |
4
Makefile
4
Makefile
@@ -613,7 +613,7 @@ fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/9p-marshal
|
||||
|
||||
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
|
||||
@@ -970,6 +970,7 @@ ifneq ($(DESCS),)
|
||||
"$(DESTDIR)$(qemu_datadir)/firmware/$$x"; \
|
||||
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 \
|
||||
@@ -984,6 +985,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
|
||||
|
@@ -39,6 +39,10 @@ endif
|
||||
PROGS=$(QEMU_PROG) $(QEMU_PROGW)
|
||||
STPFILES=
|
||||
|
||||
ifdef CONFIG_LINUX_USER
|
||||
PROGS+=$(QEMU_PROG)-binfmt
|
||||
endif
|
||||
|
||||
config-target.h: config-target.h-timestamp
|
||||
config-target.h-timestamp: config-target.mak
|
||||
|
||||
@@ -134,6 +138,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
|
||||
|
||||
#########################################################
|
||||
@@ -173,7 +179,11 @@ generated-files-y += config-devices.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)
|
||||
|
||||
#
|
||||
@@ -222,6 +232,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/module.h"
|
||||
@@ -191,6 +192,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)
|
||||
@@ -325,6 +337,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"
|
||||
|
@@ -36,6 +36,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;
|
||||
|
@@ -22,6 +22,7 @@
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#define HW_POISON_H /* avoid poison since we patch against rules it "enforces" */
|
||||
#include "qemu/osdep.h"
|
||||
#include "sysemu/sysemu.h"
|
||||
#include "chardev/char.h"
|
||||
|
6
configure
vendored
6
configure
vendored
@@ -4100,7 +4100,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
|
||||
@@ -6770,7 +6770,7 @@ if { test "$cpu" = "i386" || test "$cpu" = "x86_64"; } && \
|
||||
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"
|
||||
@@ -7229,7 +7229,7 @@ fi
|
||||
if test "$modules" = "yes"; then
|
||||
# $shacmd can generate a hash started with digit, which the compiler doesn't
|
||||
# like as an symbol. So prefix it with an underscore
|
||||
echo "CONFIG_STAMP=_$( (echo $qemu_version; echo $pkgversion; cat $0) | $shacmd - | cut -f1 -d\ )" >> $config_host_mak
|
||||
echo "CONFIG_STAMP=_$( (echo $qemu_version; cat $0) | $shacmd - | cut -f1 -d\ )" >> $config_host_mak
|
||||
echo "CONFIG_MODULES=y" >> $config_host_mak
|
||||
fi
|
||||
if test "$module_upgrades" = "yes"; then
|
||||
|
@@ -7,6 +7,7 @@
|
||||
<body>
|
||||
<h1>QEMU @@VERSION@@ Documentation</h1>
|
||||
<ul>
|
||||
<li><a href="/usr/share/doc/packages/qemu-kvm/kvm-supported.html">SUSE Support Statements</a></li>
|
||||
<li><a href="system/index.html">System Emulation User's Guide</a></li>
|
||||
<li><a href="user/index.html">User Mode Emulation User's Guide</a></li>
|
||||
<li><a href="tools/index.html">Tools Guide</a></li>
|
||||
|
@@ -1,7 +1,7 @@
|
||||
|
||||
Specify tracing options.
|
||||
|
||||
.. option:: [enable=]PATTERN
|
||||
.. option:: -trace [enable=]PATTERN
|
||||
|
||||
Immediately enable events matching *PATTERN*
|
||||
(either event name or a globbing pattern). This option is only
|
||||
@@ -11,7 +11,7 @@ Specify tracing options.
|
||||
|
||||
Use :option:`-trace help` to print a list of names of trace points.
|
||||
|
||||
.. option:: events=FILE
|
||||
.. option:: -trace events=FILE
|
||||
|
||||
Immediately enable events listed in *FILE*.
|
||||
The file must contain one event name (as listed in the ``trace-events-all``
|
||||
@@ -19,7 +19,7 @@ Specify tracing options.
|
||||
available if QEMU has been compiled with the ``simple``, ``log`` or
|
||||
``ftrace`` tracing backend.
|
||||
|
||||
.. option:: file=FILE
|
||||
.. option:: -trace file=FILE
|
||||
|
||||
Log output traces to *FILE*.
|
||||
This option is only available if QEMU has been compiled with
|
||||
|
2
exec.c
2
exec.c
@@ -2328,11 +2328,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) {
|
||||
/*
|
||||
|
@@ -275,7 +275,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 */
|
||||
.post_load = vmstate_acpi_post_load,
|
||||
.fields = (VMStateField[]) {
|
||||
VMSTATE_PCI_DEVICE(parent_obj, PIIX4PMState),
|
||||
|
@@ -270,6 +270,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, blk, conf->logical_block_size,
|
||||
blockdev->props.iothread);
|
||||
@@ -729,6 +732,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;
|
||||
@@ -797,6 +802,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.
|
||||
|
@@ -383,7 +383,8 @@ static ssize_t gpadl_iter_io(GpadlIter *iter, void *buf, uint32_t len)
|
||||
}
|
||||
}
|
||||
|
||||
p = (void *)(((uintptr_t)iter->map & TARGET_PAGE_MASK) | off_in_page);
|
||||
p = (void *)(uintptr_t)(((uintptr_t)iter->map & TARGET_PAGE_MASK) |
|
||||
off_in_page);
|
||||
if (iter->dir == DMA_DIRECTION_FROM_DEVICE) {
|
||||
memcpy(p, buf, cplen);
|
||||
} else {
|
||||
|
@@ -291,8 +291,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 n = s->num_cpu;
|
||||
uint32_t i;
|
||||
|
@@ -962,6 +962,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;
|
||||
|
||||
if (!qemu_opts_validate(opts, qemu_smbios_file_opts, errp)) {
|
||||
return;
|
||||
@@ -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);
|
||||
|
@@ -224,6 +224,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,
|
||||
@@ -231,6 +237,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),
|
||||
|
@@ -129,6 +129,7 @@ void usb_wakeup(USBEndpoint *ep, unsigned int stream)
|
||||
static void do_token_setup(USBDevice *s, USBPacket *p)
|
||||
{
|
||||
int request, value, index;
|
||||
unsigned int setup_len;
|
||||
|
||||
if (p->iov.size != 8) {
|
||||
p->status = USB_RET_STALL;
|
||||
@@ -138,14 +139,15 @@ static void do_token_setup(USBDevice *s, USBPacket *p)
|
||||
usb_packet_copy(p, s->setup_buf, p->iov.size);
|
||||
s->setup_index = 0;
|
||||
p->actual_length = 0;
|
||||
s->setup_len = (s->setup_buf[7] << 8) | s->setup_buf[6];
|
||||
if (s->setup_len > sizeof(s->data_buf)) {
|
||||
setup_len = (s->setup_buf[7] << 8) | s->setup_buf[6];
|
||||
if (setup_len > sizeof(s->data_buf)) {
|
||||
fprintf(stderr,
|
||||
"usb_generic_handle_packet: ctrl buffer too small (%d > %zu)\n",
|
||||
s->setup_len, sizeof(s->data_buf));
|
||||
setup_len, sizeof(s->data_buf));
|
||||
p->status = USB_RET_STALL;
|
||||
return;
|
||||
}
|
||||
s->setup_len = setup_len;
|
||||
|
||||
request = (s->setup_buf[0] << 8) | s->setup_buf[1];
|
||||
value = (s->setup_buf[3] << 8) | s->setup_buf[2];
|
||||
@@ -259,26 +261,28 @@ static void do_token_out(USBDevice *s, USBPacket *p)
|
||||
static void do_parameter(USBDevice *s, USBPacket *p)
|
||||
{
|
||||
int i, request, value, index;
|
||||
unsigned int setup_len;
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
s->setup_buf[i] = p->parameter >> (i*8);
|
||||
}
|
||||
|
||||
s->setup_state = SETUP_STATE_PARAM;
|
||||
s->setup_len = (s->setup_buf[7] << 8) | s->setup_buf[6];
|
||||
s->setup_index = 0;
|
||||
|
||||
request = (s->setup_buf[0] << 8) | s->setup_buf[1];
|
||||
value = (s->setup_buf[3] << 8) | s->setup_buf[2];
|
||||
index = (s->setup_buf[5] << 8) | s->setup_buf[4];
|
||||
|
||||
if (s->setup_len > sizeof(s->data_buf)) {
|
||||
setup_len = (s->setup_buf[7] << 8) | s->setup_buf[6];
|
||||
if (setup_len > sizeof(s->data_buf)) {
|
||||
fprintf(stderr,
|
||||
"usb_generic_handle_packet: ctrl buffer too small (%d > %zu)\n",
|
||||
s->setup_len, sizeof(s->data_buf));
|
||||
setup_len, sizeof(s->data_buf));
|
||||
p->status = USB_RET_STALL;
|
||||
return;
|
||||
}
|
||||
s->setup_len = setup_len;
|
||||
|
||||
if (p->pid == USB_TOKEN_OUT) {
|
||||
usb_packet_copy(p, s->data_buf, s->setup_len);
|
||||
|
@@ -1721,9 +1721,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);
|
||||
|
@@ -3340,6 +3340,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)) {
|
||||
|
@@ -104,7 +104,7 @@ bool qht_insert(struct qht *ht, void *p, uint32_t hash, void **existing);
|
||||
* Returns the corresponding pointer when a match is found.
|
||||
* Returns NULL otherwise.
|
||||
*/
|
||||
void *qht_lookup_custom(const struct qht *ht, const void *userp, uint32_t hash,
|
||||
void *qht_lookup_custom(struct qht *ht, const void *userp, uint32_t hash,
|
||||
qht_lookup_func_t func);
|
||||
|
||||
/**
|
||||
@@ -115,7 +115,7 @@ void *qht_lookup_custom(const struct qht *ht, const void *userp, uint32_t hash,
|
||||
*
|
||||
* Calls qht_lookup_custom() using @ht's default comparison function.
|
||||
*/
|
||||
void *qht_lookup(const struct qht *ht, const void *userp, uint32_t hash);
|
||||
void *qht_lookup(struct qht *ht, const void *userp, uint32_t hash);
|
||||
|
||||
/**
|
||||
* qht_remove - remove a pointer from the hash table
|
||||
@@ -211,7 +211,7 @@ void qht_iter_remove(struct qht *ht, qht_iter_bool_func_t func, void *userp);
|
||||
* When done with @stats, pass the struct to qht_statistics_destroy().
|
||||
* Failing to do this will leak memory.
|
||||
*/
|
||||
void qht_statistics_init(const struct qht *ht, struct qht_stats *stats);
|
||||
void qht_statistics_init(struct qht *ht, struct qht_stats *stats);
|
||||
|
||||
/**
|
||||
* qht_statistics_destroy - Destroy a &struct qht_stats
|
||||
|
@@ -23,3 +23,4 @@ obj-$(TARGET_SPARC) += sparc/
|
||||
obj-$(TARGET_SPARC64) += $(TARGET_ABI_DIR)/
|
||||
obj-$(TARGET_X86_64) += x86_64/
|
||||
obj-$(TARGET_XTENSA) += xtensa/
|
||||
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);
|
||||
}
|
@@ -227,10 +227,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);
|
||||
extern __thread CPUState *thread_cpu;
|
||||
void cpu_loop(CPUArchState *env);
|
||||
const char *target_strerror(int err);
|
||||
|
@@ -632,6 +632,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();
|
||||
@@ -649,6 +653,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
|
||||
|
@@ -5440,8 +5440,21 @@ static abi_long do_ioctl(int fd, int cmd, abi_long arg)
|
||||
ie = ioctl_entries;
|
||||
for(;;) {
|
||||
if (ie->target_cmd == 0) {
|
||||
int i;
|
||||
qemu_log_mask(
|
||||
LOG_UNIMP, "Unsupported ioctl: cmd=0x%04lx\n", (long)cmd);
|
||||
LOG_UNIMP, "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)))
|
||||
qemu_log_mask(
|
||||
LOG_UNIMP, "%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)
|
||||
@@ -5472,6 +5485,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)) {
|
||||
@@ -5490,6 +5510,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);
|
||||
@@ -7452,6 +7473,27 @@ static int open_self_stat(void *cpu_env, int fd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(TARGET_ARM)
|
||||
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;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int open_self_auxv(void *cpu_env, int fd)
|
||||
{
|
||||
CPUState *cpu = env_cpu((CPUArchState *)cpu_env);
|
||||
@@ -7606,6 +7648,9 @@ static int do_openat(void *cpu_env, int dirfd, const char *pathname, int flags,
|
||||
#if defined(TARGET_SPARC) || defined(TARGET_HPPA)
|
||||
{ "/proc/cpuinfo", open_cpuinfo, is_proc },
|
||||
#endif
|
||||
#if defined(TARGET_ARM)
|
||||
{ "cpuinfo", open_cpuinfo, is_proc_myself },
|
||||
#endif
|
||||
#if defined(TARGET_M68K)
|
||||
{ "/proc/hardware", open_hardware, is_proc },
|
||||
#endif
|
||||
@@ -7746,10 +7791,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_cpu(cpu_env);
|
||||
abi_long ret;
|
||||
@@ -8104,8 +8149,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 */
|
||||
@@ -8988,6 +9038,9 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
|
||||
{
|
||||
struct timeval tv;
|
||||
struct timezone tz;
|
||||
if (copy_from_user_timeval(&tv, arg1)) {
|
||||
return -TARGET_EFAULT;
|
||||
}
|
||||
|
||||
ret = get_errno(gettimeofday(&tv, &tz));
|
||||
if (!is_error(ret)) {
|
||||
@@ -10154,7 +10207,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;
|
||||
@@ -10530,7 +10583,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
|
||||
*/
|
||||
ret = -TARGET_EINVAL;
|
||||
if (cpu_isar_feature(aa64_sve, env_archcpu(cpu_env))
|
||||
&& arg2 >= 0 && arg2 <= 512 * 16 && !(arg2 & 15)) {
|
||||
&& arg2 <= 512 * 16 && !(arg2 & 15)) {
|
||||
CPUARMState *env = cpu_env;
|
||||
ARMCPU *cpu = env_archcpu(env);
|
||||
uint32_t vq, old_vq;
|
||||
@@ -12562,10 +12615,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_cpu(cpu_env);
|
||||
abi_long ret;
|
||||
|
@@ -2820,7 +2820,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)",
|
||||
|
@@ -54,6 +54,7 @@ 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) $(LIBC_INC) $(LIBNET_INC) \
|
||||
-DDHCPARCH=0x1F -MMD -MP -MT $@ -MF $(@:%.o=%.d)
|
||||
LIBNETCFLAGS += -Wno-address-of-packed-member
|
||||
|
||||
%.o : $(SLOF_DIR)/lib/libnet/%.c
|
||||
$(call quiet-command,$(CC) $(LIBNETCFLAGS) -c -o $@ $<,"CC","$(TARGET_DIR)$@")
|
||||
|
@@ -123,7 +123,12 @@ static int parse_acl_file(const char *filename, ACLList *acl_list)
|
||||
}
|
||||
|
||||
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 {
|
||||
@@ -132,7 +137,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 {
|
||||
@@ -433,6 +443,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",
|
||||
@@ -454,7 +476,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;
|
||||
|
@@ -51,6 +51,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 help:
|
||||
@echo "nothing is build by default"
|
||||
@echo "available build targets:"
|
||||
@@ -101,7 +107,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
|
||||
|
||||
|
||||
@@ -121,11 +127,13 @@ efi-rom-%: build-pxe-roms build-efi-roms edk2-basetools
|
||||
|
||||
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))
|
||||
@@ -148,7 +156,9 @@ edk2-basetools:
|
||||
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:
|
||||
@@ -195,7 +205,7 @@ opensbi64-sifive_u:
|
||||
cp opensbi/build/platform/sifive/fu540/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
|
||||
|
||||
bios-microvm:
|
||||
$(MAKE) -C qboot
|
||||
$(MAKE) -C qboot CROSS_COMPILE=$(x86_64_cross_prefix) CC=gcc
|
||||
cp qboot/bios.bin ../pc-bios/bios-microvm.bin
|
||||
|
||||
clean:
|
||||
|
@@ -116,7 +116,15 @@ qemu_edk2_get_cross_prefix()
|
||||
# force soft-float cross-compiler on Debian
|
||||
printf 'arm-linux-gnueabi-'
|
||||
else
|
||||
printf '%s-linux-gnu-\n' "$gcc_arch"
|
||||
if [ "$emulation_target" == arm ]; then
|
||||
printf '%s-suse-linux-gnueabi-\n' "$gcc_arch"
|
||||
else
|
||||
if [ "$gcc_arch" == i686 ]; then
|
||||
printf '%s-suse-linux-\n' "i586"
|
||||
else
|
||||
printf '%s-suse-linux-\n' "$gcc_arch"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
#!/usr/bin/python3
|
||||
#
|
||||
# Migration Stream Analyzer
|
||||
#
|
||||
|
@@ -266,7 +266,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() {
|
||||
@@ -305,9 +305,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"
|
||||
@@ -323,7 +323,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/env python3
|
||||
#!/usr/bin/python3
|
||||
#
|
||||
# Compares vmstate information stored in JSON format, obtained from
|
||||
# the -dump-vmstate QEMU command.
|
||||
|
12
softmmu/vl.c
12
softmmu/vl.c
@@ -34,6 +34,7 @@
|
||||
#include "qemu/uuid.h"
|
||||
#include "sysemu/reset.h"
|
||||
#include "sysemu/runstate.h"
|
||||
#include <sys/resource.h>
|
||||
#include "sysemu/seccomp.h"
|
||||
#include "sysemu/tcg.h"
|
||||
#include "sysemu/xen.h"
|
||||
@@ -2868,6 +2869,7 @@ void qemu_init(int argc, char **argv, char **envp)
|
||||
BlockdevOptionsQueue bdo_queue = QSIMPLEQ_HEAD_INITIALIZER(bdo_queue);
|
||||
QemuPluginList plugin_list = QTAILQ_HEAD_INITIALIZER(plugin_list);
|
||||
int mem_prealloc = 0; /* force preallocation of physical target memory */
|
||||
struct rlimit rlimit_as;
|
||||
|
||||
os_set_line_buffering();
|
||||
|
||||
@@ -2879,6 +2881,16 @@ void qemu_init(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);
|
||||
qemu_init_exec_dir(argv[0]);
|
||||
|
||||
|
@@ -1963,7 +1963,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
|
||||
|
@@ -370,7 +370,7 @@ uint32_t HELPER(stsi)(CPUS390XState *env, uint64_t a0, uint64_t r0, uint64_t r1)
|
||||
MIN(sizeof(sysib.sysib_322.vm[0].name),
|
||||
strlen(qemu_name)));
|
||||
strncpy((char *)sysib.sysib_322.ext_names[0], qemu_name,
|
||||
sizeof(sysib.sysib_322.ext_names[0]));
|
||||
sizeof(sysib.sysib_322.ext_names[0] - 1));
|
||||
} else {
|
||||
ebcdic_put(sysib.sysib_322.vm[0].name, "TCGguest", 8);
|
||||
strcpy((char *)sysib.sysib_322.ext_names[0], "TCGguest");
|
||||
|
@@ -63,7 +63,8 @@ echo
|
||||
_launch_qemu -drive id=testdisk,file="$TEST_IMG",backing.file.filename="$TEST_IMG.base"
|
||||
_send_qemu_cmd $QEMU_HANDLE "commit testdisk" "(qemu)"
|
||||
_send_qemu_cmd $QEMU_HANDLE '' '(qemu)'
|
||||
_cleanup_qemu
|
||||
_send_qemu_cmd $QEMU_HANDLE 'quit' ''
|
||||
wait=1 _cleanup_qemu
|
||||
_img_info | _filter_img_info
|
||||
|
||||
# Make sure that if there was a backing file that was just overridden on the
|
||||
@@ -72,7 +73,8 @@ _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)"
|
||||
_send_qemu_cmd $QEMU_HANDLE '' '(qemu)'
|
||||
_cleanup_qemu
|
||||
_send_qemu_cmd $QEMU_HANDLE 'quit' ''
|
||||
wait=1 _cleanup_qemu
|
||||
_img_info | _filter_img_info
|
||||
|
||||
echo
|
||||
|
@@ -11,6 +11,7 @@ virtual size: 64 MiB (67108864 bytes)
|
||||
QEMU X.Y.Z monitor - type 'help' for more information
|
||||
(qemu) commit testdisk
|
||||
(qemu)
|
||||
(qemu) quit
|
||||
image: TEST_DIR/t.IMGFMT
|
||||
file format: IMGFMT
|
||||
virtual size: 64 MiB (67108864 bytes)
|
||||
@@ -18,6 +19,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t
|
||||
QEMU X.Y.Z monitor - type 'help' for more information
|
||||
(qemu) commit testdisk
|
||||
(qemu)
|
||||
(qemu) quit
|
||||
image: TEST_DIR/t.IMGFMT
|
||||
file format: IMGFMT
|
||||
virtual size: 64 MiB (67108864 bytes)
|
||||
|
@@ -201,7 +201,8 @@ _send_qemu_cmd $QEMU_HANDLE \
|
||||
'return'
|
||||
_run_cmd $QEMU_IMG commit -b "${TEST_IMG}.b" "${TEST_IMG}.c"
|
||||
|
||||
_cleanup_qemu
|
||||
_send_qemu_cmd $QEMU_HANDLE "{ 'execute': 'quit' }" ''
|
||||
wait=1 _cleanup_qemu
|
||||
|
||||
_launch_qemu
|
||||
|
||||
@@ -253,7 +254,8 @@ _send_qemu_cmd $QEMU_HANDLE \
|
||||
|
||||
_run_cmd $QEMU_IO "${TEST_IMG}" -c 'write 0 512'
|
||||
|
||||
_cleanup_qemu
|
||||
_send_qemu_cmd $QEMU_HANDLE "{ 'execute': 'quit' }" ''
|
||||
wait=1 _cleanup_qemu
|
||||
|
||||
echo
|
||||
echo "== Detecting -U and force-share conflicts =="
|
||||
|
@@ -424,6 +424,8 @@ Is another process using the image [TEST_DIR/t.qcow2]?
|
||||
_qemu_img_wrapper commit -b TEST_DIR/t.qcow2.b TEST_DIR/t.qcow2.c
|
||||
{ 'execute': 'qmp_capabilities' }
|
||||
{"return": {}}
|
||||
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}}
|
||||
{"return": {}}
|
||||
Adding drive
|
||||
{ 'execute': 'human-monitor-command', 'arguments': { 'command-line': 'drive_add 0 if=none,id=d0,file=TEST_DIR/t.IMGFMT' } }
|
||||
{"return": "OKrn"}
|
||||
@@ -457,6 +459,8 @@ Closing the other
|
||||
{"return": ""}
|
||||
|
||||
_qemu_io_wrapper TEST_DIR/t.qcow2 -c write 0 512
|
||||
{"return": {}}
|
||||
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}}
|
||||
|
||||
== Detecting -U and force-share conflicts ==
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
QA output created by 162
|
||||
|
||||
=== NBD ===
|
||||
qemu-img: Could not open 'json:{"driver": "nbd", "host": -1}': address resolution failed for -1:10809: Name or service not known
|
||||
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
|
||||
|
||||
|
@@ -24,6 +24,7 @@ PATH=".:$PATH"
|
||||
HOSTOS=$(uname -s)
|
||||
arch=$(uname -m)
|
||||
[[ "$arch" =~ "ppc64" ]] && qemu_arch=ppc64 || qemu_arch="$arch"
|
||||
[[ "$arch" = "i686" ]] && qemu_arch=i386
|
||||
|
||||
# make sure we have a standard umask
|
||||
umask 022
|
||||
|
@@ -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>
|
||||
|
||||
|
20
util/qht.c
20
util/qht.c
@@ -484,10 +484,10 @@ bool qht_reset_size(struct qht *ht, size_t n_elems)
|
||||
}
|
||||
|
||||
static inline
|
||||
void *qht_do_lookup(const struct qht_bucket *head, qht_lookup_func_t func,
|
||||
void *qht_do_lookup(struct qht_bucket *head, qht_lookup_func_t func,
|
||||
const void *userp, uint32_t hash)
|
||||
{
|
||||
const struct qht_bucket *b = head;
|
||||
struct qht_bucket *b = head;
|
||||
int i;
|
||||
|
||||
do {
|
||||
@@ -511,7 +511,7 @@ void *qht_do_lookup(const struct qht_bucket *head, qht_lookup_func_t func,
|
||||
}
|
||||
|
||||
static __attribute__((noinline))
|
||||
void *qht_lookup__slowpath(const struct qht_bucket *b, qht_lookup_func_t func,
|
||||
void *qht_lookup__slowpath(struct qht_bucket *b, qht_lookup_func_t func,
|
||||
const void *userp, uint32_t hash)
|
||||
{
|
||||
unsigned int version;
|
||||
@@ -524,10 +524,10 @@ void *qht_lookup__slowpath(const struct qht_bucket *b, qht_lookup_func_t func,
|
||||
return ret;
|
||||
}
|
||||
|
||||
void *qht_lookup_custom(const struct qht *ht, const void *userp, uint32_t hash,
|
||||
void *qht_lookup_custom(struct qht *ht, const void *userp, uint32_t hash,
|
||||
qht_lookup_func_t func)
|
||||
{
|
||||
const struct qht_bucket *b;
|
||||
struct qht_bucket *b;
|
||||
const struct qht_map *map;
|
||||
unsigned int version;
|
||||
void *ret;
|
||||
@@ -547,7 +547,7 @@ void *qht_lookup_custom(const struct qht *ht, const void *userp, uint32_t hash,
|
||||
return qht_lookup__slowpath(b, func, userp, hash);
|
||||
}
|
||||
|
||||
void *qht_lookup(const struct qht *ht, const void *userp, uint32_t hash)
|
||||
void *qht_lookup(struct qht *ht, const void *userp, uint32_t hash)
|
||||
{
|
||||
return qht_lookup_custom(ht, userp, hash, ht->cmp);
|
||||
}
|
||||
@@ -900,9 +900,9 @@ bool qht_resize(struct qht *ht, size_t n_elems)
|
||||
}
|
||||
|
||||
/* pass @stats to qht_statistics_destroy() when done */
|
||||
void qht_statistics_init(const struct qht *ht, struct qht_stats *stats)
|
||||
void qht_statistics_init(struct qht *ht, struct qht_stats *stats)
|
||||
{
|
||||
const struct qht_map *map;
|
||||
struct qht_map *map;
|
||||
int i;
|
||||
|
||||
map = atomic_rcu_read(&ht->map);
|
||||
@@ -919,8 +919,8 @@ void qht_statistics_init(const struct qht *ht, struct qht_stats *stats)
|
||||
stats->head_buckets = map->n_buckets;
|
||||
|
||||
for (i = 0; i < map->n_buckets; i++) {
|
||||
const struct qht_bucket *head = &map->buckets[i];
|
||||
const struct qht_bucket *b;
|
||||
struct qht_bucket *head = &map->buckets[i];
|
||||
struct qht_bucket *b;
|
||||
unsigned int version;
|
||||
size_t buckets;
|
||||
size_t entries;
|
||||
|
@@ -306,7 +306,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);
|
||||
|
Reference in New Issue
Block a user