* [PATCH] hw/net/vmxnet3: Do not abort if the guest is trying to use an invalid TX queue
@ 2021-07-15 10:37 Thomas Huth
2021-07-15 15:54 ` Richard Henderson
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Huth @ 2021-07-15 10:37 UTC (permalink / raw)
To: qemu-devel, Jason Wang, Dmitry Fleytman; +Cc: qemu-trivial
QEMU should never abort just because the guest is doing something odd.
Let's simply log the error and ignore the bad transmit queue instead.
Buglink: https://bugs.launchpad.net/qemu/+bug/1926111
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
hw/net/vmxnet3.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
index eff299f629..f6bd8c53b1 100644
--- a/hw/net/vmxnet3.c
+++ b/hw/net/vmxnet3.c
@@ -23,6 +23,7 @@
#include "net/checksum.h"
#include "sysemu/sysemu.h"
#include "qemu/bswap.h"
+#include "qemu/log.h"
#include "qemu/module.h"
#include "hw/pci/msix.h"
#include "hw/pci/msi.h"
@@ -1093,8 +1094,12 @@ vmxnet3_io_bar0_write(void *opaque, hwaddr addr,
int tx_queue_idx =
VMW_MULTIREG_IDX_BY_ADDR(addr, VMXNET3_REG_TXPROD,
VMXNET3_REG_ALIGN);
- assert(tx_queue_idx <= s->txq_num);
- vmxnet3_process_tx_queue(s, tx_queue_idx);
+ if (tx_queue_idx <= s->txq_num) {
+ vmxnet3_process_tx_queue(s, tx_queue_idx);
+ } else {
+ qemu_log_mask(LOG_GUEST_ERROR, "vmxnet3: Illegal TX queue %d/%d\n",
+ tx_queue_idx, s->txq_num);
+ }
return;
}
--
2.27.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] hw/net/vmxnet3: Do not abort if the guest is trying to use an invalid TX queue
2021-07-15 10:37 [PATCH] hw/net/vmxnet3: Do not abort if the guest is trying to use an invalid TX queue Thomas Huth
@ 2021-07-15 15:54 ` Richard Henderson
0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 2021-07-15 15:54 UTC (permalink / raw)
To: Thomas Huth, qemu-devel, Jason Wang, Dmitry Fleytman; +Cc: qemu-trivial
On 7/15/21 3:37 AM, Thomas Huth wrote:
> QEMU should never abort just because the guest is doing something odd.
> Let's simply log the error and ignore the bad transmit queue instead.
>
> Buglink:https://bugs.launchpad.net/qemu/+bug/1926111
> Signed-off-by: Thomas Huth<thuth@redhat.com>
> ---
> hw/net/vmxnet3.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-07-15 15:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-15 10:37 [PATCH] hw/net/vmxnet3: Do not abort if the guest is trying to use an invalid TX queue Thomas Huth
2021-07-15 15:54 ` Richard Henderson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).