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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 17 Jun 2013 17:07:22 -0700
From:	Tejun Heo <tj@...nel.org>
To:	Tang Chen <tangchen@...fujitsu.com>
Cc:	tglx@...utronix.de, mingo@...e.hu, hpa@...or.com,
	akpm@...ux-foundation.org, trenn@...e.de, yinghai@...nel.org,
	jiang.liu@...wei.com, wency@...fujitsu.com, laijs@...fujitsu.com,
	isimatu.yasuaki@...fujitsu.com, mgorman@...e.de,
	minchan@...nel.org, mina86@...a86.com, gong.chen@...ux.intel.com,
	vasilis.liaskovitis@...fitbricks.com, lwoodman@...hat.com,
	riel@...hat.com, jweiner@...hat.com, prarit@...hat.com,
	x86@...nel.org, linux-doc@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-mm@...ck.org,
	Pekka Enberg <penberg@...nel.org>,
	Jacob Shin <jacob.shin@....com>,
	"Rafael J. Wysocki" <rjw@...k.pl>, linux-acpi@...r.kernel.org
Subject: Re: [Part1 PATCH v5 08/22] x86, ACPI: Make acpi_initrd_override_find
 work with 32bit flat mode

On Thu, Jun 13, 2013 at 09:02:55PM +0800, Tang Chen wrote:
> From: Yinghai Lu <yinghai@...nel.org>
> 
> For finding procedure, it would be easy to access initrd in 32bit flat
> mode, as we don't need to setup page table. That is from head_32.S, and
> microcode updating already use this trick.

It'd be really great if you can give a brief explanation of why this
is happening at the beginning of the commit description so that when
someone lands on this commit later on, [s]he can orient oneself.  It
doesn't have to be long.  Open with something like,

 To make NUMA info available early during boot for memory hotplug
 support, acpi_initrd_override_find() needs to be used very early
 during boot.

and then continue to describe what's happening.  It'll make the commit
a lot more approachable to people who just encountered it.

> This patch does the following:
> 
> 1. Change acpi_initrd_override_find to use phys to access global variables.
> 
> 2. Pass a bool parameter "is_phys" to acpi_initrd_override_find() because
>    we cannot tell if it is a pa or a va through the address itself with
>    32bit. Boot loader could load initrd above max_low_pfn.

Do you mean "from 32bit address boundary"?  Maybe "from 4G boundary"
is clearer?

> 
> 3. Put table_sigs[] on stack, otherwise it is too messy to change string
>    array to physaddr and still keep offset calculating correct. The size is
>    about 36x4 bytes, and it is small to settle in stack.
> 
> 4. Also rewrite the MACRO INVALID_TABLE to be in a do {...} while(0) loop
>    so that it is more readable.

The important part is taking "continue" out of it, right?

> +/*
> + * acpi_initrd_override_find() is called from head_32.S and head64.c.
> + * head_32.S calling path is with 32bit flat mode, so we can access

When called from head_32.S, the CPU is in 32bit flat mode and the
kernel virtual address space isn't available yet.

> + * initrd early without setting pagetable or relocating initrd. For
> + * global variables accessing, we need to use phys address instead of

As initrd is in phys_addr, it can be accessed directly; however,
global variables must be accessed by explicitly obtaining their
physical addresses.

> + * kernel virtual address, try to put table_sigs string array in stack,
> + * so avoid switching for it.

Note that table_sigs array is built on stack to avoid such address
translations while accessing its members.

> + * Also don't call printk as it uses global variables.
> + */
> +void __init acpi_initrd_override_find(void *data, size_t size, bool is_phys)

Thanks.

-- 
tejun
--
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