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]
Message-ID: <86802c440807140011v728cc35fy2540b537ddca9844@mail.gmail.com>
Date:	Mon, 14 Jul 2008 00:11:46 -0700
From:	"Yinghai Lu" <yhlu.kernel@...il.com>
To:	"Vivek Goyal" <vgoyal@...hat.com>
Cc:	"Bernhard Walle" <bwalle@...e.de>, kexec@...ts.infradead.org,
	x86@...nel.org, linux-kernel@...r.kernel.org,
	"Eric W. Biederman" <ebiederm@...ssion.com>
Subject: Re: [PATCH] x86: Find offset for crashkernel reservation automatically

On Fri, Jun 27, 2008 at 6:32 AM, Vivek Goyal <vgoyal@...hat.com> wrote:
> On Thu, Jun 26, 2008 at 09:54:08PM +0200, Bernhard Walle wrote:
>> This patch removes the need of the crashkernel=...@...set parameter to define
>> a fixed offset for crashkernel reservation. That feature can be used together
>> with a relocatable kernel where the kexec-tools relocate the kernel and
>> get the actual offset from /proc/iomem.
>>
>> The use case is a kernel where the .text+.data+.bss is after 16M physical
>> memory (debug kernel with lockdep on x86_64 can cause that) which caused a
>> major pain in autoconfiguration in our distribution.
>>
>> Also, that patch unifies crashdump architectures a bit since IA64 has
>> that semantics from the very beginning of the kdump port.
>>
>> Please provide feedback!
>>
>
> Hi Bernhard,
>
> This looks like a good idea. That means distributions don't have to
> hardcode the crashbase at 16MB and the decision to find a free memory
> can be left on kernel. Users will also find it easy that way.
>
>>
>> Signed-off-by: Bernhard Walle <bwalle@...e.de>
>> ---
>>  arch/x86/kernel/setup.c |   70 +++++++++++++++++++++++++++++++++++------------
>>  1 files changed, 52 insertions(+), 18 deletions(-)
>>
>> diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
>> index a81d82c..c30bb7b 100644
>> --- a/arch/x86/kernel/setup.c
>> +++ b/arch/x86/kernel/setup.c
>> @@ -435,6 +435,34 @@ static inline unsigned long long get_total_mem(void)
>>  }
>>
>>  #ifdef CONFIG_KEXEC
>> +
>> +/**
>> + * Reserve @size bytes of crashkernel memory at any suitable offset.
>> + *
>> + * @size: Size of the crashkernel memory to reserve.
>> + * Returns the base address on success, and -1ULL on failure.
>> + */
>> +unsigned long long find_and_reserve_crashkernel(unsigned long long size)
>> +{
>> +     const unsigned long long alignment = 16<<20;    /* 16M */
>> +     unsigned long long start = 0LL;
>> +
>> +     while (1) {
>> +             int ret;
>> +
>> +             start = find_e820_area(start, ULONG_MAX, size, alignment);

should use min_t(u64, 1ULL<<32, max_low_pfn<<PAGE_SHIFT) replace ULONG_MAX

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