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:	Tue, 31 May 2016 21:05:13 +0800
From:	Hanjun Guo <hanjun.guo@...aro.org>
To:	David Daney <ddaney.cavm@...il.com>,
	Will Deacon <will.deacon@....com>,
	linux-arm-kernel@...ts.infradead.org,
	Mark Rutland <mark.rutland@....com>,
	Catalin Marinas <catalin.marinas@....com>,
	Tony Luck <tony.luck@...el.com>,
	Fenghua Yu <fenghua.yu@...el.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	Len Brown <lenb@...nel.org>, Rob Herring <robh+dt@...nel.org>,
	Frank Rowand <frowand.list@...il.com>,
	Grant Likely <grant.likely@...aro.org>,
	Robert Moore <robert.moore@...el.com>,
	Lv Zheng <lv.zheng@...el.com>,
	Marc Zyngier <Marc.Zyngier@....com>,
	linux-ia64@...r.kernel.org, linux-acpi@...r.kernel.org,
	devel@...ica.org
Cc:	linux-kernel@...r.kernel.org, Robert Richter <rrichter@...ium.com>,
	David Daney <david.daney@...ium.com>
Subject: Re: [PATCH v7 13/15] ACPI / processor: Add acpi_map_madt_entry().

On 2016/5/25 6:35, David Daney wrote:
> From: David Daney <david.daney@...ium.com>
>
> Follow-on arm64 ACPI/NUMA patches need to map MADT entries very early
> (before kmalloc is usable).
>
> Add acpi_map_madt_entry() which, indirectly, uses
> early_memremap()/early_memunmap() to access the table and parse out
> the mpidr.  The existing implementation of map_madt_entry() is
> modified to take a pointer to the MADT as a parameter and the callers
> adjusted.
>
> Signed-off-by: David Daney <david.daney@...ium.com>
> ---
>   drivers/acpi/processor_core.c | 26 ++++++++++++++++++++++----
>   include/acpi/processor.h      |  1 +
>   2 files changed, 23 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
> index 33a38d6..9125d7d 100644
> --- a/drivers/acpi/processor_core.c
> +++ b/drivers/acpi/processor_core.c
> @@ -108,13 +108,12 @@ static int map_gicc_mpidr(struct acpi_subtable_header *entry,
>   	return -EINVAL;
>   }
>
> -static phys_cpuid_t map_madt_entry(int type, u32 acpi_id)
> +static phys_cpuid_t map_madt_entry(struct acpi_table_madt *madt,
> +				   int type, u32 acpi_id)
>   {
>   	unsigned long madt_end, entry;
>   	phys_cpuid_t phys_id = PHYS_CPUID_INVALID;	/* CPU hardware ID */
> -	struct acpi_table_madt *madt;
>
> -	madt = get_madt_table();
>   	if (!madt)
>   		return phys_id;
>
> @@ -145,6 +144,25 @@ static phys_cpuid_t map_madt_entry(int type, u32 acpi_id)
>   	return phys_id;
>   }
>
> +phys_cpuid_t __init acpi_map_madt_entry(u32 acpi_id)
> +{
> +	struct acpi_table_madt *madt = NULL;
> +	acpi_size tbl_size;
> +	phys_cpuid_t rv;
> +
> +	acpi_get_table_with_size(ACPI_SIG_MADT, 0,
> +				 (struct acpi_table_header **)&madt,
> +				 &tbl_size);
> +	if (!madt)
> +		return PHYS_CPUID_INVALID;
> +
> +	rv = map_madt_entry(madt, 1, acpi_id);

Just nit-pick, pass 1 here means we need to define an acpi processor
device object in DSDT (see function map_gicc_mpidr(),
device_declaration), it would be fine for x2apic and gic mode,
but not for lapic mode, since the function name is acpi_map_madt_entry
which is general for all architecture, it will confuse people I think.

How about rename acpi_map_madt_entry() to acpi_map_madt_gicc_entry()?
It's only used for AMR64 to get mpidrs from GICC entries using acpi_id,
other than that, it's good to me.

Thanks
Hanjun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ