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, 27 Mar 2008 19:13:20 -0700
From:	Jeremy Fitzhardinge <jeremy@...p.org>
To:	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
CC:	Yasunori Goto <y-goto@...fujitsu.com>, Ingo Molnar <mingo@...e.hu>,
	LKML <linux-kernel@...r.kernel.org>,
	Rusty Russell <rusty@...tcorp.com.au>,
	Christoph Lameter <clameter@....com>,
	Dave Hansen <dave@...ux.vnet.ibm.com>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH 2 of 4] hotplug-memory: adding non-section-aligned memory
 is bad

KAMEZAWA Hiroyuki wrote:
> On Fri, 28 Mar 2008 10:34:51 +0900
> Yasunori Goto <y-goto@...fujitsu.com> wrote:
>   
>>>> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
>>>> --- a/mm/memory_hotplug.c
>>>> +++ b/mm/memory_hotplug.c
>>>> @@ -300,6 +300,11 @@
>>>>  	int ret;
>>>>  	u64 start = res->start;
>>>>  	u64 size = res->end - res->start + 1;
>>>> +
>>>> +	/* Adding non-section-aligned memory will give unexpected
>>>> +	   and unintuitive results. */
>>>> +	WARN_ON((start & SECTION_SIZE_MASK) != 0);
>>>> +	WARN_ON((size & SECTION_SIZE_MASK) != 0);
>>>>  
>>>>         
>>> Why just WARNING ? not BUG_ON?
>>>       
>> Both Nack.
>>
>> Because, firmware may occupy some area in the section.
>> Firmware must exclude those area to notify kernel. So, E820, EFI,
>> or _CRS of ACPI may return not aligned address and size.
>> register_memory_resource() and walk_memory_resource() are to skip
>> them silently. This is intended.
>>
>>     
> Ah, ok. sorry.
>
> Jeremy, I think you can check whether you have 'struct page' or not by
> pfn_valid(). 
>
> If pfn_valid() == false, you should call add_memory() and create
> a section/mem_map. If pfn_valid() == true, you should just remove
> PG_reserved bit in mem_map by online_page().

OK.  Would that ever be necessary if I explicitly align my start and size?

    J

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