From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Yanan Wang" <wangyanan55@huawei.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Halil Pasic" <pasic@linux.ibm.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
qemu-rust@nongnu.org, "Zhao Liu" <zhao1.liu@intel.com>,
"Eric Farman" <farman@linux.ibm.com>,
"Ilya Leoshkevich" <iii@linux.ibm.com>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Jason Wang" <jasowang@redhat.com>,
"David Hildenbrand" <david@redhat.com>,
"Dmitry Fleytman" <dmitry.fleytman@gmail.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
qemu-s390x@nongnu.org,
"Christian Borntraeger" <borntraeger@linux.ibm.com>
Subject: [PATCH 05/10] hw/timer/hpet: Remove HPETState::hpet_offset_saved field
Date: Fri, 2 May 2025 01:01:23 +0200 [thread overview]
Message-ID: <20250501230129.2596-6-philmd@linaro.org> (raw)
In-Reply-To: <20250501230129.2596-1-philmd@linaro.org>
The HPETState::hpet_offset_saved boolean was only set in the
hw_compat_2_11[] array, via the 'hpet-offset-saved=false'
property. We removed all machines using that array, lets remove
that property and all the code around it.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/timer/hpet.c | 9 +--------
rust/hw/timer/hpet/src/hpet.rs | 9 ---------
2 files changed, 1 insertion(+), 17 deletions(-)
diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c
index d1b7bc52b7b..47b8fc0d880 100644
--- a/hw/timer/hpet.c
+++ b/hw/timer/hpet.c
@@ -71,7 +71,6 @@ struct HPETState {
MemoryRegion iomem;
uint64_t hpet_offset;
- bool hpet_offset_saved;
qemu_irq irqs[HPET_NUM_IRQ_ROUTES];
uint32_t flags;
uint8_t rtc_irq_level;
@@ -264,11 +263,6 @@ static int hpet_post_load(void *opaque, int version_id)
t->cmp64 = hpet_calculate_cmp64(t, s->hpet_counter, t->cmp);
t->last = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) - NANOSECONDS_PER_SECOND;
}
- /* Recalculate the offset between the main counter and guest time */
- if (!s->hpet_offset_saved) {
- s->hpet_offset = ticks_to_ns(s->hpet_counter)
- - qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
- }
return 0;
}
@@ -277,7 +271,7 @@ static bool hpet_offset_needed(void *opaque)
{
HPETState *s = opaque;
- return hpet_enabled(s) && s->hpet_offset_saved;
+ return hpet_enabled(s);
}
static bool hpet_rtc_irq_level_needed(void *opaque)
@@ -733,7 +727,6 @@ static const Property hpet_device_properties[] = {
DEFINE_PROP_UINT8("timers", HPETState, num_timers, HPET_MIN_TIMERS),
DEFINE_PROP_BIT("msi", HPETState, flags, HPET_MSI_SUPPORT, false),
DEFINE_PROP_UINT32(HPET_INTCAP, HPETState, intcap, 0),
- DEFINE_PROP_BOOL("hpet-offset-saved", HPETState, hpet_offset_saved, true),
};
static void hpet_device_class_init(ObjectClass *klass, const void *data)
diff --git a/rust/hw/timer/hpet/src/hpet.rs b/rust/hw/timer/hpet/src/hpet.rs
index cbd2ed4f6bf..9e681391176 100644
--- a/rust/hw/timer/hpet/src/hpet.rs
+++ b/rust/hw/timer/hpet/src/hpet.rs
@@ -544,7 +544,6 @@ pub struct HPETState {
/// Offset of main counter relative to qemu clock.
hpet_offset: BqlCell<u64>,
- hpet_offset_saved: bool,
irqs: [InterruptSource; HPET_NUM_IRQ_ROUTES],
rtc_irq_level: BqlCell<u32>,
@@ -885,14 +884,6 @@ impl ObjectImpl for HPETState {
u32,
default = 0
),
- qemu_api::define_property!(
- c_str!("hpet-offset-saved"),
- HPETState,
- hpet_offset_saved,
- unsafe { &qdev_prop_bool },
- bool,
- default = true
- ),
}
impl DeviceImpl for HPETState {
--
2.47.1
next prev parent reply other threads:[~2025-05-01 23:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-01 23:01 [PATCH 00/10] hw/core: Remove hw_compat[] array for 2.10, 2.11 and 2.12 machines Philippe Mathieu-Daudé
2025-05-01 23:01 ` [PATCH 01/10] hw/s390x/s390-virtio-ccw: Remove the deprecated 2.10 and 2.11 machine types Philippe Mathieu-Daudé
2025-05-01 23:01 ` [PATCH 02/10] hw/core/machine: Remove hw_compat_2_10[] array Philippe Mathieu-Daudé
2025-05-01 23:01 ` [PATCH 03/10] hw/input/virtio-input: Remove VirtIOInputHID::wheel_axis field Philippe Mathieu-Daudé
2025-05-01 23:01 ` [PATCH 04/10] hw/core/machine: Remove hw_compat_2_11[] array Philippe Mathieu-Daudé
2025-05-01 23:01 ` Philippe Mathieu-Daudé [this message]
2025-05-01 23:01 ` [PATCH 06/10] hw/net/e1000: Remove unused E1000_FLAG_TSO flag Philippe Mathieu-Daudé
2025-05-01 23:01 ` [PATCH 07/10] hw/s390x/s390-virtio-ccw: Remove the deprecated 2.12 machine type Philippe Mathieu-Daudé
2025-05-01 23:01 ` [PATCH 08/10] hw/core/machine: Remove hw_compat_2_12[] array Philippe Mathieu-Daudé
2025-05-01 23:01 ` [PATCH 09/10] hw/audio/hda-codec: Remove HDAAudioState::use_timer field Philippe Mathieu-Daudé
2025-05-01 23:01 ` [PATCH 10/10] hw/display/vga-pci: Do not expose the 'global-vmstate' property Philippe Mathieu-Daudé
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=20250501230129.2596-6-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=borntraeger@linux.ibm.com \
--cc=david@redhat.com \
--cc=dmitry.fleytman@gmail.com \
--cc=eduardo@habkost.net \
--cc=farman@linux.ibm.com \
--cc=iii@linux.ibm.com \
--cc=jasowang@redhat.com \
--cc=kraxel@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=pasic@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-rust@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=thuth@redhat.com \
--cc=wangyanan55@huawei.com \
--cc=zhao1.liu@intel.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).