spapr: option vector re-work and memory unplug support
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest10 patches 11 repliesIn review
Changes since RFC from the cover letter
* Submit as v1 now that PAPR Hotplug ACR is accepted
* Rebase on latest ppc-for-2.8 (with device-tree refactoring)
* address Patchew warnings
* add comments to clarify spapr->ov5/ov5_cas usage. (David)
* revise comment to clarify intent when setting spapr->ov5 OV5_HP_EVT bit. (Bharata)
* drop internal usage of spapr_ovec_from_bitmap() in favor of directly assigning bitmap to sPAPROptionVector instances. (David)
* standardize meaning of 'vector_len' variable through spapr_ovec_* functions to be the byte-wise length of option vectors entries, and not including the preceeding length byte itself. (David)
* fix spapr_ovec_populate_dt() to parse up to OV_MAXBITS bits rather than OV_MAXBITS - 1. (David)
* fix spapr_ovec_populate_dt() encode the minimum of 1 option vector byte instead of the max of OV_MAXBYTES in cases where no option bits are set. (David)
* add some comments to spapr_ovec_populate_dt() to clarify what is being encoded into length byte of ibm,architecture-vec-5
* switch 'legacy-hotplug-events' option to 'modern-hotplug-events' (David)
* modify rtas_event_log_to_source() to check for OV5_HP_EVT option rather than relying on whether the hotplug source is specifically enabled. Assert the latter in cases where OV5_HP_EVT is set. (Bharata)
* drop global EventSource list in favor of an sPAPREventSource list field within sPAPRMachineState (David)
* add CPU unplug hook in mc->unplug_request (Bharata)
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/10 | spapr_ovec: initial implementation of option vector helpershw/ hw/ include/ | +305 | 1 reply | |
| 2/10 | spapr_hcall: use spapr_ovec_* interfaces for CAS optionshw/ hw/ include/ +1 more | +30 | 0 replies | |
| 3/10 | spapr: add option vector handling in CAS-generated resetshw/ hw/ include/ | +55 | 1 reply | |
| 4/10 | spapr: improve ibm, architecture-vec-5 property handlinghw/ include/ | +18 | 2 replies | |
| 5/10 | spapr: update spapr hotplug documentationdocs/ | +46 | 0 replies | |
| 6/10 | spapr: add hotplug interrupt machine optionshw/ include/ include/ | +35 | 1 reply | |
| 7/10 | spapr_events: add support for dedicated hotplug event sourcehw/ hw/ include/ | +170 | 2 replies | |
| 8/10 | spapr: Add DRC count indexed hotplug identifier typehw/ include/ | +65 | 1 reply | |
| 9/10 | spapr: use count+index for memory hotplughw/ | +18 | 1 reply | |
| 10/10 | spapr: Memory hot-unplug supporthw/ hw/ | +135 | 1 reply |
Reviews trailers per patch
7 of 10 patches have a Reviewed-by or Acked-by.
| Patch | David Gibson | Bharata B Rao |
|---|---|---|
| 1/10 | R-b | |
| 2/10 | R-b | R-b |
| 3/10 | R-b | |
| 4/10 | ||
| 5/10 | R-b | |
| 6/10 | ||
| 7/10 | ||
| 8/10 | R-b | |
| 9/10 | R-b | |
| 10/10 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [Qemu-devel] [PATCH 00/10] spapr: option vector re-work and memory unplug support
This series is based on David's ppc-for-2.8 branch, and is also available from:
https://github.com/mdroth/qemu/commits/spapr-hotplug-event-update
Changes since RFC:
* Submit as v1 now that PAPR Hotplug ACR is accepted
* Rebase on latest ppc-for-2.8 (with device-tree refactoring)
* address Patchew warnings
* add comments to clarify spapr->ov5/ov5_cas usage. (David)
* revise comment to clarify intent when setting spapr->ov5 OV5_HP_EVT bit. (Bharata)
* drop internal usage of spapr_ovec_from_bitmap() in favor of directly assigning bitmap to sPAPROptionVector instances. (David)
* standardize meaning of 'vector_len' variable through spapr_ovec_* functions to be the byte-wise length of option vectors entries, and not including the preceeding length byte itself. (David)
* fix spapr_ovec_populate_dt() to parse up to OV_MAXBITS bits rather than OV_MAXBITS - 1. (David)
* fix spapr_ovec_populate_dt() encode the minimum of 1 option vector byte instead of the max of OV_MAXBYTES in cases where no option bits are set. (David)
* add some comments to spapr_ovec_populate_dt() to clarify what is being encoded into length byte of ibm,architecture-vec-5
* switch 'legacy-hotplug-events' option to 'modern-hotplug-events' (David)
* modify rtas_event_log_to_source() to check for OV5_HP_EVT option rather than relying on whether the hotplug source is specifically enabled. Assert the latter in cases where OV5_HP_EVT is set. (Bharata)
* drop global EventSource list in favor of an sPAPREventSource list field within sPAPRMachineState (David)
* add CPU unplug hook in mc->unplug_request (Bharata)
Patches 1-4 address various deficiencies in how we currently handle option vectors via ibm,client-architecture-support. This is done here in preparation for a new option vector bit introduced later in this series, as well as a number of future option vector bits related to other features, but I can break this out into a separate series if preferred.
Patches 5-7 add support for an updated event format for hotplug events, which includes a new way to specify a range of DRCs/LMBs to hotplug/unplug using a starting position and count, which is necessary for memory unplug. The format for this new event format is still in draft form, but slated for inclusion in the PAPR/LoPAPR.
Patches 8-10 add support for memory unplug using the new event format.
In addition to kernel 4.8 or later, there are a number of patches required to enable support on the guest kernel side. I've including the minimum set of patches in my branch here:
https://github.com/mdroth/linux/commits/spapr-hotplug-event-update
*powerpc/pseries: advertise Hot Plug Event support to firmware powerpc/pseries: Implement indexed-count hotplug memory remove powerpc/pseries: Implement indexed-count hotplug memory add
Note that there is currently an issue that arises when attempting to offline an LMB that was onlined using a guest kernel's auto-onlining mechanism, which can prevent full completion of memory unplug requests. This is being investigated, but for the purposes of testing this can be worked around currently by disabling auto-onlining in guests via:
"echo offline >/sys/devices/system/memory/auto_online_blocks"
and instead onlining the blocks manually or via udev.
docs/specs/ppc-spapr-hotplug.txt | 55 +++++++++++++++++++++----- hw/ppc/Makefile.objs | 2 +- hw/ppc/spapr.c | 243 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------- hw/ppc/spapr_drc.c | 17 ++++++++ hw/ppc/spapr_events.c | 278 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------- hw/ppc/spapr_hcall.c | 70 ++++++++++++++------------------- hw/ppc/spapr_ovec.c | 242 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ include/hw/ppc/spapr.h | 17 ++++++-- include/hw/ppc/spapr_ovec.h | 67 ++++++++++++++++++++++++++++++++ 9 files changed, 868 insertions(+), 123 deletions(-)