Skip to content

Commit

Permalink
Merge tag 'v9.2.1' into feat-sep_emu
Browse files Browse the repository at this point in the history
v9.2.1 release

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEZKoqtTHVaQM2a/75gqpKJDselHgFAmenP10ACgkQgqpKJDse
# lHhYXxAAhSGXrrfEjfyNPO0N5tRKqCzYkoeB5GDScRMb3UogF2/jg/VV2uAVBKnl
# ikCO87w81+8FctiYKfMYnhTk+axlxYq//H8JALX3tyt35BpSfSkyxS8RGzVl4S3l
# 0TMA0l+cs3zPDq+yA3UAhppV5CgwBbzaN8xCm9mNFe49nlIHymgcFc3tFFtS0x+H
# PLjbqGX3X7joyqZ0O2cYk3UwzF01ZR1RKgM3sUumvsoSOwuKGul4jc0iLCn9hTHX
# QdxrThxb9KL5iL+fY5DlYc/LiJNPk1NcU1dQzqJinzrux9wNr4RpF7iSrs+m0Y/d
# 3FNzMTPuiqwBh4JJFGuSguR83q6nJLlVR/kKxPmPNBSX86q4L1Dw0rbyb40ZRGAA
# xV88kv8gzvmhR2hnScn7S+2d3EG9D3DKDCKTPp0unHhMjZk9rP+hcPmQaTqi1CIW
# c400CI2gP0e0a8TFLKTnTFVP2+scvOkVn6rBy9+pQat0eTMgWjA9VSxvG5GRJ4W9
# +i/9RSTyCLy3s7DWX3JN9nytZ5mS/RDv5YB3FfeMlT/1wH5PFYitxHdyxjHrBE+8
# KjXPtqDsJTMvwqPP+2nDD7D1MQWJgz0468GeuPK5itJCYBVYilIOUlibKfAEPbo+
# 0eUtq1oVMJfKnJadARf2cQrzR2IGEWF1rZqrRrkxfl+mHnTxnss=
# =XhYS
# -----END PGP SIGNATURE-----
# gpg: Signature made Sat Feb  8 13:26:21 2025 EET
# gpg:                using RSA key 64AA2AB531D56903366BFEF982AA4A243B1E9478
# gpg: key 61AD3D98ECDF2C8E: public key "Michael Tokarev <mjt@debian.org>" imported
# gpg: Total number processed: 1
# gpg:               imported: 1
# gpg: Good signature from "Michael Tokarev <mjt@debian.org>" [unknown]
# gpg:                 aka "Michael Tokarev <mjt@corpit.ru>" [unknown]
# gpg:                 aka "Michael Tokarev <mjt@tls.msk.ru>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 9D8B E14E 3F2A 9DD7 9199  28F1 61AD 3D98 ECDF 2C8E
#      Subkey fingerprint: 64AA 2AB5 31D5 6903 366B  FEF9 82AA 4A24 3B1E 9478
  • Loading branch information
VisualEhrmanntraut committed Feb 12, 2025
2 parents 176ce45 + cac3fb4 commit 0bc70d3
Show file tree
Hide file tree
Showing 92 changed files with 505 additions and 177 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9.2.0
9.2.1
11 changes: 11 additions & 0 deletions accel/kvm/kvm-all.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,16 @@ int kvm_unpark_vcpu(KVMState *s, unsigned long vcpu_id)
return kvm_fd;
}

static void kvm_reset_parked_vcpus(void *param)
{
KVMState *s = param;
struct KVMParkedVcpu *cpu;

QLIST_FOREACH(cpu, &s->kvm_parked_vcpus, node) {
kvm_arch_reset_parked_vcpu(cpu->vcpu_id, cpu->kvm_fd);
}
}

int kvm_create_vcpu(CPUState *cpu)
{
unsigned long vcpu_id = kvm_arch_vcpu_id(cpu);
Expand Down Expand Up @@ -2728,6 +2738,7 @@ static int kvm_init(MachineState *ms)
}

qemu_register_reset(kvm_unpoison_all, NULL);
qemu_register_reset(kvm_reset_parked_vcpus, s);

if (s->kernel_irqchip_allowed) {
kvm_irqchip_create(s);
Expand Down
2 changes: 1 addition & 1 deletion accel/tcg/plugin-gen.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ static void plugin_gen_inject(struct qemu_plugin_tb *plugin_tb)
* that might be live within the existing opcode stream.
* The simplest solution is to release them all and create new.
*/
memset(tcg_ctx->free_temps, 0, sizeof(tcg_ctx->free_temps));
tcg_temp_ebb_reset_freed(tcg_ctx);

QTAILQ_FOREACH_SAFE(op, &tcg_ctx->ops, link, next) {
switch (op->opc) {
Expand Down
3 changes: 1 addition & 2 deletions backends/cryptodev-vhost-user.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,7 @@ static int cryptodev_vhost_user_create_session(
break;

default:
error_setg(&local_error, "Unsupported opcode :%" PRIu32 "",
sess_info->op_code);
error_report("Unsupported opcode :%" PRIu32 "", sess_info->op_code);
return -VIRTIO_CRYPTO_NOTSUPP;
}

Expand Down
1 change: 1 addition & 0 deletions configs/targets/i386-softmmu.mak
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
TARGET_ARCH=i386
TARGET_SUPPORTS_MTTCG=y
TARGET_KVM_HAVE_GUEST_DEBUG=y
TARGET_KVM_HAVE_RESET_PARKED_VCPU=y
TARGET_XML_FILES= gdb-xml/i386-32bit.xml
1 change: 1 addition & 0 deletions configs/targets/x86_64-softmmu.mak
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ TARGET_ARCH=x86_64
TARGET_BASE_ARCH=i386
TARGET_SUPPORTS_MTTCG=y
TARGET_KVM_HAVE_GUEST_DEBUG=y
TARGET_KVM_HAVE_RESET_PARKED_VCPU=y
TARGET_XML_FILES= gdb-xml/i386-64bit.xml
15 changes: 13 additions & 2 deletions crypto/pbkdf.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static void *threaded_qcrypto_pbkdf2_count_iters(void *data)
size_t nsalt = iters_data->nsalt;
size_t nout = iters_data->nout;
Error **errp = iters_data->errp;

size_t scaled = 0;
uint64_t ret = -1;
g_autofree uint8_t *out = g_new(uint8_t, nout);
uint64_t iterations = (1 << 15);
Expand All @@ -131,7 +131,17 @@ static void *threaded_qcrypto_pbkdf2_count_iters(void *data)

delta_ms = end_ms - start_ms;

if (delta_ms == 0) { /* sanity check */
/*
* For very small 'iterations' values, CPU (or crypto
* accelerator) might be fast enough that the scheduler
* hasn't incremented getrusage() data, or incremented
* it by a very small amount, resulting in delta_ms == 0.
* Once we've scaled 'iterations' x10, 5 times, we really
* should be seeing delta_ms != 0, so sanity check at
* that point.
*/
if (scaled > 5 &&
delta_ms == 0) { /* sanity check */
error_setg(errp, "Unable to get accurate CPU usage");
goto cleanup;
} else if (delta_ms > 500) {
Expand All @@ -141,6 +151,7 @@ static void *threaded_qcrypto_pbkdf2_count_iters(void *data)
} else {
iterations = (iterations * 1000 / delta_ms);
}
scaled++;
}

iterations = iterations * 1000 / delta_ms;
Expand Down
2 changes: 1 addition & 1 deletion docs/about/deprecated.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ marked deprecated since 9.0, users have to ensure that all the topology members
described with -smp are supported by the target machine.

``-runas`` (since 9.1)
----------------------
''''''''''''''''''''''

Use ``-run-with user=..`` instead.

Expand Down
6 changes: 3 additions & 3 deletions docs/about/removed-features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ and later do not support it because the virtio-scsi device was introduced for
full SCSI support. Use virtio-scsi instead when SCSI passthrough is required.

``-fsdev proxy`` and ``-virtfs proxy`` (since 9.2)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
''''''''''''''''''''''''''''''''''''''''''''''''''

The 9p ``proxy`` filesystem backend driver was originally developed to
enhance security by dispatching low level filesystem operations from 9p
Expand Down Expand Up @@ -1077,8 +1077,8 @@ processor IP (see `Intel discontinuance notification`_).
TCG introspection features
--------------------------

TCG trace-events (since 6.2)
''''''''''''''''''''''''''''
TCG trace-events (removed in 7.0)
'''''''''''''''''''''''''''''''''

The ability to add new TCG trace points had bit rotted and as the
feature can be replicated with TCG plugins it was removed. If
Expand Down
10 changes: 5 additions & 5 deletions gdbstub/user-target.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,9 @@ void gdb_handle_v_file_open(GArray *params, void *user_ctx)
int fd = open(filename, flags, mode);
#endif
if (fd < 0) {
g_string_printf(gdbserver_state.str_buf, "F-1,%d", errno);
g_string_printf(gdbserver_state.str_buf, "F-1,%x", errno);
} else {
g_string_printf(gdbserver_state.str_buf, "F%d", fd);
g_string_printf(gdbserver_state.str_buf, "F%x", fd);
}
gdb_put_strbuf();
}
Expand All @@ -329,7 +329,7 @@ void gdb_handle_v_file_close(GArray *params, void *user_ctx)
int fd = gdb_get_cmd_param(params, 0)->val_ul;

if (close(fd) == -1) {
g_string_printf(gdbserver_state.str_buf, "F-1,%d", errno);
g_string_printf(gdbserver_state.str_buf, "F-1,%x", errno);
gdb_put_strbuf();
return;
}
Expand All @@ -352,7 +352,7 @@ void gdb_handle_v_file_pread(GArray *params, void *user_ctx)

ssize_t n = pread(fd, buf, bufsiz, offset);
if (n < 0) {
g_string_printf(gdbserver_state.str_buf, "F-1,%d", errno);
g_string_printf(gdbserver_state.str_buf, "F-1,%x", errno);
gdb_put_strbuf();
return;
}
Expand All @@ -375,7 +375,7 @@ void gdb_handle_v_file_readlink(GArray *params, void *user_ctx)
ssize_t n = readlink(filename, buf, BUFSIZ);
#endif
if (n < 0) {
g_string_printf(gdbserver_state.str_buf, "F-1,%d", errno);
g_string_printf(gdbserver_state.str_buf, "F-1,%x", errno);
gdb_put_strbuf();
return;
}
Expand Down
27 changes: 17 additions & 10 deletions hw/9pfs/9p-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,20 +177,27 @@ static inline int openat_file(int dirfd, const char *name, int flags,
return -1;
}

if (close_if_special_file(fd) < 0) {
return -1;
}

serrno = errno;
/* O_NONBLOCK was only needed to open the file. Let's drop it. We don't
* do that with O_PATH since fcntl(F_SETFL) isn't supported, and openat()
* ignored it anyway.
*/
/* Only if O_PATH is not set ... */
if (!(flags & O_PATH_9P_UTIL)) {
/*
* Prevent I/O on special files (device files, etc.) on host side,
* however it is safe and required to allow opening them with O_PATH,
* as this is limited to (required) path based operations only.
*/
if (close_if_special_file(fd) < 0) {
return -1;
}

serrno = errno;
/*
* O_NONBLOCK was only needed to open the file. Let's drop it. We don't
* do that with O_PATH since fcntl(F_SETFL) isn't supported, and
* openat() ignored it anyway.
*/
ret = fcntl(fd, F_SETFL, flags);
assert(!ret);
errno = serrno;
}
errno = serrno;
return fd;
}

Expand Down
33 changes: 23 additions & 10 deletions hw/i386/acpi-build.c
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,7 @@ static Aml *aml_pci_pdsm(void)
Aml *acpi_index = aml_local(2);
Aml *zero = aml_int(0);
Aml *one = aml_int(1);
Aml *not_supp = aml_int(0xFFFFFFFF);
Aml *func = aml_arg(2);
Aml *params = aml_arg(4);
Aml *bnum = aml_derefof(aml_index(params, aml_int(0)));
Expand All @@ -678,7 +679,7 @@ static Aml *aml_pci_pdsm(void)
*/
ifctx1 = aml_if(aml_lnot(
aml_or(aml_equal(acpi_index, zero),
aml_equal(acpi_index, aml_int(0xFFFFFFFF)), NULL)
aml_equal(acpi_index, not_supp), NULL)
));
{
/* have supported functions */
Expand All @@ -704,18 +705,30 @@ static Aml *aml_pci_pdsm(void)
{
Aml *pkg = aml_package(2);

aml_append(pkg, zero);
/*
* optional, if not impl. should return null string
*/
aml_append(pkg, aml_string("%s", ""));
aml_append(ifctx, aml_store(pkg, ret));

aml_append(ifctx, aml_store(aml_call2("AIDX", bnum, sunum), acpi_index));
aml_append(ifctx, aml_store(pkg, ret));
/*
* update acpi-index to actual value
* Windows calls func=7 without checking if it's available,
* as workaround Microsoft has suggested to return invalid for func7
* Package, so return 2 elements package but only initialize elements
* when acpi_index is supported and leave them uninitialized, which
* leads elements to being Uninitialized ObjectType and should trip
* Windows into discarding result as an unexpected and prevent setting
* bogus 'PCI Label' on the device.
*/
aml_append(ifctx, aml_store(acpi_index, aml_index(ret, zero)));
ifctx1 = aml_if(aml_lnot(aml_lor(
aml_equal(acpi_index, zero), aml_equal(acpi_index, not_supp)
)));
{
aml_append(ifctx1, aml_store(acpi_index, aml_index(ret, zero)));
/*
* optional, if not impl. should return null string
*/
aml_append(ifctx1, aml_store(aml_string("%s", ""),
aml_index(ret, one)));
}
aml_append(ifctx, ifctx1);

aml_append(ifctx, aml_return(ret));
}

Expand Down
2 changes: 1 addition & 1 deletion hw/i386/x86-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ void x86_load_linux(X86MachineState *x86ms,
* kernel on the other side of the fw_cfg interface matches the hash of the
* file the user passed in.
*/
if (!sev_enabled()) {
if (!sev_enabled() && protocol > 0) {
memcpy(setup, header, MIN(sizeof(header), setup_size));
}

Expand Down
44 changes: 22 additions & 22 deletions hw/intc/arm_gicv3_its.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ static ItsCmdResult lookup_vte(GICv3ITSState *s, const char *who,
static ItsCmdResult process_its_cmd_phys(GICv3ITSState *s, const ITEntry *ite,
int irqlevel)
{
CTEntry cte;
CTEntry cte = {};
ItsCmdResult cmdres;

cmdres = lookup_cte(s, __func__, ite->icid, &cte);
Expand All @@ -479,7 +479,7 @@ static ItsCmdResult process_its_cmd_phys(GICv3ITSState *s, const ITEntry *ite,
static ItsCmdResult process_its_cmd_virt(GICv3ITSState *s, const ITEntry *ite,
int irqlevel)
{
VTEntry vte;
VTEntry vte = {};
ItsCmdResult cmdres;

cmdres = lookup_vte(s, __func__, ite->vpeid, &vte);
Expand Down Expand Up @@ -514,8 +514,8 @@ static ItsCmdResult process_its_cmd_virt(GICv3ITSState *s, const ITEntry *ite,
static ItsCmdResult do_process_its_cmd(GICv3ITSState *s, uint32_t devid,
uint32_t eventid, ItsCmdType cmd)
{
DTEntry dte;
ITEntry ite;
DTEntry dte = {};
ITEntry ite = {};
ItsCmdResult cmdres;
int irqlevel;

Expand Down Expand Up @@ -583,8 +583,8 @@ static ItsCmdResult process_mapti(GICv3ITSState *s, const uint64_t *cmdpkt,
uint32_t pIntid = 0;
uint64_t num_eventids;
uint16_t icid = 0;
DTEntry dte;
ITEntry ite;
DTEntry dte = {};
ITEntry ite = {};

devid = (cmdpkt[0] & DEVID_MASK) >> DEVID_SHIFT;
eventid = cmdpkt[1] & EVENTID_MASK;
Expand Down Expand Up @@ -651,8 +651,8 @@ static ItsCmdResult process_vmapti(GICv3ITSState *s, const uint64_t *cmdpkt,
{
uint32_t devid, eventid, vintid, doorbell, vpeid;
uint32_t num_eventids;
DTEntry dte;
ITEntry ite;
DTEntry dte = {};
ITEntry ite = {};

if (!its_feature_virtual(s)) {
return CMD_CONTINUE;
Expand Down Expand Up @@ -761,7 +761,7 @@ static bool update_cte(GICv3ITSState *s, uint16_t icid, const CTEntry *cte)
static ItsCmdResult process_mapc(GICv3ITSState *s, const uint64_t *cmdpkt)
{
uint16_t icid;
CTEntry cte;
CTEntry cte = {};

icid = cmdpkt[2] & ICID_MASK;
cte.valid = cmdpkt[2] & CMD_FIELD_VALID_MASK;
Expand Down Expand Up @@ -822,7 +822,7 @@ static bool update_dte(GICv3ITSState *s, uint32_t devid, const DTEntry *dte)
static ItsCmdResult process_mapd(GICv3ITSState *s, const uint64_t *cmdpkt)
{
uint32_t devid;
DTEntry dte;
DTEntry dte = {};

devid = (cmdpkt[0] & DEVID_MASK) >> DEVID_SHIFT;
dte.size = cmdpkt[1] & SIZE_MASK;
Expand Down Expand Up @@ -886,9 +886,9 @@ static ItsCmdResult process_movi(GICv3ITSState *s, const uint64_t *cmdpkt)
{
uint32_t devid, eventid;
uint16_t new_icid;
DTEntry dte;
CTEntry old_cte, new_cte;
ITEntry old_ite;
DTEntry dte = {};
CTEntry old_cte = {}, new_cte = {};
ITEntry old_ite = {};
ItsCmdResult cmdres;

devid = FIELD_EX64(cmdpkt[0], MOVI_0, DEVICEID);
Expand Down Expand Up @@ -965,7 +965,7 @@ static bool update_vte(GICv3ITSState *s, uint32_t vpeid, const VTEntry *vte)

static ItsCmdResult process_vmapp(GICv3ITSState *s, const uint64_t *cmdpkt)
{
VTEntry vte;
VTEntry vte = {};
uint32_t vpeid;

if (!its_feature_virtual(s)) {
Expand Down Expand Up @@ -1030,7 +1030,7 @@ static void vmovp_callback(gpointer data, gpointer opaque)
*/
GICv3ITSState *s = data;
VmovpCallbackData *cbdata = opaque;
VTEntry vte;
VTEntry vte = {};
ItsCmdResult cmdres;

cmdres = lookup_vte(s, __func__, cbdata->vpeid, &vte);
Expand Down Expand Up @@ -1085,9 +1085,9 @@ static ItsCmdResult process_vmovi(GICv3ITSState *s, const uint64_t *cmdpkt)
{
uint32_t devid, eventid, vpeid, doorbell;
bool doorbell_valid;
DTEntry dte;
ITEntry ite;
VTEntry old_vte, new_vte;
DTEntry dte = {};
ITEntry ite = {};
VTEntry old_vte = {}, new_vte = {};
ItsCmdResult cmdres;

if (!its_feature_virtual(s)) {
Expand Down Expand Up @@ -1186,10 +1186,10 @@ static ItsCmdResult process_vinvall(GICv3ITSState *s, const uint64_t *cmdpkt)
static ItsCmdResult process_inv(GICv3ITSState *s, const uint64_t *cmdpkt)
{
uint32_t devid, eventid;
ITEntry ite;
DTEntry dte;
CTEntry cte;
VTEntry vte;
ITEntry ite = {};
DTEntry dte = {};
CTEntry cte = {};
VTEntry vte = {};
ItsCmdResult cmdres;

devid = FIELD_EX64(cmdpkt[0], INV_0, DEVICEID);
Expand Down
Loading

0 comments on commit 0bc70d3

Please sign in to comment.