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

Re: [Xen-devel] [PATCH RFC 05/35] ARM64 / ACPI: Parse FADT table to get PSCI flags

On 2015å02æ05æ 01:45, Stefano Stabellini wrote:
On Wed, 4 Feb 2015, parth.dixit@xxxxxxxxxx wrote:
From: Naresh Bhat <naresh.bhat@xxxxxxxxxx>

There are two flags: PSCI_COMPLIANT and PSCI_USE_HVC. When set,
the former signals to the OS that the hardware is PSCI compliant.
The latter selects the appropriate conduit for PSCI calls by
toggling between Hypervisor Calls (HVC) and Secure Monitor Calls

FADT table contains such information, parse FADT to get the flags
for furture usage. At the same time, only ACPI 5.1 or higher verison
supports PSCI, and FADT Major.Minor version was introduced in ACPI
5.1, so we will check the version and only parse FADT table with
version >= 5.1.

If firmware provides ACPI tables with ACPI version less than 5.1,
OS will be messed up with those information, so disable ACPI if we
get an FADT table with version less that 5.1.

Signed-off-by: Hanjun Guo <hanjun.guo@xxxxxxxxxx>
Signed-off-by: Naresh Bhat <naresh.bhat@xxxxxxxxxx>
  xen/arch/arm/arm64/acpi/arm-core.c | 54 +++++++++++++++++++++++++++++++++++---
  xen/arch/arm/setup.c               |  1 +
  xen/include/asm-arm/acpi.h         |  2 ++
  3 files changed, 54 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/arm64/acpi/arm-core.c 
index 50a83d6..2b7e2ef 100644
--- a/xen/arch/arm/arm64/acpi/arm-core.c
+++ b/xen/arch/arm/arm64/acpi/arm-core.c
@@ -25,6 +25,7 @@
  #if defined(CONFIG_ARM_64) && defined(CONFIG_ACPI)
  #include <xen/init.h>
  #include <xen/acpi.h>
+#include <xen/errno.h>

  #include <asm/acpi.h>

@@ -42,6 +43,12 @@ EXPORT_SYMBOL(acpi_disabled);
  int acpi_pci_disabled;         /* skip ACPI PCI scan and IRQ initialization */

+/* 1 to indicate PSCI is implemented */
+int acpi_psci_present;
+/* 1 to indicate HVC must be used instead of SMC as the PSCI conduit */
+int acpi_psci_use_hvc;

Can they be static?
Also it might be better to define an enum with values: PSCI_ABSENT, PSCI_HVC, 

This patch was changed a lot in the latest v8 patch set, I introduced
two static inline function in the head file to replace those two


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.