From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Sergio Lopez <slp@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Subject: [PATCH] hw/i386: Use device_cold_reset() to reset the APIC
Date: Thu, 13 Oct 2022 18:19:26 +0100 [thread overview]
Message-ID: <20221013171926.1447899-1-peter.maydell@linaro.org> (raw)
The semantic difference between the deprecated device_legacy_reset()
function and the newer device_cold_reset() function is that the new
function resets both the device itself and any qbuses it owns,
whereas the legacy function resets just the device itself and nothing
else.
The pc_machine_reset() and microvm_machine_reset() functions use
device_legacy_reset() to reset the APIC; this is an APICCommonState
and does not have any qbuses, so for this purpose the two functions
behave identically and we can stop using the deprecated one.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
NB: tested only with 'make check' and 'make check-avocado'
hw/i386/microvm.c | 2 +-
hw/i386/pc.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c
index 7fe8cce03e9..0b08010bf0a 100644
--- a/hw/i386/microvm.c
+++ b/hw/i386/microvm.c
@@ -486,7 +486,7 @@ static void microvm_machine_reset(MachineState *machine)
cpu = X86_CPU(cs);
if (cpu->apic_state) {
- device_legacy_reset(cpu->apic_state);
+ device_cold_reset(cpu->apic_state);
}
}
}
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 566accf7e60..2b2d0bc2b33 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1860,7 +1860,7 @@ static void pc_machine_reset(MachineState *machine)
cpu = X86_CPU(cs);
if (cpu->apic_state) {
- device_legacy_reset(cpu->apic_state);
+ device_cold_reset(cpu->apic_state);
}
}
}
--
2.25.1
next reply other threads:[~2022-10-13 17:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-13 17:19 Peter Maydell [this message]
2022-10-13 17:33 ` [PATCH] hw/i386: Use device_cold_reset() to reset the APIC Michael S. Tsirkin
2022-10-13 20:43 ` Paolo Bonzini
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=20221013171926.1447899-1-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=slp@redhat.com \
/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).