21 Dec, 2015

1 commit


23 Jul, 2015

1 commit


24 May, 2014

1 commit


18 Mar, 2014

1 commit

  • syscore->resume() callback is expected to do not enable interrupts,
    it generates warning like below otherwise:

    [ 9386.365390] WARNING: CPU: 0 PID: 6733 at drivers/base/syscore.c:104 syscore_resume+0x9a/0xe0()
    [ 9386.365403] Interrupts enabled after xen_acpi_processor_resume+0x0/0x34 [xen_acpi_processor]
    ...
    [ 9386.365429] Call Trace:
    [ 9386.365434] [] dump_stack+0x45/0x56
    [ 9386.365437] [] warn_slowpath_common+0x7d/0xa0
    [ 9386.365439] [] warn_slowpath_fmt+0x4c/0x50
    [ 9386.365442] [] ? xen_upload_processor_pm_data+0x300/0x300 [xen_acpi_processor]
    [ 9386.365443] [] syscore_resume+0x9a/0xe0
    [ 9386.365445] [] suspend_devices_and_enter+0x402/0x470
    [ 9386.365447] [] pm_suspend+0x178/0x260

    On xen_acpi_processor_resume() we call various procedures, which are
    non atomic and can enable interrupts. To prevent the issue introduce
    separate resume notify called after we enable interrupts on resume
    and before we call other drivers resume callbacks.

    Signed-off-by: Stanislaw Gruszka
    Signed-off-by: Konrad Rzeszutek Wilk

    Stanislaw Gruszka
     

07 Dec, 2013

1 commit

  • Replace direct inclusions of , and
    , which are incorrect, with
    inclusions and remove some inclusions of those files that aren't
    necessary.

    First of all, , and
    should not be included directly from any files that are built for
    CONFIG_ACPI unset, because that generally leads to build warnings about
    undefined symbols in !CONFIG_ACPI builds. For CONFIG_ACPI set,
    includes those files and for CONFIG_ACPI unset it
    provides stub ACPI symbols to be used in that case.

    Second, there are ordering dependencies between those files that always
    have to be met. Namely, it is required that be included
    prior to so that the acpi_pci_root declarations the
    latter depends on are always there. And which provides
    basic ACPICA type declarations should always be included prior to any other
    ACPI headers in CONFIG_ACPI builds. That also is taken care of including
    as appropriate.

    Signed-off-by: Lv Zheng
    Cc: Greg Kroah-Hartman
    Cc: Matthew Garrett
    Cc: Tony Luck
    Cc: "H. Peter Anvin"
    Acked-by: Bjorn Helgaas (drivers/pci stuff)
    Acked-by: Konrad Rzeszutek Wilk (Xen stuff)
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     

28 Jun, 2013

1 commit

  • Convert printks to pr_ (excludes printk(KERN_DEBUG...)
    to be more consistent throughout the xen subsystem.

    Add pr_fmt with KBUILD_MODNAME or "xen:" KBUILD_MODNAME
    Coalesce formats and add missing word spaces
    Add missing newlines
    Align arguments and reflow to 80 columns
    Remove DRV_NAME from formats as pr_fmt adds the same content

    This does change some of the prefixes of these messages
    but it also does make them more consistent.

    Signed-off-by: Joe Perches
    Signed-off-by: Konrad Rzeszutek Wilk

    Joe Perches
     

19 Apr, 2013

1 commit

  • The following resolves a section mismatch warning below in xen-acpi-processor introduced by
    3fac10145b766a2244422788f62dc35978613fd8 [13/13] xen: Re-upload processor PM data to hypervisor after S3 resume (v2)

    Warning:
    WARNING: drivers/xen/built-in.o(.text+0x2056a): Section mismatch in reference from the function xen_upload_processor_pm_data() to the function .init.text:read_acpi_id()
    The function xen_upload_processor_pm_data() references
    the function __init read_acpi_id().
    This is often because xen_upload_processor_pm_data lacks a __init
    annotation or the annotation of read_acpi_id is wrong.

    Reported-by: kbuild test robot

    Signed-off-by: Ben Guthro
    Signed-off-by: Konrad Rzeszutek Wilk

    Ben Guthro
     

17 Apr, 2013

1 commit

  • Upon resume, it was found that ACPI C-states were missing from non-boot CPUs.
    This change registers a syscore_ops handler for this case, and re-uploads the
    PM information to the hypervisor to properly reset the C-state on these
    processors.

    v2:
    v1 did not go through the check_acpi_ids() code-path, and missed some cases when
    xen was running with the dom0_max_vcpus= command line parameter.

    Signed-Off-By: Ben Guthro
    [v3: Ate some tabs, s/printk/pr_info/]
    Signed-off-by: Konrad Rzeszutek Wilk

    Ben Guthro
     

22 Mar, 2013

1 commit

  • With git commit c705c78c0d0835a4aa5d0d9a3422e3218462030c
    "acpi: Export the acpi_processor_get_performance_info" we are now
    using a different mechanism to access the P-states.

    The acpi_processor per-cpu structure is set and filtered by the
    core ACPI code which shrinks the per_cpu contents to only online CPUs.
    In the past we would call acpi_processor_register_performance()
    which would have not tried to dereference offline cpus.

    With the new patch and the fact that the loop we take is for
    for_all_possible_cpus we end up crashing on some machines.
    We could modify the loop to be for online_cpus - but all the other
    loops in the code use possible_cpus (for a good reason) - so lets
    leave it as so and just check if per_cpu(processor) is NULL.

    With this patch we will bypass the !online but possible CPUs.
    This fixes:

    IP: [] xen_acpi_processor_init+0x1b6/0xe01 [xen_acpi_processor]
    PGD 4126e6067 PUD 4126e3067 PMD 0
    Oops: 0002 [#1] SMP
    Pid: 432, comm: modprobe Not tainted 3.9.0-rc3+ #28 To be filled by O.E.M. To be filled by O.E.M./M5A97
    RIP: e030:[] [] xen_acpi_processor_init+0x1b6/0xe01 [xen_acpi_processor]
    RSP: e02b:ffff88040c8a3ce8 EFLAGS: 00010282
    .. snip..
    Call Trace:
    [] ? read_acpi_id+0x12b/0x12b [xen_acpi_processor]
    [] do_one_initcall+0x12a/0x180
    [] load_module+0x1cd3/0x2870
    [] ? ddebug_proc_open+0xc0/0xc0
    [] sys_init_module+0xd7/0x120
    [] system_call_fastpath+0x16/0x1b

    on some machines.

    Signed-off-by: Konrad Rzeszutek Wilk

    Konrad Rzeszutek Wilk
     

06 Mar, 2013

1 commit

  • The git commit d5aaffa9dd531c978c6f3fea06a2972653bd7fc8
    (cpufreq: handle cpufreq being disabled for all exported function)
    tightens the cpufreq API by returning errors when disable_cpufreq()
    had been called.

    The problem we are hitting is that the module xen-acpi-processor which
    uses the ACPI's functions: acpi_processor_register_performance,
    acpi_processor_preregister_performance, and acpi_processor_notify_smm
    fails at acpi_processor_register_performance with -22.

    Note that earlier during bootup in arch/x86/xen/setup.c there is also
    an call to cpufreq's API: disable_cpufreq().

    This is b/c we want the Linux kernel to parse the ACPI data, but leave
    the cpufreq decisions to the hypervisor.

    In v3.9 all the checks that d5aaffa9dd531c978c6f3fea06a2972653bd7fc8
    added are now hit and the calls to cpufreq_register_notifier will now
    fail. This means that acpi_processor_ppc_init ends up printing:

    "Warning: Processor Platform Limit not supported"

    and the acpi_processor_ppc_status is not set.

    The repercussions of that is that the call to
    acpi_processor_register_performance fails right away at:

    if (!(acpi_processor_ppc_status & PPC_REGISTERED))

    and we don't progress any further on parsing and extracting the _P*
    objects.

    The only reason the Xen code called that function was b/c it was
    exported and the only way to gather the P-states. But we can also
    just make acpi_processor_get_performance_info be exported and not
    use acpi_processor_register_performance. This patch does so.

    Acked-by: Rafael J. Wysocki
    Signed-off-by: Konrad Rzeszutek Wilk

    Konrad Rzeszutek Wilk
     

05 Sep, 2012

1 commit


20 Jul, 2012

1 commit


18 May, 2012

1 commit


27 Apr, 2012

1 commit


22 Mar, 2012

1 commit

  • When booting the kernel under machines that do not have P-states
    we would end up with:

    ------------[ cut here ]------------
    WARNING: at drivers/xen/xen-acpi-processor.c:504
    xen_acpi_processor_init+0x286/0
    x2e0()
    Hardware name: ProLiant BL460c G6
    Modules linked in:
    Pid: 1, comm: swapper Not tainted 2.6.39-200.0.3.el5uek #1
    Call Trace:
    [] ? xen_acpi_processor_init+0x286/0x2e0
    [] warn_slowpath_common+0x90/0xc0
    [] ? check_acpi_ids+0x1e0/0x1e0
    [] warn_slowpath_null+0x1a/0x20
    [] xen_acpi_processor_init+0x286/0x2e0
    [] ? check_acpi_ids+0x1e0/0x1e0
    [] do_one_initcall+0xe8/0x130

    .. snip..

    Which is OK - the machines do not have P-states, so we fail to register
    to process the _PXX states. But there is no need to WARN the user
    of it.

    Oracle BZ# 13871288
    Signed-off-by: Konrad Rzeszutek Wilk

    Konrad Rzeszutek Wilk
     

15 Mar, 2012

1 commit

  • This driver solves three problems:
    1). Parse and upload ACPI0007 (or PROCESSOR_TYPE) information to the
    hypervisor - aka P-states (cpufreq data).
    2). Upload the the Cx state information (cpuidle data).
    3). Inhibit CPU frequency scaling drivers from loading.

    The reason for wanting to solve 1) and 2) is such that the Xen hypervisor
    is the only one that knows the CPU usage of different guests and can
    make the proper decision of when to put CPUs and packages in proper states.
    Unfortunately the hypervisor has no support to parse ACPI DSDT tables, hence it
    needs help from the initial domain to provide this information. The reason
    for 3) is that we do not want the initial domain to change P-states while the
    hypervisor is doing it as well - it causes rather some funny cases of P-states
    transitions.

    For this to work, the driver parses the Power Management data and uploads said
    information to the Xen hypervisor. It also calls acpi_processor_notify_smm()
    to inhibit the other CPU frequency scaling drivers from being loaded.

    Everything revolves around the 'struct acpi_processor' structure which
    gets updated during the bootup cycle in different stages. At the startup, when
    the ACPI parser starts, the C-state information is processed (processor_idle)
    and saved in said structure as 'power' element. Later on, the CPU frequency
    scaling driver (powernow-k8 or acpi_cpufreq), would call the the
    acpi_processor_* (processor_perflib functions) to parse P-states information
    and populate in the said structure the 'performance' element.

    Since we do not want the CPU frequency scaling drivers from loading
    we have to call the acpi_processor_* functions to parse the P-states and
    call "acpi_processor_notify_smm" to stop them from loading.

    There is also one oddity in this driver which is that under Xen, the
    physical online CPU count can be different from the virtual online CPU count.
    Meaning that the macros 'for_[online|possible]_cpu' would process only
    up to virtual online CPU count. We on the other hand want to process
    the full amount of physical CPUs. For that, the driver checks if the ACPI IDs
    count is different from the APIC ID count - which can happen if the user
    choose to use dom0_max_vcpu argument. In such a case a backup of the PM
    structure is used and uploaded to the hypervisor.

    [v1-v2: Initial RFC implementations that were posted]
    [v3: Changed the name to passthru suggested by Pasi Kärkkäinen ]
    [v4: Added vCPU != pCPU support - aka dom0_max_vcpus support]
    [v5: Cleaned up the driver, fix bug under Athlon XP]
    [v6: Changed the driver to a CPU frequency governor]
    [v7: Jan Beulich suggestion to make it a cpufreq scaling driver
    made me rework it as driver that inhibits cpufreq scaling driver]
    [v8: Per Jan's review comments, fixed up the driver]
    [v9: Allow to continue even if acpi_processor_preregister_perf.. fails]
    Signed-off-by: Konrad Rzeszutek Wilk

    Konrad Rzeszutek Wilk