aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/block/pflash_cfi01.c8
-rw-r--r--hw/core/machine-smp.c84
-rw-r--r--tests/guest-debug/test_gdbstub.py2
-rw-r--r--tests/unit/test-smp-parse.c16
-rw-r--r--ui/gtk-egl.c2
5 files changed, 44 insertions, 68 deletions
diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c
index 1bda8424b9..c8f1cf5a87 100644
--- a/hw/block/pflash_cfi01.c
+++ b/hw/block/pflash_cfi01.c
@@ -518,10 +518,6 @@ static void pflash_write(PFlashCFI01 *pfl, hwaddr offset,
break;
case 0xe8: /* Write to buffer */
trace_pflash_write(pfl->name, "write to buffer");
- /* FIXME should save @offset, @width for case 1+ */
- qemu_log_mask(LOG_UNIMP,
- "%s: Write to buffer emulation is flawed\n",
- __func__);
pfl->status |= 0x80; /* Ready! */
break;
case 0xf0: /* Probe for AMD flash */
@@ -574,7 +570,6 @@ static void pflash_write(PFlashCFI01 *pfl, hwaddr offset,
}
pfl->counter = value;
pfl->wcycle++;
- pflash_blk_write_start(pfl, offset);
break;
case 0x60:
if (cmd == 0xd0) {
@@ -605,6 +600,9 @@ static void pflash_write(PFlashCFI01 *pfl, hwaddr offset,
switch (pfl->cmd) {
case 0xe8: /* Block write */
/* FIXME check @offset, @width */
+ if (pfl->blk_offset == -1 && pfl->counter) {
+ pflash_blk_write_start(pfl, offset);
+ }
if (!pfl->ro && (pfl->blk_offset != -1)) {
pflash_data_write(pfl, offset, value, width, be);
} else {
diff --git a/hw/core/machine-smp.c b/hw/core/machine-smp.c
index 2b93fa99c9..5d8d7edcbd 100644
--- a/hw/core/machine-smp.c
+++ b/hw/core/machine-smp.c
@@ -118,76 +118,46 @@ void machine_parse_smp_config(MachineState *ms,
}
/*
- * If not supported by the machine, a topology parameter must be
- * omitted.
+ * If not supported by the machine, a topology parameter must
+ * not be set to a value greater than 1.
*/
- if (!mc->smp_props.modules_supported && config->has_modules) {
- if (config->modules > 1) {
- error_setg(errp, "modules not supported by this "
- "machine's CPU topology");
- return;
- } else {
- /* Here modules only equals 1 since we've checked zero case. */
- warn_report("Deprecated CPU topology (considered invalid): "
- "Unsupported modules parameter mustn't be "
- "specified as 1");
- }
+ if (!mc->smp_props.modules_supported &&
+ config->has_modules && config->modules > 1) {
+ error_setg(errp,
+ "modules > 1 not supported by this machine's CPU topology");
+ return;
}
modules = modules > 0 ? modules : 1;
- if (!mc->smp_props.clusters_supported && config->has_clusters) {
- if (config->clusters > 1) {
- error_setg(errp, "clusters not supported by this "
- "machine's CPU topology");
- return;
- } else {
- /* Here clusters only equals 1 since we've checked zero case. */
- warn_report("Deprecated CPU topology (considered invalid): "
- "Unsupported clusters parameter mustn't be "
- "specified as 1");
- }
+ if (!mc->smp_props.clusters_supported &&
+ config->has_clusters && config->clusters > 1) {
+ error_setg(errp,
+ "clusters > 1 not supported by this machine's CPU topology");
+ return;
}
clusters = clusters > 0 ? clusters : 1;
- if (!mc->smp_props.dies_supported && config->has_dies) {
- if (config->dies > 1) {
- error_setg(errp, "dies not supported by this "
- "machine's CPU topology");
- return;
- } else {
- /* Here dies only equals 1 since we've checked zero case. */
- warn_report("Deprecated CPU topology (considered invalid): "
- "Unsupported dies parameter mustn't be "
- "specified as 1");
- }
+ if (!mc->smp_props.dies_supported &&
+ config->has_dies && config->dies > 1) {
+ error_setg(errp,
+ "dies > 1 not supported by this machine's CPU topology");
+ return;
}
dies = dies > 0 ? dies : 1;
- if (!mc->smp_props.books_supported && config->has_books) {
- if (config->books > 1) {
- error_setg(errp, "books not supported by this "
- "machine's CPU topology");
- return;
- } else {
- /* Here books only equals 1 since we've checked zero case. */
- warn_report("Deprecated CPU topology (considered invalid): "
- "Unsupported books parameter mustn't be "
- "specified as 1");
- }
+ if (!mc->smp_props.books_supported &&
+ config->has_books && config->books > 1) {
+ error_setg(errp,
+ "books > 1 not supported by this machine's CPU topology");
+ return;
}
books = books > 0 ? books : 1;
- if (!mc->smp_props.drawers_supported && config->has_drawers) {
- if (config->drawers > 1) {
- error_setg(errp, "drawers not supported by this "
- "machine's CPU topology");
- return;
- } else {
- /* Here drawers only equals 1 since we've checked zero case. */
- warn_report("Deprecated CPU topology (considered invalid): "
- "Unsupported drawers parameter mustn't be "
- "specified as 1");
- }
+ if (!mc->smp_props.drawers_supported &&
+ config->has_drawers && config->drawers > 1) {
+ error_setg(errp,
+ "drawers > 1 not supported by this machine's CPU topology");
+ return;
}
drawers = drawers > 0 ? drawers : 1;
diff --git a/tests/guest-debug/test_gdbstub.py b/tests/guest-debug/test_gdbstub.py
index 7f71d34da1..46fbf98f0c 100644
--- a/tests/guest-debug/test_gdbstub.py
+++ b/tests/guest-debug/test_gdbstub.py
@@ -57,4 +57,4 @@ def main(test, expected_arch=None):
pass
print("All tests complete: {} failures".format(fail_count))
- exit(fail_count)
+ gdb.execute(f"exit {fail_count}")
diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c
index 8994337e12..9fdba24fce 100644
--- a/tests/unit/test-smp-parse.c
+++ b/tests/unit/test-smp-parse.c
@@ -330,6 +330,14 @@ static const struct SMPTestData data_generic_valid[] = {
.config = SMP_CONFIG_GENERIC(T, 8, T, 2, T, 4, T, 2, T, 16),
.expect_prefer_sockets = CPU_TOPOLOGY_GENERIC(8, 2, 4, 2, 16),
.expect_prefer_cores = CPU_TOPOLOGY_GENERIC(8, 2, 4, 2, 16),
+ }, {
+ /*
+ * Unsupported parameters are always allowed to be set to '1'
+ * config: -smp 8,books=1,drawers=1,sockets=2,modules=1,dies=1,cores=2,threads=2,maxcpus=8
+ * expect: cpus=8,sockets=2,cores=2,threads=2,maxcpus=8 */
+ .config = SMP_CONFIG_WITH_FULL_TOPO(8, 1, 1, 2, 1, 1, 2, 2, 8),
+ .expect_prefer_sockets = CPU_TOPOLOGY_GENERIC(8, 2, 2, 2, 8),
+ .expect_prefer_cores = CPU_TOPOLOGY_GENERIC(8, 2, 2, 2, 8),
},
};
@@ -337,21 +345,21 @@ static const struct SMPTestData data_generic_invalid[] = {
{
/* config: -smp 2,dies=2 */
.config = SMP_CONFIG_WITH_DIES(T, 2, F, 0, T, 2, F, 0, F, 0, F, 0),
- .expect_error = "dies not supported by this machine's CPU topology",
+ .expect_error = "dies > 1 not supported by this machine's CPU topology",
}, {
/* config: -smp 2,clusters=2 */
.config = SMP_CONFIG_WITH_CLUSTERS(T, 2, F, 0, T, 2, F, 0, F, 0, F, 0),
- .expect_error = "clusters not supported by this machine's CPU topology",
+ .expect_error = "clusters > 1 not supported by this machine's CPU topology",
}, {
/* config: -smp 2,books=2 */
.config = SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 2, F, 0, T, 2, F,
0, F, 0, F, 0, F, 0),
- .expect_error = "books not supported by this machine's CPU topology",
+ .expect_error = "books > 1 not supported by this machine's CPU topology",
}, {
/* config: -smp 2,drawers=2 */
.config = SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 2, T, 2, F, 0, F,
0, F, 0, F, 0, F, 0),
- .expect_error = "drawers not supported by this machine's CPU topology",
+ .expect_error = "drawers > 1 not supported by this machine's CPU topology",
}, {
/* config: -smp 8,sockets=2,cores=4,threads=2,maxcpus=8 */
.config = SMP_CONFIG_GENERIC(T, 8, T, 2, T, 4, T, 2, T, 8),
diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c
index 0473f689c9..9831c10e1b 100644
--- a/ui/gtk-egl.c
+++ b/ui/gtk-egl.c
@@ -68,9 +68,9 @@ void gd_egl_draw(VirtualConsole *vc)
GdkWindow *window;
#ifdef CONFIG_GBM
QemuDmaBuf *dmabuf = vc->gfx.guest_fb.dmabuf;
+ int fence_fd;
#endif
int ww, wh, ws;
- int fence_fd;
if (!vc->gfx.gls) {
return;