Skip to content

Commit

Permalink
Update to QEMU v8.2.2 (#57)
Browse files Browse the repository at this point in the history
Updated to QEMU v8.2.2 and some fixes. 
The compilation of `arm-linux-user` and `aarch64-linux-user` and i386 does not work because of the symqemu unit tests not linking correctly. Will be addressed in other PRs.
  • Loading branch information
aurelf authored Apr 25, 2024
2 parents 45b4700 + a227288 commit 76de0b9
Show file tree
Hide file tree
Showing 94 changed files with 519 additions and 244 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.d/cirrus/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ build_task:
install_script:
- @UPDATE_COMMAND@
- @INSTALL_COMMAND@ @PKGS@
- if test -n "@PYPI_PKGS@" ; then @PIP3@ install @PYPI_PKGS@ ; fi
- if test -n "@PYPI_PKGS@" ; then PYLIB=$(@PYTHON@ -c 'import sysconfig; print(sysconfig.get_path("stdlib"))'); rm -f $PYLIB/EXTERNALLY-MANAGED; @PIP3@ install @PYPI_PKGS@ ; fi
clone_script:
- git clone --depth 100 "$CI_REPOSITORY_URL" .
- git fetch origin "$CI_COMMIT_REF_NAME"
Expand Down
16 changes: 4 additions & 12 deletions .gitlab-ci.d/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
$MINGW_TARGET-libpng
$MINGW_TARGET-libssh
$MINGW_TARGET-libtasn1
$MINGW_TARGET-libusb
$MINGW_TARGET-lzo2
$MINGW_TARGET-nettle
$MINGW_TARGET-ninja
Expand All @@ -98,9 +97,8 @@
$MINGW_TARGET-SDL2
$MINGW_TARGET-SDL2_image
$MINGW_TARGET-snappy
$MINGW_TARGET-spice
$MINGW_TARGET-usbredir
$MINGW_TARGET-zstd "
$MINGW_TARGET-zstd
$EXTRA_PACKAGES "
- Write-Output "Running build at $(Get-Date -Format u)"
- $env:CHERE_INVOKING = 'yes' # Preserve the current working directory
- $env:MSYS = 'winsymlinks:native' # Enable native Windows symlink
Expand All @@ -123,6 +121,8 @@ msys2-64bit:
variables:
MINGW_TARGET: mingw-w64-x86_64
MSYSTEM: MINGW64
# msys2 only ship these packages for 64-bit, not 32-bit
EXTRA_PACKAGES: $MINGW_TARGET-libusb $MINGW_TARGET-usbredir $MINGW_TARGET-spice
# do not remove "--without-default-devices"!
# commit 9f8e6cad65a6 ("gitlab-ci: Speed up the msys2-64bit job by using --without-default-devices"
# changed to compile QEMU with the --without-default-devices switch
Expand All @@ -131,11 +131,3 @@ msys2-64bit:
# qTests don't run successfully with "--without-default-devices",
# so let's exclude the qtests from CI for now.
TEST_ARGS: --no-suite qtest

msys2-32bit:
extends: .shared_msys2_builder
variables:
MINGW_TARGET: mingw-w64-i686
MSYSTEM: MINGW32
CONFIGURE_ARGS: --target-list=ppc64-softmmu -Ddebug=false -Doptimization=0
TEST_ARGS: --no-suite qtest
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.2.1
8.2.2
3 changes: 2 additions & 1 deletion accel/tcg/tcg-runtime-sym-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ void *build_and_push_path_constraint(CPUArchState *env, void *arg1_expr, void *a
/* Architecture-independent way to get the program counter */
target_ulong get_pc(CPUArchState *env)
{
target_ulong pc, cs_base;
vaddr pc;
uint64_t cs_base;
uint32_t flags;

cpu_get_tb_cpu_state(env, &pc, &cs_base, &flags);
Expand Down
18 changes: 9 additions & 9 deletions accel/tcg/tcg-runtime-sym.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,22 +313,22 @@ static void *sym_load_guest_internal(CPUArchState *env,
}

void *HELPER(sym_load_guest_i32)(CPUArchState *env,
target_ulong addr, void *addr_expr,
uint64_t length, target_ulong mmu_idx)
uint64_t addr, void *addr_expr,
uint64_t length, uint64_t mmu_idx)
{
return sym_load_guest_internal(env, addr, addr_expr, length, 4, mmu_idx);
}

void *HELPER(sym_load_guest_i64)(CPUArchState *env,
target_ulong addr, void *addr_expr,
uint64_t length, target_ulong mmu_idx)
uint64_t addr, void *addr_expr,
uint64_t length, uint64_t mmu_idx)
{
return sym_load_guest_internal(env, addr, addr_expr, length, 8, mmu_idx);
}

static void sym_store_guest_internal(CPUArchState *env,
uint64_t value, void *value_expr,
target_ulong addr, void *addr_expr,
uint64_t addr, void *addr_expr,
uint64_t length, target_ulong mmu_idx)
{
/* Try an alternative address */
Expand All @@ -344,17 +344,17 @@ static void sym_store_guest_internal(CPUArchState *env,

void HELPER(sym_store_guest_i32)(CPUArchState *env,
uint32_t value, void *value_expr,
target_ulong addr, void *addr_expr,
uint64_t length, target_ulong mmu_idx)
uint64_t addr, void *addr_expr,
uint64_t length, uint64_t mmu_idx)
{
return sym_store_guest_internal(
env, value, value_expr, addr, addr_expr, length, mmu_idx);
}

void HELPER(sym_store_guest_i64)(CPUArchState *env,
uint64_t value, void *value_expr,
target_ulong addr, void *addr_expr,
uint64_t length, target_ulong mmu_idx)
uint64_t addr, void *addr_expr,
uint64_t length, uint64_t mmu_idx)
{
return sym_store_guest_internal(
env, value, value_expr, addr, addr_expr, length, mmu_idx);
Expand Down
3 changes: 2 additions & 1 deletion audio/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ endforeach

if dbus_display
module_ss = ss.source_set()
module_ss.add(when: [gio, pixman], if_true: files('dbusaudio.c'))
module_ss.add(when: [gio, dbus_display1_dep, pixman],
if_true: files('dbusaudio.c'))
audio_modules += {'dbus': module_ss}
endif

Expand Down
2 changes: 1 addition & 1 deletion block/blkio.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ typedef struct {
CoQueue bounce_available;

/* The value of the "mem-region-alignment" property */
size_t mem_region_alignment;
uint64_t mem_region_alignment;

/* Can we skip adding/deleting blkio_mem_regions? */
bool needs_mem_regions;
Expand Down
6 changes: 3 additions & 3 deletions chardev/char-socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,9 +492,9 @@ static gboolean tcp_chr_read(QIOChannel *chan, GIOCondition cond, void *opaque)
s->max_size <= 0) {
return TRUE;
}
len = sizeof(buf);
if (len > s->max_size) {
len = s->max_size;
len = tcp_chr_read_poll(opaque);
if (len > sizeof(buf)) {
len = sizeof(buf);
}
size = tcp_chr_recv(chr, (void *)buf, len);
if (size == 0 || (size == -1 && errno != EAGAIN)) {
Expand Down
3 changes: 3 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -1675,6 +1675,9 @@ fi
mkdir -p tests/tcg
echo "# Automatically generated by configure - do not modify" > $config_host_mak
echo "SRC_PATH=$source_path" >> $config_host_mak
if test "$plugins" = "yes" ; then
echo "CONFIG_PLUGIN=y" >> $config_host_mak
fi

tcg_tests_targets=
for target in $target_list; do
Expand Down
6 changes: 3 additions & 3 deletions contrib/vhost-user-gpu/virgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,15 +327,15 @@ virgl_get_resource_info_modifiers(uint32_t resource_id,
#ifdef VIRGL_RENDERER_RESOURCE_INFO_EXT_VERSION
struct virgl_renderer_resource_info_ext info_ext;
ret = virgl_renderer_resource_get_info_ext(resource_id, &info_ext);
if (ret < 0) {
if (ret) {
return ret;
}

*info = info_ext.base;
*modifiers = info_ext.modifiers;
#else
ret = virgl_renderer_resource_get_info(resource_id, info);
if (ret < 0) {
if (ret) {
return ret;
}

Expand Down Expand Up @@ -372,7 +372,7 @@ virgl_cmd_set_scanout(VuGpu *g,
uint64_t modifiers = 0;
ret = virgl_get_resource_info_modifiers(ss.resource_id, &info,
&modifiers);
if (ret == -1) {
if (ret) {
g_critical("%s: illegal resource specified %d\n",
__func__, ss.resource_id);
cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID;
Expand Down
6 changes: 3 additions & 3 deletions docs/interop/vhost-user.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ Vring descriptor indices for packed virtqueues
A vring address description
^^^^^^^^^^^^^^^^^^^^^^^^^^^

+-------+-------+------+------------+------+-----------+-----+
| index | flags | size | descriptor | used | available | log |
+-------+-------+------+------------+------+-----------+-----+
+-------+-------+------------+------+-----------+-----+
| index | flags | descriptor | used | available | log |
+-------+-------+------------+------+-----------+-----+

:index: a 32-bit vring index

Expand Down
13 changes: 7 additions & 6 deletions docs/system/keys.rst.inc
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
During the graphical emulation, you can use special key combinations to
change modes. The default key mappings are shown below, but if you use
``-alt-grab`` then the modifier is Ctrl-Alt-Shift (instead of Ctrl-Alt)
and if you use ``-ctrl-grab`` then the modifier is the right Ctrl key
(instead of Ctrl-Alt):
During the graphical emulation, you can use special key combinations from
the following table to change modes. By default the modifier is Ctrl-Alt
(used in the table below) which can be changed with ``-display`` suboption
``mod=`` where appropriate. For example, ``-display sdl,
grab-mod=lshift-lctrl-lalt`` changes the modifier key to Ctrl-Alt-Shift,
while ``-display sdl,grab-mod=rctrl`` changes it to the right Ctrl key.

Ctrl-Alt-f
Toggle full screen
Expand All @@ -28,7 +29,7 @@ Ctrl-Alt-n
*3*
Serial port
Ctrl-Alt
Ctrl-Alt-g
Toggle mouse and keyboard grab.
In the virtual consoles, you can use Ctrl-Up, Ctrl-Down, Ctrl-PageUp and
Expand Down
2 changes: 2 additions & 0 deletions hw/arm/smmu-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,8 @@ static void smmu_base_reset_hold(Object *obj)
{
SMMUState *s = ARM_SMMU(obj);

memset(s->smmu_pcibus_by_bus_num, 0, sizeof(s->smmu_pcibus_by_bus_num));

g_hash_table_remove_all(s->configs);
g_hash_table_remove_all(s->iotlb);
}
Expand Down
2 changes: 1 addition & 1 deletion hw/block/virtio-blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static void virtio_blk_req_complete(VirtIOBlockReq *req, unsigned char status)
iov_discard_undo(&req->inhdr_undo);
iov_discard_undo(&req->outhdr_undo);
virtqueue_push(req->vq, &req->elem, req->in_len);
if (s->dataplane_started && !s->dataplane_disabled) {
if (qemu_in_iothread()) {
virtio_blk_data_plane_notify(s->dataplane, req->vq);
} else {
virtio_notify(vdev, req->vq);
Expand Down
11 changes: 8 additions & 3 deletions hw/cxl/cxl-cdat.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ static void ct3_build_cdat(CDATObject *cdat, Error **errp)
g_autofree CDATTableHeader *cdat_header = NULL;
g_autofree CDATEntry *cdat_st = NULL;
uint8_t sum = 0;
uint8_t *hdr_buf;
int ent, i;

/* Use default table if fopen == NULL */
Expand All @@ -63,7 +64,7 @@ static void ct3_build_cdat(CDATObject *cdat, Error **errp)
cdat->built_buf_len = cdat->build_cdat_table(&cdat->built_buf,
cdat->private);

if (!cdat->built_buf_len) {
if (cdat->built_buf_len <= 0) {
/* Build later as not all data available yet */
cdat->to_update = true;
return;
Expand Down Expand Up @@ -95,8 +96,12 @@ static void ct3_build_cdat(CDATObject *cdat, Error **errp)
/* For now, no runtime updates */
cdat_header->sequence = 0;
cdat_header->length += sizeof(CDATTableHeader);
sum += cdat_header->revision + cdat_header->sequence +
cdat_header->length;

hdr_buf = (uint8_t *)cdat_header;
for (i = 0; i < sizeof(*cdat_header); i++) {
sum += hdr_buf[i];
}

/* Sum of all bytes including checksum must be 0 */
cdat_header->checksum = ~sum + 1;

Expand Down
2 changes: 1 addition & 1 deletion hw/cxl/cxl-component-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ void cxl_component_register_block_init(Object *obj,
/* io registers controls link which we don't care about in QEMU */
memory_region_init_io(&cregs->io, obj, NULL, cregs, ".io",
CXL2_COMPONENT_IO_REGION_SIZE);
memory_region_init_io(&cregs->cache_mem, obj, &cache_mem_ops, cregs,
memory_region_init_io(&cregs->cache_mem, obj, &cache_mem_ops, cxl_cstate,
".cache_mem", CXL2_COMPONENT_CM_REGION_SIZE);

memory_region_add_subregion(&cregs->component_registers, 0, &cregs->io);
Expand Down
17 changes: 11 additions & 6 deletions hw/cxl/cxl-device-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,9 @@ static void mailbox_reg_write(void *opaque, hwaddr offset, uint64_t value,

static uint64_t mdev_reg_read(void *opaque, hwaddr offset, unsigned size)
{
uint64_t retval = 0;

retval = FIELD_DP64(retval, CXL_MEM_DEV_STS, MEDIA_STATUS, 1);
retval = FIELD_DP64(retval, CXL_MEM_DEV_STS, MBOX_READY, 1);
CXLDeviceState *cxl_dstate = opaque;

return retval;
return cxl_dstate->memdev_status;
}

static void ro_reg_write(void *opaque, hwaddr offset, uint64_t value,
Expand Down Expand Up @@ -371,7 +368,15 @@ static void mailbox_reg_init_common(CXLDeviceState *cxl_dstate)
cxl_dstate->mbox_msi_n = msi_n;
}

static void memdev_reg_init_common(CXLDeviceState *cxl_dstate) { }
static void memdev_reg_init_common(CXLDeviceState *cxl_dstate)
{
uint64_t memdev_status_reg;

memdev_status_reg = FIELD_DP64(0, CXL_MEM_DEV_STS, MEDIA_STATUS, 1);
memdev_status_reg = FIELD_DP64(memdev_status_reg, CXL_MEM_DEV_STS,
MBOX_READY, 1);
cxl_dstate->memdev_status = memdev_status_reg;
}

void cxl_device_register_init_t3(CXLType3Dev *ct3d)
{
Expand Down
2 changes: 1 addition & 1 deletion hw/display/virtio-gpu-virgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ static void virgl_cmd_set_scanout(VirtIOGPU *g,
memset(&info, 0, sizeof(info));
ret = virgl_renderer_resource_get_info(ss.resource_id, &info);
#endif
if (ret == -1) {
if (ret) {
qemu_log_mask(LOG_GUEST_ERROR,
"%s: illegal resource specified %d\n",
__func__, ss.resource_id);
Expand Down
2 changes: 2 additions & 0 deletions hw/hppa/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ config HPPA_B160L
select DINO
select LASI
select SERIAL
select SERIAL_PCI
select ISA_BUS
select I8259
select IDE_CMD646
Expand All @@ -16,3 +17,4 @@ config HPPA_B160L
select LASIPS2
select PARALLEL
select ARTIST
select USB_OHCI_PCI
2 changes: 1 addition & 1 deletion hw/i386/acpi-build.c
Original file line number Diff line number Diff line change
Expand Up @@ -1415,7 +1415,7 @@ static void build_acpi0017(Aml *table)
aml_append(dev, aml_name_decl("_HID", aml_string("ACPI0017")));

method = aml_method("_STA", 0, AML_NOTSERIALIZED);
aml_append(method, aml_return(aml_int(0x01)));
aml_append(method, aml_return(aml_int(0x0B)));
aml_append(dev, method);
build_cxl_dsm_method(dev);

Expand Down
12 changes: 6 additions & 6 deletions hw/intc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ config IOAPIC
bool
select I8259

config ARM_GIC
bool
select MSI_NONBROKEN

config OPENPIC
bool
select MSI_NONBROKEN
Expand All @@ -25,14 +21,18 @@ config APIC
select MSI_NONBROKEN
select I8259

config ARM_GIC
bool
select ARM_GICV3_TCG if TCG
select ARM_GIC_KVM if KVM
select MSI_NONBROKEN

config ARM_GICV3_TCG
bool
default y
depends on ARM_GIC && TCG

config ARM_GIC_KVM
bool
default y
depends on ARM_GIC && KVM

config XICS
Expand Down
4 changes: 2 additions & 2 deletions hw/net/tulip.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,15 +421,15 @@ static uint16_t tulip_mdi_default[] = {
/* MDI Registers 8 - 15 */
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
/* MDI Registers 16 - 31 */
0x0003, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0003, 0x0000, 0x0001, 0x0000, 0x3b40, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
};

/* Readonly mask for MDI (PHY) registers */
static const uint16_t tulip_mdi_mask[] = {
0x0000, 0xffff, 0xffff, 0xffff, 0xc01f, 0xffff, 0xffff, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0fff, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
0x0fff, 0x0000, 0xffff, 0xffff, 0x0000, 0xffff, 0xffff, 0xffff,
0xffff, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
};

Expand Down
2 changes: 1 addition & 1 deletion hw/nvme/ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -7924,7 +7924,7 @@ static void nvme_init_state(NvmeCtrl *n)
n->aer_reqs = g_new0(NvmeRequest *, n->params.aerl + 1);
QTAILQ_INIT(&n->aer_queue);

list->numcntl = cpu_to_le16(max_vfs);
list->numcntl = max_vfs;
for (i = 0; i < max_vfs; i++) {
sctrl = &list->sec[i];
sctrl->pcid = cpu_to_le16(n->cntlid);
Expand Down
Loading

0 comments on commit 76de0b9

Please sign in to comment.