[Skiboot] [PATCH v8 0/7] OPAL support for Nest instrumentation

Madhavan Srinivasan maddy at linux.vnet.ibm.com
Mon Mar 14 15:01:56 AEDT 2016


Patchset adds support for Nest instrumentation services
in OPAL. In POWER8, Performance Monitoring Units (PMU)
have been added to nest units which are off core but on chip.
Some of these nest pmus for ex, Memory controller, Powerbus,
Xlink, Alink, so on, can be programmed. With in-band access
to these engines enabled, programming the nest pmus and
periodic collections of counter values are offloaded to
PORE-SLW engine which runs a microcode.

Microcode programs predefined set of events on specific
nest units and moves the counter data to memory. And the
information on events that are programmed by microcode
are packaged as a meta-data file (called "Catalog")in the
system firmware.

Patchset does two things, 1) At the time of boot, it detects
the Nest instrumentation feature and created device-tree
entries to pass the information to kernel, by parsing the
"Catalog" lid. Secondly, it implements an opal call to
control the PORE_SLW_IMA microcode from kernel to start/stop
Nest PMU counter collection. Patchset tested in a openpower
habanero system using a custom microcode and catalog.

Like for custom microcode (supports only memory bandwidth events):

https://github.com/maddy-kerneldev/occ/commit/636936ac5f9e89ddf27ddca08ef3395fbd5df827

And catalog creation script go go along with this microcode:

https://github.com/maddy-kerneldev/pnor/commit/691212472daeced09352ec1df3ab9844a93f4bd8

dtc output from /proc/device-tree (habanero system):
(dt entried related to Nest instrumentation)

        nest-counters {
                compatible = "ibm,opal-in-memory-counters";
                ranges;
                #address-cells = <0x2>;
                phandle = <0x100001e0>;
                #size-cells = <0x2>;
                linux,phandle = <0x100001e0>;

                chip at 7fdb20000 {
                        ibm,chip-id = <0x0>;
                        ranges = <0x0 0x7 0xfdb20000 0x30000>;
                        #address-cells = <0x1>;
                        phandle = <0x100001e1>;
                        #size-cells = <0x1>;
                        linux,phandle = <0x100001e1>;

                        mcs {
                                compatible = "ibm,nest-counters-chip";
                                ranges;
                                #address-cells = <0x1>;
                                phandle = <0x100001e2>;
                                #size-cells = <0x1>;
                                linux,phandle = <0x100001e2>;

                                write_mc at 38 {
                                        id = <0x0>;
                                        reg = <0x38 0x8>;
                                        unit = "MiB";
                                        scale = "1.2207e-4";
                                        phandle = <0x100001e7>;
                                        linux,phandle = <0x100001e7>;
                                };

                                write_mc at 40 {
                                        id = <0x1>;
                                        reg = <0x40 0x8>;
                                        unit = "MiB";
                                        scale = "1.2207e-4";
                                        phandle = <0x100001e8>;
                                        linux,phandle = <0x100001e8>;
                                };

                                write_mc at 48 {
                                        id = <0x2>;
                                        reg = <0x48 0x8>;
                                        unit = "MiB";
                                        scale = "1.2207e-4";
                                        phandle = <0x100001e9>;
                                        linux,phandle = <0x100001e9>;
                                };

                                write_mc at 50 {
                                        id = <0x3>;
                                        reg = <0x50 0x8>;
                                        unit = "MiB";
                                        scale = "1.2207e-4";
                                        phandle = <0x100001ea>;
                                        linux,phandle = <0x100001ea>;
                                };
                                read_mc at 18 {
                                        id = <0x0>;
                                        reg = <0x18 0x8>;
                                        unit = "MiB";
                                        scale = "1.2207e-4";
                                        phandle = <0x100001e3>;
                                        linux,phandle = <0x100001e3>;
                                };

                                read_mc at 20 {
                                        id = <0x1>;
                                        reg = <0x20 0x8>;
                                        unit = "MiB";
                                        scale = "1.2207e-4";
                                        phandle = <0x100001e4>;
                                        linux,phandle = <0x100001e4>;
                                };

                                read_mc at 28 {
                                        id = <0x2>;
                                        reg = <0x28 0x8>;
                                        unit = "MiB";
                                        scale = "1.2207e-4";
                                        phandle = <0x100001e5>;
                                        linux,phandle = <0x100001e5>;
                                };

                                read_mc at 30 {
                                        id = <0x3>;
                                        reg = <0x30 0x8>;
                                        unit = "MiB";
                                        scale = "1.2207e-4";
                                        phandle = <0x100001e6>;
                                        linux,phandle = <0x100001e6>;
                                };
                        };
                };
        };


....... (pasted only one chip and nest units DT entries)

Change log v7:
1)Added MURANO pvr check in is_P8_proc() and used same in
  opal_nest_counter_control call as suggested.
2)Dropped powerbus, xlink and alink units patches
  since these are not supported by custom microcode in POWER8
  and can be added for future processor when it is finalized.
3)Fix an issue reported in multiple chip configuration
4)Modified commit messages.

Change log v6:
1)Renamed some of the veriables and functions
2)Moved both mcs_read and mcs_write under the mcs dt_node
3)Added a compatible property for nest unit dt node
4)Added a check in opal_nest_counters_control to return
  without starting IBM microcode incase of POWER8 based system.
5)updated commit message and added more comments

Change log v5:
1)Rebased with latest upstream skiboot
2)Removed dimm-max-rate device-tree node file since this is
  more specific to centaur dimms.
3)Removed microcode work around.
4)Updated comments in commit messages and also code commentary
5)Added a new routine dt_add_device_node() to create nest unit
  device tree node (to reduce code duplication).
6)Added a check for POWER8 murano based system to disable nest
  instrumentation.
7)Add two new data structures and support functions to scan all
  chip groups from catalog and map to specific units. Since going
  forward, each nest unit can have multiple groups in the catalog.
8)Updated OPAL call number.

Change log v4:

1)Moved top level "nest-counters" node from /ibm,opal to "/" root.
2)Added "range" property fields
3)Added #address-cell and #size-cells
4)Added code commentary and modified commit messages.

Change log v3:

1)Renamed the top level device tree(dt) from "nest-ima" to "nest-counters"
2)Moved the toplevel device node from "/" to "/ibm,opal"
3)Added "compatible" field at toplevel node
3)Renamed the per chip homer offset node from "ima-chip" to "homer-offset"
4)Added "compatible" filed to "homer-offset" node
5)Renamed "reg" property file from per chip node to "offset"
6)Converted dt node and property names from caps to lower case.
7)Removed "catalogue" and replaced it with "catalog" for consistency
8)Renamed the "dimm" rate dt file to "max-dimm-rate"
9)Added a macro for SAMPLE rate value
10)Renamed the OPAL call from "OPAL_NEST_IMA_CONTROL" to "OPAL_NEST_COUNTERS_CONTROL"
11)Added couple of more parameters for OPAL call to make it extendable for
 future modes and updated the document.
12)Added two more events for powerbus units.
13)Merged per unit device tree event creation function to a common on with
 additional parameters.
14)Added checks for "unit" and "scale" pointers in the dt creation function for
 events.
15)Made changes to commit messages and code commeints based on the code changes
 and review.
16)Rearranged the patchset for easy reviewing.
17)Removed the "scale." and "unit." from the event unit and scale file.
18)Added domain parameter to event parser function.

Change log v2:

1) Renamed uintXX_t and __beXX variable type to uXX type.
2) Merged the Makefile and core/init file update patch as one to help out review
3) Merged nest parser function and nest mcs support function as one patch
   to fix compilation issue reported.
4) Rebased with latest skiboot code and modified OPAL call number to 117 from 116
5) Added more comments and made changes to commit message
6) Removed commented lines in the header file structures.

Change log from v1:

1) Modified OPAL-API interface, now opal call has two parameters and have
   add documentation for the same.
2) Have split the lid loading part into two functions, first queues lid loading
   and second part verifies the magic and updates the data structure.
3) Added workaround for default sampling rate issue
4) Added more comments,fixed spelling errors,removed type cast for malloc
5) Moved "NEST_CATALOGUE_SIZE" macro definition from mem-map.h to nest.h
6) Added "Naples" chip id check
7) Merged alink (patch 8) and xlink (patch 9) dt type functions
8) Removed memset since snprintf takes care of adding trailing null
9) Renamed some variables and function for consistency.
10) Removed "ibm-fsp/firenze" from patchset subject since this series is not
    specific to "ibm-fsp/firenze" platform.
11) Made changes to commit messages.

Change log from RFC:

1) Removed "uncore" naming and replaced it with "nest/ima" in all the
   file and function.
2) Added a DT entry to pass DIMM rate information
3) Added nest instrumentation detection code and catalog parser function
4) Added support functions for different nest units.

Kindly let me know your comments and feedback.

Madhavan Srinivasan (7):
  nest data structure definitions
  OPAL nest feature detection
  Create Device-Tree(DT) nodes to pass "nest-counter" information
  Catalog parser function to detect Nest units
  Create device tree for each nest unit
  nest mcs unit support
  Add OPAL call to enable/disable nest pmu

 core/flash.c                        |   1 +
 core/init.c                         |   9 +
 doc/opal-api/opal-nest-counters.txt |  37 +++
 hw/Makefile.inc                     |   2 +-
 hw/fsp/fsp.c                        |   2 +
 hw/nest.c                           | 465 ++++++++++++++++++++++++++++++++++++
 include/nest.h                      | 239 ++++++++++++++++++
 include/opal-api.h                  |   3 +-
 include/platform.h                  |   1 +
 9 files changed, 757 insertions(+), 2 deletions(-)
 create mode 100644 doc/opal-api/opal-nest-counters.txt
 create mode 100644 hw/nest.c
 create mode 100644 include/nest.h

--
1.9.1



More information about the Skiboot mailing list