All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jamin Lin <jamin_lin@aspeedtech.com>
To: "philmd@linaro.org" <philmd@linaro.org>,
	"peterx@redhat.com" <peterx@redhat.com>,
	"Cédric Le Goater" <clg@kaod.org>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Steven Lee" <steven_lee@aspeedtech.com>,
	"Troy Lee" <leetroy@gmail.com>,
	"Kane Chen" <kane_chen@aspeedtech.com>,
	"Andrew Jeffery" <andrew@codeconstruct.com.au>,
	"Joel Stanley" <joel@jms.id.au>,
	"open list:ASPEED BMCs" <qemu-arm@nongnu.org>,
	"open list:All patches CC here" <qemu-devel@nongnu.org>
Cc: Jamin Lin <jamin_lin@aspeedtech.com>,
	Troy Lee <troy_lee@aspeedtech.com>,
	 "farosas@suse.de" <farosas@suse.de>,
	"flwu@google.com" <flwu@google.com>,
	 "nabihestefan@google.com" <nabihestefan@google.com>
Subject: [PATCH v1 1/2] hw/usb/hcd-ehci: Rename migration compatibility fetch address fields
Date: Wed, 6 May 2026 03:26:44 +0000	[thread overview]
Message-ID: <20260506032643.2510575-2-jamin_lin@aspeedtech.com> (raw)
In-Reply-To: <20260506032643.2510575-1-jamin_lin@aspeedtech.com>

Rename the 32-bit fetch address migration helper fields to make
their purpose clearer.

These fields are only used for migration compatibility with older
machine types that transfer 32-bit fetch addresses in the migration
stream. They are not runtime fetch address state.

Also add comments to clarify the relationship between the migration
compatibility fields and the runtime 64-bit fetch address fields.

No functional change.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
---
 hw/usb/hcd-ehci.h | 17 ++++++++++++++---
 hw/usb/hcd-ehci.c | 12 ++++++------
 2 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/hw/usb/hcd-ehci.h b/hw/usb/hcd-ehci.h
index 3d57e1de5f..b5ac9c8670 100644
--- a/hw/usb/hcd-ehci.h
+++ b/hw/usb/hcd-ehci.h
@@ -262,6 +262,10 @@ struct EHCIState {
 
     /* properties */
     uint32_t maxframes;
+    /*
+     * Controls migration stream compatibility for old machine types.
+     * Old machine types only transfer 32-bit fetch addresses.
+     */
     bool migrate_fetch_addr_64bit;
     bool caps_64bit_addr;
     uint32_t ctrldssegment_default;
@@ -302,9 +306,16 @@ struct EHCIState {
     EHCIQueueHead aqueues;
     EHCIQueueHead pqueues;
 
-    /* which address to look at next */
-    uint32_t a_fetch_addr_32;
-    uint32_t p_fetch_addr_32;
+    /*
+     * which address to look at next
+     *
+     * Migration compatibility fields for old machine types that only
+     * support 32-bit fetch addresses in the migration stream.
+     *
+     * New machine types migrate the full 64-bit runtime fetch address.
+     */
+    uint32_t migrate_a_fetch_addr;
+    uint32_t migrate_p_fetch_addr;
     uint64_t a_fetch_addr;
     uint64_t p_fetch_addr;
 
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index 62c3770ac5..56ac8f6ae5 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -2482,8 +2482,8 @@ static int usb_ehci_pre_save(void *opaque)
     ehci->frindex = new_frindex;
 
     if (!ehci->migrate_fetch_addr_64bit) {
-        ehci->a_fetch_addr_32 = ehci->a_fetch_addr;
-        ehci->p_fetch_addr_32 = ehci->p_fetch_addr;
+        ehci->migrate_a_fetch_addr = ehci->a_fetch_addr;
+        ehci->migrate_p_fetch_addr = ehci->p_fetch_addr;
     }
 
     return 0;
@@ -2507,8 +2507,8 @@ static int usb_ehci_post_load(void *opaque, int version_id)
     }
 
     if (!s->migrate_fetch_addr_64bit) {
-        s->a_fetch_addr = s->a_fetch_addr_32;
-        s->p_fetch_addr = s->p_fetch_addr_32;
+        s->a_fetch_addr = s->migrate_a_fetch_addr;
+        s->p_fetch_addr = s->migrate_p_fetch_addr;
     }
 
     return 0;
@@ -2571,9 +2571,9 @@ const VMStateDescription vmstate_ehci = {
         /* schedule state */
         VMSTATE_UINT32(astate, EHCIState),
         VMSTATE_UINT32(pstate, EHCIState),
-        VMSTATE_UINT32_TEST(a_fetch_addr_32, EHCIState,
+        VMSTATE_UINT32_TEST(migrate_a_fetch_addr, EHCIState,
                             ehci_fetch_addr_32_needed),
-        VMSTATE_UINT32_TEST(p_fetch_addr_32, EHCIState,
+        VMSTATE_UINT32_TEST(migrate_p_fetch_addr, EHCIState,
                             ehci_fetch_addr_32_needed),
         VMSTATE_UINT64_TEST(a_fetch_addr, EHCIState,
                             ehci_fetch_addr_64_needed),
-- 
2.43.0


  reply	other threads:[~2026-05-06  3:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-06  3:26 [PATCH v1 0/2] hw/usb/ehci: Improve migration helper and property naming Jamin Lin
2026-05-06  3:26 ` Jamin Lin [this message]
2026-05-06  9:10   ` [PATCH v1 1/2] hw/usb/hcd-ehci: Rename migration compatibility fetch address fields Philippe Mathieu-Daudé
2026-05-09 16:10   ` Cédric Le Goater
2026-05-06  3:26 ` [PATCH v1 2/2] hw/usb/hcd-ehci: Rename CTRLDSSEGMENT default property Jamin Lin
2026-05-09 15:55   ` Cédric Le Goater
2026-05-08 13:35 ` [PATCH v1 0/2] hw/usb/ehci: Improve migration helper and property naming Philippe Mathieu-Daudé
2026-05-09 16:00 ` Cédric Le Goater

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=20260506032643.2510575-2-jamin_lin@aspeedtech.com \
    --to=jamin_lin@aspeedtech.com \
    --cc=andrew@codeconstruct.com.au \
    --cc=clg@kaod.org \
    --cc=farosas@suse.de \
    --cc=flwu@google.com \
    --cc=joel@jms.id.au \
    --cc=kane_chen@aspeedtech.com \
    --cc=leetroy@gmail.com \
    --cc=nabihestefan@google.com \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=steven_lee@aspeedtech.com \
    --cc=troy_lee@aspeedtech.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.