aboutsummaryrefslogtreecommitdiff
path: root/hw/net
diff options
context:
space:
mode:
authorYuri Benditovich <yuri.benditovich@daynix.com>2020-01-27 18:03:12 +0200
committerJason Wang <jasowang@redhat.com>2020-03-03 18:04:47 +0800
commitb559ea95eaee8cbf72d910e8f98d2601c7f74f97 (patch)
tree9081654ee1e88d56b0e7c3a8ff6816ab719755eb /hw/net
parentc2279bd0a19b35057f2e4c3b4df9a915717d1142 (diff)
downloadqemu-b559ea95eaee8cbf72d910e8f98d2601c7f74f97.zip
qemu-b559ea95eaee8cbf72d910e8f98d2601c7f74f97.tar.gz
qemu-b559ea95eaee8cbf72d910e8f98d2601c7f74f97.tar.bz2
e1000e: Avoid hw_error if legacy mode used
https://bugzilla.redhat.com/show_bug.cgi?id=1787142 The emulation issues hw_error if PSRCTL register is written, for example, with zero value. Such configuration does not present any problem when DTYP bits of RCTL register define legacy format of transfer descriptors. Current commit discards check for BSIZE0 and BSIZE1 when legacy mode used. Acked-by: Dmitry Fleytman <dmitry.fleytman@gmail.com> Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'hw/net')
-rw-r--r--hw/net/e1000e_core.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c
index 9b76f82..d110c5a 100644
--- a/hw/net/e1000e_core.c
+++ b/hw/net/e1000e_core.c
@@ -2813,12 +2813,15 @@ e1000e_set_eitr(E1000ECore *core, int index, uint32_t val)
static void
e1000e_set_psrctl(E1000ECore *core, int index, uint32_t val)
{
- if ((val & E1000_PSRCTL_BSIZE0_MASK) == 0) {
- hw_error("e1000e: PSRCTL.BSIZE0 cannot be zero");
- }
+ if (core->mac[RCTL] & E1000_RCTL_DTYP_MASK) {
+
+ if ((val & E1000_PSRCTL_BSIZE0_MASK) == 0) {
+ hw_error("e1000e: PSRCTL.BSIZE0 cannot be zero");
+ }
- if ((val & E1000_PSRCTL_BSIZE1_MASK) == 0) {
- hw_error("e1000e: PSRCTL.BSIZE1 cannot be zero");
+ if ((val & E1000_PSRCTL_BSIZE1_MASK) == 0) {
+ hw_error("e1000e: PSRCTL.BSIZE1 cannot be zero");
+ }
}
core->mac[PSRCTL] = val;