aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-02-04virtio: Move HMP commands from monitor/ to hw/virtio/Markus Armbruster3-309/+322
This moves these commands from MAINTAINERS section "Human Monitor (HMP)" to "virtio". Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230124121946.1139465-20-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2023-02-04migration: Move the QMP command from monitor/ to migration/Markus Armbruster2-31/+30
This moves the command from MAINTAINERS sections "Human Monitor (HMP)" and "QMP" to "Migration". Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230124121946.1139465-19-armbru@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com>
2023-02-04migration: Move HMP commands from monitor/ to migration/Markus Armbruster4-785/+808
This moves these commands from MAINTAINERS sections "Human Monitor (HMP)" and "QMP" to "Migration". Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230124121946.1139465-18-armbru@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com>
2023-02-04net: Move hmp_info_network() to net-hmp-cmds.cMarkus Armbruster6-30/+33
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230124121946.1139465-17-armbru@redhat.com>
2023-02-04net: Move HMP commands from monitor to net/Markus Armbruster4-117/+143
This moves these commands from MAINTAINERS sections "Human Monitor (HMP)" and "QMP" to "Network device backends". Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230124121946.1139465-16-armbru@redhat.com>
2023-02-04hmp: Rewrite strlist_from_comma_list() as hmp_split_at_comma()Markus Armbruster2-17/+11
Use g_strsplit() for the actual splitting. Give external linkage, so the next commit can move one of its users to another source file. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230124121946.1139465-15-armbru@redhat.com>
2023-02-04rocker: Move HMP commands from monitor to hw/net/rocker/Markus Armbruster3-297/+317
This moves these commands from MAINTAINERS section "Human Monitor (HMP)" to "Rocker" and "Network devices". Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230124121946.1139465-14-armbru@redhat.com>
2023-02-04block: Factor out hmp_change_medium(), and move to block/monitor/Markus Armbruster3-16/+25
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230124121946.1139465-13-armbru@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
2023-02-04qom: Move HMP commands from monitor/ to qom/Markus Armbruster3-68/+67
This moves these commands from MAINTAINERS sections "Human Monitor (HMP)" and "QMP" to "QOM". Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230124121946.1139465-12-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2023-02-04machine: Move HMP commands from monitor/ to hw/core/Markus Armbruster2-209/+208
This moves these commands from MAINTAINERS section "Human Monitor (HMP)" to "Machine core". Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230124121946.1139465-11-armbru@redhat.com>
2023-02-04machine: Move QMP commands from monitor/ to hw/core/Markus Armbruster2-140/+144
This moves these commands from MAINTAINERS section "QMP" to "Machine core". Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230124121946.1139465-10-armbru@redhat.com>
2023-02-04trace: Move HMP commands from monitor/ to trace/Markus Armbruster4-119/+152
This moves these commands from MAINTAINERS sections "Human Monitor (HMP)" and "QMP" to "Tracing". Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230124121946.1139465-9-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
2023-02-04hmp: Rename help_cmd() to hmp_help_cmd(), move declaration to hmp.hMarkus Armbruster4-6/+6
The next commit will move a caller of help_cmd() to a new file. Including monitor/monitor-internal.h there just for help_cmd() feels silly. Better to provide it in monitor/hmp.h suitably renamed. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230124121946.1139465-8-armbru@redhat.com>
2023-02-04readline: Extract readline_add_completion_of() from monitorMarkus Armbruster4-66/+41
monitor/misc.h has static add_completion_option(). It's useful elsewhere in the monitor. Since it's not monitor-specific, move it to util/readline.c renamed to readline_add_completion_of(), and put it to use. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230124121946.1139465-7-armbru@redhat.com>
2023-02-04hmp: Drop redundant argument check from add_completion_option()Markus Armbruster1-3/+0
No need to check for null arguments, no caller passes them. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230124121946.1139465-6-armbru@redhat.com>
2023-02-04char: Factor out qmp_add_client() parts and move to chardev/Markus Armbruster3-11/+25
Code moves from MAINTAINERS section "QMP" to "Character device backends". Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230124121946.1139465-5-armbru@redhat.com>
2023-02-04char: Move HMP commands from monitor/ to chardev/Markus Armbruster4-202/+225
This moves these commands from MAINTAINERS sections "Human Monitor (HMP)" and "QMP" to "Character device backends". Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230124121946.1139465-4-armbru@redhat.com>
2023-02-04audio: Move HMP commands from monitor/ to audio/Markus Armbruster4-56/+87
This moves these commands from MAINTAINERS sections "Human Monitor (HMP)" and "QMP" to "Overall Audio backends". Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230124121946.1139465-3-armbru@redhat.com>
2023-02-04monitor: Drop unnecessary includesMarkus Armbruster5-27/+2
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230124121946.1139465-2-armbru@redhat.com> Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
2023-02-02MAINTAINERS: Cover tpm.c againMarkus Armbruster1-1/+1
Commit 800d4deda0 "softmmu: move more files to softmmu/" (v5.2.0) updated MAINTAINERS for all moved files but one. Fix that. Fixes: 800d4deda04be016a95fbbf397c830a2d14ff9f6 Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230120170104.359690-1-armbru@redhat.com>
2023-02-02MAINTAINERS: Cover include/sysemu/accel-blocker.hMarkus Armbruster1-1/+1
Commit bd688fc931 "accel: introduce accelerator blocker API" aded include/sysemu/accel-blocker.h and accel/accel-blocker.c. MAINTAINERS covers the latter in section "Guest CPU Cores (other accelerators) / Overall", but not the former. Fix that. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230119091545.3116376-3-armbru@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com>
2023-02-02MAINTAINERS: Cover userfaultfdMarkus Armbruster1-0/+2
Commit 0e9b5cd6b2 "migration: introduce UFFD-WP low-level interface helpers" added util/userfaultfd.c without covering it in MAINTAINERS. Add it to section "Migration". Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230119091545.3116376-2-armbru@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Juan Quintela <quintela@redhat.com>
2023-02-02Merge tag 'for_upstream' of https://git.kernel.org/pub/scm/virt/kvm/mst/qemu ↵Peter Maydell86-389/+601
into staging virtio,pc,pci: features, cleanups, fixes lots of fixes, cleanups Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # -----BEGIN PGP SIGNATURE----- # # iQFDBAABCAAtFiEEXQn9CHHI+FuUyooNKB8NuNKNVGkFAmPYJdcPHG1zdEByZWRo # YXQuY29tAAoJECgfDbjSjVRp08cIAMYq0y++RtepDpLnPjybR0v1G4cPgZS4DXFz # 8uc/2nkAHe1Q2lJNmk9p3YjLLloSO8yC1bmuuhUpmry9BJokYzY1r7rfXc8jd/Za # z2FjC9LuYX+sk26NTGUxPq9mhT0p14HXyoxpnQlCweuVL0DJg1Tip6HI4oOG2LJj # Au6Rl9keMQNqf9qVtsR1djO+8nO4ywbx6D9d2CYSKkQ3pK3uLvNds9vqU16x8wq7 # mNPqV8BIoDgW4zEOL478h6rJcL7pDQo6kAT1wfg7q1JcMMHJfW36VcBeFfskfJFg # Pej3TEP2rg1LsGfh5XVw5Rp6FZ4K2TEyTK9cPZ9F7CzKdUrgBHU= # =S0zd # -----END PGP SIGNATURE----- # gpg: Signature made Mon 30 Jan 2023 20:17:27 GMT # gpg: using RSA key 5D09FD0871C8F85B94CA8A0D281F0DB8D28D5469 # gpg: issuer "mst@redhat.com" # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [full] # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" [full] # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17 0970 C350 3912 AFBE 8E67 # Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA 8A0D 281F 0DB8 D28D 5469 * tag 'for_upstream' of https://git.kernel.org/pub/scm/virt/kvm/mst/qemu: (56 commits) docs/pcie.txt: Replace ioh3420 with pcie-root-port Revert "vhost-user: Introduce nested event loop in vhost_user_read()" Revert "vhost-user: Monitor slave channel in vhost_user_read()" tests/qtest/bios-tables-test: Make the test less verbose by default hw: Use TYPE_PCI_BUS definition where appropriate vhost-user: Skip unnecessary duplicated VHOST_USER_ADD/REM_MEM_REG requests tests: acpi: update expected blobs pcihp: generate populated non-hotpluggble slot descriptions on non-hotplug path tests: acpi: whitelist DSDT before moving non-hotpluggble slots description from hotplug path tests: acpi: update expected blobs pcihp: acpi: ignore coldplugged bridges when composing hotpluggable slots tests: acpi: whitelist DSDT blobs before removing dynamic _DSM on coldplugged bridges tests: acpi: update expected blobs pcihp: acpi: decouple hotplug and generic slots description tests: acpi: whitelist DSDT before decoupling PCI hotplug code from basic slots description pcihp: isolate rule whether slot should be described in DSDT pci: make sure pci_bus_is_express() won't error out with "discards ‘const’ qualifier" pcihp: make bridge describe itself using AcpiDevAmlIfClass:build_dev_aml pci: acpi: wire up AcpiDevAmlIf interface to generic bridge x86: pcihp: acpi: prepare slot ignore rule to work with self describing bridges ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2023-02-01Merge tag 'python-pull-request' of https://gitlab.com/jsnow/qemu into stagingPeter Maydell8-28/+64
Python Bits and pieces, kibbles'n'bits # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCAAdFiEE+ber27ys35W+dsvQfe+BBqr8OQ4FAmPQlMIACgkQfe+BBqr8 # OQ5RIxAAqaG8Dx63CXa8WHMsGWc0CKTOcwTcRDw92GT3qhVkebZiNmNlZwckaU/c # CkVunJnU5T6T2qkploysUXwdlQ+XsY4fQlACNciZeffmT2E4siNQ/4H1uPB4xca6 # 8Sgmg2VH7OF+EWwuBihY1pbe7g+sOJg9w9isRduBnLGrLbOrewGIJBNbiVzFlz5W # 30RdvfLoUUak5qTlMT/6yl98r6fkkDmfPX653iYmpA/H/Ah+17ZJXB2XNigkqBdD # Cp8OxtFceKQdZOqNiADJRzT3Gore4lBkPnULKwct/5U0B/tUiBdZ2YDJW8EObUMY # zFE7giE5mCnyFSmfBmjKu8yS8zJm9NooYEjunTcodop/FDb96c3sh8376ZLamTii # /p5WSwfo4a6DXPUTx0aiCkqpeCdPncRgwKc5TvqyKLKxQHbfjt6UZrcL6iYbe6O6 # ltBcdvfdzL41TNjS678QqiGuYkADVa/nhig3ano4msx/Tf5e0O8eMoK9bDbVS9KF # QuONtOcut1YhnAHJp4oYN2Nimtr0t8j07iOOfc4X3+WwdbMCfR+toDM4wWVJ3u/O # 8Phy8hinfndMXdP9Q4eeFAiJ1zuD/XkpaKoDe0gHcEvp3zMEXmHiEOdv4hFeWTQB # ivU3oM/j2uVcHU4CSxra3B54vfLc1gudJ2yLPvhwPKoIRbJ/kbc= # =36NA # -----END PGP SIGNATURE----- # gpg: Signature made Wed 25 Jan 2023 02:32:34 GMT # gpg: using RSA key F9B7ABDBBCACDF95BE76CBD07DEF8106AAFC390E # gpg: Good signature from "John Snow (John Huston) <jsnow@redhat.com>" [full] # Primary key fingerprint: FAEB 9711 A12C F475 812F 18F2 88A9 064D 1835 61EB # Subkey fingerprint: F9B7 ABDB BCAC DF95 BE76 CBD0 7DEF 8106 AAFC 390E * tag 'python-pull-request' of https://gitlab.com/jsnow/qemu: python/qemu/machine: use socketpair() for QMP by default python/qmp/legacy: make QEMUMonitorProtocol accept a socket python/qmp/protocol: add open_with_socket() python/qmp: increase read buffer size python/machine: Fix AF_UNIX path too long on macOS python: QEMUMachine: enable qmp accept timeout by default Fix some typos Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2023-01-28docs/pcie.txt: Replace ioh3420 with pcie-root-portMarcel Apfelbaum1-8/+8
Do not mention ioh3420 in the "how to" doc. The device still works and can be used by already existing setups, but no need to be mentioned. Suggested-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Marcel Apfelbaum <marcel@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20230123174205.683979-1-berrange@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2023-01-28Revert "vhost-user: Introduce nested event loop in vhost_user_read()"Greg Kurz1-60/+5
This reverts commit a7f523c7d114d445c5d83aecdba3efc038e5a692. The nested event loop is broken by design. It's only user was removed. Drop the code as well so that nobody ever tries to use it again. I had to fix a couple of trivial conflicts around return values because of 025faa872bcf ("vhost-user: stick to -errno error return convention"). Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <20230119172424.478268-3-groug@kaod.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2023-01-28Revert "vhost-user: Monitor slave channel in vhost_user_read()"Greg Kurz1-32/+3
This reverts commit db8a3772e300c1a656331a92da0785d81667dc81. Motivation : this is breaking vhost-user with DPDK as reported in [0]. Received unexpected msg type. Expected 22 received 40 Fail to update device iotlb Received unexpected msg type. Expected 40 received 22 Received unexpected msg type. Expected 22 received 11 Fail to update device iotlb Received unexpected msg type. Expected 11 received 22 vhost VQ 1 ring restore failed: -71: Protocol error (71) Received unexpected msg type. Expected 22 received 11 Fail to update device iotlb Received unexpected msg type. Expected 11 received 22 vhost VQ 0 ring restore failed: -71: Protocol error (71) unable to start vhost net: 71: falling back on userspace virtio The failing sequence that leads to the first error is : - QEMU sends a VHOST_USER_GET_STATUS (40) request to DPDK on the master socket - QEMU starts a nested event loop in order to wait for the VHOST_USER_GET_STATUS response and to be able to process messages from the slave channel - DPDK sends a couple of legitimate IOTLB miss messages on the slave channel - QEMU processes each IOTLB request and sends VHOST_USER_IOTLB_MSG (22) updates on the master socket - QEMU assumes to receive a response for the latest VHOST_USER_IOTLB_MSG but it gets the response for the VHOST_USER_GET_STATUS instead The subsequent errors have the same root cause : the nested event loop breaks the order by design. It lures QEMU to expect responses to the latest message sent on the master socket to arrive first. Since this was only needed for DAX enablement which is still not merged upstream, just drop the code for now. A working solution will have to be merged later on. Likely protect the master socket with a mutex and service the slave channel with a separate thread, as discussed with Maxime in the mail thread below. [0] https://lore.kernel.org/qemu-devel/43145ede-89dc-280e-b953-6a2b436de395@redhat.com/ Reported-by: Yanghang Liu <yanghliu@redhat.com> Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2155173 Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <20230119172424.478268-2-groug@kaod.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2023-01-28tests/qtest/bios-tables-test: Make the test less verbose by defaultThomas Huth1-5/+12
We are facing the issues that our test logs in the gitlab CI are too big (and thus cut off). The bios-tables-test is one of the few qtests that prints many lines of output by default when running with V=1, so it contributes to this problem. Almost all other qtests are silent with V=1 and only print debug messages with V=2 and higher. Thus let's change the bios-tables-test to behave more like the other tests and only print the debug messages with V=2 (or higher). Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <20230118125132.1694469-1-thuth@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
2023-01-28hw: Use TYPE_PCI_BUS definition where appropriatePhilippe Mathieu-Daudé2-2/+4
Use the proper QOM type definition instead of magic string. This also helps during eventual refactor while using git-grep. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230117193014.83502-1-philmd@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Eric Auger <eric.auger@redhat.com>
2023-01-28vhost-user: Skip unnecessary duplicated VHOST_USER_ADD/REM_MEM_REG requestsMinghao Yuan1-0/+2
The VHOST_USER_ADD/REM_MEM_REG requests should be categorized into non-vring specific messages, and should be sent only once. Signed-off-by: Minghao Yuan <yuanmh12@chinatelecom.cn> Message-Id: <20230123122119.194347-1-yuanmh12@chinatelecom.cn> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2023-01-28tests: acpi: update expected blobsIgor Mammedov12-11/+0
Expected change removal of dynamic _DSM AML for non-hotpluggable hots-bridge, storage, isa bridge devices from PC machine blobs: - Scope (S00) - { - Name (ASUN, Zero) - Method (_DSM, 4, Serialized) // _DSM: Device-Specific Method - { - Local0 = Package (0x02) - { - BSEL, - ASUN - } - Return (PDSM (Arg0, Arg1, Arg2, Arg3, Local0)) - } - } - - Scope (S08) - { - Name (ASUN, One) - Method (_DSM, 4, Serialized) // _DSM: Device-Specific Method - { - Local0 = Package (0x02) - { - BSEL, - ASUN - } - Return (PDSM (Arg0, Arg1, Arg2, Arg3, Local0)) - } - } - - Scope (S10) - { - Name (ASUN, 0x02) - Method (_DSM, 4, Serialized) // _DSM: Device-Specific Method - { - Local0 = Package (0x02) - { - BSEL, - ASUN - } - Return (PDSM (Arg0, Arg1, Arg2, Arg3, Local0)) - } - } Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20230112140312.3096331-41-imammedo@redhat.com>
2023-01-28pcihp: generate populated non-hotpluggble slot descriptions on non-hotplug pathIgor Mammedov1-15/+12
Generating slots descriptions populated by non-hotpluggable devices is akward at best and complicates hotplug path (build_append_pcihp_slots) needlessly, and builds only dynamic _DSM for such slots which is overlkill. Clean it up and let non-hotplug path (build_append_pci_bus_devices) to handle that task. Such clean up effectively drops dynamic _DSM methods on non-hotpluggable slots (even though bus itself is hotpluggable), but in practice it affects only built-in devices (ide controllers/various bridges) that don't use acpi-index anyways so effectively it doesn't matter (NICs are hotpluggble). Follow up series will add static _DSM for non-hotpluggble devices/buses that will not depend on ACPI PCI hotplug at all, and potentially would allows us to reuse non-hotplug path elsewhere (PBX/microvm/arm-virt), including new support for acpi-index for non-hotpluggable devices. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20230112140312.3096331-40-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2023-01-28tests: acpi: whitelist DSDT before moving non-hotpluggble slots description ↵Igor Mammedov1-0/+11
from hotplug path Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20230112140312.3096331-39-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2023-01-28tests: acpi: update expected blobsIgor Mammedov5-4/+0
expected change is removal of dynamic _DSM bits from slots populated by coldplugged bridges (something like): - Scope (S18) - { - Name (ASUN, 0x03) - Method (_DSM, 4, Serialized) // _DSM: Device-Specific Method - { - Local0 = Package (0x02) - { - BSEL, - ASUN - } - Return (PDSM (Arg0, Arg1, Arg2, Arg3, Local0)) - } - } Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20230112140312.3096331-38-imammedo@redhat.com>
2023-01-28pcihp: acpi: ignore coldplugged bridges when composing hotpluggable slotsIgor Mammedov1-10/+6
coldplugged bridges are not unpluggable, so there is no need to describe slots where they are plugged as hotpluggable. To that effect we have a condition that marks slot as non-hotpluggable if it's populated by coldplugged bridge and prevents generation _SUN/_EJ0 objects for it. That leaves dynamic _DSM method on such slot (which also depends on BSEL and pcihp hardware). This _DSM method provides only dynamic acpi-index support so far, which is not actually used/supported by linux kernel for bridges and it's doubtful there will be need for it at all. So it's rather pointless to generate acpi-index related AML for bridges and we can simplify hotplug slots generator a bit more by completely ignoring coldplugged bridges on hotplug path. Another point in favor of dropping dynamic _DSM support, is that we can replace it with static _DSM if necessary since a slot with bridge can't change during VM runtime and without any dependency on ACPI PCI hotplug at that. Later I plan to implement bridge specific static _DSM PCI Firmware Specification 3.2 4.6.5. _DSM for Ignoring PCI Boot Configurations part of spec, to fix longstanding issue with fixed IO/MEM resource assignment that often leads to hotplugged device being in-operational within the guest due limited IO/MEM windows programmed on bridge at boot time. Expected change when coldplugged bridge is ignored by hotplug code, should look like: - Scope (S18) - { - Name (ASUN, 0x03) - Method (_DSM, 4, Serialized) // _DSM: Device-Specific Method - { - Local0 = Package (0x02) - { - BSEL, - ASUN - } - Return (PDSM (Arg0, Arg1, Arg2, Arg3, Local0)) - } - } Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20230112140312.3096331-37-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2023-01-28tests: acpi: whitelist DSDT blobs before removing dynamic _DSM on ↵Igor Mammedov1-0/+4
coldplugged bridges Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20230112140312.3096331-36-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2023-01-28tests: acpi: update expected blobsIgor Mammedov15-14/+0
Expected change for non-populated slots is that thay are moved after non-hotpluggable PCI tree description. And expected change for hotplug capable populated slots is: - ... + Name (BSEL, 0x03) + Scope (S00) + { + Name (ASUN, Zero) + Method (_DSM, 4, Serialized) // _DSM: Device-Specific Method + { + Local0 = Package (0x02) + { + BSEL, + ASUN + } + Return (PDSM (Arg0, Arg1, Arg2, Arg3, Local0)) + } [ ... other hotplug depended bits ] + } Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20230112140312.3096331-35-imammedo@redhat.com>
2023-01-28pcihp: acpi: decouple hotplug and generic slots descriptionIgor Mammedov1-49/+72
Split build_append_pci_bus_devices() onto generic part that builds AML descriptions only for populated slots which is applicable to both hotplug disabled and enabled bridges. And a hotplug only part that complements generic AML with hotplug depended bits (that depend on BSEL), like _SUN/_EJ0 entries, dynamic _DSM. Hotplug part, will generate full 'Device' descriptors for non-populated slots (like it used to be) and complementary 'Scope' descriptors for populated slots that are hotplug capable. i.e. something like this: - ... + Name (BSEL, 0x03) + Scope (S00) + { + Name (ASUN, Zero) + Method (_DSM, 4, Serialized) // _DSM: Device-Specific Method + { + Local0 = Package (0x02) + { + BSEL, + ASUN + } + Return (PDSM (Arg0, Arg1, Arg2, Arg3, Local0)) + } + [ ... other hotplug depended bits ] + } While generic build_append_pci_bus_devices() still calls hotplug part at its end it doesn't really depend on any hotplug bits anymore and later both could be completely separated when it's necessary. Main benefit though is that both build_append_pci_bus_devices() and build_append_pcihp_slots() become more readable and it makes easier to modify them with less risk of affecting another part. Also it opens possibility to re-use generic part elsewhere (microvm, arm/virt). Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20230112140312.3096331-34-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2023-01-28tests: acpi: whitelist DSDT before decoupling PCI hotplug code from basic ↵Igor Mammedov1-0/+14
slots description Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20230112140312.3096331-33-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2023-01-28pcihp: isolate rule whether slot should be described in DSDTIgor Mammedov1-40/+43
Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20230112140312.3096331-32-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2023-01-28pci: make sure pci_bus_is_express() won't error out with "discards ↵Igor Mammedov2-2/+2
‘const’ qualifier" function doesn't need RW aceess to passed in bus pointer, make it const. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20230112140312.3096331-31-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2023-01-28pcihp: make bridge describe itself using AcpiDevAmlIfClass:build_dev_amlIgor Mammedov8-16/+70
simplify build_append_pci_bus_devices() a bit by handling bridge specific logic in bridge dedicated AcpiDevAmlIfClass::build_dev_aml callback. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20230112140312.3096331-30-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2023-01-28pci: acpi: wire up AcpiDevAmlIf interface to generic bridgeIgor Mammedov1-0/+5
... so that the concrete impl. won't has to duplicate it every time. By default it doesn't do anything unless leaf class defines and sets AcpiDevAmlIfClass::build_dev_aml handler. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20230112140312.3096331-29-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2023-01-28x86: pcihp: acpi: prepare slot ignore rule to work with self describing bridgesIgor Mammedov1-8/+16
Before switching pci bridges to AcpiDevAmlIf interface, ensure that ignored slots are handled correctly. (existing rule works but only if bridge doesn't have AcpiDevAmlIf interface). While at it rewrite related comments to be less confusing (hopefully). Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20230112140312.3096331-28-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2023-01-28tests: acpi: update expected blobsIgor Mammedov5-4/+0
previous commit added endpoint devices to bridge testcases, which exposes extra non-hotpluggable slot in DSDT on bus where hotplug is not available. It should look like this (numbers may vary): + Device (S28) + { + Name (_ADR, 0x00050000) // _ADR: Address + } Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20230112140312.3096331-27-imammedo@redhat.com>
2023-01-28tests: acpi: add endpoint devices to bridgesIgor Mammedov1-8/+29
to make sure that they are enumerated or ignored as expected Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20230112140312.3096331-26-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2023-01-28whitelist DSDT before adding endpoint devices to bridge testcasesIgor Mammedov1-0/+4
Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20230112140312.3096331-25-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2023-01-28tests: acpi: update expected blobsIgor Mammedov37-36/+0
Expected changes: * pc/bridge testcase due to ("pcihp: compose PCNT callchain right before its user _GPE._E01") ... + Scope (\_SB.PCI0) + { + Scope (S18) + { + Scope (S08) + { + Method (PCNT, 0, NotSerialized) + { + BNUM = 0x02 + DVNT (PCIU, One) + DVNT (PCID, 0x03) + } + } Method (PCNT, 0, NotSerialized) { - BNUM = Zero + BNUM = One DVNT (PCIU, One) DVNT (PCID, 0x03) - ^S18.PCNT () + ^S08.PCNT () } } + + Method (PCNT, 0, NotSerialized) + { + BNUM = Zero + DVNT (PCIU, One) + DVNT (PCID, 0x03) + ^S18.PCNT () + } } Scope (_GPE) * due to ("pcihp: do not put empty PCNT in DSDT") in the most Q35 tests ... { Name (_ADR, 0x001F0003) // _ADR: Address } - - Method (PCNT, 0, NotSerialized) - { - } } } ... { Method (_E01, 0, NotSerialized) // _Exx: Edge-Triggered GPE { - Acquire (\_SB.PCI0.BLCK, 0xFFFF) - \_SB.PCI0.PCNT () - Release (\_SB.PCI0.BLCK) } } Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20230112140312.3096331-24-imammedo@redhat.com>
2023-01-28pcihp: do not put empty PCNT in DSDTIgor Mammedov1-8/+18
count number of PCNT methods that actually call Notify and if there aren't any, drop PCNT altogether. It mostly affects 'Q35' tests where there is no root-ports /bridges attached and 'PC' machine when ACPI PCI hotplug is completely disabled. Expected ASL change: - Method (PCNT, 0, NotSerialized) - { - } ... Method (_E01, 0, NotSerialized) // _Exx: Edge-Triggered GPE { - Acquire (\_SB.PCI0.BLCK, 0xFFFF) - \_SB.PCI0.PCNT () - Release (\_SB.PCI0.BLCK) } Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20230112140312.3096331-23-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2023-01-28pcihp: compose PCNT callchain right before its user _GPE._E01Igor Mammedov1-2/+30
it's a stepping stone to making build_append_pci_bus_devices() suitable for AcpiDevAmlIfClass:build_dev_aml callback and lets further simplify it by separating PCNT generation from slots descriptions. It also makes PCNT callchain ASL much more readable since callchain not longer cluttered by slots descriptors. Plus, move will let next patch easily drop empty PCNT (pc/q35) when there is nothing hotpluggable. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20230112140312.3096331-22-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>