[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 Wed, 2015-02-04 at 17:45 +0000, 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
> > (SMC).
> > 
> > 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 
> > b/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 */
> >  EXPORT_SYMBOL(acpi_pci_disabled);
> >  
> > +/* 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, 
> PSCI_SMC.

Why are they even needed in Xen?

The ACPI code should correctly configure the existing psci_ver variable
and any psci_FOO_nr during init.

Since HVC is an impossibility for Xen running on real firmware it should
do as psci_is_smc_method does and bail if HVC is found.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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