From nobody Sun Feb 8 20:35:45 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1763698186; cv=none; d=zohomail.com; s=zohoarc; b=KtUTTnHWVwoww+HHzbrIYXbc7qZCMb+CvEBKrPslY8jfdw5+0ZbSpwBVrHPd+BMr1++FGojCmAbXtD7jFzYgxTF2g3jeEW1r0XL3o7ErPBec5bKQSTLweY78HwVJRlNzov4YNepAn274Eqw0KChlsH2Q3assAH+19MsiNh5J6Dw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1763698186; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:Sender:Subject:Subject:To:To:Message-Id; bh=sPkLbvbDCPWJ1Jj6Zxc8o6cyx+3Ek/vgXqozaEwwU5s=; b=BeyaH0aNnRzF4KuJ2Ky+pC3A8KKr7YAPP7lXlW2qhlRG+rTAQh0ORK6BTcGG3VKQ0W4xEeGAshoIxCvkdzzj49tfCDrL67MNuFpp1VY0vq79aVCWRgkmQalvscoNSey0mn/WDhbe0x5KJM88/kEL18AEbxHYMkfNO1K45AkUFs0= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17636981857921008.5727316169705; Thu, 20 Nov 2025 20:09:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vMISJ-00029h-QY; Thu, 20 Nov 2025 23:09:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vMISF-00029K-Li; Thu, 20 Nov 2025 23:09:03 -0500 Received: from mail.aspeedtech.com ([211.20.114.72] helo=TWMBX01.aspeed.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vMISC-0006w9-ON; Thu, 20 Nov 2025 23:09:03 -0500 Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Fri, 21 Nov 2025 12:08:50 +0800 Received: from mail.aspeedtech.com (192.168.10.10) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1748.10 via Frontend Transport; Fri, 21 Nov 2025 12:08:50 +0800 To: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Peter Maydell , Steven Lee , Troy Lee , Andrew Jeffery , "Joel Stanley" , "open list:All patches CC here" , "open list:ASPEED BMCs" CC: , , Subject: [PATCH v1 0/1] hw/pci-host/aspeed_pcie: Update ASPEED PCIe Root Port capabilities and enable MSI to support hotplug Date: Fri, 21 Nov 2025 12:08:48 +0800 Message-ID: <20251121040849.3287437-1-jamin_lin@aspeedtech.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=211.20.114.72; envelope-from=jamin_lin@aspeedtech.com; helo=TWMBX01.aspeed.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_FAIL=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Jamin Lin From: Jamin Lin via Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1763698189500018901 Content-Type: text/plain; charset="utf-8" v1: 1. Update ASPEED PCIe Root Port capabilities and enable MSI to support h= otplug How to test it: Firmware Requirements =20 Before testing, please make sure the Linux kernel has the following configu= ration enabled: Reference defconfig: https://github.com/AspeedTech-BMC/linux/blob/aspeed-master-v6.6/arch/arm64/= configs/aspeed_g7_defconfig --- a/arch/arm64/configs/aspeed_g7_defconfig +++ b/arch/arm64/configs/aspeed_g7_defconfig @@ -66,6 +66,11 @@ CONFIG_PCI_IOV=3Dy CONFIG_PCI_PRI=3Dy CONFIG_PCIE_BUS_SAFE=3Dy CONFIG_PCIE_ASPEED=3Dy +CONFIG_HOTPLUG_PCI_PCIE=3Dy +CONFIG_HOTPLUG_PCI=3Dy +# CONFIG_HOTPLUG_PCI_CPCI is not set +# CONFIG_HOTPLUG_PCI_SHPC is not set CONFIG_DEVTMPFS=3Dy CONFIG_DEVTMPFS_MOUNT=3Dy CONFIG_DEVTMPFS_SAFE=3Dy QEMU Testing Procedure 1. Boot Linux and verify the root port root@ast2700-a1-spl:~# lspci 0002:00:00.0 PCI bridge: ASPEED Technology, Inc. AST1150 PCI-to-PCI Bridge 2. Add an e1000e device dynamically (Hot-plug) In QEMU monitor: (qemu) device_add e1000e,bus=3Dpcie.2,id=3Dmye1000e [ 103.919703] pcieport 0002:00:00.0: pciehp: Slot(0): Button press: will p= ower on in 5 sec [ 103.921921] pcieport 0002:00:00.0: pciehp: Slot(0): Card present [ 103.922557] pcieport 0002:00:00.0: pciehp: Slot(0): Link Up [ 105.047374] pci 0002:01:00.0: [8086:10d3] type 00 class 0x020000 [ 105.048859] pci 0002:01:00.0: reg 0x10: [mem 0x00000000-0x0001ffff] [ 105.049786] pci 0002:01:00.0: reg 0x14: [mem 0x00000000-0x0001ffff] [ 105.050453] pci 0002:01:00.0: reg 0x18: [io 0x0000-0x001f] [ 105.051049] pci 0002:01:00.0: reg 0x1c: [mem 0x00000000-0x00003fff] [ 105.051904] pci 0002:01:00.0: reg 0x30: [mem 0x00000000-0x0003ffff pref] [ 105.052880] pci 0002:01:00.0: enabling Extended Tags [ 105.063878] pci 0002:01:00.0: BAR 6: assigned [mem 0xa0000000-0xa003ffff= pref] [ 105.064889] pci 0002:01:00.0: BAR 0: assigned [mem 0xa0040000-0xa005ffff] [ 105.066104] pci 0002:01:00.0: BAR 1: assigned [mem 0xa0060000-0xa007ffff] [ 105.066881] pci 0002:01:00.0: BAR 3: assigned [mem 0xa0080000-0xa0083fff] [ 105.067637] pci 0002:01:00.0: BAR 2: assigned [io 0x1000-0x101f] [ 105.068360] pcieport 0002:00:00.0: PCI bridge to [bus 01] [ 105.068828] pcieport 0002:00:00.0: bridge window [io 0x1000-0x1fff] [ 105.072140] pcieport 0002:00:00.0: bridge window [mem 0xa0000000-0xa01= fffff] [ 105.075017] pcieport 0002:00:00.0: bridge window [mem 0xa0200000-0xa03= fffff 64bit pref] [ 105.081561] pcieport 0002:00:00.0: Max Payload Size set to 128/ 128 (wa= s 128), Max Read Rq 128 [ 105.082733] pci 0002:01:00.0: Max Payload Size set to 128/ 128 (was 12= 8), Max Read Rq 128 [ 105.089597] e1000e 0002:01:00.0: enabling device (0000 -> 0002) [ 105.098995] e1000e 0002:01:00.0: Interrupt Throttling Rate (ints/sec) se= t to dynamic conservative mode [ 105.160515] e1000e 0002:01:00.0 0002:01:00.0 (uninitialized): registered= PHC clock [ 105.231396] e1000e 0002:01:00.0 eth2: (PCI Express:2.5GT/s:Width x1) 52:= 54:00:12:34:56 [ 105.232279] e1000e 0002:01:00.0 eth2: Intel(R) PRO/1000 Network Connecti= on [ 105.233696] e1000e 0002:01:00.0 eth2: MAC: 3, PHY: 8, PBA No: 000000-000 [ 105.489627] 8021q: adding VLAN 0 to HW filter on device eth2 [ 105.788193] e1000e 0002:01:00.0 eth2: NIC Link is Up 1000 Mbps Full Dupl= ex, Flow Control: Rx/Tx Leave QEMU monitor mode and lspci now lists the device: root@ast2700-a1-spl:~# lspci 0002:00:00.0 PCI bridge: ASPEED Technology, Inc. AST1150 PCI-to-PCI Bridge 0002:01:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network = Connection 3. Remove the device dynamically (Hot-unplug) =20 In QEMU monitor: (qemu) device_del mye1000e [ 203.354941] pcieport 0002:00:00.0: pciehp: Slot(0): Button press: will p= ower off in 5 sec [ 208.411558] e1000e 0002:01:00.0 eth2: removed PHC [ 208.486799] e1000e 0002:01:00.0 eth2: NIC Link is Down Leave QEMU monitor mode and lspci again shows only the root port: root@ast2700-a1-spl:~# lspci 0002:00:00.0 PCI bridge: ASPEED Technology, Inc. AST1150 PCI-to-PCI Bridge Jamin Lin (1): hw/pci-host/aspeed_pcie: Update ASPEED PCIe Root Port capabilities and enable MSI to support hotplug hw/pci-host/aspeed_pcie.c | 40 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) --=20 2.43.0