[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH for-5.0 6/8] acpi: cpuhp: spec: add typical usecases

From: Igor Mammedov
Subject: [PATCH for-5.0 6/8] acpi: cpuhp: spec: add typical usecases
Date: Wed, 4 Dec 2019 18:05:45 +0100

Document work-flows for
  * finding a CPU with pending 'insert/remove' event
  * enumerating present and possible CPUs

Signed-off-by: Igor Mammedov <address@hidden>
 docs/specs/acpi_cpu_hotplug.txt | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/docs/specs/acpi_cpu_hotplug.txt b/docs/specs/acpi_cpu_hotplug.txt
index f3c552d..58c16c6 100644
--- a/docs/specs/acpi_cpu_hotplug.txt
+++ b/docs/specs/acpi_cpu_hotplug.txt
@@ -64,6 +64,7 @@ write access:
     [0x0-0x3] CPU selector: (DWORD access)
               selects active CPU device. All following accesses to other
               registers will read/store data from/to selected CPU.
+              Valid values: [0 .. max_cpus)
     [0x4] CPU device control fields: (1 byte access)
             0: reserved, OSPM must clear it before writing to register.
@@ -96,3 +97,31 @@ write access:
                  ACPI_DEVICE_OST QMP event from QEMU to external applications
                  with current values of OST event and status registers.
             other values: reserved
+    Typical usecases:
+        - Get a cpu with pending event
+          1. Store 0x0 to the 'CPU selector' register.
+          2. Store 0x0 to the 'Command field' register.
+          3. Read the 'CPU device status fields' register.
+          4. If both bit#1 and bit#2 are clear in the value read, there is no 
+             with a pending event and selected CPU remains unchanged.
+          5. Otherwise, read the 'Command data' register. The value read is the
+             selector of the CPU with the pending event (which is already
+             selected).
+        - Enumerate CPUs present/non present CPUs
+          01. Set the present CPU count to 0.
+          02. Set the iterator to 0.
+          03. Store 0x0 to the 'CPU selector' register, to ensure that it's in
+              a valid state and that access to other registers won't be 
+          04. Store 0x0 to the 'Command field' register to make 'Command data'
+              register return 'CPU selector' value of selected CPU
+          05. Read the 'CPU device status fields' register.
+          06. If bit#0 is set, increment the present CPU count.
+          07. Increment the iterator.
+          08. Store the iterator to the 'CPU selector' register.
+          09. Read the 'Command data' register.
+          10. If the value read is not zero, goto 05.
+          11. Otherwise store 0x0 to the 'CPU selector' register, to put it
+              into a valid state and exit.
+              The iterator at this point equals "max_cpus".

reply via email to

[Prev in Thread] Current Thread [Next in Thread]