lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 05 Dec 2013 22:27:58 +0800
From:	Hanjun Guo <hanjun.guo@...aro.org>
To:	Rob Herring <robherring2@...il.com>
CC:	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	Catalin Marinas <catalin.marinas@....com>,
	Will Deacon <will.deacon@....com>,
	Russell King - ARM Linux <linux@....linux.org.uk>,
	Daniel Lezcano <daniel.lezcano@...aro.org>,
	Mark Rutland <mark.rutland@....com>,
	Matthew Garrett <mjg59@...f.ucam.org>,
	"linaro-kernel@...ts.linaro.org" <linaro-kernel@...ts.linaro.org>,
	Graeme Gregory <graeme.gregory@...aro.org>,
	Al Stone <al.stone@...aro.org>,
	Linaro Patches <patches@...aro.org>,
	Olof Johansson <olof@...om.net>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Rob Herring <rob.herring@...xeda.com>,
	linaro-acpi@...ts.linaro.org, linux-acpi@...r.kernel.org,
	Grant Likely <grant.likely@...aro.org>,
	Bjorn Helgaas <bhelgaas@...gle.com>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [RFC part1 PATCH 5/7] ARM64 / ACPI: Introduce arm_core.c and
 its related head file

On 2013年12月05日 22:09, Rob Herring wrote:
> On Tue, Dec 3, 2013 at 10:36 AM, Hanjun Guo <hanjun.guo@...aro.org> wrote:
[...]
>> +
>>   #endif /*_ASM_ARM_ACPI_H*/
>> diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
>> index bd9bbd0..8199360 100644
>> --- a/arch/arm64/kernel/setup.c
>> +++ b/arch/arm64/kernel/setup.c
>> @@ -41,6 +41,7 @@
>>   #include <linux/memblock.h>
>>   #include <linux/of_fdt.h>
>>   #include <linux/of_platform.h>
>> +#include <linux/acpi.h>
>>
>>   #include <asm/cputype.h>
>>   #include <asm/elf.h>
>> @@ -225,6 +226,13 @@ void __init setup_arch(char **cmdline_p)
>>
>>          arm64_memblock_init();
>>
>> +       /*
>> +        * Parse the ACPI tables for possible boot-time configuration
>> +        */
>> +       acpi_boot_table_init();
>> +       early_acpi_boot_init();
>> +       acpi_boot_init();
>> +
> How about a single function here. Perhaps called acpi_early_init. That
> would save checking acpi_disabled 3 times.

It is separated for some reasons on intel platforms, one of them
is ACPI based memory hot-plug, SRAT (NUMA related ACPI table)
and its related memory initialization should be finished between
early_acpi_boot_init() and acpi_boot_init().

I keep this code unchanged for future use (memory hotplug)
on ARM, is this make sense to you?

>>          paging_init();
>>          request_standard_resources();
>>
[...]
>> lic License for more details.
>> + *
>> + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> + */
>> +
>> +#include <linux/init.h>
>> +#include <linux/acpi.h>
>> +#include <linux/acpi_pmtmr.h>
>> +#include <linux/efi.h>
>> +#include <linux/cpumask.h>
>> +#include <linux/memblock.h>
>> +#include <linux/module.h>
>> +#include <linux/irq.h>
>> +#include <linux/irqdomain.h>
>> +#include <linux/slab.h>
>> +#include <linux/bootmem.h>
>> +#include <linux/ioport.h>
>> +#include <linux/pci.h>
>> +
>> +#include <asm/pgtable.h>
>> +#include <asm/io.h>
> linux/io.h although I can't see where it is even needed.
>
>> +#include <asm/smp.h>
> linux/smp.h ...
>
> Seems like you have a lot of unnecessary headers here. efi.h, slab.h,
> pci.h, etc.

Thanks for the reminding, will update and clean them up.

>> +
>> +/*
>> + * We never plan to use RSDT on arm/arm64 as its deprecated in spec but this
>> + * variable is still required by the ACPI core
>> + */
>> +u32 acpi_rsdt_forced;
>> +
>> +int acpi_noirq;                        /* skip ACPI IRQ initialization */
>> +int acpi_strict;
>> +int acpi_disabled;
>> +EXPORT_SYMBOL(acpi_disabled);
>> +
>> +int acpi_pci_disabled;         /* skip ACPI PCI scan and IRQ initialization */
>> +EXPORT_SYMBOL(acpi_pci_disabled);
>> +
>> +#define PREFIX                 "ACPI: "
>> +
>> +/* FIXME: this function should be moved to topology.c when it is ready */
>> +void arch_fix_phys_package_id(int num, u32 slot)
>> +{
>> +       return;
>> +}
>> +EXPORT_SYMBOL_GPL(arch_fix_phys_package_id);
>> +
>> +/*
>> + * Boot-time Configuration
>> + */
>> +
> It is not really clear what this comment applies to.

Yes, only leading some confusion, will remove it.

>> +enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_PLATFORM;
>> +
>> +static unsigned int gsi_to_irq(unsigned int gsi)
>> +{
>> +       int irq = irq_create_mapping(NULL, gsi);
>> +
>> +       return irq;
>> +}
>> +
>> +/*
>> + * __acpi_map_table() will be called before page_init(), so early_ioremap()
>> + * or early_memremap() should be called here.
>> + *
>> + * FIXME: early_io/memremap()/early_iounmap() are not upstream yet on ARM64,
>> + * just wait for Mark Salter's patchset accepted by mainline
>> + */
>> +char *__init __acpi_map_table(unsigned long phys, unsigned long size)
>> +{
>> +       if (!phys || !size)
>> +               return NULL;
>> +
>> +       /*
>> +        * temporarily use phys_to_virt(),
>> +        * should be early_memremap(phys, size) here
>> +        */
>> +       return phys_to_virt(phys);
>> +}
>> +
>> +void __init __acpi_unmap_table(char *map, unsigned long size)
>> +{
>> +       if (!map || !size)
>> +               return;
>> +
>> +       /* should be early_iounmap(map, size); */
>> +       return;
>> +}
>> +
>> +int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
>> +{
>> +       *irq = gsi_to_irq(gsi);
>> +
>> +       return 0;
>> +}
>> +EXPORT_SYMBOL_GPL(acpi_gsi_to_irq);
>> +
>> +/*
>> + * success: return IRQ number (>=0)
> '> 0' for interrupts is what normally means success in the kernel. 0
> is for no irq.

Will update :)

>> + * failure: return < 0
>> + */
>> +int acpi_register_gsi(struct device *dev, u32 gsi, int trigger, int polarity)
>> +{
>> +       return -1;
>> +}
>> +EXPORT_SYMBOL_GPL(acpi_register_gsi);
[...]
>> +
>> +static int __init parse_acpi(char *arg)
>> +{
>> +       if (!arg)
>> +               return -EINVAL;
>> +
>> +       /* "acpi=off" disables both ACPI table parsing and interpreter */
>> +       if (strcmp(arg, "off") == 0) {
>> +               disable_acpi();
>> +       }
>> +       /* acpi=strict disables out-of-spec workarounds */
>> +       else if (strcmp(arg, "strict") == 0) {
>> +               acpi_strict = 1;
>> +       }
>> +       return 0;
>> +}
>> +early_param("acpi", parse_acpi);
> These aren't common options across architectures?

Different architectures have different options,
such as x86, it has more options which ARM is not needed.

Thanks
Hanjun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ