CPPC:
====
CPPC (Collaborative Processor Performance Control) is a new way to control CPU
performance using an abstract continous scale as against a discretized P-state scale
which is tied to CPU frequency only. It is defined in the ACPI 5.0+ spec. In brief,
the basic operation involves:
- OS makes a CPU performance request. (Can provide min and max tolerable bounds)
- Platform (such as BMC) is free to optimize request within requested bounds depending
on power/thermal budgets etc.
- Platform conveys its decision back to OS
The communication between OS and platform occurs through another medium called (PCC)
Platform communication Channel. This is a generic mailbox like mechanism which includes
doorbell semantics to indicate register updates. See drivers/mailbox/pcc.c
This patchset introduces a CPPC based CPUFreq driver that works with existing governors
such as ondemand. The CPPC table parsing and the CPPC communication semantics are
abstracted into separate files to allow future CPPC based drivers to implement their
own governors if required.
Initial patchsets included an adaptation of the PID governor from intel_pstate.c. However
recent experiments led to extensive modifications of the algorithm to calculate CPU
busyness. Until it is verified that these changes are worthwhile, the existing governors
should provide for a good enough starting point for ARM64 servers.
Finer details about the PCC and CPPC spec are available in the latest ACPI 5.1
specification.[2]
Changes since V3:
- Split CPPC backend methods into separate files.
- Add frontend driver which plugs into existing CPUfreq governors.
- Simplify PCC driver by moving communication space mapping and read/write
into client drivers.
Changes since V2:
- Select driver if !X86, since intel_pstate will use HWP extensions instead.
- Added more comments.
- Added Freq domain awareness and PSD parsing.
Changes since V1:
- Create a new driver based on Dirks suggestion.
- Fold in CPPC backend hooks into main driver.
Changes since V0: [1]
- Split intel_pstate.c into a generic PID governor and platform specific backend.
- Add CPPC accessors as PID backend.
[1] - http://lwn.net/Articles/608715/
[2] - http://www.uefi.org/sites/default/files/resources/ACPI_5_1release.pdf
[3] - https://patches.linaro.org/40705/
Ashwin Chaugule (2):
Mailbox: Restructure and simplify PCC mailbox code
CPPC: Add CPUFreq driver based on CPPC methods
drivers/cpufreq/Kconfig.arm | 15 +
drivers/cpufreq/Makefile | 1 +
drivers/cpufreq/cppc_acpi.c | 801 +++++++++++++++++++++++++++++++++++++++++
drivers/cpufreq/cppc_acpi.h | 134 +++++++
drivers/cpufreq/cppc_cpufreq.c | 186 ++++++++++
drivers/mailbox/pcc.c | 122 ++-----
6 files changed, 1174 insertions(+), 85 deletions(-)
create mode 100644 drivers/cpufreq/cppc_acpi.c
create mode 100644 drivers/cpufreq/cppc_acpi.h
create mode 100644 drivers/cpufreq/cppc_cpufreq.c
--
1.9.1
Slowly but surely, the Seattle topic branch is coming back to life.
I pushed up a version today to acpi.git that has the console working
(and earlycon) via SPCR, AHCI works so the SATA drive will come up, and
the PMU will start, and the secondary CPUs will come up via the parking
protocol. GICv2 support seems to be working. too. I recommend that
you have version 73C or 74D firmware; anything earlier is sketchy.
This is all in acpi-topic-seattle, which is based on the v9 version of
the patches (and hence 4.0-rc1, too). It's enough I can get to a shell
prompt/login and do useful things.
Things that still need work:
-- Reboot doesn't work; there's a patch for this but not applied
just yet
-- The XGBE NIC is weird. If you have the B0 rev of the board,
it may work fine. I have an A0 which requires a slightly
different driver that is not working (it causes a hang that
I'm trying to figure out); this may just be because of 4.0.
-- Need to add in PCI support, plus things like USB, I2C, IPMI,
and so on -- all the other stuff currently listed in the DT.
There are patches for all of this, but it's a mess because
of what we can and cannot release just yet -- and, well,
because I find PCI confusing, too :).
-- KVM would be good to have (yes, it does need a mod for ACPI).
I'd like to at least get PCI working before notifying LKML.
Anything you have time to help with is greatly appreciated....
--
ciao,
al
-----------------------------------
Al Stone
Software Engineer
Linaro Enterprise Group
al.stone(a)linaro.org
-----------------------------------
Currently, the virt machine model generates Device Tree information dynamically based on the existing devices in the system. This patch series extends the same concept but for ACPI information instead. A total of seven tables have been
implemented in this patch series, which is the minimum for a basic ARM support.
The set of generated tables are:
- RSDP
- XSDT
- MADT
- GTDT
- FADT
- FACS
- DSDT
The tables are created in standalone buffers, taking into account the
needed information passed from the virt machine model. When the generation
is finalized, the individual buffers are compacted to a single ACPI binary
blob, where it is injected on the guest memory space in a fixed location.
The guest kernel can find the ACPI tables by providing to it the physical
address of the ACPI blob (e.g. acpi_rsdp=0x47000000 boot argument).
This series has been tested on the Foundation Model 0.8 build 5206 and
the Juno development board. For kernel and driver support it is based
on the "Introduce ACPI for ARM64 based on ACPI 5.1" and
"Drivers for Juno to boot from ACPI" patch series from Hanjun Guo.
Alexander Spyridakis (7):
hw/i386: Move ACPI header definitions in an arch-independent location
hw/arm/virt-acpi: Basic skeleton for dynamic generation of ACPI tables
hw/arm/virt-acpi: Generate RSDP and XSDT, add helper functions
hw/arm/virt-acpi: Generate FACS and FADT, update ACPI headers
hw/arm/virt-acpi: GIC and Arch Timer definitions in MADT and GTDT
hw/arm/virt-acpi: Generation of DSDT including virt devices
hw/arm/virt: Enable dynamic generation of ACPI v5.1 tables
hw/arm/Makefile.objs | 2 +-
hw/arm/boot.c | 26 +++
hw/arm/virt-acpi.c | 555 ++++++++++++++++++++++++++++++++++++++++++++
hw/arm/virt.c | 54 ++++-
hw/i386/acpi-build.c | 2 +-
hw/i386/acpi-defs.h | 368 -----------------------------
include/hw/acpi/acpi-defs.h | 535 ++++++++++++++++++++++++++++++++++++++++++
include/hw/arm/arm.h | 2 +
include/hw/arm/virt-acpi.h | 73 ++++++
tests/bios-tables-test.c | 2 +-
10 files changed, 1244 insertions(+), 375 deletions(-)
create mode 100644 hw/arm/virt-acpi.c
delete mode 100644 hw/i386/acpi-defs.h
create mode 100644 include/hw/acpi/acpi-defs.h
create mode 100644 include/hw/arm/virt-acpi.h
--
1.9.1
From: Al Stone <al.stone(a)linaro.org>
The use of the ACPI _OSI method in Linux has a long and sordid history.
Instead of perpetuating past complications on new architectures, the
consensus amongst those writing the ACPI specification and those using
it seems to be to ultimately deprecate the use of _OSI. A change request
has been submitted (but not yet decided upon) to modify the ACPI spec
accordingly.
In the meantime, these patches rearrange the implementation of _OSI so
that it can be deprecated, or ultimately removed completely, on at least
arm64 platforms. This is done by separating out the _OSI implementation
and moving it into a new file. For x86 and ia64, there is no change in
functionality. But, this allows us to provide a separate implementation
of _OSI for arm64 that generates a warning that it has been deprecated,
and always returns false; i.e., that the capability being queried for,
whether OS name or functionality, is not supported. Patches 0005
through 0008 provide these changes; the first four patches are solely
cleanup to the file drivers/acpi/osl.c made so that checkpatch will not
complain.
The final patch changes the default value for the _OS_ method for arm64
only. Since there is no need to pretend to be older versions of Windows,
or any other OS at all, the _OS_ method will return "Linux" on arm64.
One can still use the acpi_os_name kernel parameter if there is a need
to use some other value.
The first seven patches do not depend on arm64 support for ACPI and could
be used independently. The last two patches make much more sense when used
in conjunction with Hanjun's patches for ACPI 5.1 on arm64 [0]. In fact,
patch 0008 cannot be applied without [0].
These have been through some simple testing on two different x86 laptops,
and all seems well (Lenovo t440s and t430s ThinkPads). The arm64 code has
been tested on an AMD Seattle system. Unfortunately, for ia64, all I could
do was cross-compile the code; I have no access to hardware to test on.
NB: the first four patches are solely cleanup to drivers/acpi/osl.c based
on the results from checkpatch and can be treated independently. However,
the remainder of the patch set assumes this cleanup has been done. There
are some checkpatch warnings still remaining in osl.c -- specifically about
use of volatiles and one line of 81 characters -- that these patches
intentionally do not correct as they do not appear to need correcting.
Changes in v3:
-- add in cleanup to osl.c based on checkpatch output
-- put arch-specific _OSI implementation in the correct place (arch/*)
-- modify CONFIG item names and make them so they are not user selectable
-- get rid of the BLACKLIST config item; it wasn't really needed.
Changes in v2:
-- significant simplification based on Rafael's comments
-- ACPI spec change request has now been submitted
[0] https://lkml.org/lkml/2015/2/2/261
Al Stone (9):
ACPI: fix all errors reported by cleanpatch.pl in osl.c
ACPI: clear up warnings on use of printk reported by checkpatch.pl
ACPI: clean up checkpatch warnings for various bits of syntax
ACPI: clean up checkpatch warnings for items with possible semantic
value
ACPI: move acpi_os_handler() so it can be made arch-dependent later
ACPI: move _OSI support functions to allow arch-dependent
implementation
ACPI: enable arch-specific compilation for _OSI and the blacklist
ACPI: arm64: use an arch-specific ACPI _OSI method and ACPI blacklist
ACPI: arm64: use "Linux" as ACPI_OS_NAME for _OS on arm64
arch/arm64/Kconfig | 6 +
arch/arm64/kernel/Makefile | 2 +-
arch/arm64/kernel/acpi-blacklist.c | 20 ++
arch/arm64/kernel/acpi-osi.c | 25 +++
drivers/acpi/Kconfig | 3 +
drivers/acpi/Makefile | 5 +
drivers/acpi/osi.c | 245 +++++++++++++++++++++++
drivers/acpi/osl.c | 387 ++++++++-----------------------------
include/acpi/acconfig.h | 2 +
include/acpi/platform/aclinux.h | 4 +
include/linux/acpi.h | 14 +-
11 files changed, 406 insertions(+), 307 deletions(-)
create mode 100644 arch/arm64/kernel/acpi-blacklist.c
create mode 100644 arch/arm64/kernel/acpi-osi.c
create mode 100644 drivers/acpi/osi.c
--
2.1.0
With ACPI arm64 core paches and NUMA patch from Ganapatrao,
I prepared those ACPI based NUMA support for ARM64.
v1->v2:
- fix the warning about not released a early remapped
memory;
- rebase on top of 4.0-rc1 and v9 of ACPI patch set.
Ashok, sorry for sending out the patch set late, and
your patch for " ARM64 / ACPI : Probe _PXM during pci acpi scan"
need based on PCI patches, I will pick it up later.
Note: Haven't tested on real hardware...
git repo:
https://git.linaro.org/leg/acpi/acpi.git branch numa
Ganapatrao Kulkarni (1):
arm64:numa: adding numa support for arm64 platforms
Hanjun Guo (4):
ACPI / NUMA: Use pr_fmt() instead of printk
ACPI / NUMA: Replace ACPI_DEBUG_PRINT() with pr_debug()
ARM64 / ACPI: NUMA support based on SRAT and SLIT
ACPI / NUMA: Enable ACPI based NUMA on ARM64
arch/arm64/Kconfig | 32 +++
arch/arm64/include/asm/acpi.h | 6 +
arch/arm64/include/asm/mmzone.h | 32 +++
arch/arm64/include/asm/numa.h | 51 ++++
arch/arm64/kernel/Makefile | 2 +
arch/arm64/kernel/acpi_numa.c | 208 +++++++++++++++
arch/arm64/kernel/dt_numa.c | 302 +++++++++++++++++++++
arch/arm64/kernel/setup.c | 11 +
arch/arm64/kernel/smp.c | 2 +
arch/arm64/mm/Makefile | 1 +
arch/arm64/mm/init.c | 34 ++-
arch/arm64/mm/numa.c | 573 ++++++++++++++++++++++++++++++++++++++++
drivers/acpi/Kconfig | 2 +-
drivers/acpi/numa.c | 108 +++++---
include/linux/acpi.h | 15 ++
15 files changed, 1329 insertions(+), 50 deletions(-)
create mode 100644 arch/arm64/include/asm/mmzone.h
create mode 100644 arch/arm64/include/asm/numa.h
create mode 100644 arch/arm64/kernel/acpi_numa.c
create mode 100644 arch/arm64/kernel/dt_numa.c
create mode 100644 arch/arm64/mm/numa.c
--
1.9.1
On 2015年01月08日 17:26, Ashok Kumar wrote:
> On Thu, Jan 08, 2015 at 04:00:37PM +0800, Hanjun Guo wrote:
>> On 2015???01???07??? 21:32, Ashok Kumar wrote:
>>> Also provided pcibus_to_node and cpumask_of_pcibus
>>> based on x86.
>>>
>>> Signed-off-by: Ashok Kumar <ashoks(a)broadcom.com>
>>> ---
>>> Hanjun,
>>> This patch is based on your acpi numa patchset and leg-kernel.
>>> Tested it on qemu using generic pci host controller.
>>> could you add this to your set of patches if it is fine?
>>> Thanks!
>>
>> sure, I will. thanks for your patch!
>>
>> I already fixed the call trace of early_ioremap memory
>> leak, will send another version.
> Hanjun,
>
> Thanks!
>
> I just noticed the call to numa_add_memblk in acpi_numa_memory_affinity_init should use ma->length
> as the second param. The syntax of numa_add_memblk is numa_add_memblk(u32 nid, u64 base, u64 size).
Hi Ashok,
I'm going to send another version of ACPI patches but
I can't add your _PXM patch in my patch set, it depends
on PCI patches, I will add them when PCI patch is ready.
Thanks
Hanjun