[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v8 02/18] hw/usb/hcd-xhci: Add an auto-hub property and leave it off
- To: "kraxel@xxxxxxxxxx" <kraxel@xxxxxxxxxx>, "marcandre.lureau@xxxxxxxxxx" <marcandre.lureau@xxxxxxxxxx>, "junjie.cao@xxxxxxxxx" <junjie.cao@xxxxxxxxx>, "junjie.cao@xxxxxxxxx" <junjie.cao@xxxxxxxxx>, "clg@xxxxxxxx" <clg@xxxxxxxx>, Pierrick Bouvier <pierrick.bouvier@xxxxxxxxxxxxxxxx>, Peter Maydell <peter.maydell@xxxxxxxxxx>, Kane Chen <kane_chen@xxxxxxxxxxxxxx>, Philippe Mathieu-Daudé <philmd@xxxxxxxxxxxxxxxx>, Tyrone Ting <kfting@xxxxxxxxxxx>, Hao Wu <wuhaotsh@xxxxxxxxxx>, Zhao Liu <zhao1.liu@xxxxxxxxx>, Richard Henderson <richard.henderson@xxxxxxxxxx>, Helge Deller <deller@xxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony PERARD <anthony@xxxxxxxxxxxxxx>, "Edgar E. Iglesias" <edgar.iglesias@xxxxxxxxx>, "open list:All patches CC here" <qemu-devel@xxxxxxxxxx>, "open list:ASPEED BMCs" <qemu-arm@xxxxxxxxxx>, "open list:X86 Xen CPUs" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jamin Lin <jamin_lin@xxxxxxxxxxxxxx>
- Date: Mon, 2 Nov 2026 09:22:05 +0000
- Accept-language: zh-TW, en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=aspeedtech.com; dmarc=pass action=none header.from=aspeedtech.com; dkim=pass header.d=aspeedtech.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DX9Bu5iUcluzz1IwNbqqdX2x3rrq6ZvYTGoWFsJ0rB8=; b=TtGzs64+llQOq3kH/z243omwQv6jzfFpTUvcLBOckwN3AhrqHqwOfM2S5VsX1IKC/Luy5FowII5Yo4LpkzQvSLuookHxDDALOYY9khI7EsSQVAAwqxZ7rzeUAUHNbMdYFTQ7y0nLzXHYGOM0/RVLQJ3SItD/1rQ1pemIX82FNKU4N0vMD8duuuDWPFiNjhcYNDlJr87/mYRS+lHTl9yzyNYwHEmORGzNkdZHV600CyvsSDMp/GFnSlUCaWNjrF8khYIcdcEOmfQoi6tieVCwViM6pRa590qDyFKn77s9YRi8nfCmSb4d0yET/F+4ss8f3JGelPQD53s7GgZi6zCGVw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hjx/b7ZkOY7jcsUD3VMnC1vAhlhOrp6gdKSdJmZ4sdfCKGL0Bh3f4sCtbwCo9BaVpZdNu40I3a/lUS3YXlrBMJJzqIFZj+uAUL8Of6Ln08tg5kW0V8vkZwKDJrhW0i576d4SdZKv0txDnPjGnGyCLc2pV/DqFhhmjlzlFZvhSIqiHfCOR+hVFTlMRVn4omH8P2IMiUUZVPN4K66iyKxbGibkUL+4snj/Cd/Kcc+sA3EifGlh3WwJcu3UdaVFQ1U9tgTPySOUtwTz9ur1scCaehZuZavIlG1tTx1xFBWSUXi9TmVFUI2W93EieLJ5r5a77e1LXc7/OrzQyLeL6h7A0A==
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=aspeedtech.com header.i="@aspeedtech.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
- Authentication-results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=aspeedtech.com;
- Cc: Jamin Lin <jamin_lin@xxxxxxxxxxxxxx>, Troy Lee <troy_lee@xxxxxxxxxxxxxx>
- Delivery-date: Mon, 02 Nov 2026 09:24:49 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHdaqugzonZbCOsyEq5GblPuZWDag==
- Thread-topic: [PATCH v8 02/18] hw/usb/hcd-xhci: Add an auto-hub property and leave it off
xHCI has up to 15 root ports and does not need a hub to fit more
devices.
Add auto-hub and leave it off. hw_compat_11_1 turns it on, so an older
machine type keeps the hub it has today and a guest saved by an older
QEMU still loads.
Suggested-by: Gerd Hoffmann <kraxel@xxxxxxxxxx>
Reported-by: Junjie Cao <junjie.cao@xxxxxxxxx>
Signed-off-by: Jamin Lin <jamin_lin@xxxxxxxxxxxxxx>
---
hw/usb/hcd-xhci.h | 1 +
hw/core/machine.c | 1 +
hw/usb/hcd-xhci.c | 2 ++
3 files changed, 4 insertions(+)
diff --git a/hw/usb/hcd-xhci.h b/hw/usb/hcd-xhci.h
index 5cb9e06d1d..a3eaf2ebb6 100644
--- a/hw/usb/hcd-xhci.h
+++ b/hw/usb/hcd-xhci.h
@@ -191,6 +191,7 @@ typedef struct XHCIState {
uint32_t numslots;
uint32_t flags;
uint32_t max_pstreams_mask;
+ bool auto_hub;
void (*intr_update)(XHCIState *s, int n, bool enable);
bool (*intr_raise)(XHCIState *s, int n, bool level);
/*
diff --git a/hw/core/machine.c b/hw/core/machine.c
index d9ac4b419a..f8f5b01117 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -43,6 +43,7 @@
GlobalProperty hw_compat_11_1[] = {
{ "sysbus-ehci-usb", "x-migrate-fetch-addr-64bit", "off" },
{ "pci-ehci-usb", "x-migrate-fetch-addr-64bit", "off" },
+ { "base-xhci", "auto-hub", "on" },
};
const size_t hw_compat_11_1_len = G_N_ELEMENTS(hw_compat_11_1);
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 376bc00264..1e42c851b4 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -3377,6 +3377,7 @@ static void usb_xhci_init(XHCIState *xhci)
xhci->numports = xhci->numports_2 + xhci->numports_3;
usb_bus_new(&xhci->bus, sizeof(xhci->bus), &xhci_bus_ops,
xhci->hostOpaque);
+ xhci->bus.auto_hub = xhci->auto_hub;
for (i = 0; i < usbports; i++) {
speedmask = 0;
@@ -3660,6 +3661,7 @@ static const Property xhci_properties[] = {
DEFINE_PROP_UINT32("p3", XHCIState, numports_3, 4),
DEFINE_PROP_LINK("host", XHCIState, hostOpaque, TYPE_DEVICE,
DeviceState *),
+ DEFINE_PROP_BOOL("auto-hub", XHCIState, auto_hub, false),
};
static void xhci_class_init(ObjectClass *klass, const void *data)
--
2.43.0
|