From: Jason Wang <jasowang@redhat.com>
To: qemu-devel@nongnu.org, peter.maydell@linaro.org
Cc: Jason Wang <jasowang@redhat.com>
Subject: [Qemu-devel] [PULL 1/5] e1000: don't raise interrupt in pre_save()
Date: Mon, 29 Jul 2019 16:33:42 +0800 [thread overview]
Message-ID: <1564389226-4489-2-git-send-email-jasowang@redhat.com> (raw)
In-Reply-To: <1564389226-4489-1-git-send-email-jasowang@redhat.com>
We should not raise any interrupt after VM has been stopped but this
is what e1000 currently did when mit timer is active in
pre_save(). Fixing this by scheduling a timer in post_load() which can
make sure the interrupt was raised when VM is running.
Reported-and-tested-by: Longpeng <longpeng2@huawei.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
hw/net/e1000.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/hw/net/e1000.c b/hw/net/e1000.c
index 1dc1466..a023ceb 100644
--- a/hw/net/e1000.c
+++ b/hw/net/e1000.c
@@ -1381,11 +1381,6 @@ static int e1000_pre_save(void *opaque)
E1000State *s = opaque;
NetClientState *nc = qemu_get_queue(s->nic);
- /* If the mitigation timer is active, emulate a timeout now. */
- if (s->mit_timer_on) {
- e1000_mit_timer(s);
- }
-
/*
* If link is down and auto-negotiation is supported and ongoing,
* complete auto-negotiation immediately. This allows us to look
@@ -1423,7 +1418,8 @@ static int e1000_post_load(void *opaque, int version_id)
s->mit_irq_level = false;
}
s->mit_ide = 0;
- s->mit_timer_on = false;
+ s->mit_timer_on = true;
+ timer_mod(s->mit_timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + 1);
/* nc.link_down can't be migrated, so infer link_down according
* to link status bit in mac_reg[STATUS].
--
2.5.0
next prev parent reply other threads:[~2019-07-29 8:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-29 8:33 [Qemu-devel] [PULL 0/5] Net patches Jason Wang
2019-07-29 8:33 ` Jason Wang [this message]
2019-07-29 8:33 ` [Qemu-devel] [PULL 2/5] qemu-bridge-helper: restrict interface name to IFNAMSIZ Jason Wang
2019-07-29 8:33 ` [Qemu-devel] [PULL 3/5] qemu-bridge-helper: move repeating code in parse_acl_file Jason Wang
2019-07-29 8:33 ` [Qemu-devel] [PULL 4/5] net: tap: replace snprintf with g_strdup_printf calls Jason Wang
2019-07-29 8:33 ` [Qemu-devel] [PULL 5/5] net/colo-compare.c: Fix memory leak and code style issue Jason Wang
2019-07-29 11:47 ` [Qemu-devel] [PULL 0/5] Net patches Peter Maydell
2019-07-29 12:50 ` Jason Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1564389226-4489-2-git-send-email-jasowang@redhat.com \
--to=jasowang@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).